LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/loader.c
// Function: unload
int unload(measuresuite_t ms, size_t id) {

  struct function_tuple *fct = &ms->functions[id];

  free(fct->arithmetic_results);
  fct->arithmetic_results = NULL;

  free(fct->cycle_results);
  fct->cycle_results = NULL;

  int ret = 0;
  switch (fct->type) {
  case SHARED_OBJECT:
    ret = so_unload_file(ms, fct);
    break;
  case ASM:
#if USE_ASSEMBLYLINE
    if (fct->al == NULL || asm_destroy_instance(fct->al)) {
      ms->errorno = E_LOAD__AL_FREE;
      ret = 1;
    }
    fct->al = NULL;
    __attribute__((fallthrough));
#endif
  case BIN:
  case ELF:
    unmap(ms, fct->code, fct->code_size_bytes);
    fct->code_size_bytes = 0;
  }

  ms->num_functions--;
  reset_permutaions(ms);
  return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x70(%rdi), %r15
imulq $0x28, %rsi, %r12
leaq (%r15,%r12), %r14
movq 0x18(%r15,%r12), %rdi
callq 0x2040
andq $0x0, 0x18(%r15,%r12)
movq 0x20(%r15,%r12), %rdi
callq 0x2040
andq $0x0, 0x20(%r15,%r12)
xorl %ebp, %ebp
cmpl $0x3, (%r15,%r12)
jae 0x3683
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
movq %rbx, %rdi
callq 0x2fa8
andq $0x0, 0x10(%r14)
jmp 0x3692
jne 0x3692
movq %rbx, %rdi
movq %r14, %rsi
callq 0x426c
movl %eax, %ebp
decq 0x80(%rbx)
movq %rbx, %rdi
callq 0x36ac
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/loader.c
// Function: reset_permutaions
static int reset_permutaions(measuresuite_t ms) {

  // allocate permutation
  ms->permutation =
      realloc(ms->permutation, ms->num_functions * sizeof(size_t));

  if (ms->permutation == NULL) {
    ms->errorno = E_INTERNAL_RANDOMNESS__AI__MALLOC;
    ms->additional_info = strerror(errno);
    return 1;
  }

  for (size_t i = 0; i < ms->num_functions; i++) {
    ms->permutation[i] = i;
  }
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
movq 0x80(%rbx), %rsi
shlq $0x3, %rsi
callq 0x21d0
movq %rax, 0x60(%rbx)
testq %rax, %rax
je 0x36e4
movq 0x80(%rbx), %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x3701
movq %rdx, (%rax,%rdx,8)
incq %rdx
jmp 0x36d6
movl $0xc, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r14
movq 0x78(%rdi), %rax
movq 0x80(%rdi), %rcx
pushq $0x1
popq %rbx
cmpq %rcx, %rax
ja 0x38ae
leaq (%rax,%rax), %rcx
movq %rcx, 0x78(%r14)
leaq 0x70(%r14), %rsi
imulq $0x50, %rax, %rdx
movq %r14, %rdi
callq 0x2e84
testl %eax, %eax
jne 0x391d
movq 0x80(%r14), %rcx
movq 0x70(%r14), %rax
imulq $0x28, %rcx, %rcx
leaq (%rax,%rcx), %r12
movl %ebp, (%rax,%rcx)
movq %r14, %rdi
movq %r12, %rsi
callq 0x2fed
cmpl $0x3, %ebp
jae 0x3906
testq %r15, %r15
movl $0xea60, %edx           # imm = 0xEA60
cmovneq %r15, %rdx
movq %rdx, 0x10(%r12)
leaq 0x8(%r12), %rsi
movq %r14, %rdi
callq 0x2ece
testl %eax, %eax
jne 0x391d
andq $0x0, 0x20(%r12)
testl %ebp, %ebp
jne 0x390c
movl $0x21, 0x88(%r14)
jmp 0x391d
andq $0x0, 0x20(%r12)
incq 0x80(%r14)
movq %r14, %rdi
callq 0x36ac
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, %r12
cmpl $0x3, %esi
jne 0x395b
movl $0xa, 0x88(%r12)
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r9, %r13
movq %rcx, %r15
movq %rdx, %r14
movl %esi, %ebp
movl (%r9), %eax
pushq $0x1
popq %rbx
cmpl $-0x1, %eax
je 0x39c8
movq 0x70(%r12), %rcx
cltq
imulq $0x28, %rax, %rax
leaq (%rcx,%rax), %r13
movq 0x10(%rcx,%rax), %rdx
cmpq %r15, %rdx
jae 0x39ac
movq %r8, (%rsp)
movq 0x8(%r13), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2f52
testl %eax, %eax
jne 0x394a
movq %r15, 0x10(%r13)
movq %r15, %rdx
movq (%rsp), %r8
cmpl $0x2, %ebp
je 0x3a0e
cmpl $0x1, %ebp
je 0x39f8
testl %ebp, %ebp
jne 0x394a
movl $0x21, 0x88(%r12)
jmp 0x394a
movq %r8, (%rsp)
movq %r12, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x3868
testl %eax, %eax
jne 0x394a
movl 0x80(%r12), %eax
decl %eax
movl %eax, (%r13)
movq (%rsp), %r8
jmp 0x3971
movq 0x8(%r13), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x21b0
xorl %ebx, %ebx
jmp 0x394a
movq 0x8(%r13), %rsi
movq %r12, %rdi
movq %r14, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3c72
nop
// File: /workspace/github_c_makefile_star2_O2/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
xorl %ebx, %ebx
movq %rdi, %rcx
subq $0x1, %rcx
jb 0x3a4f
movq (%rsi,%rcx,8), %rdi
xorl %r8d, %r8d
cmpq (%rdx,%rcx,8), %rdi
setne %r8b
orl %r8d, %ebx
jmp 0x3a35
cmpl $0x1, %ebx
jne 0x3a62
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x48d8
movl %ebx, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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, %r13
movq %rdx, %rdi
callq 0x20a0
leaq 0x10(%rsp), %rbp
andq $0x0, (%rbp)
movq %rax, %r12
movzwl 0x8e(%rsp), %esi
shll $0x6, %esi
addq %r15, %rsi
movq %r13, %rdi
movq %rbp, %rdx
callq 0x3eca
movzwl 0x8c(%rsp), %ebx
movq (%rbp), %r13
pushq $0x1
popq %rbp
leaq (%rbx,%rbp), %rax
cmpq $0x1, %rax
je 0x3eb4
movl (%r15), %edi
addq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2080
decq %rbp
addq $0x40, %r15
testl %eax, %eax
jne 0x3e83
negq %rbp
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_O2/0xADE1A1DE[P]MeasureSuite/lib/src/io/elf_memory.c
// Function: find_symbol_in_table_mem
void find_symbol_in_table_mem(Elf64_Sym *dest, const uint8_t *src,
                              Elf64_Shdr sh_table[], Elf64_Half sh_table_len,
                              const char *symbol) {

  size_t symbol_len = symbol != NULL ? strlen(symbol) : 0;
  Elf64_Shdr *last = NULL;
  Elf64_Shdr *entry = NULL;

  for (last = sh_table + sh_table_len * sizeof(Elf64_Shdr), // find end
       entry = sh_table;                                    // set first end
       entry != last;                                       // check not last
       entry++                                              // next
  ) {

    if ((entry->sh_type != SHT_SYMTAB) && (entry->sh_type != SHT_DYNSYM)) {
      continue;
    }

    Elf64_Sym *sym_tbl = {0};

    read_section_mem(src, entry, (void *)&sym_tbl);

    /* Read linked string-table
     * Section containing the string table having names of
     * symbols of this section
     */
    Elf64_Word str_tbl_ndx = entry->sh_link;
    char *str_tbl = NULL;
    read_section_mem(src, &sh_table[str_tbl_ndx], (void *)&str_tbl);

    unsigned long symbol_count = entry->sh_size / sizeof(Elf64_Sym);

    for (unsigned long j = 0; j < symbol_count; j++) {

      const char *name = str_tbl + sym_tbl[j].st_name;
      // if we don't have a symbol(i.e. symbol len == 0),
      // or the current symbol is the required one
      if (symbol_len == 0 || strncmp(name, symbol, symbol_len) == 0) {
        memcpy(dest, &sym_tbl[j], sizeof(Elf64_Sym));
        break;
      }
    }
    free(str_tbl);
    free(sym_tbl);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %ebp
movq %rdx, 0x8(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdi, 0x28(%rsp)
testq %r8, %r8
movq %r8, 0x40(%rsp)
je 0x3f3d
movq %r8, %rdi
callq 0x20a0
movq %rax, %r13
jmp 0x3f40
xorl %r13d, %r13d
movzwl %bp, %eax
shll $0xc, %eax
movq 0x8(%rsp), %r14
addq %r14, %rax
movq %rax, 0x38(%rsp)
cmpq 0x38(%rsp), %r14
je 0x402f
movl 0x4(%r14), %eax
cmpl $0xb, %eax
je 0x3f70
cmpl $0x2, %eax
jne 0x4026
andq $0x0, 0x20(%rsp)
movq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x20(%rsp), %rdx
callq 0x3eca
movl 0x28(%r14), %esi
andq $0x0, 0x18(%rsp)
shlq $0x6, %rsi
addq 0x8(%rsp), %rsi
movq %rbx, %rdi
leaq 0x18(%rsp), %rdx
callq 0x3eca
movq 0x20(%r14), %rax
xorl %edx, %edx
pushq $0x18
popq %rcx
divq %rcx
movq %rax, %r15
movq 0x18(%rsp), %r12
movq 0x20(%rsp), %rbx
movq %rbx, 0x10(%rsp)
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0x4014
testq %r13, %r13
je 0x3ff4
movl (%rbx), %edi
addq %r12, %rdi
movq 0x40(%rsp), %rsi
movq %r13, %rdx
callq 0x2080
testl %eax, %eax
je 0x3ff6
incq %rbp
addq $0x18, %rbx
jmp 0x3fcb
xorl %ebp, %ebp
imulq $0x18, %rbp, %rax
movq 0x10(%rsp), %rsi
movq 0x10(%rsi,%rax), %rcx
movq 0x28(%rsp), %rdx
movq %rcx, 0x10(%rdx)
movups (%rsi,%rax), %xmm0
movups %xmm0, (%rdx)
movq %r12, %rdi
callq 0x2040
movq 0x10(%rsp), %rdi
callq 0x2040
addq $0x40, %r14
jmp 0x3f53
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rbx
testq %rsi, %rsi
je 0x408b
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 0x1f41(%rip), %rsi      # 0x5fb3
pushq $0x4
popq %rdx
movq %r14, %rdi
callq 0x2080
testl %eax, %eax
jne 0x408b
xorl %ebx, %ebx
cmpb $0x2, 0x4(%r14)
setne %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0x40de
movl $0xb, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
pushq $0x1
popq %rax
jmp 0x40e8
movq 0x38(%rsp), %rax
movq %rax, (%r14)
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, (%r13)
movq %rcx, %rsi
movq %r13, %rdx
callq 0x4098
testl %eax, %eax
setne %al
movq (%r13), %r13
cmpq %r14, %r13
seta %cl
orb %al, %cl
pushq $0x1
popq %rax
jne 0x418b
movq %r12, %rdi
movl $0x101000, %esi         # imm = 0x101000
xorl %eax, %eax
callq 0x21f0
cmpl $-0x1, %eax
je 0x416b
movl %eax, %ebp
movl %eax, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2150
cmpq %r13, %rax
jne 0x416b
movl %ebp, %edi
callq 0x2140
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
jne 0x418b
movl $0xb, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x5
popq %rsi
movq %rdx, %rdi
callq 0x2200
testl %eax, %eax
je 0x41db
movl $0x1a, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
pushq $0x1
popq %rax
jmp 0x41f9
callq 0x2030
pushq $0x2
popq %rsi
movq %r15, %rdi
callq 0x2180
movq %rax, %rcx
movq %rax, 0x10(%r14)
xorl %eax, %eax
testq %rcx, %rcx
je 0x41ff
popq %rbx
popq %r14
popq %r15
retq
movl $0x15, 0x88(%rbx)
callq 0x2030
jmp 0x41cf
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
pushq $0x1
popq %rbp
cmpq $0x0, 0x10(%rsi)
je 0x425f
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 0x4261
movl $0x14, 0x88(%rbx)
callq 0x2030
movq %rax, 0x90(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x42a3
movl $0x13, 0x88(%rbx)
callq 0x2030
movq %rax, 0x90(%rbx)
pushq $0x1
popq %rax
jmp 0x42a5
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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
cmpq %r14, %rax
jne 0x42f9
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
jmp 0x42fc
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0x48(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
movq %rdx, %rdi
callq 0x20a0
leaq 0x50(%rsp), %r13
andq $0x0, (%r13)
movq %rax, %r12
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
movq %r13, %rsi
callq 0x43c6
movzwl 0xcc(%rsp), %ebx
movq (%r13), %r13
pushq $0x1
popq %rbp
leaq (%rbx,%rbp), %rax
cmpq $0x1, %rax
je 0x43b0
movl (%r15), %edi
addq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2080
decq %rbp
addq $0x40, %r15
testl %eax, %eax
jne 0x437f
negq %rbp
movq 0x48(%rsp), %rax
movq %rbp, (%rax)
movq %r13, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rbx
testq %rsi, %rsi
je 0x4608
movq %rsi, %r14
movl %edi, %ebp
xorl %esi, %esi
xorl %edx, %edx
callq 0x2100
testq %rax, %rax
jne 0x4608
pushq $0x40
popq %rdx
movl %ebp, %edi
movq %r14, %rsi
callq 0x2150
cmpq $0x40, %rax
jne 0x4608
leaq 0x19c4(%rip), %rsi      # 0x5fb3
pushq $0x4
popq %rdx
movq %r14, %rdi
callq 0x2080
testl %eax, %eax
jne 0x4608
xorl %ebx, %ebx
cmpb $0x2, 0x4(%r14)
setne %bl
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x80(%rdi), %r14
xorl %eax, %eax
cmpq $0x2, %r14
jb 0x48c9
movq %rdi, %rbx
decq %r14
movq %rsp, %r15
movq %r14, %r12
addq $-0x1, %r12
jae 0x48c1
andq $0x0, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2c9a
testl %eax, %eax
jne 0x48c1
movq 0x60(%rbx), %rax
movq (%rax,%r14,8), %rcx
movq (%rsp), %rdx
movq (%rax,%rdx,8), %rdx
movq %rdx, (%rax,%r14,8)
movq (%rsp), %rdx
movq %rcx, (%rax,%rdx,8)
movq %r12, %r14
jmp 0x4883
xorl %eax, %eax
testq %r14, %r14
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, (%rsp)
movq %rdi, %r15
xorl %r14d, %r14d
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x4959
movq (%r15,%r14,2), %r13
movq (%rsp), %rax
movq (%rax,%r14,2), %rbp
xorl %esi, %esi
cmpq %r13, %rbp
sete %sil
addl $0x1f, %esi
leaq 0x1755(%rip), %rdi      # 0x606c
movq %r12, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x20d0
movq %r13, %rdi
movq %r13, %rsi
callq 0x4968
leaq 0x1750(%rip), %rdi      # 0x6086
xorl %eax, %eax
callq 0x20d0
movq %rbp, %rdi
movq %r13, %rsi
callq 0x4968
pushq $0xa
popq %rdi
callq 0x2050
incq %r12
addq $0x8, %r14
jmp 0x48f3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x3c
popq %rbp
leaq 0x1711(%rip), %r15      # 0x6090
testl %ebp, %ebp
js 0x49b1
movq %r14, %rdx
movl %ebp, %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 %r15, %rdi
xorl %eax, %eax
callq 0x20d0
addl $-0x4, %ebp
jmp 0x497f
leaq 0x16e1(%rip), %rdi      # 0x6099
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x20d0
// File: /workspace/github_c_makefile_star2_O2/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
leaq 0xe8b(%rip), %rbx       # 0x2004
callq 0x1050
testq %rax, %rax
je 0x1198
movl 0x10(%rax), %esi
movl 0x14(%rax), %edx
movq (%rax), %rcx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1030
jmp 0x1179
callq 0x1060
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
pushq $0x1
popq %rdi
pushq $0x2
popq %rsi
callq 0x1040
testl %eax, %eax
js 0x1197
leaq 0xe96(%rip), %rsi       # 0x2009
pushq $0x1
popq %rdi
pushq $0x7
popq %rbx
movq %rbx, %rdx
callq 0x1030
leaq 0xe89(%rip), %rsi       # 0x2011
pushq $0x2
popq %rdi
movq %rbx, %rdx
callq 0x1030
xorl %eax, %eax
popq %rbx
retq
leaq 0xe66(%rip), %rdi       # 0x2004
callq 0x1050
pushq $-0x1
popq %rax
jmp 0x1195
// File: /workspace/github_c_makefile_star2_O2/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, %rbx
movl %edi, %ebp
leaq 0xf33(%rip), %rdi       # 0x20b6
callq 0x1040
leaq 0xe75(%rip), %r14       # 0x2004
leaq 0x2eba(%rip), %r15      # 0x4050
movq 0x2e5b(%rip), %r13      # 0x3ff8
leaq 0xe8d(%rip), %r12       # 0x2031
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x1060
testl %eax, %eax
je 0x1200
cmpl $0x3a, %eax
je 0x1224
cmpl $0x3f, %eax
je 0x1216
cmpl $0x62, %eax
je 0x11e4
cmpl $0x66, %eax
je 0x1235
cmpl $0x68, %eax
je 0x11f2
cmpl $0x3ea, %eax            # imm = 0x3EA
jne 0x124c
movq (%r13), %rsi
movq %r12, %rdi
jmp 0x1240
leaq 0xf31(%rip), %rdi       # 0x211c
callq 0x1040
jmp 0x11a4
leaq 0xf39(%rip), %rdi       # 0x2132
callq 0x1040
jmp 0x11a4
movl 0x2f2e(%rip), %esi      # 0x4134
leaq 0xe42(%rip), %rdi       # 0x204f
xorl %eax, %eax
callq 0x1050
jmp 0x11a4
leaq 0xedc(%rip), %rdi       # 0x20f9
callq 0x1040
jmp 0x11a4
leaq 0xebf(%rip), %rdi       # 0x20ea
callq 0x1040
jmp 0x11a4
movq (%r13), %rsi
leaq 0xdc9(%rip), %rdi       # 0x2009
xorl %eax, %eax
callq 0x1050
jmp 0x11a4
cmpl $-0x1, %eax
jne 0x129a
leaq 0xe79(%rip), %rdi       # 0x20d1
callq 0x1040
movq 0x2d7c(%rip), %rax      # 0x3fe0
movslq (%rax), %r15
movslq %ebp, %r12
leaq 0xe03(%rip), %r14       # 0x2074
cmpq %r12, %r15
jge 0x1289
movq (%rbx,%r15,8), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1050
incq %r15
jmp 0x1271
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_O2/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
pushq $0x4
popq %r15
leaq 0xe8d(%rip), %rbx       # 0x204f
cmpq $0xe, %r15
je 0x11dd
cvtss2sd (%r14,%r15,4), %xmm0
movq %rbx, %rdi
movb $0x1, %al
callq 0x1050
incq %r15
jmp 0x11c2
pushq $0xa
popq %rdi
callq 0x1030
leaq 0xe70(%rip), %rdi       # 0x205c
popq %rbx
popq %r14
popq %r15
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/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 0xe3f(%rip), %rax       # 0x2056
movq %rax, 0x40(%rsp)
movabsq $0x4281800000000013, %rax # imm = 0x4281800000000013
movq %rax, 0x48(%rsp)
pushq $0x4
popq %rax
cmpq $0xe, %rax
je 0x1241
movl $0x42c40000, 0x40(%rsp,%rax,4) # imm = 0x42C40000
incq %rax
jmp 0x122e
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_O2/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
subq $0x10, %rsp
movq 0x6a9b(%rip), %rdi      # 0xc260
testq %rdi, %rdi
je 0x57d8
callq 0x2160
cmpl $0x3, 0x6a42(%rip)      # 0xc218
jge 0x57fb
movq 0xe0f2c1(%rip), %rbx    # 0xe14aa0
testq %rbx, %rbx
je 0x57f5
movq %rbx, %rdi
callq 0x2160
cmpl $0x3, 0x6a25(%rip)      # 0xc218
jge 0x583b
addq $0x10, %rsp
popq %rbx
retq
movq 0x67de(%rip), %rax      # 0xbfe0
movq (%rax), %rdi
movl 0x6a5c(%rip), %r8d      # 0xc268
movq 0x6a4d(%rip), %rax      # 0xc260
movq %rax, (%rsp)
leaq 0x3449(%rip), %rsi      # 0x8c67
leaq 0x298a(%rip), %rdx      # 0x81af
leaq 0x43c7(%rip), %rcx      # 0x9bf3
movl $0x55d, %r9d            # imm = 0x55D
xorl %eax, %eax
callq 0x2380
jmp 0x57d8
movq 0x679e(%rip), %rax      # 0xbfe0
movq (%rax), %rdi
movl 0x6a1c(%rip), %r8d      # 0xc268
movq %rbx, (%rsp)
leaq 0x3410(%rip), %rsi      # 0x8c67
leaq 0x2951(%rip), %rdx      # 0x81af
leaq 0x438e(%rip), %rcx      # 0x9bf3
movl $0x560, %r9d            # imm = 0x560
xorl %eax, %eax
callq 0x2380
jmp 0x57f5
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movl %edi, %ebx
cmpb $0x1, 0x2069f6(%rip)    # 0x20c274
jne 0x58ab
movq 0x6749(%rip), %rdi      # 0xbfd0
callq 0x578c
cmpl $0x0, 0xe122c9(%rip)    # 0xe17b5c
jne 0x589c
callq 0x22a0
jmp 0x58ab
movq 0x672d(%rip), %rdi      # 0xbfd0
pushq $-0x5
popq %rsi
callq 0x21d0
movl %ebx, %edi
callq 0x20d0
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
cmpl $0x2, 0x679f(%rip)      # 0xc218
jg 0x5b77
movslq %edi, %rbx
movq 0x67c7(%rip), %rax      # 0xc250
movq 0xb028(%rax), %rsi
imulq 0xb020(%rax), %rsi
shlq $0x4, %rbx
leaq 0x67cd(%rip), %rax      # 0xc270
leaq (%rax,%rbx), %r14
movq 0x8(%rbx,%rax), %rdi
callq 0x22e0
testl %eax, %eax
je 0x5abe
cmpl $0x0, 0x675c(%rip)      # 0xc218
jg 0x5ae0
movl (%r14), %edi
callq 0x2080
movl %eax, %ebx
testl %eax, %eax
je 0x5ad5
cmpl $0x0, 0x6745(%rip)      # 0xc218
jg 0x5b2a
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x64f9(%rip), %rax      # 0xbfe0
movq (%rax), %rbx
movl 0x6778(%rip), %ebp      # 0xc268
callq 0x2240
movl (%rax), %edi
callq 0x21f0
movq %rax, (%rsp)
leaq 0x26dc(%rip), %rsi      # 0x81e3
leaq 0x2690(%rip), %rdx      # 0x819e
leaq 0x26bd(%rip), %rcx      # 0x81d2
movq %rbx, %rdi
movl %ebp, %r8d
movl $0x1bf, %r9d            # imm = 0x1BF
xorl %eax, %eax
callq 0x2380
jmp 0x5abe
movq 0x64af(%rip), %rax      # 0xbfe0
movq (%rax), %r14
movl 0x672e(%rip), %ebp      # 0xc268
callq 0x2240
movl (%rax), %edi
callq 0x21f0
movq %rax, (%rsp)
leaq 0x26ae(%rip), %rsi      # 0x81ff
leaq 0x2646(%rip), %rdx      # 0x819e
leaq 0x2673(%rip), %rcx      # 0x81d2
movq %r14, %rdi
movl %ebp, %r8d
movl $0x1c3, %r9d            # imm = 0x1C3
xorl %eax, %eax
callq 0x2380
jmp 0x5ad5
movq 0x6462(%rip), %rax      # 0xbfe0
movq (%rax), %rax
movl 0x66e0(%rip), %r8d      # 0xc268
movslq %edi, %rbx
movq %rbx, %rcx
shlq $0x4, %rcx
leaq 0x66d7(%rip), %rdx      # 0xc270
movq 0x8(%rcx,%rdx), %rcx
movq %rcx, 0x8(%rsp)
movl %edi, (%rsp)
leaq 0x2608(%rip), %rsi      # 0x81b5
leaq 0x25fb(%rip), %rdx      # 0x81af
leaq 0x2617(%rip), %rcx      # 0x81d2
movq %rax, %rdi
movl $0x1b8, %r9d            # imm = 0x1B8
xorl %eax, %eax
callq 0x2380
jmp 0x5a82
// File: /workspace/github_c_makefile_star2_O2/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
movl %edi, %ebx
movq 0x666f(%rip), %rax      # 0xc250
movq 0xb028(%rax), %rsi
imulq 0xb020(%rax), %rsi
cmpb $0x0, 0xb030(%rax)
je 0x5bfe
pushq $0x1
popq %rax
jmp 0x5c05
movslq 0xb01c(%rax), %rax
imulq %rax, %rsi
movslq %ebx, %r15
shlq $0x4, %r15
leaq 0x6659(%rip), %r12      # 0xc270
movq 0x8(%r15,%r12), %rdi
pushq $0x4
popq %rdx
callq 0x21b0
testl %eax, %eax
je 0x5c87
callq 0x2240
xorl %r14d, %r14d
subl (%rax), %r14d
cmpl $0x2, 0x65de(%rip)      # 0xc218
jl 0x5c8a
leaq (%r15,%r12), %r10
addq $0x8, %r10
movq 0x6395(%rip), %rax      # 0xbfe0
movq (%rax), %rdi
movl 0x6613(%rip), %r8d      # 0xc268
subq $0x8, %rsp
leaq 0x25ba(%rip), %rsi      # 0x821a
leaq 0x253d(%rip), %rdx      # 0x81a4
leaq 0x25cf(%rip), %rcx      # 0x823d
movl $0x1d7, %r9d            # imm = 0x1D7
xorl %eax, %eax
pushq %r14
pushq (%r10)
pushq %rbx
callq 0x2380
addq $0x20, %rsp
jmp 0x5c8a
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x658e(%rip), %rcx      # 0xc270
movq 0x8(%rax,%rcx), %r12
cmpl $0x3, 0x652a(%rip)      # 0xc218
jge 0x5d10
addq %r15, %r12
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x23b0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x62c9(%rip), %rax      # 0xbfe0
movq (%rax), %rdi
movl 0x6547(%rip), %r8d      # 0xc268
leaq (%r12,%r15), %r10
subq $0x8, %rsp
leaq 0x251e(%rip), %rsi      # 0x824e
leaq 0x2478(%rip), %rdx      # 0x81af
leaq 0x2532(%rip), %rcx      # 0x8270
movl $0x1ef, %r9d            # imm = 0x1EF
xorl %eax, %eax
pushq %rbx
pushq %r15
pushq %r10
callq 0x2380
addq $0x20, %rsp
jmp 0x5cf0
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rsi, %r14
leaq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x5eb8
movl %eax, %ebx
movslq %eax, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2320
callq 0x5e9a
testb %al, %al
je 0x5dd0
cmpl $0x3, 0x644a(%rip)      # 0xc218
jge 0x5ddc
movl %ebx, %eax
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x61fd(%rip), %rax      # 0xbfe0
movq (%rax), %rdi
movl 0x647b(%rip), %r8d      # 0xc268
movq %r14, (%rsp)
leaq 0x2cae(%rip), %rsi      # 0x8aa6
leaq 0x23b0(%rip), %rdx      # 0x81af
leaq 0x2cb2(%rip), %rcx      # 0x8ab8
movl $0x298, %r9d            # imm = 0x298
xorl %eax, %eax
callq 0x2380
jmp 0x5dd0
// File: /workspace/github_c_makefile_star2_O2/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 0x5eb8
movl %eax, %ebp
testq %rbx, %rbx
je 0x5e42
movq %rsp, %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x2330
movq %rax, (%rbx)
callq 0x5e9a
testb %al, %al
je 0x5e54
cmpl $0x3, 0x63c6(%rip)      # 0xc218
jge 0x5e5f
movl %ebp, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x617a(%rip), %rax      # 0xbfe0
movq (%rax), %rdi
movl 0x63f8(%rip), %r8d      # 0xc268
leaq 0x2c82(%rip), %rsi      # 0x8af9
leaq 0x2331(%rip), %rdx      # 0x81af
leaq 0x2c8a(%rip), %rcx      # 0x8b0f
movl $0x28a, %r9d            # imm = 0x28A
xorl %eax, %eax
pushq (%rbx)
pushq %r14
callq 0x2380
popq %rcx
popq %rdx
jmp 0x5e54
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbx
xorl %eax, %eax
cmpq $0x40, %rax
je 0x5ed1
movb (%rdi,%rax), %cl
cmpb $0x3a, %cl
je 0x5edf
movb %cl, (%rsi,%rax)
incq %rax
jmp 0x5ebb
cmpb $0x3a, 0x40(%rdi)
jne 0x5f36
pushq $0x40
popq %rbx
pushq $0x40
popq %rax
jmp 0x5ee7
cmpb $0x3a, (%rdi,%rax)
jne 0x5eef
movl %eax, %ebx
movb $0x0, (%rsi,%rax)
incl %ebx
jmp 0x5f39
cmpq $0x41, %rax
jne 0x5f36
pushq $-0x7
popq %rbx
cmpl $0x0, 0x6319(%rip)      # 0xc218
jle 0x5f39
movq 0x60d8(%rip), %rax      # 0xbfe0
movq (%rax), %rdi
movl 0x6356(%rip), %r8d      # 0xc268
leaq 0x29d0(%rip), %rsi      # 0x88e9
leaq 0x227e(%rip), %rdx      # 0x819e
leaq 0x2bb3(%rip), %rcx      # 0x8ada
movl $0x275, %r9d            # imm = 0x275
xorl %eax, %eax
callq 0x2380
jmp 0x5f39
pushq $-0x16
popq %rbx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq 0x5d7d(%rip), %rcx      # 0xc230
testl %esi, %esi
js 0x64d6
movl %esi, %r9d
leaq 0x2c6f(%rip), %rdx      # 0x9130
leaq 0xe0f5f8(%rip), %r8     # 0xe15ac0
movl $0x1000, %esi           # imm = 0x1000
xorl %eax, %eax
callq 0x2070
jmp 0x64f0
leaq 0x2ae7(%rip), %rdx      # 0x8fc4
leaq 0xe0f5dc(%rip), %r8     # 0xe15ac0
movl $0x1000, %esi           # imm = 0x1000
xorl %eax, %eax
callq 0x2070
xorl %ebx, %ebx
cmpl $0x1001, %eax           # imm = 0x1001
jl 0x6505
pushq $-0x24
popq %rbx
cmpl $0x0, 0x5d15(%rip)      # 0xc218
jg 0x6510
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x5ac9(%rip), %rax      # 0xbfe0
movq (%rax), %r14
movl 0x5d48(%rip), %ebp      # 0xc268
pushq $0x24
popq %rdi
callq 0x21f0
movq %rax, (%rsp)
leaq 0x2573(%rip), %rsi      # 0x8aa6
leaq 0x1c64(%rip), %rdx      # 0x819e
leaq 0x2bf7(%rip), %rcx      # 0x9138
movq %r14, %rdi
movl %ebp, %r8d
movl $0x48f, %r9d            # imm = 0x48F
xorl %eax, %eax
callq 0x2380
jmp 0x6505