LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/com.c
// Function: reg_info_print
int reg_info_print(struct reg_info_t *reg_info)
{
  printf("  -- COM Reg Info --\n");
  printf("       bNextObject: %d\n", reg_info->bNextObject);
  printf("       bObjectName: %d (%s)\n", reg_info->bObjectName,reg_info->szObjectName);
  printf("bObjectDescription: %d\n", reg_info->bObjectDescription);
  printf("      dwInstancing: %d\n", reg_info->dwInstancing);
  printf("        dwObjectId: %d\n", reg_info->dwObjectId);
  printf("        uuidObject: ");
  clsid_print(reg_info->uuidObject);
  printf("\n");
  printf("      fIsInterface: %d\n", reg_info->fIsInterface);
  printf("   bUidObjectIFace: %d\n", reg_info->bUidObjectIFace);
  printf("   bUidEventsIFace: %d\n", reg_info->bUidEventsIFace);
  printf("        fHasEvents: %d\n", reg_info->fHasEvents);
  printf("      dwMiscStatus: %d\n", reg_info->dwMiscStatus);
  printf("        fClassType: %d\n", reg_info->fClassType);
  printf("       fObjectType: %d\n", reg_info->fObjectType);
  printf("  wToolboxBitmap32: %d\n", reg_info->wToolboxBitmap32);
  printf("      wDefaultIcon: %d\n", reg_info->wDefaultIcon);
  printf("       fIsDesigner: %d\n", reg_info->fIsDesigner);
  printf("     bDesignerData: %d\n", reg_info->bDesignerData);
  printf("\n");

  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x4f79(%rip), %rdi      # 0x8c54
callq 0x3060
movl (%rbx), %esi
leaq 0x4cfc(%rip), %rdi      # 0x89e5
xorl %eax, %eax
callq 0x3090
movl 0x4(%rbx), %esi
leaq 0x48(%rbx), %rdx
leaq 0x4cff(%rip), %rdi      # 0x89fd
xorl %eax, %eax
callq 0x3090
movl 0x8(%rbx), %esi
leaq 0x4d0b(%rip), %rdi      # 0x8a1a
xorl %eax, %eax
callq 0x3090
movl 0xc(%rbx), %esi
leaq 0x4d12(%rip), %rdi      # 0x8a32
xorl %eax, %eax
callq 0x3090
movl 0x10(%rbx), %esi
leaq 0x4d19(%rip), %rdi      # 0x8a4a
xorl %eax, %eax
callq 0x3090
leaq 0x4d23(%rip), %rdi      # 0x8a62
xorl %eax, %eax
callq 0x3090
leaq 0x14(%rbx), %rdi
callq 0x3b6c
movl $0xa, %edi
callq 0x3030
movl 0x24(%rbx), %esi
leaq 0x4d14(%rip), %rdi      # 0x8a77
xorl %eax, %eax
callq 0x3090
movl 0x28(%rbx), %esi
leaq 0x4d1b(%rip), %rdi      # 0x8a8f
xorl %eax, %eax
callq 0x3090
movl 0x2c(%rbx), %esi
leaq 0x4d22(%rip), %rdi      # 0x8aa7
xorl %eax, %eax
callq 0x3090
movl 0x30(%rbx), %esi
leaq 0x4d29(%rip), %rdi      # 0x8abf
xorl %eax, %eax
callq 0x3090
movl 0x34(%rbx), %esi
leaq 0x4d30(%rip), %rdi      # 0x8ad7
xorl %eax, %eax
callq 0x3090
movl 0x38(%rbx), %esi
leaq 0x4d37(%rip), %rdi      # 0x8aef
xorl %eax, %eax
callq 0x3090
movzwl 0x3c(%rbx), %esi
leaq 0x4d3d(%rip), %rdi      # 0x8b07
xorl %eax, %eax
callq 0x3090
movzwl 0x3e(%rbx), %esi
leaq 0x4d43(%rip), %rdi      # 0x8b1f
xorl %eax, %eax
callq 0x3090
movzwl 0x40(%rbx), %esi
leaq 0x4d49(%rip), %rdi      # 0x8b37
xorl %eax, %eax
callq 0x3090
movzwl 0x42(%rbx), %esi
leaq 0x4d4f(%rip), %rdi      # 0x8b4f
xorl %eax, %eax
callq 0x3090
movl 0x44(%rbx), %esi
leaq 0x4d56(%rip), %rdi      # 0x8b67
xorl %eax, %eax
callq 0x3090
movl $0xa, %edi
callq 0x3030
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/com.c
// Function: com_reg_data_read
int com_reg_data_read(struct com_reg_data_t *com_reg_data, FILE *in, int offset)
{
  int marker;

  marker = ftell(in);
  fseek(in, offset, SEEK_SET);

  com_reg_data->bRegInfo = read_uint32(in);
  com_reg_data->bSZProjectName = read_uint32(in);
  com_reg_data->bSZHelpDirectory = read_uint32(in);
  com_reg_data->bSZProjectDescription = read_uint32(in);
  clsid_read((char *)com_reg_data->uuidProjectClsId, in);
  com_reg_data->dwTlbLcid = read_uint32(in);
  com_reg_data->wUnknown = read_uint16(in);
  com_reg_data->wTlbVerMajor = read_uint16(in);
  com_reg_data->wTlbVerMinor = read_uint16(in);

  fseek(in, marker, SEEK_SET);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x30f0
movq %rax, %r15
movslq %ebp, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3100
movq %rbx, %rdi
callq 0x51ae
movl %eax, (%r14)
movq %rbx, %rdi
callq 0x51ae
movl %eax, 0x4(%r14)
movq %rbx, %rdi
callq 0x51ae
movl %eax, 0x8(%r14)
movq %rbx, %rdi
callq 0x51ae
movl %eax, 0xc(%r14)
leaq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x3b2c
movq %rbx, %rdi
callq 0x51ae
movl %eax, 0x20(%r14)
movq %rbx, %rdi
callq 0x51f0
movw %ax, 0x24(%r14)
movq %rbx, %rdi
callq 0x51f0
movw %ax, 0x26(%r14)
movq %rbx, %rdi
callq 0x51f0
movw %ax, 0x28(%r14)
movslq %r15d, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3100
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/com.c
// Function: com_reg_data_print
int com_reg_data_print(struct com_reg_data_t *com_reg_data)
{
  printf("  -- COM Reg Data --\n");
  printf("          bRegInfo: %d\n", com_reg_data->bRegInfo);
  printf("    bSZProjectName: %d\n", com_reg_data->bSZProjectName);
  printf("  bSZHelpDirectory: %d\n", com_reg_data->bSZHelpDirectory);
  printf("bSZProjectDescrptn: %d\n", com_reg_data->bSZProjectDescription);
  printf("  uuidProjectClsId: ");
  clsid_print(com_reg_data->uuidProjectClsId);
  printf("\n");
  printf("         dwTlbLcid: %d\n", com_reg_data->dwTlbLcid);
  printf("          wUnknown: %d\n", com_reg_data->wUnknown);
  printf("      wTlbVerMajor: %d\n", com_reg_data->wTlbVerMajor);
  printf("      wTlbVerMinor: %d\n", com_reg_data->wTlbVerMinor);
  printf("\n");

  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x4d89(%rip), %rdi      # 0x8c69
callq 0x3060
movl (%rbx), %esi
leaq 0x4c91(%rip), %rdi      # 0x8b7f
xorl %eax, %eax
callq 0x3090
movl 0x4(%rbx), %esi
leaq 0x4c98(%rip), %rdi      # 0x8b97
xorl %eax, %eax
callq 0x3090
movl 0x8(%rbx), %esi
leaq 0x4c9f(%rip), %rdi      # 0x8baf
xorl %eax, %eax
callq 0x3090
movl 0xc(%rbx), %esi
leaq 0x4ca6(%rip), %rdi      # 0x8bc7
xorl %eax, %eax
callq 0x3090
leaq 0x4cb0(%rip), %rdi      # 0x8bdf
xorl %eax, %eax
callq 0x3090
leaq 0x10(%rbx), %rdi
callq 0x3b6c
movl $0xa, %edi
callq 0x3030
movl 0x20(%rbx), %esi
leaq 0x4ca1(%rip), %rdi      # 0x8bf4
xorl %eax, %eax
callq 0x3090
movzwl 0x24(%rbx), %esi
leaq 0x4ca7(%rip), %rdi      # 0x8c0c
xorl %eax, %eax
callq 0x3090
movzwl 0x26(%rbx), %esi
leaq 0x4cad(%rip), %rdi      # 0x8c24
xorl %eax, %eax
callq 0x3090
movzwl 0x28(%rbx), %esi
leaq 0x4cb3(%rip), %rdi      # 0x8c3c
xorl %eax, %eax
callq 0x3090
movl $0xa, %edi
callq 0x3030
xorl %eax, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/dos.c
// Function: read_dos_header
int read_dos_header(FILE *in, struct dos_header_t *dos_header)
{
  dos_header->e_magic = read_uint16(in);
  dos_header->e_cblp = read_uint16(in);
  dos_header->e_cp = read_uint16(in);
  dos_header->e_crlc = read_uint16(in);
  dos_header->e_cparhdr = read_uint16(in);
  dos_header->e_minalloc = read_uint16(in);
  dos_header->e_maxalloc = read_uint16(in);
  dos_header->e_ss = read_uint16(in);
  dos_header->e_sp = read_uint16(in);
  dos_header->e_csum = read_uint16(in);
  dos_header->e_ip = read_uint16(in);
  dos_header->e_cs = read_uint16(in);
  dos_header->e_lfarlc = read_uint16(in);
  dos_header->e_ovno = read_uint16(in);
  read_chars_bin(in, dos_header->e_res, 8);
  dos_header->e_oemid = read_uint16(in);
  dos_header->e_oeminfo = read_uint16(in);
  read_chars_bin(in, dos_header->e_res2, 20);
  dos_header->e_lfanew = read_uint32(in);

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x51f0
movw %ax, (%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0x2(%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0x4(%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0x6(%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0x8(%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0xa(%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0xc(%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0xe(%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0x10(%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0x12(%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0x14(%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0x16(%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0x18(%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0x1a(%rbx)
leaq 0x1c(%rbx), %rsi
movq %r14, %rdi
movl $0x8, %edx
callq 0x525a
movq %r14, %rdi
callq 0x51f0
movw %ax, 0x24(%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0x26(%rbx)
leaq 0x28(%rbx), %rsi
movq %r14, %rdi
movl $0x14, %edx
callq 0x525a
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x3c(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/file_header.c
// Function: file_header_read
int file_header_read(struct file_header_t *file_header, FILE *in)
{
  file_header->Machine = read_uint16(in);
  file_header->NumberOfSections = read_uint16(in);
  file_header->TimeDateStamp = read_uint32(in);
  file_header->PointerToSymbolTable = read_uint32(in);
  file_header->NumberOfSymbols = read_uint32(in);
  file_header->SizeOfOptionalHeader = read_uint16(in);
  file_header->Characteristics = read_uint16(in);

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x51f0
movw %ax, (%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0x2(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x4(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x8(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0xc(%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0x10(%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0x12(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/imports.c
// Function: import_dir_read
static int import_dir_read(struct import_dir_t *import_dir, FILE *in)
{
  import_dir->FunctionNameList = read_uint32(in);
  import_dir->TimeDateStamp = read_uint32(in);
  import_dir->ForwardChain = read_uint32(in);
  import_dir->ModuleName = read_uint32(in);
  import_dir->FunctionAddressList = read_uint32(in);

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x51ae
movl %eax, (%r14)
movq %rbx, %rdi
callq 0x51ae
movl %eax, 0x4(%r14)
movq %rbx, %rdi
callq 0x51ae
movl %eax, 0x8(%r14)
movq %rbx, %rdi
callq 0x51ae
movl %eax, 0xc(%r14)
movq %rbx, %rdi
callq 0x51ae
movl %eax, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/imports.c
// Function: imports_find
int imports_find(
  FILE *in,
  int address,
  int size,
  int address_size,
  struct section_header_t *section_header,
  const char *search_name)
{
  struct import_dir_t import_dir;
  char name[1024];
  long marker;
  int total_size;
  uint32_t virtual_address, raw_ptr;
  int func_addr;
  int t, ptr;

  virtual_address = section_header->VirtualAddress;
  raw_ptr = section_header->PointerToRawData;

  address = (address - virtual_address) + raw_ptr;

  marker = ftell(in);
  fseek(in, address, SEEK_SET);

  total_size = 0;

  while (total_size < size)
  {
    import_dir_read(&import_dir, in);

    if (import_dir.FunctionNameList == 0) { break; }

    t = 0;

    while (1)
    {
      func_addr = get_ptr(in, (import_dir.FunctionAddressList - virtual_address) + raw_ptr + t);

      if (func_addr == 0) { break; }

      ptr = get_ptr(in, (import_dir.FunctionNameList - virtual_address) + raw_ptr + t);
      get_string(in, name, (ptr - virtual_address) + raw_ptr + 2);

      if (strcmp(name, search_name) == 0)
      {
        fseek(in, marker, SEEK_SET);
        return 1;
      }

      t = t + address_size;
    }

    total_size = total_size + sizeof(import_dir);
  }

  fseek(in, marker, SEEK_SET);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
movq %r9, 0x20(%rsp)
movl %ecx, %ebp
movl %edx, %r13d
movl %esi, %r15d
movq %rdi, %rbx
movl 0x10(%r8), %eax
movl 0x18(%r8), %r12d
movl %eax, 0x4(%rsp)
subl %eax, %r15d
addl %r12d, %r15d
callq 0x30f0
movq %rax, %r14
movslq %r15d, %rsi
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3100
movl %r13d, 0x14(%rsp)
testl %r13d, %r13d
jle 0x57b8
movq %r14, 0x8(%rsp)
movl %r12d, %eax
movl 0x4(%rsp), %ecx
subl %ecx, %eax
movq %rax, 0x18(%rsp)
leal 0x2(%rax), %r14d
addl %ebp, %r12d
subl %ecx, %r12d
leaq 0x2c(%rsp), %rdi
leaq 0x40(%rsp), %r15
xorl %eax, %eax
movl %r12d, 0x10(%rsp)
movl %eax, 0x4(%rsp)
movq %rbx, %rsi
callq 0x563f
movl 0x2c(%rsp), %r12d
testl %r12d, %r12d
je 0x57a3
movl 0x3c(%rsp), %r13d
movq 0x18(%rsp), %rax
leal (%rax,%r13), %esi
movq %rbx, %rdi
callq 0x53c4
testl %eax, %eax
je 0x578d
addl 0x18(%rsp), %r12d
addl 0x10(%rsp), %r13d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x53c4
leal (%rax,%r14), %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5351
movq %r15, %rdi
movq 0x20(%rsp), %rsi
callq 0x30c0
testl %eax, %eax
je 0x57ad
movq %rbx, %rdi
movl %r13d, %esi
callq 0x53c4
addl %ebp, %r12d
addl %ebp, %r13d
testl %eax, %eax
jne 0x574d
movl 0x4(%rsp), %eax
addl $0x14, %eax
cmpl 0x14(%rsp), %eax
leaq 0x2c(%rsp), %rdi
jl 0x5713
movq 0x8(%rsp), %r14
xorl %r15d, %r15d
jmp 0x57b8
movl $0x1, %r15d
movq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3100
movl %r15d, %eax
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/pe.c
// Function: rip_binary
int rip_binary(FILE *in, char *filename, int address, int size)
{
  FILE *out;
  long marker;
  int t;

  out = fopen(filename, "wb");

  if (out == NULL)
  {
    printf("Cannot open file %s for writing.\n\n",filename);
    return -1;
  }

  marker = ftell(in);
  fseek(in, address, SEEK_SET);

  for (t = 0; t < size; t++)
  {
    putc(getc(in), out);
  }

  fseek(in, marker, SEEK_SET);
  fclose(out);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %r14
leaq 0x21ac(%rip), %rsi      # 0x8045
movq %r12, %rdi
callq 0x3110
testq %rax, %rax
je 0x5ef4
movq %rax, %r15
movq %r14, %rdi
callq 0x30f0
movq %rax, %r12
movslq %ebp, %rsi
xorl %ebp, %ebp
movq %r14, %rdi
xorl %edx, %edx
callq 0x3100
testl %ebx, %ebx
jle 0x5edd
movq %r14, %rdi
callq 0x3150
movl %eax, %edi
movq %r15, %rsi
callq 0x30d0
decl %ebx
jne 0x5ec7
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x3100
movq %r15, %rdi
callq 0x3070
jmp 0x5f0a
leaq 0x3e55(%rip), %rdi      # 0x9d50
movq %r12, %rsi
xorl %eax, %eax
callq 0x3090
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/pe.c
// Function: read_unicode
int read_unicode(FILE *in, int address, char *s, int max_chars)
{
  long marker;
  int ch,t,len;

  marker = ftell(in);
  fseek(in, address, SEEK_SET);

  t = 0;
  len = read_uint16(in);

  while (t < len)
  {
    getc(in);
    ch = getc(in);
    if (ch == EOF || ch == 0) { break; }
    s[t++] = ch;

    if (t == max_chars - 1) { break; }
  }

  s[t] = 0;

  fseek(in, marker, SEEK_SET);

  return t;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r12d
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
callq 0x30f0
movq %rax, (%rsp)
movslq %ebp, %rsi
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3100
movq %rbx, %rdi
callq 0x51f0
movl %eax, %r13d
leal -0x2(%r12), %r15d
decl %r12d
testl %eax, %eax
cmovlel %ebp, %r13d
incq %r15
cmpq %rbp, %r13
je 0x5f90
movq %rbx, %rdi
callq 0x3150
movq %rbx, %rdi
callq 0x3150
leal 0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0x5f8d
movb %al, (%r14,%rbp)
incq %rbp
cmpq %rbp, %r15
jne 0x5f5f
movl %r12d, %r13d
jmp 0x5f90
movl %ebp, %r13d
movslq %r13d, %r12
movb $0x0, (%r14,%r12)
movq %rbx, %rdi
movq (%rsp), %rsi
xorl %edx, %edx
callq 0x3100
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/pe.c
// Function: hex_dump
int hex_dump(FILE *in, int address, int size, struct section_header_t *section_header)
{
  long marker;
  uint32_t virtual_address, raw_ptr;
  int t;

  virtual_address = section_header->VirtualAddress;
  raw_ptr = section_header->PointerToRawData;

  address = (address - virtual_address) + raw_ptr;

  marker = ftell(in);
  fseek(in, address, SEEK_SET);

  printf("-- Hex Dump address=0x%04x size=%d --\n", address, size);

  for (t = 0; t < size; t++)
  {
    if ((t % 8) == 0) { printf("\n"); }
    printf(" %02x", getc(in));
  }
  printf("\n");

  fseek(in, marker, SEEK_SET);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %rbx
subl 0x10(%rcx), %r15d
addl 0x18(%rcx), %r15d
callq 0x30f0
movq %rax, %r14
movslq %r15d, %r15
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x3100
leaq 0x3d84(%rip), %rdi      # 0x9d73
movl %r15d, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3090
testl %ebp, %ebp
jle 0x6035
leaq 0x2df9(%rip), %r15      # 0x8dff
xorl %r12d, %r12d
testb $0x7, %r12b
jne 0x6019
movl $0xa, %edi
callq 0x3030
movq %rbx, %rdi
callq 0x3150
movq %r15, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x3090
incl %r12d
cmpl %r12d, %ebp
jne 0x6009
movl $0xa, %edi
callq 0x3030
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3100
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/resource.c
// Function: read_struct_info
static int read_struct_info(
  FILE *in,
  uint16_t *wLength,
  uint16_t *wValueLength,
  uint16_t *wType,
  char *szKey,
  int szKey_length)
{
  int len = 6;

  *wLength = read_uint16(in);
  *wValueLength = read_uint16(in);
  *wType = read_uint16(in);

  printf("   wLength=%d\n", *wLength);
  printf("   wValueLength=%d\n", *wValueLength);
  printf("   wType=%d %s\n", *wType, *wType == 0 ? "(binary)" : "(text)");
  printf("   szKey=");
  len += parse_unicode(in, szKey, szKey_length);
  len += read_padding(in, len);
  printf("\n");

  return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
callq 0x51f0
movw %ax, (%r13)
movq %rbx, %rdi
callq 0x51f0
movw %ax, (%r12)
movq %rbx, %rdi
callq 0x51f0
movw %ax, (%r15)
movzwl (%r13), %esi
leaq 0x3ecf(%rip), %rdi      # 0xa2a3
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x3090
movzwl (%r12), %esi
leaq 0x3ec8(%rip), %rdi      # 0xa2b2
xorl %eax, %eax
callq 0x3090
movzwl (%r15), %esi
testl %esi, %esi
leaq 0x3ed8(%rip), %rax      # 0xa2d6
leaq 0x3eda(%rip), %rdx      # 0xa2df
cmoveq %rax, %rdx
leaq 0x3eb6(%rip), %rdi      # 0xa2c6
xorl %eax, %eax
callq 0x3090
leaq 0x3ec8(%rip), %rdi      # 0xa2e6
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
callq 0x3150
movl %eax, %ebp
movq %rbx, %rdi
callq 0x3150
movl %eax, %ecx
shll $0x8, %eax
orl %ebp, %eax
sete %dl
cmpl $-0x1, %ecx
sete %cl
movl $0x8, %r15d
orb %dl, %cl
jne 0x648d
movl %eax, %edi
callq 0x3030
cmpl $0x7e, %r13d
jg 0x6468
movslq %r13d, %rax
incl %r13d
movb %bpl, (%r14,%rax)
movq %rbx, %rdi
callq 0x3150
movl %eax, %ebp
movq %rbx, %rdi
callq 0x3150
addl $0x2, %r15d
cmpl $-0x1, %eax
je 0x648a
shll $0x8, %eax
orl %ebp, %eax
jne 0x6451
movslq %r13d, %r13
movb $0x0, (%r14,%r13)
movl $0xa, %edi
callq 0x3030
testb $0x3, %r15b
je 0x64d6
movl %r15d, %r14d
negb %r14b
movl %r15d, %ebp
andl $0x3, %ebp
movl $0x1, %r12d
andb $0x3, %r14b
movq %rbx, %rdi
callq 0x3150
movl %r12d, %eax
andb $0x3, %al
incl %r12d
cmpb %r14b, %al
jne 0x64b8
movl $0x4, %ebx
subl %ebp, %ebx
jmp 0x64d8
xorl %ebx, %ebx
addl %r15d, %ebx
movl $0xa, %edi
callq 0x3030
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/resource.c
// Function: read_fixed_file_info
int read_fixed_file_info(FILE *in, struct fixed_file_info_t *fixed_file_info)
{
  fixed_file_info->Signature = read_uint32(in);
  fixed_file_info->StrucVersion = read_uint32(in);
  fixed_file_info->FileVersionMS = read_uint32(in);
  fixed_file_info->FileVersionLS = read_uint32(in);
  fixed_file_info->ProductVersionMS = read_uint32(in);
  fixed_file_info->ProductVersionLS = read_uint32(in);
  fixed_file_info->FileFlagsMask = read_uint32(in);
  fixed_file_info->FileFlags = read_uint32(in);
  fixed_file_info->FileOS = read_uint32(in);
  fixed_file_info->FileType = read_uint32(in);
  fixed_file_info->FileSubtype = read_uint32(in);
  fixed_file_info->FileDateMS = read_uint32(in);
  fixed_file_info->FileDateLS = read_uint32(in);

  return 13 * sizeof(uint32_t);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x51ae
movl %eax, (%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x4(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x8(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0xc(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x10(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x14(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x18(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x1c(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x20(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x24(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x28(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x2c(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x30(%rbx)
movl $0x34, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/resource.c
// Function: read_resource_dir
int read_resource_dir(FILE *in, int addr, struct resource_dir_t *resource_dir)
{
  int marker;

  marker = ftell(in);
  fseek(in,addr,SEEK_SET);

  resource_dir->Characteristics = read_uint32(in);
  resource_dir->TimeDateStamp = read_uint32(in);
  resource_dir->MajorVersion = read_uint16(in);
  resource_dir->MinorVersion = read_uint16(in);
  resource_dir->NumberOfNamedEntries = read_uint16(in);
  resource_dir->NumberOfIdEntries = read_uint16(in);

  fseek(in, marker, SEEK_SET);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
callq 0x30f0
movq %rax, %r15
movslq %ebp, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3100
movq %rbx, %rdi
callq 0x51ae
movl %eax, (%r14)
movq %rbx, %rdi
callq 0x51ae
movl %eax, 0x4(%r14)
movq %rbx, %rdi
callq 0x51f0
movw %ax, 0x8(%r14)
movq %rbx, %rdi
callq 0x51f0
movw %ax, 0xa(%r14)
movq %rbx, %rdi
callq 0x51f0
movw %ax, 0xc(%r14)
movq %rbx, %rdi
callq 0x51f0
movw %ax, 0xe(%r14)
movslq %r15d, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3100
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/resource.c
// Function: print_resource_dir
int print_resource_dir(struct resource_dir_t *resource_dir, int level)
{
  char indent[RES_INDENT_MAX];

  memset(indent, ' ', RES_INDENT_MAX);
  if (level > RES_INDENT_LEVELS) { level = RES_INDENT_LEVELS; }
  indent[level * RES_INDENT_UNIT] = 0;

  printf("%s|_______ Resource Directory ___\n",indent);

  printf("%s|  Characteristics: 0x%x\n",indent,resource_dir->Characteristics);
  printf("%s|    TimeDateStamp: %s",indent,ctime((time_t *)&resource_dir->TimeDateStamp));
  printf("%s|     MajorVersion: %d\n",indent,resource_dir->MajorVersion);
  printf("%s|     MinorVersion: %d\n",indent,resource_dir->MinorVersion);
  printf("%s|NumOfNamedEntries: %d\n",indent,resource_dir->NumberOfNamedEntries);
  printf("%s|   NumOfIdEntries: %d\n",indent,resource_dir->NumberOfIdEntries);
  printf("\n");

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r14
movaps 0x34b3(%rip), %xmm0     # 0x9e40
movq %rsp, %rbx
movaps %xmm0, 0x50(%rbx)
movaps %xmm0, 0x40(%rbx)
movaps %xmm0, 0x30(%rbx)
movaps %xmm0, 0x20(%rbx)
movaps %xmm0, 0x10(%rbx)
movaps %xmm0, (%rbx)
movl $0x20202020, 0x60(%rbx) # imm = 0x20202020
cmpl $0x18, %esi
movl $0x18, %eax
cmovll %esi, %eax
cltq
movb $0x0, (%rsp,%rax,4)
leaq 0x353d(%rip), %rdi      # 0x9f03
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movl (%r14), %edx
leaq 0x354c(%rip), %rdi      # 0x9f26
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
leaq 0x4(%r14), %rdi
callq 0x3080
leaq 0x354e(%rip), %rdi      # 0x9f42
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3090
movzwl 0x8(%r14), %edx
leaq 0x354e(%rip), %rdi      # 0x9f5b
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movzwl 0xa(%r14), %edx
leaq 0x3552(%rip), %rdi      # 0x9f75
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movzwl 0xc(%r14), %edx
leaq 0x3556(%rip), %rdi      # 0x9f8f
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movzwl 0xe(%r14), %edx
leaq 0x355a(%rip), %rdi      # 0x9fa9
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movl $0xa, %edi
callq 0x3030
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/resource.c
// Function: read_resource_dir_entry
int read_resource_dir_entry(
  FILE *in,
  int addr,
  struct resource_dir_entry_t *resource_dir_entry,
  int offset)
{
  long marker;

  marker = ftell(in);
  fseek(in, addr + offset, SEEK_SET);

  resource_dir_entry->Name = read_uint32(in);
  resource_dir_entry->OffsetToData = read_uint32(in);

  if ((resource_dir_entry->Name & 0x80000000) != 0)
  {
    read_unicode(
      in,
      addr + (resource_dir_entry->Name & 0x7fffffff),
      resource_dir_entry->RealName,
      256);
  }
    else
  {
    resource_dir_entry->RealName[0] = 0;
  }

  fseek(in, marker, SEEK_SET);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %r12d
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %rbx
callq 0x30f0
movq %rax, %r14
addl %ebp, %r12d
movslq %r12d, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3100
movq %rbx, %rdi
callq 0x51ae
movl %eax, (%r15)
movq %rbx, %rdi
callq 0x51ae
movl %eax, 0x4(%r15)
movl (%r15), %esi
testl %esi, %esi
js 0x6abd
movb $0x0, 0x8(%r15)
jmp 0x6ad9
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
addl %ebp, %esi
addq $0x8, %r15
movq %rbx, %rdi
movq %r15, %rdx
movl $0x100, %ecx            # imm = 0x100
callq 0x5f15
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3100
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/resource.c
// Function: print_resource_dir_entry
int print_resource_dir_entry(
  struct resource_dir_entry_t *resource_dir_entry,
  int level,
  int count)
{
  char indent[RES_INDENT_MAX];

  memset(indent, ' ', RES_INDENT_MAX);
  if (level > RES_INDENT_LEVELS) level = RES_INDENT_LEVELS;
  indent[level * RES_INDENT_UNIT] = 0;

  if ((resource_dir_entry->OffsetToData & 0x80000000) == 0)
  {
    printf("%s-- Resource Dir Entry [%d] --\n", indent, count);
  }
    else
  {
    printf("%s-- Resource Dir Entry (Dir) [%d] --\n", indent, count);
  }

  printf("%s|             Name: 0x%08x", indent, resource_dir_entry->Name);

  if ((resource_dir_entry->Name&0x80000000) != 0)
  {
    printf("%s|(%s)", indent, resource_dir_entry->RealName);
  }

  printf("\n");
  printf("%s|     OffsetToData: 0x%08x\n", indent, resource_dir_entry->OffsetToData);
  printf("\n");

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movaps 0x333e(%rip), %xmm0     # 0x9e40
movq %rsp, %r14
movaps %xmm0, 0x50(%r14)
movaps %xmm0, 0x40(%r14)
movaps %xmm0, 0x30(%r14)
movaps %xmm0, 0x20(%r14)
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movl $0x20202020, 0x60(%r14) # imm = 0x20202020
cmpl $0x18, %esi
movl $0x18, %eax
cmovll %esi, %eax
cltq
movb $0x0, (%rsp,%rax,4)
cmpl $0x0, 0x4(%rdi)
leaq 0x3332(%rip), %rax      # 0x9e78
leaq 0x334c(%rip), %rdi      # 0x9e99
cmovnsq %rax, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x3090
movl (%rbx), %edx
leaq 0x335c(%rip), %rdi      # 0x9ec0
movq %r14, %rsi
xorl %eax, %eax
callq 0x3090
cmpl $0x0, (%rbx)
jns 0x6b88
leaq 0x8(%rbx), %rdx
leaq 0x335f(%rip), %rdi      # 0x9edd
movq %rsp, %rsi
xorl %eax, %eax
callq 0x3090
movl $0xa, %edi
callq 0x3030
movl 0x4(%rbx), %edx
leaq 0x3349(%rip), %rdi      # 0x9ee5
movq %rsp, %rsi
xorl %eax, %eax
callq 0x3090
movl $0xa, %edi
callq 0x3030
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/resource.c
// Function: read_resource_data
int read_resource_data(
  FILE *in,
  int addr,
  struct resource_data_t *resource_data,
  int offset)
{
  long marker;

  marker = ftell(in);
  fseek(in, addr + offset, SEEK_SET);

  resource_data->OffsetToData = read_uint32(in);
  resource_data->Size = read_uint32(in);
  resource_data->CodePage = read_uint32(in);
  resource_data->Reserved = read_uint32(in);

  fseek(in, marker, SEEK_SET);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rdx, %r14
movl %esi, %r12d
movq %rdi, %rbx
callq 0x30f0
movq %rax, %r15
addl %ebp, %r12d
movslq %r12d, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3100
movq %rbx, %rdi
callq 0x51ae
movl %eax, (%r14)
movq %rbx, %rdi
callq 0x51ae
movl %eax, 0x4(%r14)
movq %rbx, %rdi
callq 0x51ae
movl %eax, 0x8(%r14)
movq %rbx, %rdi
callq 0x51ae
movl %eax, 0xc(%r14)
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x3100
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/resource.c
// Function: print_resource_data
int print_resource_data(struct resource_data_t *resource_data, int level)
{
  char indent[RES_INDENT_MAX];

  memset(indent, ' ', RES_INDENT_MAX);
  if (level > RES_INDENT_LEVELS) { level = RES_INDENT_LEVELS; }
  indent[level * RES_INDENT_UNIT] = 0;

  printf("%s-- Resource Data --\n", indent);
  printf("%s|     OffsetToData: %d\n", indent,resource_data->OffsetToData);
  printf("%s|             Size: %d\n", indent,resource_data->Size);
  printf("%s|         CodePage: %d\n", indent,resource_data->CodePage);
  printf("%s|         Reserved: %d\n", indent,resource_data->Reserved);
  printf("\n");

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r14
movaps 0x3203(%rip), %xmm0     # 0x9e40
movq %rsp, %rbx
movaps %xmm0, 0x50(%rbx)
movaps %xmm0, 0x40(%rbx)
movaps %xmm0, 0x30(%rbx)
movaps %xmm0, 0x20(%rbx)
movaps %xmm0, 0x10(%rbx)
movaps %xmm0, (%rbx)
movl $0x20202020, 0x60(%rbx) # imm = 0x20202020
cmpl $0x18, %esi
movl $0x18, %eax
cmovll %esi, %eax
cltq
movb $0x0, (%rsp,%rax,4)
leaq 0x33e6(%rip), %rdi      # 0xa05c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movl (%r14), %edx
leaq 0x33e9(%rip), %rdi      # 0xa073
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movl 0x4(%r14), %edx
leaq 0x33ee(%rip), %rdi      # 0xa08d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movl 0x8(%r14), %edx
leaq 0x33f3(%rip), %rdi      # 0xa0a7
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movl 0xc(%r14), %edx
leaq 0x33f8(%rip), %rdi      # 0xa0c1
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movl $0xa, %edi
callq 0x3030
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/resource.c
// Function: print_resource_type
int print_resource_type(int id, int level)
{
  char indent[RES_INDENT_MAX];
  char *ids[] = {
    "", "Cursor", "Bitmap", "Icon", "Menu", "Dialog", "String",
    "Font Dir", "Font", "Accelerator", "RCData", "MessageTable",
    "", "", "", "", "Version Info", "DlgInclude", "", "PlugPlay",
    "VXD", "AniCursor", "AniIcon", "HTML", "Unknown"
  };

  memset(indent, ' ', RES_INDENT_MAX);
  if (level > RES_INDENT_LEVELS) { level = RES_INDENT_LEVELS; }
  indent[level*RES_INDENT_UNIT] = 0;

  printf("%s>> Resource Type: ", indent);

  if (id < 0x17)
  {
    printf("%s\n", ids[id]);
  }
  else
  {
    printf("???\n");
  }

  printf("\n");

  return 0;
}

// Assembly:
pushq %rbx
subq $0x70, %rsp
movl %edi, %ebx
movaps 0x314b(%rip), %xmm0     # 0x9e40
movq %rsp, %rax
movaps %xmm0, 0x50(%rax)
movaps %xmm0, 0x40(%rax)
movaps %xmm0, 0x30(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movl $0x20202020, 0x60(%rax) # imm = 0x20202020
cmpl $0x18, %esi
movl $0x18, %ecx
cmovll %esi, %ecx
movslq %ecx, %rcx
movb $0x0, (%rsp,%rcx,4)
leaq 0x3318(%rip), %rdi      # 0xa047
movq %rax, %rsi
xorl %eax, %eax
callq 0x3090
cmpl $0x16, %ebx
jg 0x6d51
movslq %ebx, %rax
leaq 0x3068(%rip), %rcx      # 0x9db0
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
jmp 0x6d58
leaq 0x2042(%rip), %rdi      # 0x8d9a
callq 0x3060
movl $0xa, %edi
callq 0x3030
xorl %eax, %eax
addq $0x70, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/resource.c
// Function: save_resource
int save_resource(FILE *in, char *filename, int addr)
{
  int marker;
  unsigned OffsetToData,Size;

  marker = ftell(in);
  fseek(in, addr, SEEK_SET);

  OffsetToData = read_uint32(in);
  Size = read_uint32(in);

  printf("OffsetToData=%d\n", OffsetToData);
  printf("Size=0x%08x\n", Size);

  fseek(in, marker, SEEK_SET);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %rbx
callq 0x30f0
movq %rax, %r14
movslq %ebp, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3100
movq %rbx, %rdi
callq 0x51ae
movl %eax, %ebp
movq %rbx, %rdi
callq 0x51ae
movl %eax, %r15d
leaq 0x30ae(%rip), %rdi      # 0x9e5a
movl %ebp, %esi
xorl %eax, %eax
callq 0x3090
leaq 0x30af(%rip), %rdi      # 0x9e6b
movl %r15d, %esi
xorl %eax, %eax
callq 0x3090
movslq %r14d, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3100
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/section_header.c
// Function: section_header_read
int section_header_read(struct section_header_t *section_header, FILE *in)
{
  memset(section_header->name, 0, sizeof(section_header->name));
  read_chars(in, section_header->name, 8);
  section_header->VirtualSize = read_uint32(in);
  section_header->VirtualAddress = read_uint32(in);
  section_header->SizeOfRawData = read_uint32(in);
  section_header->PointerToRawData = read_uint32(in);
  section_header->PointerToRelocations = read_uint32(in);
  section_header->PointerToLinenumbers = read_uint32(in);
  section_header->NumberOfRelocations = read_uint16(in);
  section_header->NumberOfLinenumbers = read_uint16(in);
  section_header->Characteristics = read_uint32(in);

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movw $0x0, 0x8(%rdi)
movq $0x0, (%rdi)
movq %rsi, %rdi
movq %rbx, %rsi
movl $0x8, %edx
callq 0x5216
movq %r14, %rdi
callq 0x51ae
movl %eax, 0xc(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x10(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x14(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x18(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x1c(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x20(%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0x24(%rbx)
movq %r14, %rdi
callq 0x51f0
movw %ax, 0x26(%rbx)
movq %r14, %rdi
callq 0x51ae
movl %eax, 0x28(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/section_header.c
// Function: section_header_print
int section_header_print(struct section_header_t *section_header, int count)
{
  printf("---------------------------------------------\n");
  printf("Section Header %d\n",count);
  printf("---------------------------------------------\n");
  printf("      Section Name: %s\n",section_header->name);
  printf("       VirtualSize: %d\n",section_header->VirtualSize);
  printf("    VirtualAddress: 0x%04x\n",section_header->VirtualAddress);
  printf("     SizeOfRawData: %d\n",section_header->SizeOfRawData);
  printf("  PointerToRawData: 0x%04x\n",section_header->PointerToRawData);
  printf("  PtrToRelocations: %d\n",section_header->PointerToRelocations);
  printf("  PtrToLinenumbers: %d\n",section_header->PointerToLinenumbers);
  printf("  NumOfRelocations: %d\n",section_header->NumberOfRelocations);
  printf("  NumOfLinenumbers: %d\n",section_header->NumberOfLinenumbers);
  printf("   Characteristics: 0x%x\n",section_header->Characteristics);
  printf("\n");

  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x13bb(%rip), %r14      # 0x8241
movq %r14, %rdi
callq 0x3060
leaq 0x34fa(%rip), %rdi      # 0xa38f
movl %ebp, %esi
xorl %eax, %eax
callq 0x3090
movq %r14, %rdi
callq 0x3060
leaq 0x34f5(%rip), %rdi      # 0xa3a2
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movl 0xc(%rbx), %esi
leaq 0x34f9(%rip), %rdi      # 0xa3ba
xorl %eax, %eax
callq 0x3090
movl 0x10(%rbx), %esi
leaq 0x3500(%rip), %rdi      # 0xa3d2
xorl %eax, %eax
callq 0x3090
movl 0x14(%rbx), %esi
leaq 0x350b(%rip), %rdi      # 0xa3ee
xorl %eax, %eax
callq 0x3090
movl 0x18(%rbx), %esi
leaq 0x1ede(%rip), %rdi      # 0x8dd2
xorl %eax, %eax
callq 0x3090
movl 0x1c(%rbx), %esi
leaq 0x3501(%rip), %rdi      # 0xa406
xorl %eax, %eax
callq 0x3090
movl 0x20(%rbx), %esi
leaq 0x3508(%rip), %rdi      # 0xa41e
xorl %eax, %eax
callq 0x3090
movzwl 0x24(%rbx), %esi
leaq 0x350e(%rip), %rdi      # 0xa436
xorl %eax, %eax
callq 0x3090
movzwl 0x26(%rbx), %esi
leaq 0x3514(%rip), %rdi      # 0xa44e
xorl %eax, %eax
callq 0x3090
movl 0x28(%rbx), %esi
leaq 0x351b(%rip), %rdi      # 0xa466
xorl %eax, %eax
callq 0x3090
movl $0xa, %edi
callq 0x3030
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/nerves-project[P]nerves_initramfs/src/script.c
// Function: function_help
const struct term *function_help(const struct term *parameters)
{
    (void)parameters;

    struct function_info *entry = function_table;
    while (entry->handler) {
        if (entry->description) {
            char buf[16];
            snprintf(buf, sizeof(buf), "%s/%d", entry->name, entry->arity);
            fprintf(stderr, "%-16s%s\n", buf, entry->description);
        }
        entry++;
    }

    fprintf(stderr, "\nType Ctrl-D to exit repl.\n");
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpq $0x0, 0xbd84(%rip)      # 0xe320
jne 0x25cb
movq 0xba4b(%rip), %rax      # 0xdff0
movq (%rax), %rcx
leaq 0x811a(%rip), %rdi      # 0xa6c9
pushq $0x1b
popq %rsi
pushq $0x1
popq %rdx
callq 0x24b0
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbd3e(%rip), %r13      # 0xe310
leaq 0x80e1(%rip), %rbx      # 0xa6ba
movq %rsp, %r14
pushq $0x10
popq %r15
movq 0xba09(%rip), %rbp      # 0xdff0
leaq 0x80d2(%rip), %r12      # 0xa6c0
cmpq $0x0, 0x18(%r13)
jne 0x2602
cmpq $0x0, 0x30(%r13)
leaq 0x20(%r13), %r13
jne 0x25ee
jmp 0x259e
movq (%r13), %rcx
movl 0x8(%r13), %r8d
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2210
movq (%rbp), %rdi
movq 0x18(%r13), %rcx
movq %r12, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2320
jmp 0x25f5
// File: /workspace/github_c_makefile_star2_O3/nerves-project[P]nerves_initramfs/src/nerves_initramfs.c
// Function: cleanup_dir
void cleanup_dir(int dirfd, const char **skip_list)
{
    DIR *dir = fdopendir(dirfd);
    if (dir == NULL) {
        info("fdopendir failed");
        return;
    }

    for (struct dirent *dt = readdir(dir); dt != NULL; dt = readdir(dir)) {
        // Skip . and ..
        const char *name = dt->d_name;
        if (in_skip_list(name, skip_list))
            continue;

        if (dt->d_type & DT_DIR) {
            int fd = openat(dirfd, name, O_RDONLY);
            if (fd >= 0) {
                cleanup_dir(fd, nonroot_skip_list);
            } else {
                info("openat %s failed", name);
            }
            OK_OR_WARN(unlinkat(dirfd, name, AT_REMOVEDIR), "unlinkat directory  %s", name);
        } else {
            OK_OR_WARN(unlinkat(dirfd, name, 0), "unlinkat %s", name);
        }
    }

    closedir(dir);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movl %edi, %ebp
callq 0x2440
testq %rax, %rax
je 0x2a21
movq %rax, %r14
movq %rax, %rdi
callq 0x2370
testq %rax, %rax
je 0x2a0b
movq %rax, %r12
movq (%rsp), %rax
leaq 0x8(%rax), %rbx
leaq 0x13(%r12), %r13
movq (%rsp), %rax
movq (%rax), %rdi
movq %rbx, %r15
testq %rdi, %rdi
je 0x2983
movq %r13, %rsi
callq 0x2310
testl %eax, %eax
je 0x29f7
movq (%r15), %rdi
addq $0x8, %r15
jmp 0x2969
testb $0x4, 0x12(%r12)
jne 0x29a0
movl %ebp, %edi
movq %r13, %rsi
xorl %edx, %edx
callq 0x20e0
leaq 0x66cb(%rip), %rdi      # 0x9069
jmp 0x29e9
movl %ebp, %edi
movq %r13, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x21b0
testl %eax, %eax
js 0x29c2
movl %eax, %edi
leaq 0xb8f5(%rip), %rsi      # 0xe2b0
callq 0x291c
jmp 0x29d3
leaq 0x6678(%rip), %rdi      # 0x9041
movq %r13, %rsi
xorl %eax, %eax
callq 0x3204
movl %ebp, %edi
movq %r13, %rsi
movl $0x200, %edx            # imm = 0x200
callq 0x20e0
leaq 0x6669(%rip), %rdi      # 0x9052
testl %eax, %eax
jns 0x29f7
movq %r13, %rsi
xorl %eax, %eax
callq 0x3204
movq %r14, %rdi
callq 0x2370
movq %rax, %r12
testq %rax, %rax
jne 0x295a
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22a0
leaq 0x6608(%rip), %rdi      # 0x9030
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3204
// File: /workspace/github_c_makefile_star2_O3/nerves-project[P]nerves_initramfs/src/util.c
// Function: log_format
static void log_format(const char *fmt, va_list ap)
{
    char *line;
    int len = format_message(&line, fmt, ap);

    if (len >= 0) {
        log_write(line, len);
        free(line);
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rdx
movq %rdi, %rsi
leaq 0x8(%rsp), %rdi
callq 0x2160
testl %eax, %eax
js 0x32df
movq 0x8(%rsp), %rdx
leaq 0x6159(%rip), %rsi      # 0x940a
movq %rsp, %rdi
xorl %eax, %eax
callq 0x23c0
movl %eax, %ebx
movq 0x8(%rsp), %rdi
callq 0x2040
testl %ebx, %ebx
js 0x32df
movq (%rsp), %rdi
movl %ebx, %esi
callq 0x339a
movq (%rsp), %rdi
callq 0x2040
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/nerves-project[P]nerves_initramfs/src/util.c
// Function: fatal
void fatal(const char *fmt, ...)
{
    log_write("\r\n\r\nFATAL ERROR:\r\n", 18);

    va_list ap;
    va_start(ap, fmt);
    log_format(fmt, ap);
    va_end(ap);

    log_write("\r\n\r\nCANNOT CONTINUE.\r\n", 22);

    // This will cause the kernel to panic.
    exit(1);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %rsi, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x3346
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
leaq 0x6093(%rip), %rdi      # 0x93e0
movl $0x12, %esi
callq 0x339a
movq %rsp, %rsi
movq %r14, 0x10(%rsi)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsi)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsi)
movq %rbx, %rdi
callq 0x328c
leaq 0x606d(%rip), %rdi      # 0x93f3
movl $0x16, %esi
callq 0x339a
movl $0x1, %edi
callq 0x24a0
// File: /workspace/github_c_makefile_star2_O3/nerves-project[P]nerves_initramfs/src/util.c
// Function: log_write
static void log_write(const char *str, size_t len)
{
    size_t ignore;
    int log_fd = open("/dev/kmsg", O_WRONLY | O_CLOEXEC);
    if (log_fd >= 0) {
        ignore = write(log_fd, str, len);
        close(log_fd);
    } else {
        ignore = write(STDERR_FILENO, str, len);
    }
    (void) ignore;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x6076(%rip), %rdi      # 0x9421
movl $0x80001, %esi          # imm = 0x80001
xorl %eax, %eax
callq 0x2420
testl %eax, %eax
js 0x33d5
movl %eax, %ebp
movl %eax, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2140
movl %ebp, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0x2280
movl $0x2, %edi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0x2140
// File: /workspace/github_c_makefile_star2_O3/nerves-project[P]nerves_initramfs/src/util.c
// Function: trim_string_in_place
void trim_string_in_place(char *str)
{
    char *first = str;
    while (*first && isspace(*first))
        first++;

    char *last = first + strlen(first) - 1;
    while (last != first && isspace(*last))
        last--;

    size_t len = last - first + 1;
    memmove(str, first, len);
    str[len] = '\0';
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb (%rdi), %bpl
movq %rdi, %r14
testb %bpl, %bpl
je 0x3420
callq 0x2520
movq (%rax), %rax
movq %rbx, %r14
movsbq %bpl, %rcx
testb $0x20, 0x1(%rax,%rcx,2)
je 0x3420
movb 0x1(%r14), %bpl
incq %r14
testb %bpl, %bpl
jne 0x3409
movq %r14, %rdi
callq 0x2190
movq %rax, %r15
cmpq $0x1, %r15
je 0x344e
callq 0x2520
movq (%rax), %rax
movsbq -0x1(%r14,%r15), %rcx
decq %r15
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x342b
addq %r14, %r15
jmp 0x3451
movq %r14, %r15
subq %r14, %r15
leaq 0x1(%r15), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x23e0
movb $0x0, 0x1(%rbx,%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/nerves-project[P]nerves_initramfs/src/crc32.c
// Function: crc32buf
uint32_t crc32buf(const char *buf, size_t len)
{
      uint32_t crc32 = 0xFFFFFFFF;
      for ( ; len; --len, ++buf)
      {
            crc32 = UPDC32(*buf, crc32);
      }

      return ~crc32;
}

// Assembly:
testq %rsi, %rsi
je 0x34a4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
leaq 0x5fa9(%rip), %rdx      # 0x9430
movb (%rdi,%rcx), %r8b
xorb %al, %r8b
movzbl %r8b, %r8d
shrl $0x8, %eax
xorl (%rdx,%r8,4), %eax
incq %rcx
cmpq %rcx, %rsi
jne 0x3487
notl %eax
retq
xorl %eax, %eax
retq
nop