// compile with -march=armv8-a+simd on compatible aarch64 compiler
// linux-aarch64-neon.core was generated by: aarch64-linux-gnu-gcc-8
// commandline: -march=armv8-a+simd -nostdlib -static -g linux-aarch64-neon.c
#include <stdint.h>

static void bar(char *boom) {
  char F = 'b';
  asm volatile("fmov     d0,  #0.5\n\t");
  asm volatile("fmov     d1,  #1.5\n\t");
  asm volatile("fmov     d2,  #2.5\n\t");
  asm volatile("fmov     d3,  #3.5\n\t");
  asm volatile("fmov     s4,  #4.5\n\t");
  asm volatile("fmov     s5,  #5.5\n\t");
  asm volatile("fmov     s6,  #6.5\n\t");
  asm volatile("fmov     s7,  #7.5\n\t");
  asm volatile("movi     v8.16b, #0x11\n\t");
  asm volatile("movi     v31.16b, #0x30\n\t");

  uint64_t pattern = 0x1122334455667788;
  asm volatile("msr tpidr_el0, %0" ::"r"(pattern));

  *boom = 47; // Frame bar
}

static void foo(char *boom, void (*boomer)(char *)) {
  char F = 'f';
  boomer(boom); // Frame foo
}

void _start(void) {
  char F = '_';
  foo(0, bar); // Frame _start
}
