LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/0xADE1A1DE[P]MeasureSuite/lib/src/loader.c
// Function: create_new_function
static int create_new_function(measuresuite_t ms, enum load_type type,
                               size_t code_size_bytes) {

  DEBUG("Creating new function. type: %d\n", type);
  // check size and allocate more if needed
  if (ms->size_functions <= ms->num_functions) {
    ms->size_functions *= 2;
    DEBUG("Doubled size_functions to %lu\n", ms->size_functions);
    if (realloc_or_fail(ms, (void **)&ms->functions,
                        ms->size_functions * sizeof(struct function_tuple))) {
      return 1;
    }
  }

  // convenience pointer to the new tuple
  struct function_tuple *new = &ms->functions[ms->num_functions];

  new->type = type;

  // initialize the memory for arith_result
  init_arithmetic_results(ms, new);

  // if we need the 'code' segment, initialize that memory
  if (type == ELF || type == BIN || type == ASM) {

    new->code_size_bytes =
        code_size_bytes == 0 ? DEFAULT_CODE_SIZE : code_size_bytes;
    if (map_rwx(ms, (void **)&new->code, new->code_size_bytes)) {
      return 1;
    }
  }

  // Because we don't have any batch_size yet.
  new->cycle_results = NULL;

#ifdef USE_ASSEMBLYLINE
  new->chunks = 0;

  if (type == ASM) {
    // create asm instance
    new->al = asm_create_instance(new->code, (int)new->code_size_bytes);
  } else {
    new->al = NULL;
  }
#else
  if (type == ASM) {
    ms->errorno = E_NO_ASSEMBLYLINE;
    return 1;
  }

#endif

  // specify that we have a new one now
  ms->num_functions += 1;
  reset_permutaions(ms);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movq 0x78(%rdi), %rax
cmpq 0x80(%rdi), %rax
ja 0x3b93
leaq (%rax,%rax), %rcx
movq %rcx, 0x78(%rbx)
leaq 0x70(%rbx), %rsi
shlq $0x4, %rax
leaq (%rax,%rax,4), %rdx
movq %rbx, %rdi
callq 0x3030
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x3c0e
movq 0x70(%rbx), %rax
movq 0x80(%rbx), %rcx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %r15
movl %ebp, (%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x31a7
cmpl $0x2, %ebp
ja 0x3be0
testq %r14, %r14
movl $0xea60, %edx           # imm = 0xEA60
cmovneq %r14, %rdx
movq %rdx, 0x10(%r15)
leaq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0x307c
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x3c0e
movq $0x0, 0x20(%r15)
testl %ebp, %ebp
je 0x3bff
incq 0x80(%rbx)
movq %rbx, %rdi
callq 0x3965
xorl %eax, %eax
jmp 0x3c0e
movl $0x21, 0x88(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/0xADE1A1DE[P]MeasureSuite/lib/src/loader.c
// Function: load_data
int load_data(measuresuite_t ms, enum load_type type, const uint8_t *data,
              size_t data_len, const char *symbol, int *id) {
  if (type == SHARED_OBJECT) {
    ms->errorno = E_INVALID_INPUT__SO_FROM_MEMORY;
    return 1;
  }

  if (*id == -1) {
    if (create_new_function(ms, type, data_len)) {
      return 1;
    }
    *id = (int)ms->num_functions - 1;
  }

  struct function_tuple *fct = &ms->functions[*id];
  /** make sure we got enough space in case we are re-using */
  if (fct->code_size_bytes < data_len) {
    if (realloc_rwx_or_fail(ms, fct->code, fct->code_size_bytes, data_len)) {
      return 1;
    }
    fct->code_size_bytes = data_len;
  }

  switch (type) {
  case ASM: {
#ifdef USE_ASSEMBLYLINE
    if (asm_assemble_string_counting_chunks(
            fct->al, (char *)data, (int)ms->chunk_size, &fct->chunks)) {
      ms->errorno = E_LOAD__ASM_DATA;
      return 1;
    }
    return 0;
#else
    ms->errorno = E_NO_ASSEMBLYLINE;
    return 1;
#endif
  }

  case BIN: {
    memcpy(fct->code, data, data_len);
    return 0;
  }

  case ELF:
    return elf_load_symbol_mem(ms, fct->code, fct->code_size_bytes, data,
                               symbol);

  default:
    return 1;
  }

  ms->errorno = E_SUCCESS;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
cmpl $0x3, %esi
jne 0x3c4b
movl $0xa, 0x88(%r14)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r9, %r13
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %rbx
movl %esi, %ebp
cmpl $-0x1, (%r9)
je 0x3cb6
movq 0x70(%r14), %rax
movslq (%r13), %rcx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %r13
movq 0x10(%r13), %rdx
cmpq %r15, %rdx
jae 0x3c96
movq 0x8(%r13), %rsi
movq %r14, %rdi
movq %r15, %rcx
callq 0x3108
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x3c3c
movq %r15, 0x10(%r13)
cmpl $0x2, %ebp
je 0x3cfa
cmpl $0x1, %ebp
je 0x3ce4
movl $0x1, %eax
testl %ebp, %ebp
jne 0x3c3c
movl $0x21, 0x88(%r14)
jmp 0x3c3c
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x3b50
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x3c3c
movl 0x80(%r14), %eax
decl %eax
movl %eax, (%r13)
jmp 0x3c5f
movq 0x8(%r13), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x21b0
xorl %eax, %eax
jmp 0x3c3c
movq 0x8(%r13), %rsi
movq 0x10(%r13), %rdx
movq %r14, %rdi
movq %rbx, %rcx
movq %r12, %r8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3f8e
nop
// File: /workspace/github_c_makefile_star2_O1/0xADE1A1DE[P]MeasureSuite/lib/src/checker.c
// Function: check
int check(size_t len, const uint64_t *data, const uint64_t *check_data) {
  size_t total = len;
  int res = OK;
  data += len;
  check_data += len;
  // check first.
  while (len--) {
    res |= (*(--data) != *(--check_data));
  }

  // if where is a mistake, print all
  if (res == WRONG) {
    pretty_print_results(data, check_data, total);
  }
  // and return the result anyway
  return res;
}

// Assembly:
pushq %rbx
movq %rdi, %rax
testq %rdi, %rdi
je 0x3d49
leaq -0x1(%rax), %rcx
xorl %ebx, %ebx
movq (%rsi,%rcx,8), %rdi
xorl %r8d, %r8d
cmpq (%rdx,%rcx,8), %rdi
setne %r8b
orl %r8d, %ebx
addq $-0x1, %rcx
jb 0x3d2f
jmp 0x3d53
leaq (%rsi,%rax,8), %rsi
leaq (%rdx,%rax,8), %rdx
xorl %ebx, %ebx
cmpl $0x1, %ebx
jne 0x3d66
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x4d40
movl %ebx, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/0xADE1A1DE[P]MeasureSuite/lib/src/io/elf_memory.c
// Function: find_section_offset_mem
void find_section_offset_mem(const uint8_t *src, Elf64_Ehdr hdr,
                             Elf64_Shdr sh_table[], const char *needle,
                             unsigned long *dest) {

  size_t len_needle = strlen(needle);

  /* Read section-header string-table */
  void *sh_str = NULL;
  read_section_mem(src, &sh_table[hdr.e_shstrndx], &sh_str);

  for (int i = 0; i < hdr.e_shnum; i++) {
    char *name = sh_str + sh_table[i].sh_name;

    if (strncmp(name, needle, len_needle) == 0) {
      *dest = i;
      break;
    }
  }
  free(sh_str);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbp
movq %rdx, %rdi
callq 0x20a0
movq %rax, %r12
movzwl 0x8e(%rsp), %ebx
shll $0x6, %ebx
movq 0x20(%r15,%rbx), %rdi
movq %rdi, 0x10(%rsp)
callq 0x21c0
movq %rax, %r13
addq 0x18(%r15,%rbx), %rbp
movq %rax, %rdi
movq %rbp, %rsi
movq 0x10(%rsp), %rdx
callq 0x21b0
movzwl 0x8c(%rsp), %ebx
testq %rbx, %rbx
je 0x41f5
xorl %ebp, %ebp
movl (%r15), %edi
addq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2080
testl %eax, %eax
je 0x41ed
incq %rbp
addq $0x40, %r15
cmpq %rbp, %rbx
jne 0x41ca
jmp 0x41f5
movq 0x8(%rsp), %rax
movq %rbp, (%rax)
movq %r13, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O1/0xADE1A1DE[P]MeasureSuite/lib/src/io/elf_memory.c
// Function: read_elf_header_mem
int read_elf_header_mem(const uint8_t *src, Elf64_Ehdr *elf_header) {
  size_t size = sizeof(Elf64_Ehdr);
  char magic[] = {"\177ELF"};
  if (elf_header == NULL                                     // sanity
      || memcpy(elf_header, src, size) == NULL               // read header
      || strncmp((char *)elf_header->e_ident, magic, 4) != 0 // check magic
      || elf_header->e_ident[EI_CLASS] != ELFCLASS64         // is elf64
  ) {
    return 1;
  }
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x1, %ebx
testq %rsi, %rsi
je 0x43be
movq %rsi, %r14
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movups 0x20(%rdi), %xmm2
movups 0x30(%rdi), %xmm3
movups %xmm3, 0x30(%rsi)
movups %xmm2, 0x20(%rsi)
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
leaq 0x1c18(%rip), %rsi      # 0x5fbb
movl $0x4, %edx
movq %r14, %rdi
callq 0x2080
testl %eax, %eax
jne 0x43be
xorl %ebx, %ebx
cmpb $0x2, 0x4(%r14)
setne %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/0xADE1A1DE[P]MeasureSuite/lib/src/io/file.c
// Function: filesize
int filesize(measuresuite_t ms, const char *filename, size_t *size) {
  struct stat stats;
  DEBUG("trying to Stat file '%s'\n", filename);
  if (stat(filename, &stats)) {
    ms->errorno = E_INVALID_INPUT__FILE;
    ms->additional_info = strerror(errno);
    return 1;
  }
  *size = stats.st_size;
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rdx, %r14
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x21a0
testl %eax, %eax
je 0x4410
movl $0xb, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
movl $0x1, %eax
jmp 0x441a
movq 0x38(%rsp), %rax
movq %rax, (%r14)
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/0xADE1A1DE[P]MeasureSuite/lib/src/io/file.c
// Function: filecopy
int filecopy(measuresuite_t ms, void *dest, size_t dest_size,
             const char *filename) {
  size_t size = 0;
  if (filesize(ms, filename, &size) || size > dest_size) {
    return 1;
  }

  int file = open(filename, O_RDONLY | O_SYNC);
  if (file == -1                                      // open
      || read(file, dest, dest_size) != (ssize_t)size // read
      || close(file) == -1                            // close
  ) {
    ms->errorno = E_INVALID_INPUT__FILE;
    ms->additional_info = strerror(errno);
    return 1;
  };

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, %r13
movq $0x0, (%r13)
movq %rcx, %rsi
movq %r13, %rdx
callq 0x43c8
testl %eax, %eax
setne %al
movq (%r13), %r13
cmpq %r14, %r13
seta %cl
orb %al, %cl
movl $0x1, %eax
jne 0x44c4
movq %r12, %rdi
movl $0x101000, %esi         # imm = 0x101000
xorl %eax, %eax
callq 0x21f0
cmpl $-0x1, %eax
je 0x44a2
movl %eax, %ebp
movl %eax, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2150
cmpq %r13, %rax
jne 0x44a2
movl %ebp, %edi
callq 0x2140
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
jne 0x44c4
movl $0xb, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/0xADE1A1DE[P]MeasureSuite/lib/src/io/shared_object.c
// Function: so_load_file
int so_load_file(struct measuresuite *ms, struct function_tuple *fct,
                 const char *filename) {

  if (access(filename, F_OK | X_OK | R_OK) != 0) {
    ms->errorno = E_LOAD__SO_FILE;
    ms->additional_info = strerror(errno);
    return 1;
  }

  // clear error
  dlerror();

  // open
  fct->lib_handle = dlopen(filename, RTLD_NOW | RTLD_LOCAL);

  // check
  if (fct->lib_handle == NULL) {
    ms->errorno = E_INTERNAL_MEASURE__AI__DLOPEN;
    ms->additional_info = dlerror();
    return 1;
  }

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, %rdi
movl $0x5, %esi
callq 0x2200
testl %eax, %eax
je 0x4517
movl $0x1a, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
movl $0x1, %eax
jmp 0x4537
callq 0x2030
movq %r15, %rdi
movl $0x2, %esi
callq 0x2180
movq %rax, %rcx
movq %rax, 0x10(%r14)
xorl %eax, %eax
testq %rcx, %rcx
je 0x453d
popq %rbx
popq %r14
popq %r15
retq
movl $0x15, 0x88(%rbx)
callq 0x2030
jmp 0x4509
// File: /workspace/github_c_makefile_star2_O1/0xADE1A1DE[P]MeasureSuite/lib/src/io/shared_object.c
// Function: so_load_symbol
int so_load_symbol(struct measuresuite *ms, struct function_tuple *fct,
                   const char *symbol) {

  // sanity check  the handle
  if (fct->lib_handle == NULL) {
    return 1;
  }

  // clear error
  dlerror();

  // load
  fct->code = dlsym(fct->lib_handle, symbol);

  /// check
  if (fct->code == NULL) {
    ms->errorno = E_INTERNAL_MEASURE__AI__DLSYM;
    ms->additional_info = dlerror();
    return 1;
  }

  return 0;
}

// Assembly:
movl $0x1, %eax
cmpq $0x0, 0x10(%rsi)
je 0x45a7
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2030
movq 0x10(%r14), %rdi
movq %r15, %rsi
callq 0x2230
movq %rax, %rcx
movq %rax, 0x8(%r14)
xorl %eax, %eax
testq %rcx, %rcx
jne 0x45a2
movl $0x14, 0x88(%rbx)
callq 0x2030
movq %rax, 0x90(%rbx)
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/0xADE1A1DE[P]MeasureSuite/lib/src/io/shared_object.c
// Function: so_unload_file
int so_unload_file(struct measuresuite *ms, struct function_tuple *fct) {
  // clear error
  dlerror();

  // close and check
  if (dlclose(fct->lib_handle) != 0) {
    ms->errorno = E_INTERNAL_MEASURE__AI__DLCLOSE;
    ms->additional_info = dlerror();
    return 1;
  }

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2030
movq 0x10(%r14), %rdi
callq 0x2270
testl %eax, %eax
je 0x45e1
movl $0x13, 0x88(%rbx)
callq 0x2030
movq %rax, 0x90(%rbx)
movl $0x1, %eax
jmp 0x45e3
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O1/0xADE1A1DE[P]MeasureSuite/lib/src/io/elf_file.c
// Function: read_section_header_table64
int read_section_header_table64(int32_t file, Elf64_Ehdr hdr,
                                Elf64_Shdr *sh_table) {

  // seek to header
  if (lseek(file, (off_t)hdr.e_shoff, SEEK_SET) != (off_t)hdr.e_shoff) {
    return 1;
  };

  // read all headers at once
  const ssize_t combined_size = (long)hdr.e_shnum * hdr.e_shentsize;
  if (read(file, sh_table, combined_size) != combined_size) {
    return 1;
  }

  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
movq 0x48(%rsp), %r14
movq %r14, %rsi
xorl %edx, %edx
callq 0x2100
movq %rax, %rcx
movl $0x1, %eax
cmpq %r14, %rcx
jne 0x463b
leaq 0x20(%rsp), %rax
movzwl 0x3c(%rax), %ecx
movzwl 0x3a(%rax), %r14d
imulq %rcx, %r14
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2150
movq %rax, %rcx
xorl %eax, %eax
cmpq %r14, %rcx
setne %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/0xADE1A1DE[P]MeasureSuite/lib/src/io/elf_file.c
// Function: find_section_offset
void find_section_offset(int32_t file, Elf64_Ehdr hdr, Elf64_Shdr sh_table[],
                         const char *needle, unsigned long *dest) {

  size_t len_needle = strlen(needle);

  /* Read section-header string-table */
  char *sh_str = NULL;
  read_section(file, sh_table[hdr.e_shstrndx], (void **)&sh_str);

  for (int i = 0; i < hdr.e_shnum; i++) {

    // sh_name is the index in the string_table
    Elf64_Word index = sh_table[i].sh_name;

    // get the address of the string to compare
    const char *name = &(sh_str[index]);

    if (strncmp(name, needle, len_needle) == 0) {
      *dest = i;
      break;
    }
  }
  free(sh_str);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x50(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
movq %rdx, %rdi
callq 0x20a0
movq %rax, %r12
leaq 0x48(%rsp), %rsi
movq $0x0, (%rsi)
movzwl 0xce(%rsp), %eax
shll $0x6, %eax
movups (%r15,%rax), %xmm0
movups 0x10(%r15,%rax), %xmm1
movups 0x20(%r15,%rax), %xmm2
movups 0x30(%r15,%rax), %xmm3
movups %xmm3, 0x30(%rsp)
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movl %ebp, %edi
callq 0x4706
movzwl 0xcc(%rsp), %r13d
testq %r13, %r13
je 0x46ee
movq 0x48(%rsp), %rbx
xorl %ebp, %ebp
movl (%r15), %edi
addq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2080
testl %eax, %eax
je 0x46e6
incq %rbp
addq $0x40, %r15
cmpq %rbp, %r13
jne 0x46c3
jmp 0x46ee
movq 0x50(%rsp), %rax
movq %rbp, (%rax)
movq 0x48(%rsp), %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O1/0xADE1A1DE[P]MeasureSuite/lib/src/io/elf_file.c
// Function: read_section
static int read_section(int32_t file, Elf64_Shdr sect_hdr, void **dest) {

  *dest = malloc(sect_hdr.sh_size);
  if (!dest) {
    fprintf(stderr, "%s:Failed to allocate %ldbytes\n", __func__,
            sect_hdr.sh_size);
    return 1;
  }

  if (lseek(file, (off_t)sect_hdr.sh_offset, SEEK_SET) !=
      (off_t)sect_hdr.sh_offset) {
    return 1;
  };
  ssize_t bytes_read = read(file, *dest, sect_hdr.sh_size);
  if (bytes_read == -1 || bytes_read == 0 || bytes_read == EOF ||
      (size_t)bytes_read != sect_hdr.sh_size) {
    return 1;
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
movq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq 0x21c0
movq %rax, (%r14)
movq 0x48(%rsp), %r15
movl %ebp, %edi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2100
cmpq %r15, %rax
jne 0x474f
movq (%r14), %rsi
movl %ebp, %edi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2150
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/0xADE1A1DE[P]MeasureSuite/lib/src/io/elf_file.c
// Function: read_elf_header
int read_elf_header(int32_t file, Elf64_Ehdr *elf_header) {
  size_t size = sizeof(Elf64_Ehdr);
  char magic[] = {"\177ELF"};
  if (elf_header == NULL                                     // sanity
      || lseek(file, (off_t)0, SEEK_SET) != (off_t)0         // seek to start
      || (size_t)read(file, elf_header, size) != size        // read header
      || strncmp((char *)elf_header->e_ident, magic, 4) != 0 // check magic
      || elf_header->e_ident[EI_CLASS] != ELFCLASS64         // is elf64
  ) {
    return 1;
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl $0x1, %ebx
testq %rsi, %rsi
je 0x495a
movq %rsi, %r14
movl %edi, %ebp
xorl %esi, %esi
xorl %edx, %edx
callq 0x2100
testq %rax, %rax
jne 0x495a
movl $0x40, %edx
movl %ebp, %edi
movq %r14, %rsi
callq 0x2150
cmpq $0x40, %rax
jne 0x495a
leaq 0x167c(%rip), %rsi      # 0x5fbb
movl $0x4, %edx
movq %r14, %rdi
callq 0x2080
testl %eax, %eax
jne 0x495a
xorl %ebx, %ebx
cmpb $0x2, 0x4(%r14)
setne %bl
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/0xADE1A1DE[P]MeasureSuite/lib/src/fisher_yates.c
// Function: shuffle_permutations
int shuffle_permutations(measuresuite_t ms) {

  // nothing to shuffle if we didn't load any functions yet / there is only one
  // function
  if (ms->num_functions <= 1) {
    return 0;
  }

  for (size_t i = ms->num_functions - 1; // start with last item
       i >= 1; // until second item (no need to shuffle first item with itself)
       i--     // every item
  ) {
    size_t num = 0;
    if (get_random_number(ms, i, &num)) {
      return 1;
    }
    // swap random with current
    size_t tmp = ms->permutation[i];
    ms->permutation[i] = ms->permutation[num];
    ms->permutation[num] = tmp;
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq 0x80(%rdi), %r14
xorl %eax, %eax
cmpq $0x2, %r14
jb 0x4d33
movq %r14, %rsi
decq %rsi
setne %bpl
je 0x4d2f
movq %rdi, %rbx
leaq 0x8(%rsp), %rdx
movq $0x0, (%rdx)
callq 0x2ded
testl %eax, %eax
jne 0x4d2f
addq $-0x2, %r14
leaq 0x8(%rsp), %r15
movq %r14, %r12
movq 0x60(%rbx), %rax
movq 0x8(%rax,%r14,8), %rcx
movq 0x8(%rsp), %rdx
movq (%rax,%rdx,8), %rdx
movq %rdx, 0x8(%rax,%r14,8)
movq 0x8(%rsp), %rdx
movq %rcx, (%rax,%rdx,8)
addq $-0x1, %r12
setb %bpl
jae 0x4d2f
movq $0x0, 0x8(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2ded
movq %r12, %r14
testl %eax, %eax
je 0x4ce7
movzbl %bpl, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/0xADE1A1DE[P]MeasureSuite/lib/src/printer.c
// Function: pretty_print_results
void pretty_print_results(uint64_t const *data_a, uint64_t const *data_b,
                          size_t total) {

  for (size_t i = 0; i < total; i++) {

    uint64_t ground_truth = data_a[i];
    uint64_t val = data_b[i];
    printf("\n\x1b[%dm@ %lu/%lu\x1b[0m:\n"
           "a:0x",
           color_grn - (val != ground_truth), i, total);

    printbin_single_number_hex(ground_truth, ground_truth);
#ifdef ENABLE_DEBUG
    printbin_single_number_bin(ground_truth, ground_truth);
#endif
    printf("\n\x1b[0mb:0x");

    printbin_single_number_hex(val, ground_truth);
#ifdef ENABLE_DEBUG
    printbin_single_number_bin(val, ground_truth);
#endif

    printf("\n");
    data_b++;
    data_a++;
  }
}

// Assembly:
testq %rdx, %rdx
je 0x4dd7
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq %rsi, (%rsp)
movq (%rbx,%r14), %r12
movq (%rsi,%r14), %r13
xorl %esi, %esi
cmpq %r12, %r13
sete %sil
addl $0x1f, %esi
leaq 0x12f6(%rip), %rdi      # 0x6074
movq %rbp, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x20d0
movq %r12, %rdi
movq %r12, %rsi
callq 0x4dd8
leaq 0x12f1(%rip), %rdi      # 0x608e
xorl %eax, %eax
callq 0x20d0
movq %r13, %rdi
movq %r12, %rsi
callq 0x4dd8
movl $0xa, %edi
callq 0x2050
movq (%rsp), %rsi
incq %rbp
addq $0x10, %r14
cmpq %rbp, %r15
jne 0x4d63
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/0xADE1A1DE[P]MeasureSuite/lib/src/printer.c
// Function: printbin_single_number_hex
static void printbin_single_number_hex(uint64_t num, uint64_t compare) {

  const short bits_in_u64 = 64;
  const short bits_in_nibble = 4;
  const char nibble_mask = 0xF;

  int width = bits_in_u64 - bits_in_nibble;
  while (width >= 0) {
    unsigned long value = (num >> width) & nibble_mask;
    unsigned long truth = (compare >> width) & nibble_mask;
    int color = color_grn - (truth != value); // col 32 when its equal, grn

    printf("\x1b[%dm%lx", color, value);
    width -= bits_in_nibble;
  }
  printf("\x1b[0m");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x3c, %r15d
leaq 0x12a5(%rip), %r12      # 0x6098
movq %r14, %rdx
movl %r15d, %ecx
shrq %cl, %rdx
andl $0xf, %edx
movq %rbx, %rax
shrq %cl, %rax
andl $0xf, %eax
xorl %esi, %esi
cmpl %edx, %eax
sete %sil
addl $0x1f, %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x20d0
addq $-0x4, %r15
cmpq $-0x4, %r15
jne 0x4df3
leaq 0x1273(%rip), %rdi      # 0x60a1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x20d0
// File: /workspace/github_c_makefile_star2_O1/giometti[P]mastering_UNIX_programming/chapter_01/passwd.c
// Function: main
int main(void) {
	struct passwd *pwd;

	setpwent();
	while((pwd = getpwent()) != NULL)
		printf("uid=%d gid=%d name=%s\n",
			pwd->pw_uid, pwd->pw_gid, pwd->pw_name);
	endpwent();

	return 0;
}

// Assembly:
pushq %rbx
callq 0x1040
callq 0x1050
testq %rax, %rax
je 0x11a0
leaq 0xe81(%rip), %rbx       # 0x2004
movl 0x10(%rax), %esi
movl 0x14(%rax), %edx
movq (%rax), %rcx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1030
callq 0x1050
testq %rax, %rax
jne 0x1183
callq 0x1060
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/giometti[P]mastering_UNIX_programming/chapter_03/dup2.c
// Function: main
int main(void)
{
	int ret;

	ret = dup2(STDOUT_FILENO, STDERR_FILENO);
	if (ret < 0) {
		perror("dup2");
		return -1;
	}

	/* WARNING: this is an example! NEVER, NEVER, NEVER call
	 *          a system call without checking its return value!
	 */
	write(STDOUT_FILENO, "stdout\n", 7);
	write(STDERR_FILENO, "stderr\n", 7);

	return 0;
}

// Assembly:
pushq %rax
movl $0x1, %edi
movl $0x2, %esi
callq 0x1040
testl %eax, %eax
js 0x11a0
leaq 0xe92(%rip), %rsi       # 0x2009
movl $0x7, %edx
movl $0x1, %edi
callq 0x1030
leaq 0xe84(%rip), %rsi       # 0x2011
movl $0x7, %edx
movl $0x2, %edi
callq 0x1030
xorl %eax, %eax
popq %rcx
retq
leaq 0xe5d(%rip), %rdi       # 0x2004
callq 0x1050
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x119e
// File: /workspace/github_c_makefile_star2_O1/zpole[P]IICV/src/test_getopt_long.c
// Function: main
int
main (int argc, char *argv[])
{
  int ch ;

  printf("*** parsing options: start\n") ;

  while ((ch = getopt_long(argc, argv, "hbf:", longopts, 0)) != -1) {

    switch (ch) {

    case 'h':
        printf("test_getopt_long: test VLFeat implementation of this function.\n"
               " --help -h      this message\n"
               " --buffy -b     option with no arguments\n"
               " --fluoride -f  option with required argument\n"
               " --daggerset    auto option with no arguments\n"
               " --daggerrunset auto option with no argument\n"
               " --spike        long option with optional argument\n") ;
        break;

    case 'b':
      printf("option `b' or `buffy'\n") ;
      break;

    case 'f':
      printf("option `f' or `flouride' with arg `%s'\n", optarg) ;
      break ;

    case 1002 :
      printf("option `spike' with arg `%s'\n", optarg) ;
      break ;

    case 0:
      printf("automatic longoption (daggerset=%d)\n", daggerset) ;
      break ;

    case  '?' :
      printf("illegal option or missing argument\n") ;
      break ;

    case ':'  :
      printf("illegal option\n") ;
      break ;

    default:
      abort() ;
    }
  }

  printf("*** parsing options: end\n");
  {
    int i ;
    for(i = optind ; i < argc ; ++i)
		printf("non-option: '%s'\n", argv[i]) ;
  }

  return 0 ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebx
leaq 0xf33(%rip), %rdi       # 0x20b6
callq 0x1040
leaq 0xe75(%rip), %r15       # 0x2004
leaq 0x2eba(%rip), %r12      # 0x4050
movq 0x2e5b(%rip), %rbp      # 0x3ff8
leaq 0xf8e(%rip), %r13       # 0x2132
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x1060
cmpl $0x61, %eax
jle 0x11e3
cmpl $0x67, %eax
jg 0x1204
cmpl $0x62, %eax
je 0x124c
cmpl $0x66, %eax
jne 0x12ca
movq (%rbp), %rsi
leaq 0xe2b(%rip), %rdi       # 0x2009
jmp 0x1268
cmpl $0x39, %eax
jle 0x121e
cmpl $0x3a, %eax
je 0x123b
cmpl $0x3f, %eax
jne 0x12ca
leaq 0xefc(%rip), %rdi       # 0x20f9
callq 0x1040
jmp 0x11a4
cmpl $0x3ea, %eax            # imm = 0x3EA
je 0x125d
cmpl $0x68, %eax
jne 0x12ca
movq %r13, %rdi
callq 0x1040
jmp 0x11a4
testl %eax, %eax
jne 0x1274
movl 0x2f0c(%rip), %esi      # 0x4134
leaq 0xe20(%rip), %rdi       # 0x204f
xorl %eax, %eax
callq 0x1050
jmp 0x11a4
leaq 0xea8(%rip), %rdi       # 0x20ea
callq 0x1040
jmp 0x11a4
leaq 0xec9(%rip), %rdi       # 0x211c
callq 0x1040
jmp 0x11a4
movq (%rbp), %rsi
leaq 0xdc9(%rip), %rdi       # 0x2031
xorl %eax, %eax
callq 0x1050
jmp 0x11a4
cmpl $-0x1, %eax
jne 0x12ca
leaq 0xe51(%rip), %rdi       # 0x20d1
callq 0x1040
movq 0x2d54(%rip), %rax      # 0x3fe0
movslq (%rax), %rax
cmpl %eax, %ebx
jle 0x12b9
leaq (%r14,%rax,8), %r15
subl %eax, %ebx
leaq 0xdd4(%rip), %r14       # 0x2074
xorl %r12d, %r12d
movq (%r15,%r12,8), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1050
incq %r12
cmpl %r12d, %ebx
jne 0x12a3
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1030
// File: /workspace/github_c_makefile_star2_O1/accre[P]Cprogramming/structures.c
// Function: printStruct
void printStruct( student oneStudent )
{
   int i;

   printf("=====================\n");
   printf("Student name: %s\n",oneStudent.name);
   printf("        age: %d\n",oneStudent.age);
   printf("        height: %6.3f\n",oneStudent.height);
   printf("        grades: ");
   for (i=0; i<10; i++) printf("%4.1f ",oneStudent.grades[i]);
   printf("\n");
   printf("=====================\n");

   // note that we're just changing the age of the local
   // copy here, so this will not affect the age of the 
   // original struct created in main()
   oneStudent.age = 45;

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x20(%rsp), %r14
leaq 0xeef(%rip), %rdi       # 0x205c
callq 0x1040
movq (%r14), %rsi
leaq 0xe88(%rip), %rdi       # 0x2004
xorl %eax, %eax
callq 0x1050
movl 0x8(%r14), %esi
leaq 0xe88(%rip), %rdi       # 0x2016
xorl %eax, %eax
callq 0x1050
cvtss2sd 0xc(%r14), %xmm0
leaq 0xe85(%rip), %rdi       # 0x2027
movb $0x1, %al
callq 0x1050
leaq 0xe8e(%rip), %rdi       # 0x203e
xorl %eax, %eax
callq 0x1050
movl $0x4, %r15d
leaq 0xe8b(%rip), %rbx       # 0x204f
xorps %xmm0, %xmm0
cvtss2sd (%r14,%r15,4), %xmm0
movq %rbx, %rdi
movb $0x1, %al
callq 0x1050
incq %r15
cmpq $0xe, %r15
jne 0x11c4
movl $0xa, %edi
callq 0x1030
leaq 0xe6b(%rip), %rdi       # 0x205c
callq 0x1040
movl $0x2d, 0x8(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/accre[P]Cprogramming/structures.c
// Function: main
int main()
{

   student Nikki;
   Nikki.name = "Nikki";
   Nikki.age = 19;
   Nikki.height = 64.75;
   int i;
   for (i=0; i<10 ; i++) {
      Nikki.grades[i] = 98.0; // overachiever
   }

   printStruct(Nikki);

   // It's advantageous to pass arrays and structures by reference, 
   // because it's more efficient (don't need to make a copy of all data)
   // and allows you to modify the contents of the array or struct
   modifyStruct(&Nikki);

   printStruct(Nikki);

   return 0;
}

// Assembly:
subq $0x78, %rsp
leaq 0xe31(%rip), %rax       # 0x2056
movq %rax, 0x40(%rsp)
movabsq $0x4281800000000013, %rax # imm = 0x4281800000000013
movq %rax, 0x48(%rsp)
movl $0x4, %eax
movl $0x42c40000, 0x40(%rsp,%rax,4) # imm = 0x42C40000
incq %rax
cmpq $0xe, %rax
jne 0x123e
movq 0x70(%rsp), %rax
movq %rax, 0x30(%rsp)
movups 0x40(%rsp), %xmm0
movups 0x50(%rsp), %xmm1
movups 0x60(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x115c
movl $0x42900000, 0x50(%rsp) # imm = 0x42900000
movl $0x42a20000, 0x60(%rsp) # imm = 0x42A20000
movl $0x42aa0000, 0x68(%rsp) # imm = 0x42AA0000
movq 0x70(%rsp), %rax
movq %rax, 0x30(%rsp)
movups 0x40(%rsp), %xmm0
movups 0x50(%rsp), %xmm1
movups 0x60(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x115c
xorl %eax, %eax
addq $0x78, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/00pauln00[P]yapio/yapio.c
// Function: yapio_destroy_buffers
static void
yapio_destroy_buffers(void)
{
    if (yapioSourceBlkMd)
        YAPIO_FREE(yapioSourceBlkMd);

    if (yapioIOBuf)
        YAPIO_FREE(yapioIOBuf);
}

// Assembly:
pushq %rbx
movq 0x6aa2(%rip), %rdi      # 0xd260
testq %rdi, %rdi
je 0x67d1
callq 0x2170
cmpl $0x3, 0x6a51(%rip)      # 0xd220
jge 0x67f0
movq 0xe0f2c8(%rip), %rbx    # 0xe15aa0
testq %rbx, %rbx
je 0x67ee
movq %rbx, %rdi
callq 0x2170
cmpl $0x3, 0x6a34(%rip)      # 0xd220
jge 0x67f7
popq %rbx
retq
callq 0x2420
jmp 0x67d1
movq %rbx, %rdi
callq 0x2461
jmp 0x67ee
// File: /workspace/github_c_makefile_star2_O1/00pauln00[P]yapio/yapio.c
// Function: yapio_exit
static void
yapio_exit(int exit_rc)
{
    if (yapioMpiInit)
    {
        yapio_mpi_barrier(MPI_COMM_WORLD);

        if (yapioIOErrorCnt)
            MPI_Abort(MPI_COMM_WORLD, -EIO);

        else
            MPI_Finalize();
    }

    exit(exit_rc);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
cmpb $0x1, 0x206a66(%rip)    # 0x20d274
jne 0x6854
leaq 0xe112b1(%rip), %r14    # 0xe17ac8
movq %r14, %rdi
callq 0x2370
movq 0x67aa(%rip), %rdi      # 0xcfd0
callq 0x2030
movq %r14, %rdi
callq 0x23b0
cmpl $0x0, 0xe12322(%rip)    # 0xe18b5c
jne 0x6843
callq 0x22b0
jmp 0x6854
movq 0x6786(%rip), %rdi      # 0xcfd0
movl $0xfffffffb, %esi       # imm = 0xFFFFFFFB
callq 0x21e0
movl %ebx, %edi
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O1/00pauln00[P]yapio/yapio.c
// Function: yapio_mmap_open
static int
yapio_mmap_open(const char *file, int flags, mode_t mode)
{
    int fd = open(file, flags, mode);
    if (fd >= YAPIO_FD_MAP_SIZE_MAX)
    {
        log_msg(YAPIO_LL_FATAL, "fd=%d exceeds map table size %u",
                fd, YAPIO_FD_MAP_SIZE_MAX);
        close(fd);
        return -ERANGE;
    }

    int prot = mode == O_RDONLY ? PROT_READ : (PROT_READ | PROT_WRITE);

    size_t len = (yapioMyTestGroup->ytg_num_blks_per_rank *
                  yapioMyTestGroup->ytg_blk_sz *
                  (yapioMyTestGroup->ytg_file_per_process ?
                   1 : yapioMyTestGroup->ytg_num_ranks));

    void *addr = mmap(NULL, len, prot, MAP_SHARED, fd, 0);
    if (addr == NULL)
    {
        const int error = errno;
        log_msg(YAPIO_LL_FATAL, "mmap() prot=%d len=%zd: %s",
                prot, len, strerror(error));
        close(fd);
        return -error;
    }

    log_msg(YAPIO_LL_DEBUG, "fd=%d addr=%p len=%zd", fd, addr, len);

    yapioFdMap[fd].yfm_fd = fd;
    yapioFdMap[fd].yfm_addr = addr;

    return fd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
xorl %eax, %eax
callq 0x23d0
movl %eax, %ebx
cmpl $0x20000, %eax          # imm = 0x20000
jl 0x6892
cmpl $0x0, 0x69a5(%rip)      # 0xd220
jns 0x697f
movl %ebx, %edi
callq 0x2090
movl $0xffffffde, %ebx       # imm = 0xFFFFFFDE
jmp 0x692d
xorl %ecx, %ecx
testl %ebp, %ebp
setne %cl
movq 0x69b0(%rip), %rax      # 0xd250
movq 0xb028(%rax), %r14
imulq 0xb020(%rax), %r14
leal 0x1(,%rcx,2), %ebp
movl $0x1, %ecx
cmpb $0x0, 0xb030(%rax)
jne 0x68cb
movslq 0xb01c(%rax), %rcx
imulq %rcx, %r14
xorl %edi, %edi
movq %r14, %rsi
movl %ebp, %edx
movl $0x1, %ecx
movl %ebx, %r8d
xorl %r9d, %r9d
callq 0x23e0
testq %rax, %rax
je 0x690f
movq %rax, %r15
cmpl $0x3, 0x692b(%rip)      # 0xd220
jge 0x693a
movslq %ebx, %rax
shlq $0x4, %rax
leaq 0x696b(%rip), %rcx      # 0xd270
movl %ebx, (%rax,%rcx)
movq %r15, 0x8(%rax,%rcx)
jmp 0x692d
callq 0x2250
movl (%rax), %r15d
cmpl $0x0, 0x6902(%rip)      # 0xd220
jns 0x6986
movl %ebx, %edi
callq 0x2090
negl %r15d
movl %r15d, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x669f(%rip), %rax      # 0xcfe0
movq (%rax), %rdi
movl 0x691d(%rip), %r8d      # 0xd268
subq $0x8, %rsp
leaq 0x1869(%rip), %rsi      # 0x81bf
leaq 0x189e(%rip), %rdx      # 0x81fb
leaq 0x1821(%rip), %rcx      # 0x8185
movl $0x1ad, %r9d            # imm = 0x1AD
xorl %eax, %eax
pushq %r14
pushq %r15
pushq %rbx
callq 0x2390
addq $0x20, %rsp
jmp 0x68f7
movl %ebx, %edi
callq 0x24ff
movl %r15d, %edi
movl %ebp, %esi
movq %r14, %rdx
callq 0x249e
// File: /workspace/github_c_makefile_star2_O1/00pauln00[P]yapio/yapio.c
// Function: yapio_mmap_close
static int
yapio_mmap_close(int fd)
{
    log_msg(YAPIO_LL_DEBUG, "fd=%d addr=%p", fd, yapioFdMap[fd].yfm_addr);

    size_t len = (yapioMyTestGroup->ytg_num_blks_per_rank *
                  yapioMyTestGroup->ytg_blk_sz);

    int rc = munmap(yapioFdMap[fd].yfm_addr, len);
    if (rc)
        log_msg(YAPIO_LL_ERROR, "munmap(): %s", strerror(errno));

    rc = close(yapioFdMap[fd].yfm_fd);
    if (rc)
        log_msg(YAPIO_LL_ERROR, "close(): %s", strerror(errno));

    return rc;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
cmpl $0x3, 0x6883(%rip)      # 0xd220
jge 0x6a06
movq 0x68aa(%rip), %rax      # 0xd250
movq 0xb028(%rax), %rsi
imulq 0xb020(%rax), %rsi
movslq %ebx, %rax
shlq $0x4, %rax
leaq 0x68ad(%rip), %rcx      # 0xd270
leaq (%rcx,%rax), %rbx
movq 0x8(%rax,%rcx), %rdi
callq 0x22f0
testl %eax, %eax
je 0x69de
cmpl $0x0, 0x6844(%rip)      # 0xd220
jg 0x69f8
movl (%rbx), %edi
callq 0x2090
movl %eax, %ebx
testl %eax, %eax
je 0x69f4
cmpl $0x0, 0x682e(%rip)      # 0xd220
jg 0x69ff
movl %ebx, %eax
popq %rbx
retq
callq 0x259a
jmp 0x69de
callq 0x25ec
jmp 0x69f4
movl %ebx, %edi
callq 0x2547
jmp 0x699f
// File: /workspace/github_c_makefile_star2_O1/00pauln00[P]yapio/yapio.c
// Function: yapio_mmap_fsync
static int
yapio_mmap_fsync(int fd)
{
#if 1
    size_t len = (yapioMyTestGroup->ytg_num_blks_per_rank *
                  yapioMyTestGroup->ytg_blk_sz *
                  (yapioMyTestGroup->ytg_file_per_process ?
                   1 : yapioMyTestGroup->ytg_num_ranks));

    int rc = msync(yapioFdMap[fd].yfm_addr, len, MS_SYNC);
    if (rc)
    {
        rc = -errno;

        log_msg(YAPIO_LL_WARN, "fd=%d addr=%p rc=%d",
                fd, yapioFdMap[fd].yfm_addr, rc);
    }
#else
    int rc = fsync(fd);
#endif
    return rc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x6832(%rip), %rax      # 0xd250
movq 0xb028(%rax), %rsi
imulq 0xb020(%rax), %rsi
movl %edi, %ebx
movl $0x1, %ecx
cmpb $0x0, 0xb030(%rax)
jne 0x6a44
movslq 0xb01c(%rax), %rcx
imulq %rcx, %rsi
movslq %ebx, %r15
shlq $0x4, %r15
leaq 0x681a(%rip), %r12      # 0xd270
movq 0x8(%r15,%r12), %rdi
movl $0x4, %edx
callq 0x21c0
testl %eax, %eax
je 0x6ac8
callq 0x2250
xorl %r14d, %r14d
subl (%rax), %r14d
cmpl $0x2, 0x67a5(%rip)      # 0xd220
jl 0x6acb
leaq (%r15,%r12), %r10
addq $0x8, %r10
movq 0x6554(%rip), %rax      # 0xcfe0
movq (%rax), %rdi
movl 0x67d2(%rip), %r8d      # 0xd268
subq $0x8, %rsp
leaq 0x17c5(%rip), %rsi      # 0x8266
leaq 0x1748(%rip), %rdx      # 0x81f0
leaq 0x17da(%rip), %rcx      # 0x8289
movl $0x1d7, %r9d            # imm = 0x1D7
xorl %eax, %eax
pushq %r14
pushq (%r10)
pushq %rbx
callq 0x2390
addq $0x20, %rsp
jmp 0x6acb
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/00pauln00[P]yapio/yapio.c
// Function: yapio_mmap_pwrite
static ssize_t
yapio_mmap_pwrite(int fd, const void *buf, size_t count, off_t offset)
{
    char *addr = yapioFdMap[fd].yfm_addr;

    log_msg(YAPIO_LL_DEBUG, "%p off=%ld cnt=%zd",
            &addr[offset], offset, count);

    memcpy(&addr[offset], (char *)buf, count);

    return count;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r14
movslq %edi, %rax
shlq $0x4, %rax
leaq 0x674d(%rip), %rcx      # 0xd270
movq 0x8(%rax,%rcx), %r12
cmpl $0x3, 0x66f1(%rip)      # 0xd220
jge 0x6b51
addq %r15, %r12
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x23c0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x6488(%rip), %rax      # 0xcfe0
movq (%rax), %rdi
movl 0x6706(%rip), %r8d      # 0xd268
leaq (%r12,%r15), %r10
subq $0x8, %rsp
leaq 0x1729(%rip), %rsi      # 0x829a
leaq 0x1683(%rip), %rdx      # 0x81fb
leaq 0x173d(%rip), %rcx      # 0x82bc
movl $0x1ef, %r9d            # imm = 0x1EF
xorl %eax, %eax
pushq %rbx
pushq %r15
pushq %r10
callq 0x2390
addq $0x20, %rsp
jmp 0x6b31
// File: /workspace/github_c_makefile_star2_O1/00pauln00[P]yapio/yapio.c
// Function: yapio_test_recipe_param_to_string
static int
yapio_test_recipe_param_to_string(const char *param_str, char *dest)
{
    char recipe_param_tmp_str[YAPIO_RECIPE_PARAM_STRLEN_MAX];

    int len = yapio_test_recipe_param_gather(param_str, recipe_param_tmp_str);

    strncpy(dest, recipe_param_tmp_str, len);

    log_msg_r0(YAPIO_LL_DEBUG, "%s", dest);

    return len;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rsp, %r14
movq %r14, %rsi
callq 0x6cde
movl %eax, %ebp
movslq %eax, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2330
movq 0x664d(%rip), %rax      # 0xd250
testq %rax, %rax
je 0x6c10
movb 0xb032(%rax), %al
jmp 0x6c1a
cmpl $0x0, 0x6651(%rip)      # 0xd268
sete %al
testb %al, %al
je 0x6c27
cmpl $0x3, 0x65fb(%rip)      # 0xd220
jge 0x6c32
movl %ebp, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
callq 0x263e
jmp 0x6c27
// File: /workspace/github_c_makefile_star2_O1/00pauln00[P]yapio/yapio.c
// Function: yapio_test_recipe_param_to_ull
static int
yapio_test_recipe_param_to_ull(const char *param_str, size_t *result)
{
    char recipe_param_tmp_str[YAPIO_RECIPE_PARAM_STRLEN_MAX];

    int len = yapio_test_recipe_param_gather(param_str, recipe_param_tmp_str);

    if (result)
        *result = strtoull(recipe_param_tmp_str, NULL, 10);

    log_msg_r0(YAPIO_LL_DEBUG, "%s %zu", recipe_param_tmp_str, *result);

    return len;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rsp, %r14
movq %r14, %rsi
callq 0x6cde
movl %eax, %ebp
testq %rbx, %rbx
je 0x6c6b
movq %rsp, %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2340
movq %rax, (%rbx)
movq 0x65de(%rip), %rax      # 0xd250
testq %rax, %rax
je 0x6c7f
movb 0xb032(%rax), %al
jmp 0x6c89
cmpl $0x0, 0x65e2(%rip)      # 0xd268
sete %al
testb %al, %al
je 0x6c96
cmpl $0x3, 0x658c(%rip)      # 0xd220
jge 0x6ca1
movl %ebp, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x6338(%rip), %rax      # 0xcfe0
movq (%rax), %rdi
movl 0x65b6(%rip), %r8d      # 0xd268
leaq 0x1e8c(%rip), %rsi      # 0x8b45
leaq 0x153b(%rip), %rdx      # 0x81fb
leaq 0x1e94(%rip), %rcx      # 0x8b5b
movl $0x28a, %r9d            # imm = 0x28A
xorl %eax, %eax
pushq (%rbx)
pushq %r14
callq 0x2390
addq $0x10, %rsp
jmp 0x6c96
// File: /workspace/github_c_makefile_star2_O1/00pauln00[P]yapio/yapio.c
// Function: yapio_test_recipe_param_gather
static int
yapio_test_recipe_param_gather(const char *param_str, char *buf)
{
    int j;

    for (j = 0; j < YAPIO_RECIPE_PARAM_STRLEN_MAX - 1 && param_str[j] != ':';
         j++)
        buf[j] = param_str[j];

    if (param_str[j] != ':')
    {
        if (j == YAPIO_RECIPE_PARAM_STRLEN_MAX)
        {
            log_msg(YAPIO_LL_ERROR, "recipe input string is too long");
            return -E2BIG;
        }
        return -EINVAL;
    }

    buf[j] = '\0';

    return j + 1; //include ':' char
}

// Assembly:
xorl %eax, %eax
movb (%rdi,%rax), %cl
cmpb $0x3a, %cl
je 0x6cf9
movb %cl, (%rsi,%rax)
incq %rax
cmpq $0x40, %rax
jne 0x6ce0
movl $0x40, %eax
pushq %rbx
movl %eax, %eax
cmpb $0x3a, (%rdi,%rax)
jne 0x6d0b
movb $0x0, (%rsi,%rax)
leal 0x1(%rax), %ebx
jmp 0x6d23
movl $0xffffffea, %ebx       # imm = 0xFFFFFFEA
cmpl $0x41, %eax
jne 0x6d23
movl $0xfffffff9, %ebx       # imm = 0xFFFFFFF9
cmpl $0x0, 0x64ff(%rip)      # 0xd220
jg 0x6d27
movl %ebx, %eax
popq %rbx
retq
callq 0x267b
jmp 0x6d23
// File: /workspace/github_c_makefile_star2_O1/00pauln00[P]yapio/yapio.c
// Function: yapio_open_fpp_file
static int
yapio_open_fpp_file(int rank, int oflags)
{
    if (rank >= yapioNumRanks)
        return -EINVAL;

    char file_per_process_name[PATH_MAX + 1];

    int rc = yapio_make_filename(file_per_process_name, rank);
    if (rc)
        return rc;

    if (yapioFileDescFpp[rank] < 0)
    {
        yapioFileDescFpp[rank] =
            YAPIO_SYS_CALL(open)(file_per_process_name, oflags, 0644);

        if (yapioFileDescFpp[rank] < 0)
        {
            rc = -errno;
            log_msg(YAPIO_LL_ERROR, "open `%s': %s",
                    file_per_process_name, strerror(errno));
        }
        else
        {
            log_msg(YAPIO_LL_DEBUG, "%s", file_per_process_name);

            if (yapioModeCurrent == YAPIO_IO_MODE_MMAP)
            {
                size_t len = (yapioMyTestGroup->ytg_num_blks_per_rank *
                              yapioMyTestGroup->ytg_blk_sz);

                if (ftruncate(yapioFileDescFpp[rank], len))
                {
                    log_msg(YAPIO_LL_FATAL, "ftruncate(): %s",
                            strerror(errno));
                }
            }
        }
    }

    return rc;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1010, %rsp           # imm = 0x1010
movl $0xffffffea, %ebx       # imm = 0xFFFFFFEA
cmpl %edi, 0x2062e3(%rip)    # 0x20d270
jle 0x6fb8
movl %esi, %ebp
movl %edi, %r14d
movq %rsp, %rdi
movl %r14d, %esi
callq 0x7061
movl %eax, %ebx
testl %eax, %eax
jne 0x6fb8
movq 0xe10b44(%rip), %rax    # 0xe17af0
movslq %r14d, %r14
xorl %ebx, %ebx
cmpl $0x0, (%rax,%r14,4)
js 0x6fc6
movl %ebx, %eax
addq $0x1010, %rsp           # imm = 0x1010
popq %rbx
popq %r14
popq %rbp
retq
movq 0x624b(%rip), %rax      # 0xd218
movq %rsp, %rdi
movl %ebp, %esi
movl $0x1a4, %edx            # imm = 0x1A4
callq *(%rax)
movq 0xe10b10(%rip), %rcx    # 0xe17af0
movl %eax, (%rcx,%r14,4)
testl %eax, %eax
js 0x7032
cmpl $0x3, 0x6231(%rip)      # 0xd220
jge 0x7057
cmpl $0x3, 0x2062a0(%rip)    # 0x20d298
jne 0x6fb8
movq 0x624f(%rip), %rax      # 0xd250
movq 0xb028(%rax), %rsi
imulq 0xb020(%rax), %rsi
movq 0xe10ad9(%rip), %rax    # 0xe17af0
movl (%rax,%r14,4), %edi
callq 0x2350
testl %eax, %eax
je 0x6fb8
cmpl $0x0, 0x61f5(%rip)      # 0xd220
js 0x6fb8
callq 0x2870
callq 0x2250
movl (%rax), %edi
movl %edi, %ebx
negl %ebx
cmpl $0x0, 0x61dc(%rip)      # 0xd220
jle 0x6fb8
movq %rsp, %rsi
callq 0x28c3
jmp 0x6fb8
movq %rsp, %rdi
callq 0x2830
jmp 0x6ff1
// File: /workspace/github_c_makefile_star2_O1/00pauln00[P]yapio/yapio.c
// Function: yapio_make_filename
static int
yapio_make_filename(char *file_name, int rank)
{
    int rc = rank >= 0 ?
        snprintf(file_name, PATH_MAX, "%s%s.%d",
                 yapioTestFileNamePrefix, yapioTestFileName, rank) :
        snprintf(file_name, PATH_MAX, "%s%s",
                 yapioTestFileNamePrefix, yapioTestFileName);

    if (rc > PATH_MAX)
    {
        log_msg(YAPIO_LL_ERROR, "%s", strerror(ENAMETOOLONG));
        return -ENAMETOOLONG;
    }

    return 0;
}

// Assembly:
pushq %rbx
movq 0x61cf(%rip), %rcx      # 0xd238
testl %esi, %esi
js 0x708c
movl %esi, %r9d
leaq 0x2105(%rip), %rdx      # 0x917c
leaq 0xe0fa42(%rip), %r8     # 0xe16ac0
movl $0x1000, %esi           # imm = 0x1000
xorl %eax, %eax
callq 0x2080
jmp 0x70a6
leaq 0x1f7d(%rip), %rdx      # 0x9010
leaq 0xe0fa26(%rip), %r8     # 0xe16ac0
movl $0x1000, %esi           # imm = 0x1000
xorl %eax, %eax
callq 0x2080
xorl %ebx, %ebx
cmpl $0x1001, %eax           # imm = 0x1001
jl 0x70bd
movl $0xffffffdc, %ebx       # imm = 0xFFFFFFDC
cmpl $0x0, 0x6165(%rip)      # 0xd220
jg 0x70c1
movl %ebx, %eax
popq %rbx
retq
callq 0x2914
jmp 0x70bd
// File: /workspace/github_c_makefile_star2_O1/00pauln00[P]yapio/yapio.c
// Function: yapio_stats_reporting
static void *
yapio_stats_reporting(void *unused_arg)
{
    int remaining_test_contexts_to_report = 0;

    yapio_timer_t start_time;
    yapio_get_time(&start_time);

    do
    {
        pthread_mutex_lock(&yapioThreadMutex);

        remaining_test_contexts_to_report =
            yapio_stats_report_iterate(start_time);

        if (remaining_test_contexts_to_report)
            pthread_cond_wait(&yapioThreadCond, &yapioThreadMutex);

        pthread_mutex_unlock(&yapioThreadMutex);
    } while (remaining_test_contexts_to_report && !yapioHaltStonewallThread);

    log_msg(YAPIO_LL_DEBUG,
            "remaining_test_contexts_to_report=%d yapioHaltStonewallThread=%d",
            remaining_test_contexts_to_report, yapioHaltStonewallThread);

    if (remaining_test_contexts_to_report)
        yapio_stats_report_iterate(start_time);

    return unused_arg;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x744f
leaq 0xe109e1(%rip), %r15    # 0xe17ac8
leaq 0xe11a2a(%rip), %r12    # 0xe18b18
movq %r15, %rdi
callq 0x2370
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x7471
movl %eax, %r14d
testl %eax, %eax
je 0x7117
movq %r12, %rdi
movq %r15, %rsi
callq 0x22d0
movq %r15, %rdi
callq 0x23b0
movb 0xe11a23(%rip), %al     # 0xe18b48
testl %r14d, %r14d
je 0x712e
testb $0x1, %al
je 0x70ee
cmpl $0x3, 0x60eb(%rip)      # 0xd220
jge 0x715a
testl %r14d, %r14d
je 0x714b
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x7471
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movzbl %al, %r10d
andl $0x1, %r10d
movq 0x5e77(%rip), %rax      # 0xcfe0
movq (%rax), %rdi
movl 0x60f5(%rip), %r8d      # 0xd268
leaq 0x2073(%rip), %rsi      # 0x91ed
leaq 0x107a(%rip), %rdx      # 0x81fb
leaq 0x20b5(%rip), %rcx      # 0x923d
movl $0xaca, %r9d            # imm = 0xACA
xorl %eax, %eax
pushq %r10
pushq %r14
callq 0x2390
addq $0x10, %rsp
jmp 0x7137