LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/onai[P]npio/npio_test_c.c
// Function: test3
void test3()
{
  int i, err;
  float *data, total;
  npio_Array array;

  npio_init_array(&array);
  err = npio_load_header("test2.npy", &array);
  if (err)
  {
    fprintf(stderr, "npio_load_header: %s\n", strerror(err));
    exit(1);
  }

  err = npio_load_data(&array);
  if (err)
  {
    fprintf(stderr, "npio_load_data: %s\n", strerror(err));
    exit(1);
  }

  data = (float*) array.data;
  total = 0;
  for (i = 0; i < array.size; ++i)
    total += data[i];
  assert(fabs(total / 5005.37f - 1.0f) < 1e-6f);

  npio_free_array(&array);
  printf("test3 passed\n");
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
movw $0x1, 0x8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movups %xmm0, 0x20(%rsp)
movups %xmm0, 0x2c(%rsp)
movaps 0x18b1(%rip), %xmm1     # 0x3010
movups %xmm1, 0x3c(%rsp)
andq $0x0, 0x50(%rsp)
andl $0x0, 0x58(%rsp)
movups %xmm0, 0x60(%rsp)
movups %xmm0, 0x70(%rsp)
andq $0x0, 0x80(%rsp)
leaq 0x19c8(%rip), %rdi      # 0x3151
xorl %esi, %esi
xorl %eax, %eax
callq 0x1190
testl %eax, %eax
js 0x17d8
movl %eax, %ebp
leaq 0x8(%rsp), %r14
movl %eax, 0x50(%r14)
movl $0x1, 0x80(%r14)
pushq $0x20
popq %rdx
movl %eax, %edi
movq %r14, %rsi
callq 0x1d3f
movl %eax, %ebx
cmpl $0x0, 0x78(%r14)
je 0x17df
movl %ebp, %edi
callq 0x10e0
orl $-0x1, 0x58(%rsp)
andl $0x0, 0x88(%rsp)
jmp 0x17df
callq 0x1050
movl (%rax), %ebx
testl %ebx, %ebx
jne 0x1858
leaq 0x8(%rsp), %rdi
callq 0x18bf
testl %eax, %eax
jne 0x1875
movq 0x30(%rsp), %rax
movq 0x50(%rsp), %rcx
xorps %xmm0, %xmm0
xorl %edx, %edx
cmpq %rdx, %rax
je 0x1813
addss (%rcx,%rdx,4), %xmm0
incq %rdx
jmp 0x1804
divss 0x1835(%rip), %xmm0     # 0x3050
addss 0x1831(%rip), %xmm0     # 0x3054
andps 0x17f6(%rip), %xmm0     # 0x3020
movss 0x1826(%rip), %xmm1     # 0x3058
ucomiss %xmm0, %xmm1
jbe 0x18a2
leaq 0x8(%rsp), %rdi
callq 0x14f2
leaq 0x1a64(%rip), %rdi      # 0x32ac
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x1060
movq 0x3799(%rip), %rax      # 0x4ff8
movq (%rax), %r14
movl %ebx, %edi
callq 0x11f0
leaq 0x194c(%rip), %rsi      # 0x31bc
movq %r14, %rdi
jmp 0x1890
movq 0x377c(%rip), %rcx      # 0x4ff8
movq (%rcx), %rbx
movl %eax, %edi
callq 0x11f0
leaq 0x1945(%rip), %rsi      # 0x31d2
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1100
pushq $0x1
popq %rdi
callq 0x11d0
leaq 0x18ed(%rip), %rdi      # 0x3196
leaq 0x1878(%rip), %rsi      # 0x3128
leaq 0x192f(%rip), %rcx      # 0x31e6
pushq $0x79
popq %rdx
callq 0x10d0
// File: /workspace/github_cpp_makefile_star2_O2/onai[P]npio/npio_test_c.c
// Function: test4
void test4()
{
  int i, err;
  int64_t *data;
  float total;
  FILE *f;
  void *p;
  size_t sz;
  npio_Array array;

  npio_init_array(&array);
  f = fopen("test1.npy", "r");
  if (!f)
  {
    fprintf(stderr, "could not open test1.npy\n");
    exit(1);
  }

  fseek(f, 0, SEEK_END);
  sz = ftell(f);
  fseek(f, 0, SEEK_SET);
  p = malloc(sz);
  if (fread(p, 1, sz, f) != sz)
  {
    perror("fread");
    exit(1);
  }

  err = npio_load_mem(p, sz, &array);
  if (err)
  {
    fprintf(stderr, "npio_load_mem: %s\n", strerror(err));
    exit(1);
  }

  fclose(f);

  data = (int64_t*) array.data;
  total = 0;
  for (i = 0; i < array.size; ++i)
    total += data[i];

  assert(total == 4950);

  npio_free_array(&array);
  free(p);
  printf("test4 passed\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movw $0x1, 0x8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movups %xmm0, 0x20(%rsp)
movups %xmm0, 0x2c(%rsp)
movaps 0x15b0(%rip), %xmm1     # 0x3010
movups %xmm1, 0x3c(%rsp)
andq $0x0, 0x50(%rsp)
andl $0x0, 0x58(%rsp)
movups %xmm0, 0x60(%rsp)
movups %xmm0, 0x70(%rsp)
andq $0x0, 0x80(%rsp)
leaq 0x17ad(%rip), %rdi      # 0x3237
leaq 0x17e0(%rip), %rsi      # 0x3271
callq 0x11b0
testq %rax, %rax
je 0x1b9c
movq %rax, %r14
pushq $0x2
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x1160
movq %r14, %rdi
callq 0x1110
movq %rax, %r15
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1160
movq %r15, %rdi
callq 0x1140
movq %rax, %rbx
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x1070
cmpq %r15, %rax
jne 0x1bba
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1eb4
testl %eax, %eax
jne 0x1b75
leaq 0x8(%rsp), %rdi
callq 0x18bf
testl %eax, %eax
jne 0x1b75
movq %r14, %rdi
callq 0x1080
movq 0x30(%rsp), %rax
movq 0x50(%rsp), %rcx
xorps %xmm0, %xmm0
xorl %edx, %edx
cmpq %rdx, %rax
je 0x1b38
cvtsi2ssq (%rcx,%rdx,8), %xmm1
addss %xmm1, %xmm0
incq %rdx
jmp 0x1b24
ucomiss 0x151d(%rip), %xmm0     # 0x305c
jne 0x1bce
jp 0x1bce
leaq 0x8(%rsp), %rdi
callq 0x14f2
movq %rbx, %rdi
callq 0x1030
leaq 0x1755(%rip), %rdi      # 0x32b9
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x1060
movq 0x347c(%rip), %rcx      # 0x4ff8
movq (%rcx), %rbx
movl %eax, %edi
callq 0x11f0
leaq 0x1686(%rip), %rsi      # 0x3213
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1100
jmp 0x1bc6
movq 0x3455(%rip), %rax      # 0x4ff8
movq (%rax), %rcx
leaq 0x1646(%rip), %rdi      # 0x31f3
pushq $0x19
popq %rsi
pushq $0x1
popq %rdx
callq 0x11e0
jmp 0x1bc6
leaq 0x164c(%rip), %rdi      # 0x320d
callq 0x11c0
pushq $0x1
popq %rdi
callq 0x11d0
leaq 0x156e(%rip), %rdi      # 0x3143
leaq 0x154c(%rip), %rsi      # 0x3128
leaq 0x1643(%rip), %rcx      # 0x3226
movl $0xaa, %edx
callq 0x10d0
// File: /workspace/github_cpp_makefile_star2_O2/onai[P]npio/npio_test_c.c
// Function: test5
void test5()
{
  int fd, err;
  npio_Array array;
  size_t sz, i;
  FILE* f;
  int64_t *data, total;

  f = popen("cat test1.npy", "r");
  if (f == 0)
  {
    perror("popen");
    exit(1);
  }

  fd = fileno(f);
  npio_init_array(&array);
  if ((err = npio_load_fd(fd, &array)))
  {
    fprintf(stderr, "npio_load_fd: %s\n", strerror(err));
    exit(1);
  }

  data = (int64_t*) array.data;
  total = 0;
  for (i = 0; i < array.size; ++i)
    total += data[i];
  assert(total == 4950);

  fclose(f);
  npio_free_array(&array);
  printf("test5 passed\n");
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
leaq 0x1637(%rip), %rdi      # 0x3233
leaq 0x166e(%rip), %rsi      # 0x3271
callq 0x11a0
testq %rax, %rax
je 0x1caf
movq %rax, %rbx
movq %rax, %rdi
callq 0x1130
leaq 0x8(%rsp), %rsi
movw $0x1, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsi)
movups %xmm0, 0x18(%rsi)
movups %xmm0, 0x24(%rsi)
movaps 0x13d4(%rip), %xmm1     # 0x3010
movups %xmm1, 0x34(%rsi)
andq $0x0, 0x48(%rsi)
andl $0x0, 0x50(%rsi)
movups %xmm0, 0x58(%rsi)
movups %xmm0, 0x68(%rsi)
andq $0x0, 0x78(%rsi)
pushq $0x20
popq %rdx
movl %eax, %edi
callq 0x1d27
testl %eax, %eax
jne 0x1cbd
movq 0x30(%rsp), %rax
movq 0x50(%rsp), %rcx
xorl %edx, %edx
xorl %esi, %esi
cmpq %rdx, %rax
je 0x1c80
addq (%rcx,%rdx,8), %rsi
incq %rdx
jmp 0x1c72
cmpq $0x1356, %rsi           # imm = 0x1356
jne 0x1cea
movq %rbx, %rdi
callq 0x1080
leaq 0x8(%rsp), %rdi
callq 0x14f2
leaq 0x1624(%rip), %rdi      # 0x32c6
addq $0x90, %rsp
popq %rbx
jmp 0x1060
leaq 0x158b(%rip), %rdi      # 0x3241
callq 0x11c0
jmp 0x1ce2
movq 0x3334(%rip), %rcx      # 0x4ff8
movq (%rcx), %rbx
movl %eax, %edi
callq 0x11f0
leaq 0x1572(%rip), %rsi      # 0x3247
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1100
pushq $0x1
popq %rdi
callq 0x11d0
leaq 0x1452(%rip), %rdi      # 0x3143
leaq 0x1430(%rip), %rsi      # 0x3128
leaq 0x155a(%rip), %rcx      # 0x3259
movl $0xce, %edx
callq 0x10d0
// File: /workspace/github_cpp_makefile_star2_O2/onai[P]npio/npio_test_c.c
// Function: main
int main()
{
  test1();
  test2();
  test3();
  test4();
  test5();
  return 0;
}

// Assembly:
pushq %rax
callq 0x130c
callq 0x1573
callq 0x1734
callq 0x1a34
callq 0x1bed
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O2/onai[P]npio/./npio.h
// Function: npio_load_header_fd3
static inline int npio_load_header_fd3(int fd, npio_Array* array, size_t max_dim)
{
  ssize_t file_size;
  char *p;

  /* Store the file descriptor for load_data */
  if (!array->_opened)
    array->_fd = fd;

  /* Get the file size in preparation to mmap */
  file_size = lseek(fd, 0, SEEK_END);

  /* If we could not lseek, fallback on read. */
  if (file_size < 0)
    return npio_load_header_fd_read_(fd, array, max_dim);

  /* map-in the file */
  p = (char*) mmap(0, file_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
  if (p == MAP_FAILED)
  {
    if (lseek(fd, 0, SEEK_SET))
      return errno;
    return npio_load_header_fd_read_(fd, array, max_dim);
  }

  array->_mmapped = 1;
  array->_buf = p;
  array->_buf_size = file_size;

  return npio_load_header_mem4(p, file_size, array, max_dim);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
cmpl $0x0, 0x80(%rsi)
jne 0x1d5a
movl %ebp, 0x50(%rbx)
pushq $0x2
popq %rdx
movl %ebp, %edi
xorl %esi, %esi
callq 0x10c0
testq %rax, %rax
js 0x1dd3
movq %rax, %r15
pushq $0x3
popq %rdx
pushq $0x2
popq %rcx
xorl %edi, %edi
movq %rax, %rsi
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x10a0
cmpq $-0x1, %rax
je 0x1db1
movl $0x1, 0x78(%rbx)
movq %rax, 0x58(%rbx)
movq %r15, 0x60(%rbx)
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1eb4
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10c0
testq %rax, %rax
je 0x1dd3
callq 0x1050
movl (%rax), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1de7
// File: /workspace/github_cpp_makefile_star2_O2/onai[P]npio/./npio.h
// Function: npio_load_header_mem4
static inline int npio_load_header_mem4(void* p_, size_t sz
  , npio_Array* array, size_t max_dim)
{
  int err;
  char* p = (char*) p_;
  char *end = p + sz;

  /* sanity check, to avoid some checks a bit later. */
  if (sz < 16)
    return EINVAL;

  /* Store this buffer address for load_data */
  if (!array->_mmapped)
  {
    array->_buf = p;
    array->_buf_size = sz;
  }

  if ((err = npio_load_header_prelude_(p, array, &p)))
    return err;

  /* Ensure that the header_len doesn't make us go out of bounds */
  if (p + array->header_len < end)
    end = p + array->header_len;

  /* Parse the header and return */
  return npio_ph_parse_dict_(array, p, end);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, 0x8(%rsp)
cmpq $0x10, %rsi
jae 0x1ecd
pushq $0x16
popq %rax
jmp 0x1ef8
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
cmpl $0x0, 0x78(%rdx)
jne 0x1ee4
movq %r14, 0x58(%rbx)
movq %r15, 0x60(%rbx)
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f29
testl %eax, %eax
je 0x1f02
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
addq %r15, %r14
movq 0x8(%rsp), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
cmpq %r14, %rdx
cmovaeq %r14, %rdx
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x1fba
// File: /workspace/github_cpp_makefile_star2_O2/chfeder[P]turbulence_generator/./TurbGen.h
// Function: TurbGen::Constructor(int)
void Constructor(const int PE)
    {
        ClassSignature = "TurbGen: ";
        this->PE = PE;
        verbose = 1; // default verbose level
        evolfile = "TurbGen.dat";
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
addq $0x8, %rdi
leaq 0x715a(%rip), %rsi      # 0xc4b8
callq 0x34d0
movl %ebx, 0x150(%r14)
movl $0x1, (%r14)
addq $0x218, %r14            # imm = 0x218
leaq 0x7143(%rip), %rsi      # 0xc4c2
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x34d0
// File: /workspace/github_cpp_makefile_star2_O2/chfeder[P]turbulence_generator/./TurbGen.h
// Function: TurbGen::TurbGen_printf(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, ...)
void TurbGen_printf(std::string format, ...) {
        // ******************************************************
        // special printf prepends string and only lets PE=0 print
        // ******************************************************
        va_list args;
        va_start(args, format);
        std::string new_format = ClassSignature+format;
        if (PE == 0) vfprintf(stdout, new_format.c_str(), args);
        va_end(args);
    }

// Assembly:
pushq %rbx
subq $0xf0, %rsp
movq %rsi, %r10
movq %rdi, %rbx
leaq 0x40(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x6610
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
movaps %xmm4, 0xb0(%rsp)
movaps %xmm5, 0xc0(%rsp)
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0xe0(%rsp)
movq %rsi, 0x10(%rsp)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
leaq 0x8(%rdi), %rsi
leaq 0x20(%rsp), %rdi
movq %r10, %rdx
callq 0x93c1
cmpl $0x0, 0x150(%rbx)
jne 0x6661
movq 0xa96f(%rip), %rax      # 0x10fc0
movq (%rax), %rdi
movq 0x20(%rsp), %rsi
movq %rsp, %rdx
callq 0x3370
leaq 0x20(%rsp), %rdi
callq 0x3120
addq $0xf0, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/chfeder[P]turbulence_generator/./TurbGen.h
// Function: TurbGen::set_number_of_components()
void set_number_of_components(void) {
        // error check on user setting of ndim
        if ((ndim != 1) && (ndim != 1.5) && (ndim != 2) && (ndim != 2.5) && (ndim != 3)) {
            TurbGen_printf("ERROR: number of dimensions must be in [1, 1.5, 2, 2.5, 3].\n");
            exit(-1);
        }
        // set the number of vector field components
        if (ndim == 1) ncmp = 1;
        if (ndim == 2) ncmp = 2;
        if ((ndim == 1.5) || (ndim == 2.5) || (ndim == 3)) ncmp = 3;
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movsd 0x158(%rdi), %xmm0
ucomisd 0x4fe0(%rip), %xmm0     # 0xc028
jne 0x704c
jnp 0x707c
ucomisd 0x5014(%rip), %xmm0     # 0xc068
jne 0x7058
jnp 0x707c
ucomisd 0x4fd0(%rip), %xmm0     # 0xc030
jne 0x7064
jnp 0x707c
ucomisd 0x4fdc(%rip), %xmm0     # 0xc048
jne 0x7070
jnp 0x707c
ucomisd 0x4fe8(%rip), %xmm0     # 0xc060
jne 0x70de
jp 0x70de
ucomisd 0x4fc4(%rip), %xmm0     # 0xc048
jne 0x7092
jp 0x7092
movl $0x1, 0x160(%rbx)
ucomisd 0x4f96(%rip), %xmm0     # 0xc030
jne 0x70a8
jp 0x70a8
movl $0x2, 0x160(%rbx)
ucomisd 0x4f78(%rip), %xmm0     # 0xc028
jne 0x70b4
jnp 0x70cc
ucomisd 0x4fa4(%rip), %xmm0     # 0xc060
jne 0x70c0
jnp 0x70cc
ucomisd 0x4fa0(%rip), %xmm0     # 0xc068
jne 0x70d6
jp 0x70d6
movl $0x3, 0x160(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
retq
leaq 0x574c(%rip), %rsi      # 0xc831
leaq 0x8(%rsp), %r14
leaq 0x7(%rsp), %rdx
movq %r14, %rdi
callq 0x3e22
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x65ac
leaq 0x8(%rsp), %rdi
callq 0x3120
pushq $-0x1
popq %rdi
callq 0x3300
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3470
nop
// File: /workspace/github_cpp_makefile_star2_O2/chfeder[P]turbulence_generator/./TurbGen.h
// Function: TurbGen::OU_noise_init()
void OU_noise_init(void) {
        // ******************************************************
        // initialize pseudo random sequence for the Ornstein-Uhlenbeck (OU) process
        // ******************************************************
        OUphases.resize(nmodes*ncmp*2);
        for (int m = 0; m < nmodes; m++) {
            for (int d = 0; d < ncmp; d++) {
                for (int ir = 0; ir < 2; ir++) {
                    OUphases[2*ncmp*m+2*d+ir] = OUvar * get_random_number();
                }
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x120, %rdi            # imm = 0x120
movl 0x154(%rbx), %eax
imull 0x160(%rbx), %eax
addl %eax, %eax
movslq %eax, %rsi
callq 0x9406
xorl %ebp, %ebp
cmpl 0x154(%rbx), %ebp
jge 0x86ea
movl 0x160(%rbx), %eax
xorl %r14d, %r14d
cmpl %eax, %r14d
jge 0x86e6
xorl %r15d, %r15d
cmpl $0x2, %r15d
je 0x86e1
movsd 0x1b0(%rbx), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x9db8
mulsd (%rsp), %xmm0
movl 0x160(%rbx), %eax
movl %ebp, %ecx
imull %eax, %ecx
addl %r14d, %ecx
leal (%r15,%rcx,2), %ecx
movslq %ecx, %rcx
movq 0x120(%rbx), %rdx
movsd %xmm0, (%rdx,%rcx,8)
incl %r15d
jmp 0x869b
incl %r14d
jmp 0x8693
incl %ebp
jmp 0x8682
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/chfeder[P]turbulence_generator/./TurbGen.h
// Function: TurbGen::get_random_number()
double get_random_number(void) {
        // ******************************************************
        //  get random number; draws a number randomly from a Gaussian distribution
        //  with the standard uniform distribution function "ran1s"
        //  using the Box-Muller transformation in polar coordinates. The
        //  resulting Gaussian has unit variance.
        // ******************************************************
        double r1 = ran1s(&seed);
        double r2 = ran1s(&seed);
        double g1 = sqrt(2.0*log(1.0/r1))*cos(2*M_PI*r2);
        return g1;
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x168(%rdi), %r14
movq %r14, %rsi
callq 0x9e3c
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9e3c
movsd %xmm0, 0x10(%rsp)
movsd 0x2258(%rip), %xmm0     # 0xc048
divsd 0x8(%rsp), %xmm0
callq 0x3210
addsd %xmm0, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x9e0f
sqrtsd %xmm0, %xmm0
jmp 0x9e14
callq 0x3200
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd 0x2260(%rip), %xmm0     # 0xc088
callq 0x34b0
mulsd 0x8(%rsp), %xmm0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/chfeder[P]turbulence_generator/./TurbGen.h
// Function: TurbGen::ran1s(int*)
double ran1s(int * idum) {
        // ******************************************************
        static const int IA=16807, IM=2147483647, IQ=127773, IR=2836;
        static const double AM=1.0/IM, RNMX=1.0-1.2e-7;
        if (*idum <= 0) *idum = std::max(-*idum, 1);
        int k = *idum/IQ;
        *idum = IA*(*idum-k*IQ)-IR*k;
        if (*idum < 0) *idum = *idum+IM;
        int iy = *idum;
        double ret = std::min(AM*iy, RNMX); // returns uniform random number in [0,1[
        return ret;
    }

// Assembly:
movl (%rsi), %eax
movl %eax, %edx
negl %edx
testl %eax, %eax
pushq $0x1
popq %rcx
cmovnel %edx, %ecx
cmovgl %eax, %ecx
movl $0x1f31d, %edi          # imm = 0x1F31D
movl %ecx, %eax
xorl %edx, %edx
divl %edi
imull $0xfffe0ce3, %eax, %edx # imm = 0xFFFE0CE3
addl %ecx, %edx
imull $0x41a7, %edx, %ecx     # imm = 0x41A7
imull $0xfffff4ec, %eax, %eax # imm = 0xFFFFF4EC
leal (%rcx,%rax), %edx
addl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
addl %eax, %ecx
cmovnsl %ecx, %edx
cvtsi2sd %edx, %xmm1
mulsd 0x224a(%rip), %xmm1     # 0xc0d0
movl %edx, (%rsi)
movsd 0x2238(%rip), %xmm0     # 0xc0c8
minsd %xmm1, %xmm0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/chfeder[P]turbulence_generator/./TurbGen.h
// Function: TurbGen::TurbGen_printf_raw(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, ...)
void TurbGen_printf_raw(std::string format, ...) {
        // ******************************************************
        // special printf prepends string and only lets PE=0 print
        // ******************************************************
        va_list args;
        va_start(args, format);
        std::string new_format = format;
        if (PE == 0) vfprintf(stdout, new_format.c_str(), args);
        va_end(args);
    }

// Assembly:
pushq %rbx
subq $0xf0, %rsp
movq %rdi, %rbx
leaq 0x40(%rsp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0xa6f9
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
movaps %xmm4, 0xb0(%rsp)
movaps %xmm5, 0xc0(%rsp)
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0xe0(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
leaq 0x20(%rsp), %rdi
callq 0x3380
cmpl $0x0, 0x150(%rbx)
jne 0xa743
movq 0x688d(%rip), %rax      # 0x10fc0
movq (%rax), %rdi
movq 0x20(%rsp), %rsi
movq %rsp, %rdx
callq 0x3370
leaq 0x20(%rsp), %rdi
callq 0x3120
addq $0xf0, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lupo-CalPoly[P]cpe315-thumbsim/./thumbsim.hpp
// Function: Cache::printStats() const
void printStats() const {
         cout << dec << size << " byte cache (blocksize " << dec << blocksize
            << " bytes): " << hits << " hits, " << misses << " misses (hit rate: " 
                              << (static_cast<float>(hits) * 100.0f /
                                    static_cast<float>(hits + misses)) << "%)" << endl;
      }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x601a(%rip), %rdi      # 0x8fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movl 0x18(%rdi,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rdi,%rax)
movl (%rbx), %esi
callq 0x20e0
leaq 0x310c(%rip), %rsi      # 0x60e5
movq %rax, %rdi
callq 0x2150
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
movl 0x4(%rbx), %esi
movq %rax, %rdi
callq 0x20e0
leaq 0x30f5(%rip), %rsi      # 0x60fd
movq %rax, %rdi
callq 0x2150
movl 0x20(%rbx), %esi
movq %rax, %rdi
callq 0x20e0
leaq 0x30e5(%rip), %rsi      # 0x6107
movq %rax, %rdi
callq 0x2150
movl 0x24(%rbx), %esi
movq %rax, %rdi
callq 0x20e0
leaq 0x30d3(%rip), %rsi      # 0x610f
movq %rax, %rdi
callq 0x2150
movl 0x20(%rbx), %ecx
cvtsi2ss %rcx, %xmm0
mulss 0x2fcc(%rip), %xmm0     # 0x6020
movl 0x24(%rbx), %edx
addl %ecx, %edx
cvtsi2ss %rdx, %xmm1
divss %xmm1, %xmm0
movq %rax, %rdi
callq 0x2100
leaq 0x30b2(%rip), %rsi      # 0x6123
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x20c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Lupo-CalPoly[P]cpe315-thumbsim/decode.cpp
// Function: decode(ALL_Types)
Thumb_Types decode (const ALL_Types data) {
  if (data.type.alu.instr.class_type.type_check == ALU_TYPE) {
    return ALU;
  }
  else if (data.type.dp.instr.class_type.type_check == DP_TYPE) {
    return DP;
  }
  else if (data.type.sp.instr.class_type.type_check == SP_TYPE) {
    return SPECIAL;
  }
  else if (data.type.uncond.instr.class_type.type_check == UNCOND_TYPE) {
    return UNCOND;
  }
  else if (data.type.bl.instr.class_type.type_check == BL_TYPE) {
    return BL;
  }
  else if (data.type.misc.instr.class_type.type_check == MISC_TYPE) {
    return MISC;
  }
  else if (data.type.cond.instr.class_type.type_check == COND_TYPE) {
    return COND;
  }
  else if (data.type.ldm.instr.class_type.type_check == LDM_TYPE) {
    return LDM;
  }
  else if (data.type.stm.instr.class_type.type_check == STM_TYPE) {
    return STM;
  }
  else if (data.type.ldrl.instr.class_type.type_check == LDRL_TYPE) {
    return LDRL;
  }
  else if (data.type.addsp.instr.class_type.type_check == ADD_SP_TYPE) {
    return ADD_SP;
  }
  else {
    if (data.type.ld_st.instr.class_type.opA == LD_ST_REG_OPA) {
    }
    else if (data.type.ld_st.instr.class_type.opA == LD_ST_IMM_OPA) {
    }
    else if (data.type.ld_st.instr.class_type.opA == LD_ST_IMMB_OPA) {
    }
    else if (data.type.ld_st.instr.class_type.opA == LD_ST_IMMH_OPA) {
    }
    else if (data.type.ld_st.instr.class_type.opA == LD_ST_IMMSP_OPA) {
    }
    else {
      cout << "NO TYPE FOUND" << endl;
      return ERROR_TYPE;
    }
    return LD_ST;
  }
}

// Assembly:
xorl %eax, %eax
cmpw $0x4000, %di            # imm = 0x4000
jae 0x3332
retq
movzwl %di, %eax
movl %eax, %ecx
shrl $0xa, %ecx
cmpw $0x10, %cx
je 0x3349
cmpl $0x11, %ecx
jne 0x334d
pushq $0x2
jmp 0x3379
pushq $0x1
jmp 0x3379
movl %eax, %ecx
shrl $0xb, %ecx
cmpw $0x1c, %cx
je 0x3361
cmpl $0x1e, %ecx
jne 0x3365
pushq $0xb
jmp 0x3379
pushq $0x6
jmp 0x3379
shrl $0xc, %eax
cmpw $0xb, %ax
je 0x3377
cmpl $0xd, %eax
jne 0x337b
pushq $0x5
jmp 0x3379
pushq $0x4
popq %rax
retq
cmpw $0x9, %cx
je 0x339f
movzwl %cx, %ecx
cmpl $0x15, %ecx
je 0x3397
cmpl $0x19, %ecx
je 0x339b
cmpl $0x18, %ecx
jne 0x33a3
pushq $0x8
jmp 0x3379
pushq $0xa
jmp 0x3379
pushq $0x7
jmp 0x3379
pushq $0x9
jmp 0x3379
movzwl %ax, %eax
addl $-0x5, %eax
cmpw $0x5, %ax
jae 0x33b3
pushq $0x3
jmp 0x3379
pushq %rbp
movq %rsp, %rbp
movq 0x5c12(%rip), %rdi      # 0x8fd0
leaq 0x2dfb(%rip), %rsi      # 0x61c0
callq 0x2150
movq %rax, %rdi
callq 0x20c0
pushq $0xc
popq %rax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lupo-CalPoly[P]cpe315-thumbsim/decode.cpp
// Function: decode(DP_Type)
DP_Ops decode (const DP_Type data) {
  if (data.instr.DP_Instr.op == DP_CMP) {
    // 315: insert code here to print cmp instruction
    return DP_CMP;
  }
  else {
    cerr << "UNKNOWN DP TYPE -- Exiting" << endl;
    exit(1);
  }
}

// Assembly:
andl $0x3c0, %edi            # imm = 0x3C0
cmpw $0x280, %di             # imm = 0x280
jne 0x361c
pushq $0xa
popq %rax
retq
pushq %rbp
movq %rsp, %rbp
movq 0x59c9(%rip), %rdi      # 0x8ff0
leaq 0x2bde(%rip), %rsi      # 0x620c
callq 0x2150
movq %rax, %rdi
callq 0x20c0
pushq $0x1
popq %rdi
callq 0x2190
// File: /workspace/github_cpp_makefile_star2_O2/Lupo-CalPoly[P]cpe315-thumbsim/decode.cpp
// Function: decode(COND_Type)
int decode (const COND_Type data) {
  // complete
  if (opts.instrs) { 
    cout << "b";
    printCond(data.instr.b.cond);
    // consider calling your sign extension function here to get the 
    // printout to be consistent
    cout << " 0x" << hex << rf[15] + 2*(int)((char)(data.instr.b.imm))+2 << endl;
  }
  return COND;
}

// Assembly:
leaq 0x5216(%rip), %rax      # 0x91ec
cmpb $0x1, 0x2(%rax)
jne 0x4085
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
movq 0x4fe0(%rip), %rdi      # 0x8fd0
leaq 0x22b8(%rip), %rsi      # 0x62af
callq 0x2150
movl %ebx, %eax
shrl $0x8, %eax
andb $0xf, %al
cmpb $0xd, %al
ja 0x401a
movzbl %al, %eax
leaq 0x2177(%rip), %rcx      # 0x6188
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0x4021
leaq 0x22d6(%rip), %rsi      # 0x62f7
movq 0x4fa8(%rip), %r14      # 0x8fd0
movq %r14, %rdi
callq 0x2150
leaq 0x227b(%rip), %rsi      # 0x62b2
movq %r14, %rdi
callq 0x2150
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r14,%rax)
leaq 0x5160(%rip), %rdi      # 0x91c0
pushq $0xf
popq %rsi
callq 0x4492
movsbl %bl, %ecx
leal (%rax,%rcx,2), %esi
addl $0x2, %esi
movq %r14, %rdi
callq 0x20e0
movq %rax, %rdi
callq 0x20c0
popq %rbx
popq %r14
popq %rbp
pushq $0x5
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lupo-CalPoly[P]cpe315-thumbsim/decode.cpp
// Function: decode(UNCOND_Type)
int decode (const UNCOND_Type data) {
  // complete
  if (opts.instrs) { 
    // consider calling your sign extension function here to get the 
    // printout to be consistent
    cout << "b 0x" << hex << rf[15] + 2*(int)((char)(data.instr.b.imm))+2 << endl;
  }
  return UNCOND;
}

// Assembly:
leaq 0x515c(%rip), %rax      # 0x91ec
cmpb $0x1, 0x2(%rax)
jne 0x40f8
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
movq 0x4f2a(%rip), %rdi      # 0x8fd0
leaq 0x2204(%rip), %rsi      # 0x62b1
callq 0x2150
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r14,%rax)
leaq 0x50ed(%rip), %rdi      # 0x91c0
pushq $0xf
popq %rsi
callq 0x4492
movsbl %bl, %ecx
leal (%rax,%rcx,2), %esi
addl $0x2, %esi
movq %r14, %rdi
callq 0x20e0
movq %rax, %rdi
callq 0x20c0
popq %rbx
popq %r14
popq %rbp
pushq $0x6
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lupo-CalPoly[P]cpe315-thumbsim/decode.cpp
// Function: decode(BL_Type)
BL_Ops decode (const BL_Type data) {
  // complete
  if (opts.instrs) { 
    cout << "bl 0x" << hex << data.instr.bl_upper.imm10 << endl;
  }
  return BL_UPPER;
}

// Assembly:
leaq 0x50e9(%rip), %rax      # 0x91ec
cmpb $0x1, 0x2(%rax)
jne 0x4157
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
movq 0x4eb8(%rip), %rdi      # 0x8fd0
leaq 0x2197(%rip), %rsi      # 0x62b6
callq 0x2150
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
andl $0x3ff, %ebx            # imm = 0x3FF
movq %rax, %rdi
movl %ebx, %esi
callq 0x2210
movq %rax, %rdi
callq 0x20c0
addq $0x8, %rsp
popq %rbx
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lupo-CalPoly[P]cpe315-thumbsim/decode.cpp
// Function: decode(ADD_SP_Type)
int decode (const ADD_SP_Type data) {
  // complete
  if (opts.instrs) { 
    cout << "add r" << data.instr.add.rd << ", sp, #" << data.instr.add.imm*4 << endl;
  }
  return ADD_SP;
}

// Assembly:
leaq 0x506a(%rip), %rax      # 0x91ec
cmpb $0x1, 0x2(%rax)
jne 0x41de
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
movq 0x4e39(%rip), %rdi      # 0x8fd0
leaq 0x211e(%rip), %rsi      # 0x62bc
callq 0x2150
movl %ebx, %esi
shrl $0x8, %esi
andl $0x7, %esi
movq %rax, %rdi
callq 0x2210
leaq 0x2108(%rip), %rsi      # 0x62c2
movq %rax, %rdi
callq 0x2150
movzbl %bl, %esi
shll $0x2, %esi
movq %rax, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x20c0
addq $0x8, %rsp
popq %rbx
popq %rbp
pushq $0xa
popq %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Lupo-CalPoly[P]cpe315-thumbsim/thumbsim_driver.cpp
// Function: Memory<Data8, Data32>::write(unsigned int, Data32)
void Memory<Data8, Data32>::write(const unsigned int addr, const Data32 data) {
  // data is in native format
  //   if little-endian, 3210 (MSB=3)
  // memory is in big-endian format (0123, MSB=0)
  int i;
  unsigned int myAddr = addr - base;
  if (size() < myAddr + 4) {
    m.resize(myAddr + 4, 0);
  }
  if (myAddr < lowest) lowest = myAddr;
  if (myAddr > highest) highest = myAddr;
  if (opts.writes) {
    cout << hex << addr << ": " << data << " ( ";
    for (i = 0 ; i < 4 ; i++) {
      cout << static_cast<unsigned int>(data.data_ubyte4(i)) << ' ';
    }
    cout << ")" << endl;
  }
  for (i = 0 ; i < 4 ; i++) {
    m[myAddr+i] = Data8(data.data_ubyte4(i));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movl %esi, %r12d
movq %rdi, %rbx
movl %edx, -0x30(%rbp)
movl 0x8(%rdi), %ecx
movl %esi, %r13d
subl 0x18(%rdi), %r13d
subl (%rdi), %ecx
leal 0x4(%r13), %eax
cmpl %ecx, %eax
jbe 0x4223
movl %eax, %esi
leaq -0x29(%rbp), %rdx
movb $0x0, (%rdx)
movq %rbx, %rdi
callq 0x478a
cmpl 0x1c(%rbx), %r13d
jae 0x422d
movl %r13d, 0x1c(%rbx)
cmpl 0x20(%rbx), %r13d
jbe 0x4237
movl %r13d, 0x20(%rbx)
leaq 0x4fae(%rip), %rax      # 0x91ec
cmpb $0x1, 0x3(%rax)
jne 0x42e2
movq 0x4d81(%rip), %r15      # 0x8fd0
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r15,%rax)
movl %r12d, %esi
movq %r15, %rdi
callq 0x20e0
leaq 0x1e8c(%rip), %rsi      # 0x6104
movq %rax, %rdi
callq 0x2150
movl %r14d, %esi
movq %rax, %rdi
callq 0x20e0
leaq 0x2062(%rip), %rsi      # 0x62f4
movq %rax, %rdi
callq 0x2150
pushq $0x4
popq %rax
pushq $0x20
popq %r14
movq %rax, %r12
subq $0x1, %r12
jb 0x42c7
movzbl -0x31(%rbp,%rax), %esi
movq %r15, %rdi
callq 0x20e0
movq %rax, %rdi
movl %r14d, %esi
callq 0x2180
movq %r12, %rax
jmp 0x42a4
movq 0x4d02(%rip), %rdi      # 0x8fd0
leaq 0x1e4f(%rip), %rsi      # 0x6124
callq 0x2150
movq %rax, %rdi
callq 0x20c0
pushq $0x4
popq %rcx
movq %rcx, %rax
subq $0x1, %rax
jb 0x4303
movb -0x31(%rbp,%rcx), %cl
movl %r13d, %edx
movq (%rbx), %rsi
movb %cl, (%rsi,%rdx)
incl %r13d
movq %rax, %rcx
jmp 0x42e8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lupo-CalPoly[P]cpe315-thumbsim/thumbsim_driver.cpp
// Function: Memory<Data16, Data16>::write(unsigned int, Data16)
void Memory<Data16, Data16>::write(const unsigned int addr, const Data16 data) {
  // data is in native format
  int i;
  unsigned short myAddr = addr - base;
  if (size() < myAddr + 2) {
    m.resize(myAddr + 2, 0);
  }
  if (myAddr < lowest) lowest = myAddr;
  if (myAddr > highest) highest = myAddr;
  if (opts.writes) {
    cout << hex << addr << ": " << data << " ( ";
    for (i = 0 ; i < 2 ; i++) {
      cout << static_cast<unsigned int>(data.data_ubyte2(i)) << ' ';
    }
    cout << ")" << endl;
  }

  m[myAddr] = data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movl %esi, %r12d
movq %rdi, %r14
movw %bx, -0x2a(%rbp)
movl %esi, %eax
subl 0x18(%rdi), %eax
movq 0x8(%rdi), %rcx
subq (%rdi), %rcx
shrq %rcx
movzwl %ax, %r13d
leal 0x2(%r13), %eax
cmpl %ecx, %eax
jbe 0x435c
movl %eax, %esi
leaq -0x32(%rbp), %rdx
andw $0x0, (%rdx)
movq %r14, %rdi
callq 0x47c0
cmpl 0x1c(%r14), %r13d
jae 0x4366
movl %r13d, 0x1c(%r14)
cmpl 0x20(%r14), %r13d
jbe 0x4370
movl %r13d, 0x20(%r14)
leaq 0x4e75(%rip), %rax      # 0x91ec
cmpb $0x1, 0x3(%rax)
jne 0x4421
movq 0x4c48(%rip), %r15      # 0x8fd0
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r15,%rax)
movl %r12d, %esi
movq %r15, %rdi
callq 0x20e0
leaq 0x1d53(%rip), %rsi      # 0x6104
movq %rax, %rdi
callq 0x2150
movl %ebx, -0x30(%rbp)
movzwl %bx, %esi
movq %rax, %rdi
callq 0x2210
leaq 0x1f26(%rip), %rsi      # 0x62f4
movq %rax, %rdi
callq 0x2150
pushq $0x2
popq %rax
pushq $0x20
popq %r12
movq %rax, %rbx
subq $0x1, %rbx
jb 0x4403
movzbl -0x2b(%rbp,%rax), %esi
movq %r15, %rdi
callq 0x20e0
movq %rax, %rdi
movl %r12d, %esi
callq 0x2180
movq %rbx, %rax
jmp 0x43e0
movq 0x4bc6(%rip), %rdi      # 0x8fd0
leaq 0x1d13(%rip), %rsi      # 0x6124
callq 0x2150
movq %rax, %rdi
callq 0x20c0
movl -0x30(%rbp), %ebx
movq (%r14), %rax
movl %r13d, %ecx
movw %bx, (%rax,%rcx,2)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lupo-CalPoly[P]cpe315-thumbsim/thumbsim_driver.cpp
// Function: Memory<Data8, Data32>::dump(DataType) const
void Memory<Data8, Data32>::dump(DataType dt) const {
  Data32 d(0);
  unsigned int addr;
  for (addr = lowest ; addr <= highest + 3 ; addr++) {
    unsigned int byte = addr & 0x3;
    d.set_data_ubyte4(byte, m[addr]);
    if ((byte == 0x3) && (dt == INSTRUCTIONS)) {
      cout << hex << d << endl;
    } else if ((byte == 0x3) && (dt == DATA) && (d.data_uint() != 0)) {
      cout << hex << addr - 3 + getBase() << ": " << d << endl;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
andl $0x0, -0x2c(%rbp)
movl 0x1c(%rdi), %r13d
movq 0x4b0c(%rip), %r15      # 0x8fd0
movl %esi, %eax
xorl $0x1, %eax
movl %eax, -0x30(%rbp)
movl 0x20(%r14), %eax
addl $0x3, %eax
cmpl %eax, %r13d
ja 0x4581
movl %r13d, %eax
andl $0x3, %eax
movl %r13d, %ecx
movq (%r14), %rdx
movb (%rdx,%rcx), %cl
movq %rax, %rdx
xorq $0x3, %rdx
movb %cl, -0x2c(%rbp,%rdx)
xorl $0x3, %eax
movl %ebx, %ecx
orl %eax, %ecx
jne 0x451f
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r15,%rax)
movl -0x2c(%rbp), %r12d
movq %r15, %rdi
jmp 0x4569
orl -0x30(%rbp), %eax
jne 0x4579
movl -0x2c(%rbp), %r12d
testl %r12d, %r12d
je 0x4579
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r15,%rax)
movl 0x18(%r14), %eax
leal (%rax,%r13), %esi
addl $-0x3, %esi
movq %r15, %rdi
callq 0x20e0
movq %rax, %rdi
leaq 0x1ba3(%rip), %rsi      # 0x6104
callq 0x2150
movq %rax, %rdi
movl %r12d, %esi
callq 0x20e0
movq %rax, %rdi
callq 0x20c0
incl %r13d
jmp 0x44cc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lupo-CalPoly[P]cpe315-thumbsim/thumbsim_driver.cpp
// Function: Stats::print()
void Stats::print() {
  cout << dec
       << "Total number of dynamic instructions: " << instrs << endl
       << "Number of Memory Reads: " << numMemReads << endl
       << "Number of Memory Writes: " << numMemWrites << endl
       << "Number of Register Reads: " << numRegReads << endl
       << "Number of Register Writes: " << numRegWrites << endl
       << "Branches: " << endl
       << "  Forward:" << endl
       << "    Taken: " << numForwardBranchesTaken << endl
       << "    Not taken: " << numForwardBranchesNotTaken << endl
       << "  Backward:" << endl
       << "    Taken: " << numBackwardBranchesTaken << endl
       << "    Not taken: " << numBackwardBranchesNotTaken << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x49e0(%rip), %rdi      # 0x8fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movl 0x18(%rdi,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rdi,%rax)
leaq 0x1cec(%rip), %rsi      # 0x62f8
callq 0x2150
movl (%rbx), %esi
movq %rax, %rdi
callq 0x20e0
movq %rax, %rdi
callq 0x20c0
leaq 0x1cf5(%rip), %rsi      # 0x631f
movq %rax, %rdi
callq 0x2150
movl 0xc(%rbx), %esi
movq %rax, %rdi
callq 0x20e0
movq %rax, %rdi
callq 0x20c0
leaq 0x1cec(%rip), %rsi      # 0x6338
movq %rax, %rdi
callq 0x2150
movl 0x8(%rbx), %esi
movq %rax, %rdi
callq 0x20e0
movq %rax, %rdi
callq 0x20c0
leaq 0x1ce4(%rip), %rsi      # 0x6352
movq %rax, %rdi
callq 0x2150
movl 0x18(%rbx), %esi
movq %rax, %rdi
callq 0x20e0
movq %rax, %rdi
callq 0x20c0
leaq 0x1cdd(%rip), %rsi      # 0x636d
movq %rax, %rdi
callq 0x2150
movl 0x14(%rbx), %esi
movq %rax, %rdi
callq 0x20e0
movq %rax, %rdi
callq 0x20c0
leaq 0x1cd7(%rip), %rsi      # 0x6389
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20c0
leaq 0x1ccb(%rip), %rsi      # 0x6394
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20c0
leaq 0x1cbf(%rip), %r14      # 0x639f
movq %rax, %rdi
movq %r14, %rsi
callq 0x2150
movl 0x1c(%rbx), %esi
movq %rax, %rdi
callq 0x20e0
movq %rax, %rdi
callq 0x20c0
leaq 0x1ca6(%rip), %r15      # 0x63ab
movq %rax, %rdi
movq %r15, %rsi
callq 0x2150
movl 0x20(%rbx), %esi
movq %rax, %rdi
callq 0x20e0
movq %rax, %rdi
callq 0x20c0
leaq 0x1c91(%rip), %rsi      # 0x63bb
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x2150
movl 0x24(%rbx), %esi
movq %rax, %rdi
callq 0x20e0
movq %rax, %rdi
callq 0x20c0
movq %rax, %rdi
movq %r15, %rsi
callq 0x2150
movl 0x28(%rbx), %esi
movq %rax, %rdi
callq 0x20e0
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/Lupo-CalPoly[P]cpe315-thumbsim/parse.cpp
// Function: parse(char const*)
void parse(const char * file) {
  ifstream in(file);
  string s;
  unsigned int addr;
  in >> hex;                    // in takes hex numbers
  in >> s;
  if (s != "PC") {
    exit(1);
  }
  in >> addr;
  pc = addr;
  parseMem(in, "instruction");
  parseMem(in, "data");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %rdi, %rsi
leaq -0x278(%rbp), %rbx
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x2270
leaq -0x20(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl -0x260(%rbp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, -0x260(%rbp,%rax)
leaq -0x30(%rbp), %rsi
movq %rbx, %rdi
callq 0x21a0
leaq 0x1489(%rip), %rsi      # 0x6452
leaq -0x30(%rbp), %rdi
callq 0x50bf
testb %al, %al
jne 0x506f
leaq -0x278(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x2240
movl -0x10(%rbp), %eax
leaq 0x41f4(%rip), %rcx      # 0x91e8
movl %eax, (%rcx)
leaq 0x13fd(%rip), %rsi      # 0x63fa
leaq -0x70(%rbp), %rdi
leaq -0x9(%rbp), %rdx
callq 0x50cc
leaq -0x278(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x4cec
leaq -0x70(%rbp), %rdi
callq 0x20b0
leaq 0x13b4(%rip), %rsi      # 0x63de
leaq -0x50(%rbp), %rdi
leaq -0x9(%rbp), %rdx
callq 0x50cc
leaq -0x278(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4cec
leaq -0x50(%rbp), %rdi
callq 0x20b0
leaq -0x30(%rbp), %rdi
callq 0x20b0
leaq -0x278(%rbp), %rdi
callq 0x2040
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %rbp
retq
pushq $0x1
popq %rdi
callq 0x2190
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
jmp 0x5089
jmp 0x5092
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x20b0
jmp 0x5095
jmp 0x5092
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x20b0
leaq -0x278(%rbp), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/Lupo-CalPoly[P]cpe315-thumbsim/execute.cpp
// Function: setCarryOverflow(int, int, OFType)
void setCarryOverflow (int num1, int num2, OFType oftype) {
  switch (oftype) {
    case OF_ADD:
      if (((unsigned long long int)num1 + (unsigned long long int)num2) ==
          ((unsigned int)num1 + (unsigned int)num2)) {
        flags.C = 0;
      }
      else {
        flags.C = 1;
      }
      if (((long long int)num1 + (long long int)num2) ==
          ((int)num1 + (int)num2)) {
        flags.V = 0;
      }
      else {
        flags.V = 1;
      }
      break;
    case OF_SUB:
      if (num1 >= num2) {
        flags.C = 1;
      }
      else if ((long long int)((unsigned long long int)num1 - (unsigned long long int)num2) ==
          (int)((unsigned int)num1 - (unsigned int)num2)) {
        flags.C = 0;
      }
      else {
        flags.C = 1;
      }
      if (((num1==0) && (num2==0)) ||
          (((long long int)num1 - (long long int)num2) ==
           ((int)num1 - (int)num2))) {
        flags.V = 0;
      }
      else {
        flags.V = 1;
      }
      break;
    case OF_SHIFT:
      // C flag unaffected for shifts by zero
      if (num2 != 0) {
        if (((unsigned long long int)num1 << (unsigned long long int)num2) ==
            ((unsigned int)num1 << (unsigned int)num2)) {
          flags.C = 0;
        }
        else {
          flags.C = 1;
        }
      }
      // Shift doesn't set overflow
      break;
    default:
      cerr << "Bad OverFlow Type encountered." << __LINE__ << __FILE__ << endl;
      exit(1);
  }
}

// Assembly:
cmpl $0x2, %edx
je 0x5262
cmpl $0x1, %edx
je 0x5224
testl %edx, %edx
jne 0x5290
movslq %edi, %rax
movslq %esi, %rcx
addq %rax, %rcx
addl %edi, %esi
cmpq %rsi, %rcx
setne 0x402b(%rip)            # 0x924a
movslq %esi, %rax
jmp 0x5255
movb $0x1, %cl
movl %edi, %eax
subl %esi, %eax
jge 0x523e
movslq %edi, %rcx
movslq %esi, %rdx
subq %rdx, %rcx
movslq %eax, %rdx
cmpq %rdx, %rcx
setne %cl
movb %cl, 0x4006(%rip)       # 0x924a
movl %esi, %ecx
orl %edi, %ecx
je 0x525a
movslq %edi, %rcx
movslq %esi, %rdx
subq %rdx, %rcx
cltq
cmpq %rax, %rcx
jne 0x5280
movb $0x0, 0x3fea(%rip)      # 0x924b
retq
testl %esi, %esi
je 0x528f
movslq %edi, %rax
movq %rax, %rdx
movl %esi, %ecx
shlq %cl, %rdx
shll %cl, %eax
cmpq %rax, %rdx
jne 0x5288
movb $0x0, 0x3fcb(%rip)      # 0x924a
retq
movb $0x1, 0x3fc4(%rip)      # 0x924b
retq
movb $0x1, 0x3fbb(%rip)      # 0x924a
retq
pushq %rbp
movq %rsp, %rbp
movq 0x3d55(%rip), %rdi      # 0x8ff0
leaq 0x123a(%rip), %rsi      # 0x64dc
callq 0x2150
pushq $0x57
popq %rsi
movq %rax, %rdi
callq 0x2230
leaq 0x1242(%rip), %rsi      # 0x64fb
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20c0
pushq $0x1
popq %rdi
callq 0x2190
// File: /workspace/github_cpp_makefile_star2_O2/amukherj[P]concurrencyts/future.cc
// Function: basic_future_state()
void basic_future_state() {
  std::experimental::future_state<int> f;

  std::thread t([&f]() {
    auto val = f.get();
    std::cout << val << '\n';
  });

  std::thread t0([&f]() {
    f.wait();
    std::cout << "Done\n";
  });

  std::thread t1([&f]() {
    auto val = f.get();
    std::cout << val << '\n';
  });

  std::this_thread::sleep_for(std::chrono::seconds(2));
  f.emplace(10);

  t.join();
  t0.join();
  t1.join();
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x54ba
andq $0x0, 0x18(%rsp)
pushq $0x10
popq %rdi
callq 0x31a0
leaq 0xb2e2(%rip), %rcx      # 0xe728
movq %rcx, (%rax)
movq %rbx, 0x8(%rax)
movq %rsp, %rsi
movq %rax, (%rsi)
leaq 0x18(%rsp), %rdi
xorl %edx, %edx
callq 0x3170
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x346e
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x10(%rsp)
pushq $0x10
popq %rdi
callq 0x31a0
leaq 0xb2e5(%rip), %rcx      # 0xe768
movq %rcx, (%rax)
movq %rbx, 0x8(%rax)
movq %rsp, %rsi
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdi
xorl %edx, %edx
callq 0x3170
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x34ab
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x8(%rsp)
pushq $0x10
popq %rdi
callq 0x31a0
leaq 0xb2e8(%rip), %rcx      # 0xe7a8
movq %rcx, (%rax)
movq %rbx, 0x8(%rax)
movq %rsp, %rsi
movq %rax, (%rsi)
leaq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x3170
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x34e8
movq (%rdi), %rax
callq *0x8(%rax)
movq %rsp, %rdi
movq $0x2, (%rdi)
callq 0x54de
movq %rsp, %rsi
movl $0xa, (%rsi)
leaq 0x20(%rsp), %rdi
callq 0x5516
leaq 0x18(%rsp), %rdi
callq 0x3270
leaq 0x10(%rsp), %rdi
callq 0x3270
leaq 0x8(%rsp), %rdi
callq 0x3270
leaq 0x8(%rsp), %rdi
callq 0x55a8
leaq 0x10(%rsp), %rdi
callq 0x55a8
leaq 0x18(%rsp), %rdi
callq 0x55a8
leaq 0x20(%rsp), %rdi
callq 0x55b6
addq $0x90, %rsp
popq %rbx
retq
jmp 0x35a8
jmp 0x35a8
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x35b5
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x35b5
movq %rax, %rbx
jmp 0x35b5
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x35bf
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x35bf
movq %rax, %rbx
jmp 0x35bf
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x35c9
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x35c9
movq %rax, %rbx
jmp 0x35c9
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x55a8
leaq 0x10(%rsp), %rdi
callq 0x55a8
leaq 0x18(%rsp), %rdi
callq 0x55a8
leaq 0x20(%rsp), %rdi
callq 0x55b6
movq %rbx, %rdi
callq 0x32a0
// File: /workspace/github_cpp_makefile_star2_O2/amukherj[P]concurrencyts/future.cc
// Function: promise_to_future()
void promise_to_future() {
  std::experimental::promise<int> prom;
  auto fut = prom.get_future();

  std::thread t([&prom]() {
    std::this_thread::sleep_for(std::chrono::seconds(2));
    prom.set(10);
  });
  t.detach();

  std::cout << fut.get() << '\n';
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x5c43
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x55d6
andq $0x0, (%rsp)
pushq $0x10
popq %rdi
callq 0x31a0
leaq 0xb1da(%rip), %rcx      # 0xe7e8
movq %rcx, (%rax)
movq %rbx, 0x8(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %rsp, %rdi
xorl %edx, %edx
callq 0x3170
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x3637
movq (%rdi), %rax
callq *0x8(%rax)
movq %rsp, %rdi
callq 0x3290
movq 0x10(%rsp), %rdi
callq 0x5a32
movl (%rax), %esi
movq 0xb97e(%rip), %rdi      # 0xefd0
callq 0x3280
pushq $0xa
popq %rsi
movq %rax, %rdi
callq 0x31d0
movq %rsp, %rdi
callq 0x55a8
leaq 0x18(%rsp), %rdi
callq 0x594e
leaq 0x28(%rsp), %rdi
callq 0x594e
addq $0x30, %rsp
popq %rbx
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x36ae
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x36ae
movq %rax, %rbx
jmp 0x36ae
movq %rax, %rbx
jmp 0x36b8
movq %rax, %rbx
movq %rsp, %rdi
callq 0x55a8
leaq 0x18(%rsp), %rdi
callq 0x594e
leaq 0x28(%rsp), %rdi
callq 0x594e
movq %rbx, %rdi
callq 0x32a0
// File: /workspace/github_cpp_makefile_star2_O2/amukherj[P]concurrencyts/future.cc
// Function: main
int main() {
  basic_future_state();
  promise_to_future();
  async_to_promise();
  when_all();
  when_any();
}

// Assembly:
pushq %rax
callq 0x341c
callq 0x35db
callq 0x36ca
callq 0x3c11
callq 0x3ea9
xorl %eax, %eax
popq %rcx
retq
nop