LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/clsid.c
// Function: clsid_print
int clsid_print(const uint8_t *clsid)
{
  int t;

  for (t = 0; t < 16; t++)
  {
    printf("%02X", clsid[t]);

    if (t == 3 || t == 5 || t == 7 || t == 9) { printf("-"); }
  }

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4e5d(%rip), %r14      # 0x89e0
pushq $0x2d
popq %rbp
xorl %r15d, %r15d
cmpq $0x10, %r15
je 0x3bc1
movzbl (%rbx,%r15), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x3090
movl %r15d, %eax
andl $0xb, %eax
cmpl $0x3, %eax
je 0x3bb5
cmpl $0x9, %r15d
je 0x3bb5
cmpl $0x5, %r15d
jne 0x3bbc
movl %ebp, %edi
callq 0x3030
incq %r15
jmp 0x3b89
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/com.c
// Function: reg_info_read
int reg_info_read(struct reg_info_t *reg_info, FILE *in, int offset)
{
  int marker;

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

  reg_info->bNextObject = read_uint32(in);
  reg_info->bObjectName = read_uint32(in);
  reg_info->bObjectDescription = read_uint32(in);
  reg_info->dwInstancing = read_uint32(in);
  reg_info->dwObjectId = read_uint32(in);
  clsid_read((char *)reg_info->uuidObject, in);
  reg_info->fIsInterface = read_uint32(in);
  reg_info->bUidObjectIFace = read_uint32(in);
  reg_info->bUidEventsIFace = read_uint32(in);
  reg_info->fHasEvents = read_uint32(in);
  reg_info->dwMiscStatus = read_uint32(in);
  reg_info->fClassType = read_uint32(in);
  reg_info->fObjectType = read_uint16(in);
  reg_info->wToolboxBitmap32 = read_uint16(in);
  reg_info->wDefaultIcon = read_uint16(in);
  reg_info->fIsDesigner = read_uint16(in);
  reg_info->bDesignerData = read_uint32(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 0x3110
movq %rbx, %rdi
callq 0x5126
movl %eax, (%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x4(%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x8(%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0xc(%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x10(%r14)
leaq 0x14(%r14), %rdi
movq %rbx, %rsi
callq 0x3b30
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x24(%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x28(%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x2c(%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x30(%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x34(%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x38(%r14)
movq %rbx, %rdi
callq 0x5168
movw %ax, 0x3c(%r14)
movq %rbx, %rdi
callq 0x5168
movw %ax, 0x3e(%r14)
movq %rbx, %rdi
callq 0x5168
movw %ax, 0x40(%r14)
movq %rbx, %rdi
callq 0x5168
movw %ax, 0x42(%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x44(%r14)
movslq %r15d, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3110
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4f67(%rip), %rdi      # 0x8c54
callq 0x3060
movl (%rbx), %esi
leaq 0x4cea(%rip), %rdi      # 0x89e5
xorl %eax, %eax
callq 0x3090
movl 0x4(%rbx), %esi
leaq 0x48(%rbx), %rdx
leaq 0x4ced(%rip), %rdi      # 0x89fd
xorl %eax, %eax
callq 0x3090
movl 0x8(%rbx), %esi
leaq 0x4cf9(%rip), %rdi      # 0x8a1a
xorl %eax, %eax
callq 0x3090
movl 0xc(%rbx), %esi
leaq 0x4d00(%rip), %rdi      # 0x8a32
xorl %eax, %eax
callq 0x3090
movl 0x10(%rbx), %esi
leaq 0x4d07(%rip), %rdi      # 0x8a4a
xorl %eax, %eax
callq 0x3090
leaq 0x4d11(%rip), %rdi      # 0x8a62
xorl %eax, %eax
callq 0x3090
leaq 0x14(%rbx), %rdi
callq 0x3b72
pushq $0xa
popq %rbp
movl %ebp, %edi
callq 0x3030
movl 0x24(%rbx), %esi
leaq 0x4d02(%rip), %rdi      # 0x8a77
xorl %eax, %eax
callq 0x3090
movl 0x28(%rbx), %esi
leaq 0x4d09(%rip), %rdi      # 0x8a8f
xorl %eax, %eax
callq 0x3090
movl 0x2c(%rbx), %esi
leaq 0x4d10(%rip), %rdi      # 0x8aa7
xorl %eax, %eax
callq 0x3090
movl 0x30(%rbx), %esi
leaq 0x4d17(%rip), %rdi      # 0x8abf
xorl %eax, %eax
callq 0x3090
movl 0x34(%rbx), %esi
leaq 0x4d1e(%rip), %rdi      # 0x8ad7
xorl %eax, %eax
callq 0x3090
movl 0x38(%rbx), %esi
leaq 0x4d25(%rip), %rdi      # 0x8aef
xorl %eax, %eax
callq 0x3090
movzwl 0x3c(%rbx), %esi
leaq 0x4d2b(%rip), %rdi      # 0x8b07
xorl %eax, %eax
callq 0x3090
movzwl 0x3e(%rbx), %esi
leaq 0x4d31(%rip), %rdi      # 0x8b1f
xorl %eax, %eax
callq 0x3090
movzwl 0x40(%rbx), %esi
leaq 0x4d37(%rip), %rdi      # 0x8b37
xorl %eax, %eax
callq 0x3090
movzwl 0x42(%rbx), %esi
leaq 0x4d3d(%rip), %rdi      # 0x8b4f
xorl %eax, %eax
callq 0x3090
movl 0x44(%rbx), %esi
leaq 0x4d44(%rip), %rdi      # 0x8b67
xorl %eax, %eax
callq 0x3090
movl %ebp, %edi
callq 0x3030
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3110
movq %rbx, %rdi
callq 0x5126
movl %eax, (%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x4(%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x8(%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0xc(%r14)
leaq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x3b30
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x20(%r14)
movq %rbx, %rdi
callq 0x5168
movw %ax, 0x24(%r14)
movq %rbx, %rdi
callq 0x5168
movw %ax, 0x26(%r14)
movq %rbx, %rdi
callq 0x5168
movw %ax, 0x28(%r14)
movslq %r15d, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3110
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4d73(%rip), %rdi      # 0x8c69
callq 0x3060
movl (%rbx), %esi
leaq 0x4c7b(%rip), %rdi      # 0x8b7f
xorl %eax, %eax
callq 0x3090
movl 0x4(%rbx), %esi
leaq 0x4c82(%rip), %rdi      # 0x8b97
xorl %eax, %eax
callq 0x3090
movl 0x8(%rbx), %esi
leaq 0x4c89(%rip), %rdi      # 0x8baf
xorl %eax, %eax
callq 0x3090
movl 0xc(%rbx), %esi
leaq 0x4c90(%rip), %rdi      # 0x8bc7
xorl %eax, %eax
callq 0x3090
leaq 0x4c9a(%rip), %rdi      # 0x8bdf
xorl %eax, %eax
callq 0x3090
leaq 0x10(%rbx), %rdi
callq 0x3b72
pushq $0xa
popq %rbp
movl %ebp, %edi
callq 0x3030
movl 0x20(%rbx), %esi
leaq 0x4c8b(%rip), %rdi      # 0x8bf4
xorl %eax, %eax
callq 0x3090
movzwl 0x24(%rbx), %esi
leaq 0x4c91(%rip), %rdi      # 0x8c0c
xorl %eax, %eax
callq 0x3090
movzwl 0x26(%rbx), %esi
leaq 0x4c97(%rip), %rdi      # 0x8c24
xorl %eax, %eax
callq 0x3090
movzwl 0x28(%rbx), %esi
leaq 0x4c9d(%rip), %rdi      # 0x8c3c
xorl %eax, %eax
callq 0x3090
movl %ebp, %edi
callq 0x3030
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 0x5168
movw %ax, (%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0x2(%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0x4(%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0x6(%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0x8(%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0xa(%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0xc(%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0xe(%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0x10(%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0x12(%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0x14(%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0x16(%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0x18(%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0x1a(%rbx)
leaq 0x1c(%rbx), %rsi
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x51d0
movq %r14, %rdi
callq 0x5168
movw %ax, 0x24(%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0x26(%rbx)
leaq 0x28(%rbx), %rsi
pushq $0x14
popq %rdx
movq %r14, %rdi
callq 0x51d0
movq %r14, %rdi
callq 0x5126
movl %eax, 0x3c(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x5168
movw %ax, (%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0x2(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x4(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x8(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0xc(%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0x10(%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0x12(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x5126
movl %eax, (%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x4(%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x8(%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0xc(%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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, %r12d
movl %esi, %r15d
movq %rdi, %rbx
movl 0x10(%r8), %r14d
movl 0x18(%r8), %r13d
subl %r14d, %r15d
addl %r13d, %r15d
callq 0x30f0
movq %rax, 0x10(%rsp)
movslq %r15d, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3110
subl %r14d, %r13d
movq %r13, 0x18(%rsp)
leal 0x2(%r13), %r14d
leaq 0x2c(%rsp), %rdi
leaq 0x40(%rsp), %r15
xorl %eax, %eax
movl %r12d, 0x8(%rsp)
cmpl %r12d, %eax
jge 0x56b0
movl %eax, 0xc(%rsp)
movq %rbx, %rsi
callq 0x554f
movl 0x2c(%rsp), %r13d
testl %r13d, %r13d
je 0x56b0
movl 0x3c(%rsp), %r12d
movq 0x18(%rsp), %rax
addl %eax, %r12d
addl %eax, %r13d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x531c
testl %eax, %eax
je 0x5674
movq %rbx, %rdi
movl %r13d, %esi
callq 0x531c
leal (%rax,%r14), %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x52bb
movq %r15, %rdi
movq 0x20(%rsp), %rsi
callq 0x30c0
addl %ebp, %r12d
addl %ebp, %r13d
testl %eax, %eax
jne 0x5632
jmp 0x568a
movl 0xc(%rsp), %eax
addl $0x14, %eax
movl 0x8(%rsp), %r12d
leaq 0x2c(%rsp), %rdi
jmp 0x55ff
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x3110
movl %ebp, %eax
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x568d
// File: /workspace/github_c_makefile_star2_O2/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, %ebp
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x22eb(%rip), %rsi      # 0x8045
movq %r15, %rdi
callq 0x3120
testq %rax, %rax
je 0x5dbe
movq %rax, %r14
movq %rbx, %rdi
callq 0x30f0
movq %rax, %r15
movslq %r12d, %rsi
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3110
testl %ebp, %ebp
cmovgl %ebp, %r12d
subl $0x1, %r12d
jb 0x5da5
movq %rbx, %rdi
callq 0x3160
movl %eax, %edi
movq %r14, %rsi
callq 0x30d0
jmp 0x5d8b
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x3110
movq %r14, %rdi
callq 0x3070
jmp 0x5dd2
leaq 0x3f8b(%rip), %rdi      # 0x9d50
movq %r15, %rsi
xorl %eax, %eax
callq 0x3090
pushq $-0x1
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3110
movq %rbx, %rdi
callq 0x5168
movl %eax, %r13d
leal -0x2(%r12), %r15d
decl %r12d
testl %eax, %eax
cmovlel %ebp, %r13d
incq %r15
cmpq %rbp, %r13
je 0x5e58
movq %rbx, %rdi
callq 0x3160
movq %rbx, %rdi
callq 0x3160
leal 0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0x5e55
movb %al, (%r14,%rbp)
incq %rbp
cmpq %rbp, %r15
jne 0x5e27
movl %r12d, %r13d
jmp 0x5e58
movl %ebp, %r13d
movslq %r13d, %r12
movb $0x0, (%r14,%r12)
movq %rbx, %rdi
movq (%rsp), %rsi
xorl %edx, %edx
callq 0x3110
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_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
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
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x3110
leaq 0x3eb6(%rip), %rdi      # 0x9d73
movl %r15d, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3090
testl %ebp, %ebp
cmovlel %r12d, %ebp
pushq $0xa
popq %r15
leaq 0x2f25(%rip), %r12      # 0x8dff
xorl %r13d, %r13d
cmpl %r13d, %ebp
je 0x5f09
testb $0x7, %r13b
jne 0x5ef0
movl %r15d, %edi
callq 0x3030
movq %rbx, %rdi
callq 0x3160
movq %r12, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x3090
incl %r13d
jmp 0x5edd
pushq $0xa
popq %rdi
callq 0x3030
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3110
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 0x5168
movw %ax, (%r13)
movq %rbx, %rdi
callq 0x5168
movw %ax, (%r12)
movq %rbx, %rdi
callq 0x5168
movw %ax, (%r15)
movzwl (%r13), %esi
leaq 0x40c2(%rip), %rdi      # 0xa2a3
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x3090
movzwl (%r12), %esi
leaq 0x40bc(%rip), %rdi      # 0xa2b2
xorl %eax, %eax
callq 0x3090
movzwl (%r15), %esi
testl %esi, %esi
leaq 0x40cc(%rip), %rax      # 0xa2d6
leaq 0x40ce(%rip), %rdx      # 0xa2df
cmoveq %rax, %rdx
leaq 0x40aa(%rip), %rdi      # 0xa2c6
xorl %eax, %eax
callq 0x3090
leaq 0x40bc(%rip), %rdi      # 0xa2e6
xorl %eax, %eax
callq 0x3090
xorl %r12d, %r12d
addl $0x8, %ebp
movq %rbx, %rdi
callq 0x3160
movl %eax, %r15d
movq %rbx, %rdi
callq 0x3160
movl %r12d, %r13d
cmpl $-0x1, %eax
je 0x6276
shll $0x8, %eax
orl %r15d, %eax
je 0x6276
movl %eax, %edi
callq 0x3030
addl $0x2, %ebp
cmpl $0x7e, %r12d
ja 0x6237
incl %r12d
movb %r15b, (%r14,%r13)
addl $-0x8, %ebp
jmp 0x6234
movb $0x0, (%r14,%r13)
pushq $0xa
popq %r14
movl %r14d, %edi
callq 0x3030
movq %rbx, %rdi
movl %ebp, %esi
callq 0x62ae
movl %eax, %ebx
addl %ebp, %ebx
movl %r14d, %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_O2/mikeakohn[P]print_pe/build/../src/resource.c
// Function: read_padding
static int read_padding(FILE *in, int len)
{
  int count = 0;

  while ((len & 0x3) != 0)
  {
    getc(in);
    count++;
    len++;
  }

  return count;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
negl %ebx
andl $0x3, %ebx
movl %ebx, %ebp
subl $0x1, %ebp
jb 0x62cd
movq %r14, %rdi
callq 0x3160
jmp 0x62be
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x5126
movl %eax, (%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x4(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x8(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0xc(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x10(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x14(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x18(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x1c(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x20(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x24(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x28(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x2c(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x30(%rbx)
pushq $0x34
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3110
movq %rbx, %rdi
callq 0x5126
movl %eax, (%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x4(%r14)
movq %rbx, %rdi
callq 0x5168
movw %ax, 0x8(%r14)
movq %rbx, %rdi
callq 0x5168
movw %ax, 0xa(%r14)
movq %rbx, %rdi
callq 0x5168
movw %ax, 0xc(%r14)
movq %rbx, %rdi
callq 0x5168
movw %ax, 0xe(%r14)
movslq %r15d, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3110
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x36eb(%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
pushq $0x18
popq %rax
cmovll %esi, %eax
cltq
movb $0x0, (%rsp,%rax,4)
leaq 0x3777(%rip), %rdi      # 0x9f03
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movl (%r14), %edx
leaq 0x3786(%rip), %rdi      # 0x9f26
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
leaq 0x4(%r14), %rdi
callq 0x3080
leaq 0x3788(%rip), %rdi      # 0x9f42
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3090
movzwl 0x8(%r14), %edx
leaq 0x3788(%rip), %rdi      # 0x9f5b
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movzwl 0xa(%r14), %edx
leaq 0x378c(%rip), %rdi      # 0x9f75
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movzwl 0xc(%r14), %edx
leaq 0x3790(%rip), %rdi      # 0x9f8f
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movzwl 0xe(%r14), %edx
leaq 0x3794(%rip), %rdi      # 0x9fa9
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
pushq $0xa
popq %rdi
callq 0x3030
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3110
movq %rbx, %rdi
callq 0x5126
movl %eax, (%r15)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x4(%r15)
movl (%r15), %esi
testl %esi, %esi
js 0x6881
movb $0x0, 0x8(%r15)
jmp 0x689d
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
addl %ebp, %esi
addq $0x8, %r15
movq %rbx, %rdi
movq %r15, %rdx
movl $0x100, %ecx            # imm = 0x100
callq 0x5ddd
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3110
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rdi, %rbx
movaps 0x3579(%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
pushq $0x18
popq %rax
cmovll %esi, %eax
cltq
movb $0x0, (%rsp,%rax,4)
cmpl $0x0, 0x4(%rdi)
leaq 0x356f(%rip), %rax      # 0x9e78
leaq 0x3589(%rip), %rdi      # 0x9e99
cmovnsq %rax, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x3090
movl (%rbx), %edx
leaq 0x3599(%rip), %rdi      # 0x9ec0
movq %r14, %rsi
xorl %eax, %eax
callq 0x3090
cmpl $0x0, (%rbx)
jns 0x694b
leaq 0x8(%rbx), %rdx
leaq 0x359c(%rip), %rdi      # 0x9edd
movq %rsp, %rsi
xorl %eax, %eax
callq 0x3090
pushq $0xa
popq %rbp
movl %ebp, %edi
callq 0x3030
movl 0x4(%rbx), %edx
leaq 0x3586(%rip), %rdi      # 0x9ee5
movq %rsp, %rsi
xorl %eax, %eax
callq 0x3090
movl %ebp, %edi
callq 0x3030
xorl %eax, %eax
addq $0x70, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3110
movq %rbx, %rdi
callq 0x5126
movl %eax, (%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x4(%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0x8(%r14)
movq %rbx, %rdi
callq 0x5126
movl %eax, 0xc(%r14)
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x3110
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3442(%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
pushq $0x18
popq %rax
cmovll %esi, %eax
cltq
movb $0x0, (%rsp,%rax,4)
leaq 0x3627(%rip), %rdi      # 0xa05c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movl (%r14), %edx
leaq 0x362a(%rip), %rdi      # 0xa073
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movl 0x4(%r14), %edx
leaq 0x362f(%rip), %rdi      # 0xa08d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movl 0x8(%r14), %edx
leaq 0x3634(%rip), %rdi      # 0xa0a7
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movl 0xc(%r14), %edx
leaq 0x3639(%rip), %rdi      # 0xa0c1
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
pushq $0xa
popq %rdi
callq 0x3030
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x338e(%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
pushq $0x18
popq %rcx
cmovll %esi, %ecx
movslq %ecx, %rcx
movb $0x0, (%rsp,%rcx,4)
leaq 0x355d(%rip), %rdi      # 0xa047
movq %rax, %rsi
xorl %eax, %eax
callq 0x3090
cmpl $0x16, %ebx
jg 0x6b0c
movslq %ebx, %rax
leaq 0x32ad(%rip), %rcx      # 0x9db0
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
jmp 0x6b13
leaq 0x2287(%rip), %rdi      # 0x8d9a
callq 0x3060
pushq $0xa
popq %rdi
callq 0x3030
xorl %eax, %eax
addq $0x70, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3110
movq %rbx, %rdi
callq 0x5126
movl %eax, %ebp
movq %rbx, %rdi
callq 0x5126
movl %eax, %r15d
leaq 0x32f5(%rip), %rdi      # 0x9e5a
movl %ebp, %esi
xorl %eax, %eax
callq 0x3090
leaq 0x32f6(%rip), %rdi      # 0x9e6b
movl %r15d, %esi
xorl %eax, %eax
callq 0x3090
movslq %r14d, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3110
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 %rdi, %rbx
andw $0x0, 0x8(%rdi)
movq %rsi, %r14
andq $0x0, (%rdi)
pushq $0x8
popq %rdx
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x518e
movq %r14, %rdi
callq 0x5126
movl %eax, 0xc(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x10(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x14(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x18(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x1c(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x20(%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0x24(%rbx)
movq %r14, %rdi
callq 0x5168
movw %ax, 0x26(%rbx)
movq %r14, %rdi
callq 0x5126
movl %eax, 0x28(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1605(%rip), %r14      # 0x8241
movq %r14, %rdi
callq 0x3060
leaq 0x3744(%rip), %rdi      # 0xa38f
movl %ebp, %esi
xorl %eax, %eax
callq 0x3090
movq %r14, %rdi
callq 0x3060
leaq 0x373f(%rip), %rdi      # 0xa3a2
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3090
movl 0xc(%rbx), %esi
leaq 0x3743(%rip), %rdi      # 0xa3ba
xorl %eax, %eax
callq 0x3090
movl 0x10(%rbx), %esi
leaq 0x374a(%rip), %rdi      # 0xa3d2
xorl %eax, %eax
callq 0x3090
movl 0x14(%rbx), %esi
leaq 0x3755(%rip), %rdi      # 0xa3ee
xorl %eax, %eax
callq 0x3090
movl 0x18(%rbx), %esi
leaq 0x2128(%rip), %rdi      # 0x8dd2
xorl %eax, %eax
callq 0x3090
movl 0x1c(%rbx), %esi
leaq 0x374b(%rip), %rdi      # 0xa406
xorl %eax, %eax
callq 0x3090
movl 0x20(%rbx), %esi
leaq 0x3752(%rip), %rdi      # 0xa41e
xorl %eax, %eax
callq 0x3090
movzwl 0x24(%rbx), %esi
leaq 0x3758(%rip), %rdi      # 0xa436
xorl %eax, %eax
callq 0x3090
movzwl 0x26(%rbx), %esi
leaq 0x375e(%rip), %rdi      # 0xa44e
xorl %eax, %eax
callq 0x3090
movl 0x28(%rbx), %esi
leaq 0x3765(%rip), %rdi      # 0xa466
xorl %eax, %eax
callq 0x3090
pushq $0xa
popq %rdi
callq 0x3030
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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, %r15
movl %edi, %ebp
callq 0x2440
testq %rax, %rax
je 0x2728
movq %rax, %r14
movq %r14, %rdi
callq 0x2370
testq %rax, %rax
je 0x2712
movq %rax, %r12
movq %rax, %r13
addq $0x13, %r13
movq %r15, %rbx
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2695
movq %r13, %rsi
callq 0x2310
addq $0x8, %rbx
testl %eax, %eax
jne 0x267b
jmp 0x265d
testb $0x4, 0x12(%r12)
jne 0x26b2
movl %ebp, %edi
movq %r13, %rsi
xorl %edx, %edx
callq 0x20e0
leaq 0x59b9(%rip), %rdi      # 0x8069
jmp 0x26fb
movl %ebp, %edi
movq %r13, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x21b0
testl %eax, %eax
js 0x26d4
movl %eax, %edi
leaq 0xabe3(%rip), %rsi      # 0xd2b0
callq 0x263c
jmp 0x26e5
leaq 0x5966(%rip), %rdi      # 0x8041
movq %r13, %rsi
xorl %eax, %eax
callq 0x2ee4
movl %ebp, %edi
movq %r13, %rsi
movl $0x200, %edx            # imm = 0x200
callq 0x20e0
leaq 0x5957(%rip), %rdi      # 0x8052
testl %eax, %eax
jns 0x265d
movq %r13, %rsi
xorl %eax, %eax
callq 0x2ee4
jmp 0x265d
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22a0
leaq 0x5901(%rip), %rdi      # 0x8030
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2ee4
// File: /workspace/github_c_makefile_star2_O2/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 0x2fbf
movq 0x8(%rsp), %rdx
leaq 0x5479(%rip), %rsi      # 0x840a
movq %rsp, %rdi
xorl %eax, %eax
callq 0x23c0
movl %eax, %ebx
movq 0x8(%rsp), %rdi
callq 0x2040
testl %ebx, %ebx
js 0x2fbf
movq (%rsp), %rdi
movl %ebx, %esi
callq 0x3074
movq (%rsp), %rdi
callq 0x2040
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3026
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 0x53b3(%rip), %rdi      # 0x83e0
pushq $0x12
popq %rsi
callq 0x3074
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 0x2f6c
leaq 0x538f(%rip), %rdi      # 0x83f3
pushq $0x16
popq %rsi
callq 0x3074
pushq $0x1
popq %rdi
callq 0x24a0
// File: /workspace/github_c_makefile_star2_O2/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 0x539c(%rip), %rdi      # 0x8421
movl $0x80001, %esi          # imm = 0x80001
xorl %eax, %eax
callq 0x2420
testl %eax, %eax
js 0x30af
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
pushq $0x2
popq %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0x2140
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq -0x1(%rdi), %r13
pushq $0x1
popq %r12
movq %rdi, %r14
movsbq (%r14), %r15
testq %r15, %r15
je 0x30fc
callq 0x2520
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r15,2)
je 0x30fc
incq %r14
incq %r13
decq %r12
jmp 0x30d8
movq %r14, %rdi
callq 0x2190
movq %rax, %r15
cmpq $0x1, %r15
je 0x312a
callq 0x2520
movq (%rax), %rax
movsbq -0x1(%r14,%r15), %rcx
decq %r15
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x3107
addq %r14, %r15
jmp 0x312d
movq %r14, %r15
movq %r15, %rdx
subq %r13, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x23e0
movb $0x0, (%r12,%r15)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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:
pushq $-0x1
popq %rax
xorl %ecx, %ecx
leaq 0x52d4(%rip), %rdx      # 0x8430
cmpq %rcx, %rsi
je 0x3178
movb (%rdi,%rcx), %r8b
xorb %al, %r8b
movzbl %r8b, %r8d
shrl $0x8, %eax
xorl (%rdx,%r8,4), %eax
incq %rcx
jmp 0x315c
notl %eax
retq
nop