LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: read_coff_section_header
int read_coff_section_header(
  FILE *in,
  struct coff_section_header_t *section_header)
{
  section_header->offset = ftell(in);

  if (fread(section_header->name, 1, 8, in) != 8) { return -1; }

  section_header->physical_address = read_uint32(in);
  section_header->virtual_address = read_uint32(in);
  section_header->size = read_uint32(in);
  section_header->file_offset_section_data = read_uint32(in);
  section_header->file_offset_relocation_table = read_uint32(in);
  section_header->file_offset_line_number = read_uint32(in);
  section_header->relocation_count = read_uint16(in);
  section_header->line_number_count = read_uint16(in);
  section_header->flags = read_uint32(in);

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x10c0
movq %rax, (%rbx)
leaq 0x8(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x8
popq %rdx
movq %r14, %rcx
callq 0x1070
cmpq $0x8, %rax
jne 0x14ca
movq %r14, %rdi
callq 0x2422
movl %eax, 0x10(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x14(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x18(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x1c(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x20(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x24(%rbx)
movq %r14, %rdi
callq 0x2464
movw %ax, 0x28(%rbx)
movq %r14, %rdi
callq 0x2464
movw %ax, 0x2a(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x2c(%rbx)
xorl %eax, %eax
jmp 0x14cd
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: print_file_header
void print_file_header(struct file_header_t *file_header)
{
  printf(" --- file header 0x%06lx ---\n", file_header->offset);
  printf("        name: %.16s\n", file_header->name);
  printf("        date: %.12s\n", file_header->date);
  printf("     user_id: %.6s\n", file_header->user_id);
  printf("    group_id: %.6s\n", file_header->group_id);
  printf("        mode: %.8s\n", file_header->mode);
  printf("        size: %.10s\n", file_header->size);
  printf("         end: %.2s\n", file_header->end);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rsi
leaq 0x2b5d(%rip), %rdi      # 0x4040
xorl %eax, %eax
callq 0x1090
leaq 0x8(%rbx), %rsi
leaq 0x2b69(%rip), %rdi      # 0x405e
xorl %eax, %eax
callq 0x1090
leaq 0x18(%rbx), %rsi
leaq 0x2b6c(%rip), %rdi      # 0x4073
xorl %eax, %eax
callq 0x1090
leaq 0x24(%rbx), %rsi
leaq 0x2b6f(%rip), %rdi      # 0x4088
xorl %eax, %eax
callq 0x1090
leaq 0x2a(%rbx), %rsi
leaq 0x2b71(%rip), %rdi      # 0x409c
xorl %eax, %eax
callq 0x1090
leaq 0x30(%rbx), %rsi
leaq 0x2b73(%rip), %rdi      # 0x40b0
xorl %eax, %eax
callq 0x1090
leaq 0x38(%rbx), %rsi
leaq 0x2b75(%rip), %rdi      # 0x40c4
xorl %eax, %eax
callq 0x1090
addq $0x42, %rbx
leaq 0x2b78(%rip), %rdi      # 0x40d9
movq %rbx, %rsi
xorl %eax, %eax
popq %rbx
jmp 0x1090
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: print_coff_header
void print_coff_header(struct coff_header_t *coff_header)
{
  printf(" --- coff header 0x%06lx ---\n", coff_header->offset);
  printf("                magic: 0x%04x\n", coff_header->magic);
  printf("        section_count: %d\n", coff_header->section_count);
  printf("            timestamp: %d\n", coff_header->timestamp);
  printf(" symbol_table_pointer: 0x%04x\n", coff_header->symbol_table_pointer);
  printf("         symbol_count: %d\n", coff_header->symbol_count);
  printf(" optional_header_size: %d\n", coff_header->optional_header_size);
  printf("                flags: %08x\n", coff_header->flags);
  printf("\n");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rsi
leaq 0x2b73(%rip), %rdi      # 0x40ed
xorl %eax, %eax
callq 0x1090
movzwl 0x8(%rbx), %esi
leaq 0x2b7f(%rip), %rdi      # 0x410b
xorl %eax, %eax
callq 0x1090
movzwl 0xa(%rbx), %esi
leaq 0x2b8c(%rip), %rdi      # 0x412a
xorl %eax, %eax
callq 0x1090
movl 0xc(%rbx), %esi
leaq 0x2b96(%rip), %rdi      # 0x4145
xorl %eax, %eax
callq 0x1090
movl 0x10(%rbx), %esi
leaq 0x2ba0(%rip), %rdi      # 0x4160
xorl %eax, %eax
callq 0x1090
movl 0x14(%rbx), %esi
leaq 0x2bae(%rip), %rdi      # 0x417f
xorl %eax, %eax
callq 0x1090
movzwl 0x18(%rbx), %esi
leaq 0x2bb7(%rip), %rdi      # 0x419a
xorl %eax, %eax
callq 0x1090
movzwl 0x1a(%rbx), %esi
leaq 0x2dd4(%rip), %rdi      # 0x43c9
xorl %eax, %eax
callq 0x1090
pushq $0xa
popq %rdi
popq %rbx
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: print_coff_optional_header
void print_coff_optional_header(struct coff_optional_header_t *optional_header)
{
  printf(" --- coff optional header 0x%06lx ---\n", optional_header->offset);
  printf("          magic: 0x%04x\n", optional_header->magic);
  printf("        version: 0x%04x\n", optional_header->version);
  printf("      text_size: %d\n", optional_header->text_size);
  printf("      data_size: %d\n", optional_header->data_size);
  printf("   uininit_size: %d\n", optional_header->uninit_size);
  printf("    entry_point: 0x%06x\n", optional_header->entry_point);
  printf("     text_start: 0x%06x\n", optional_header->text_start);
  printf("     data_start: 0x%06x\n", optional_header->data_start);
  printf("\n");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rsi
leaq 0x2ba2(%rip), %rdi      # 0x41b5
xorl %eax, %eax
callq 0x1090
movzwl 0x8(%rbx), %esi
leaq 0x2aec(%rip), %rdi      # 0x4111
xorl %eax, %eax
callq 0x1090
movzwl 0xa(%rbx), %esi
leaq 0x2ba5(%rip), %rdi      # 0x41dc
xorl %eax, %eax
callq 0x1090
movl 0xc(%rbx), %esi
leaq 0x2bad(%rip), %rdi      # 0x41f5
xorl %eax, %eax
callq 0x1090
movl 0x10(%rbx), %esi
leaq 0x2bb1(%rip), %rdi      # 0x420a
xorl %eax, %eax
callq 0x1090
movl 0x14(%rbx), %esi
leaq 0x2bb5(%rip), %rdi      # 0x421f
xorl %eax, %eax
callq 0x1090
movl 0x18(%rbx), %esi
leaq 0x2bb9(%rip), %rdi      # 0x4234
xorl %eax, %eax
callq 0x1090
movl 0x1c(%rbx), %esi
leaq 0x2bc1(%rip), %rdi      # 0x424d
xorl %eax, %eax
callq 0x1090
movl 0x20(%rbx), %esi
leaq 0x2bc9(%rip), %rdi      # 0x4266
xorl %eax, %eax
callq 0x1090
pushq $0xa
popq %rdi
popq %rbx
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: print_coff_section_header
void print_coff_section_header(struct coff_section_header_t *section_header)
{
  printf(" --- coff section header 0x%06lx ---\n", section_header->offset);
  printf("                       name: %.8s\n", section_header->name);
  printf("           physical_address: 0x%06x\n", section_header->physical_address);
  printf("            virtual_address: 0x%06x\n", section_header->virtual_address);
  printf("                       size: %d\n", section_header->size);
  printf("   file_offset_section_data: 0x%06x\n", section_header->file_offset_section_data);
  printf("file_offset_relocation_data: 0x%06x\n", section_header->file_offset_relocation_table);
  printf("    file_offset_line_number: 0x%06x\n", section_header->file_offset_line_number);
  printf("          line_number_count: %d\n", section_header->line_number_count);
  printf("                      flags: %08x\n", section_header->flags);
  printf("\n");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rsi
leaq 0x2bc4(%rip), %rdi      # 0x427f
xorl %eax, %eax
callq 0x1090
leaq 0x8(%rbx), %rsi
leaq 0x2bd8(%rip), %rdi      # 0x42a5
xorl %eax, %eax
callq 0x1090
movl 0x10(%rbx), %esi
leaq 0x2bea(%rip), %rdi      # 0x42c8
xorl %eax, %eax
callq 0x1090
movl 0x14(%rbx), %esi
leaq 0x2bfe(%rip), %rdi      # 0x42ed
xorl %eax, %eax
callq 0x1090
movl 0x18(%rbx), %esi
leaq 0x2c12(%rip), %rdi      # 0x4312
xorl %eax, %eax
callq 0x1090
movl 0x1c(%rbx), %esi
leaq 0x2c22(%rip), %rdi      # 0x4333
xorl %eax, %eax
callq 0x1090
movl 0x20(%rbx), %esi
leaq 0x2c36(%rip), %rdi      # 0x4358
xorl %eax, %eax
callq 0x1090
movl 0x24(%rbx), %esi
leaq 0x2c4a(%rip), %rdi      # 0x437d
xorl %eax, %eax
callq 0x1090
movzwl 0x2a(%rbx), %esi
leaq 0x2c5d(%rip), %rdi      # 0x43a2
xorl %eax, %eax
callq 0x1090
movl 0x2c(%rbx), %esi
leaq 0x2c6d(%rip), %rdi      # 0x43c3
xorl %eax, %eax
callq 0x1090
pushq $0xa
popq %rdi
popq %rbx
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: print_symbol
int print_symbol(FILE *in)
{
  while (1)
  {
    int ch = getc(in);
    if (ch == 0 || ch == EOF) { break; }
    printf("%c", ch);
  }

  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rbx, %rdi
callq 0x1150
leal 0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0x1783
movl %eax, %edi
callq 0x1040
jmp 0x176a
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: print_symbol_offsets
int print_symbol_offsets(FILE *in, uint32_t size)
{
  long marker = ftell(in);
  int symbol_count = read_uint32_be(in);
  uint32_t *offsets = (uint32_t *)malloc(symbol_count * sizeof(uint32_t));
  int n;

  printf(" --- symbol_count: %d ---\n", symbol_count);

  for (n = 0; n < symbol_count; n++)
  {
    offsets[n] = read_uint32_be(in);
  }

  for (n = 0; n < symbol_count; n++)
  {
    printf("   0x%06x  ", offsets[n]);
    print_symbol(in);
    printf("\n");
  }

  printf("\n");

  free(offsets);

  long total = ftell(in) - marker;

  if (total != size)
  {
    printf("Error: Bad archive members size %ld vs %d.\n", total, size);
    return -1;
  }

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, 0xc(%rsp)
movq %rdi, %r14
callq 0x10c0
movq %rax, 0x10(%rsp)
movq %r14, %rdi
callq 0x2509
movslq %eax, %r13
leaq (,%r13,4), %rdi
callq 0x10e0
movq %rax, %r12
leaq 0x2c1e(%rip), %rdi      # 0x43e6
xorl %r15d, %r15d
movl %r13d, %esi
xorl %eax, %eax
callq 0x1090
testl %r13d, %r13d
cmovlel %r15d, %r13d
cmpq %r15, %r13
je 0x17f2
movq %r14, %rdi
callq 0x2509
movl %eax, (%r12,%r15,4)
incq %r15
jmp 0x17dc
leaq 0x2c08(%rip), %rbp      # 0x4401
pushq $0xa
popq %r15
xorl %ebx, %ebx
cmpq %rbx, %r13
je 0x1827
movl (%r12,%rbx,4), %esi
movq %rbp, %rdi
xorl %eax, %eax
callq 0x1090
movq %r14, %rdi
callq 0x1766
movl %r15d, %edi
callq 0x1040
incq %rbx
jmp 0x17ff
pushq $0xa
popq %rdi
callq 0x1040
movq %r12, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x10c0
subq 0x10(%rsp), %rax
movl 0xc(%rsp), %edx
movl %edx, %esi
xorl %ecx, %ecx
cmpq %rsi, %rax
je 0x1865
leaq 0x2bb5(%rip), %rdi      # 0x440d
movq %rax, %rsi
xorl %eax, %eax
callq 0x1090
pushq $-0x1
popq %rcx
movl %ecx, %eax
addq $0x18, %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/print_lib.c
// Function: print_symbol_header
int print_symbol_header(FILE *in)
{
  struct coff_symbol_header_t symbol_header;

  symbol_header.offset = ftell(in);
  symbol_header.version = read_uint16(in);
  symbol_header.machine = read_uint16(in);
  symbol_header.timestamp = read_uint32(in);
  symbol_header.size = read_uint32(in);
  symbol_header.unknown_0 = read_uint16(in);
  symbol_header.unknown_1 = read_uint16(in);

  printf("--- symbol %06lx ---\n", symbol_header.offset);
  printf("        version: 0x%04x\n", symbol_header.version);
  printf("        machine: 0x%04x\n", symbol_header.machine);
  printf("      timestamp: %d\n", symbol_header.timestamp);
  printf("           size: %d\n", symbol_header.size);
  printf("      unknown_0: %d\n", symbol_header.unknown_0);
  printf("      unknown_1: %d\n", symbol_header.unknown_1);
  printf("           name: ");
  print_symbol(in);
  printf("\n");
  printf("            DLL: ");
  print_symbol(in);
  printf("\n\n");

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x10c0
movq %rax, %r12
movq %rbx, %rdi
callq 0x2464
movl %eax, %r15d
movq %rbx, %rdi
callq 0x2464
movl %eax, %r13d
movq %rbx, %rdi
callq 0x2422
movl %eax, (%rsp)
movq %rbx, %rdi
callq 0x2422
movl %eax, 0x4(%rsp)
movq %rbx, %rdi
callq 0x2464
movl %eax, %r14d
movq %rbx, %rdi
callq 0x2464
movl %eax, %ebp
leaq 0x2b64(%rip), %rdi      # 0x4439
movq %r12, %rsi
xorl %eax, %eax
callq 0x1090
movl $0xffff, %r12d          # imm = 0xFFFF
andl %r12d, %r15d
leaq 0x28ed(%rip), %rdi      # 0x41dc
movl %r15d, %esi
xorl %eax, %eax
callq 0x1090
andl %r12d, %r13d
leaq 0x3692(%rip), %rdi      # 0x4f95
movl %r13d, %esi
xorl %eax, %eax
callq 0x1090
leaq 0x2837(%rip), %rdi      # 0x414b
movl (%rsp), %esi
xorl %eax, %eax
callq 0x1090
leaq 0x29f9(%rip), %rdi      # 0x431e
movl 0x4(%rsp), %esi
xorl %eax, %eax
callq 0x1090
andl %r12d, %r14d
leaq 0x2b15(%rip), %rdi      # 0x444f
movl %r14d, %esi
xorl %eax, %eax
callq 0x1090
andl %r12d, %ebp
leaq 0x2b16(%rip), %rdi      # 0x4464
movl %ebp, %esi
xorl %eax, %eax
callq 0x1090
leaq 0x2b1b(%rip), %rdi      # 0x4479
xorl %eax, %eax
callq 0x1090
movq %rbx, %rdi
callq 0x1766
pushq $0xa
popq %rdi
callq 0x1040
leaq 0x2b0f(%rip), %rdi      # 0x448b
xorl %eax, %eax
callq 0x1090
movq %rbx, %rdi
callq 0x1766
leaq 0x3e8a(%rip), %rdi      # 0x581c
callq 0x1060
xorl %eax, %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/print_lib.c
// Function: print_public_symbols
int print_public_symbols(FILE *in, uint32_t size)
{
  long marker = ftell(in);
  int offset_count = read_uint32(in);
  int n;

  printf(" --- offset_count: %d ---\n", offset_count);

  for (n = 0; n < offset_count; n++)
  {
    printf("  %02x %06x\n", n, read_uint32(in));
  }

  printf("\n");

  int symbol_count = read_uint32(in);
  uint16_t *offsets = (uint16_t *)malloc(symbol_count * sizeof(uint16_t));

  printf(" --- symbol_count: %d ---\n", symbol_count);

  for (n = 0; n < symbol_count; n++)
  {
    offsets[n] = read_uint16(in);
  }

  for (n = 0; n < symbol_count; n++)
  {
    printf("   0x%04x  ", offsets[n]);
	    print_symbol(in);
	    printf("\n");
	  }

	  printf("\n");

	  long total = ftell(in) - marker;

	  if (total != size)
	  {
	    printf("Error: Bad archive members size %ld vs %d.\n", total, size);
	    return -1;
	  }

	  return 0;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, 0xc(%rsp)
movq %rdi, %r14
callq 0x10c0
movq %rax, 0x10(%rsp)
movq %r14, %rdi
callq 0x2422
movl %eax, %ebp
leaq 0x2ac5(%rip), %rdi      # 0x449d
xorl %ebx, %ebx
movl %eax, %esi
xorl %eax, %eax
callq 0x1090
testl %ebp, %ebp
cmovlel %ebx, %ebp
leaq 0x2ac9(%rip), %r15      # 0x44b8
xorl %r12d, %r12d
cmpl %r12d, %ebp
je 0x1a13
movq %r14, %rdi
callq 0x2422
movq %r15, %rdi
movl %r12d, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x1090
incl %r12d
jmp 0x19f2
pushq $0xa
popq %rdi
callq 0x1040
movq %r14, %rdi
callq 0x2422
movslq %eax, %r12
leaq (%r12,%r12), %rdi
callq 0x10e0
movq %rax, %r13
leaq 0x29ad(%rip), %rdi      # 0x43e6
xorl %r15d, %r15d
movl %r12d, %esi
xorl %eax, %eax
callq 0x1090
testl %r12d, %r12d
cmovlel %r15d, %r12d
cmpq %r15, %r12
je 0x1a65
movq %r14, %rdi
callq 0x2464
movw %ax, (%r13,%r15,2)
incq %r15
jmp 0x1a4d
leaq 0x2a59(%rip), %rbp      # 0x44c5
pushq $0xa
popq %r15
xorl %ebx, %ebx
cmpq %rbx, %r12
je 0x1a9c
movzwl (%r13,%rbx,2), %esi
movq %rbp, %rdi
xorl %eax, %eax
callq 0x1090
movq %r14, %rdi
callq 0x1766
movl %r15d, %edi
callq 0x1040
incq %rbx
jmp 0x1a72
pushq $0xa
popq %rdi
callq 0x1040
movq %r14, %rdi
callq 0x10c0
subq 0x10(%rsp), %rax
movl 0xc(%rsp), %edx
movl %edx, %esi
xorl %ecx, %ecx
cmpq %rsi, %rax
je 0x1ad2
leaq 0x2948(%rip), %rdi      # 0x440d
movq %rax, %rsi
xorl %eax, %eax
callq 0x1090
pushq $-0x1
popq %rcx
movl %ecx, %eax
addq $0x18, %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/print_lib.c
// Function: print_name
int print_name(FILE *in, uint32_t size)
	{
	  long marker = ftell(in);

	  printf("   name: ");
	  print_symbol(in);
  printf("\n\n");

  long total = ftell(in) - marker;

  if (total != size)
  {
    printf("Error: Bad archive members size %ld vs %d.\n", total, size);
    return -1;
  }

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0x10c0
movq %rax, %r15
leaq 0x2983(%rip), %rdi      # 0x4481
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x1090
movq %r14, %rdi
callq 0x1766
leaq 0x3d06(%rip), %rdi      # 0x581c
callq 0x1060
movq %r14, %rdi
callq 0x10c0
subq %r15, %rax
movl %ebx, %ecx
cmpq %rcx, %rax
je 0x1b43
leaq 0x28d9(%rip), %rdi      # 0x440d
movq %rax, %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1090
pushq $-0x1
popq %rbp
movl %ebp, %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/print_lib.c
// Function: print_raw
int print_raw(FILE *in, long offset, uint32_t size)
{
  long marker = ftell(in);
  fseek(in, offset, SEEK_SET);
  int n, i;

  uint8_t data[16];
  int total = 0;

  for (n = 0; n < size; n += 16)
  {
    int length = fread(data, 1, 16, in);
    printf("  %06x: ", n);

    total += length;
    if (total > size) { length -= total - size; }

    for (i = 0; i < length; i++)
    {
      printf("%02x ", data[i]);
    }

    for (i = length; i < 16; i++) { printf("   "); }

    for (i = 0; i < length; i++)
    {
      printf("%c", data[i] >= 32 && data[i] < 126 ? data[i] : '.');
    }

    printf("\n");
  }

  printf("\n");

  fseek(in, marker, SEEK_SET);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x10c0
movq %rax, 0x18(%rsp)
movq %rbx, 0x10(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x10f0
leaq 0x296d(%rip), %r15      # 0x44f6
pushq $0x2e
popq %rbx
leaq 0x2947(%rip), %r13      # 0x44da
xorl %r14d, %r14d
movl $0x0, 0x4(%rsp)
movl %ebp, 0x8(%rsp)
cmpl %ebp, %r14d
jae 0x1c6e
leaq 0x20(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x10
popq %rdx
movq 0x10(%rsp), %rcx
callq 0x1070
movq %rax, %r12
leaq 0x2907(%rip), %rdi      # 0x44d1
movl %r14d, 0xc(%rsp)
movl %r14d, %esi
xorl %eax, %eax
callq 0x1090
movl 0x4(%rsp), %eax
addl %r12d, %eax
movl %eax, 0x4(%rsp)
subl %ebp, %eax
movl $0x0, %ecx
cmovbl %ecx, %eax
subl %eax, %r12d
testl %r12d, %r12d
movl $0x0, %ebp
cmovgl %r12d, %ebp
xorl %r14d, %r14d
cmpq %r14, %rbp
je 0x1c1a
movzbl 0x20(%rsp,%r14), %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x1090
incq %r14
jmp 0x1c00
movl 0xc(%rsp), %r14d
cmpl $0x10, %r12d
jge 0x1c34
movq %r15, %rdi
xorl %eax, %eax
callq 0x1090
incl %r12d
jmp 0x1c1f
xorl %r12d, %r12d
cmpq %r12, %rbp
je 0x1c59
movzbl 0x20(%rsp,%r12), %eax
leal -0x20(%rax), %ecx
cmpb $0x5e, %cl
jb 0x1c4c
movl %ebx, %eax
movzbl %al, %edi
callq 0x1040
incq %r12
jmp 0x1c37
pushq $0xa
popq %rdi
callq 0x1040
addl $0x10, %r14d
movl 0x8(%rsp), %ebp
jmp 0x1ba2
pushq $0xa
popq %rdi
callq 0x1040
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
xorl %edx, %edx
callq 0x10f0
xorl %eax, %eax
addq $0x38, %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/print_lib.c
// Function: print_section
int print_section(FILE *in, uint32_t size)
{
  struct coff_header_t coff_header;
  struct coff_optional_header_t optional_header;
  struct coff_section_header_t section_header;
  long marker = ftell(in);
  int n;

  int result = read_coff_header(in, &coff_header);

  if (result != 0)
  {
    return result;
  }

  print_coff_header(&coff_header);

  if (coff_header.optional_header_size != 0)
  {
    read_coff_optional_header(in, &optional_header);
    print_coff_optional_header(&optional_header);
  }

  for (n = 0; n < coff_header.section_count; n++)
  {
    read_coff_section_header(in, &section_header);
    print_coff_section_header(&section_header);
    print_raw(in, marker + section_header.file_offset_section_data, section_header.size);
  }

#if 0
  long total = ftell(in) - marker;

  if (total != size)
  {
    printf("Error: Bad archive members size %ld vs %d.\n", total, size);
    return -1;
  }
#endif

  fseek(in, marker + size, SEEK_SET);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movl %esi, %ebp
movq %rdi, %rbx
callq 0x10c0
movq %rax, %r14
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1347
movl %eax, %r15d
testl %eax, %eax
jne 0x1d43
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x156c
cmpw $0x0, 0x18(%r15)
je 0x1cf5
leaq 0x58(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x13c1
movq %r15, %rdi
callq 0x1605
movzwl 0x12(%rsp), %r12d
leaq 0x28(%rsp), %r15
subl $0x1, %r12d
jb 0x1d2e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1437
movq %r15, %rdi
callq 0x16ad
movl 0x40(%rsp), %edx
movl 0x44(%rsp), %esi
addq %r14, %rsi
movq %rbx, %rdi
callq 0x1b50
jmp 0x1d00
movl %ebp, %eax
addq %rax, %r14
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x10f0
movl %r15d, %eax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: main
int main(int argc, char *argv[])
{
  FILE *in;

  printf("\nprint_lib (March 24, 2023)\n");
  printf("Copyright 2023 - Michael Kohn  http://www.mikekohn.net/\n\n");

  if (argc != 2)
  {
    printf("Usage: print_lib <filename>\n");
    exit(0);
  }

  in = fopen(argv[1], "rb");

  if (in == NULL)
  {
    printf("Could not open input file %s for reading.\n", argv[1]);
    exit(1);
  }

  read_lib(in);

  fclose(in);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x26b7(%rip), %rdi      # 0x45ae
callq 0x1060
leaq 0x26c7(%rip), %rdi      # 0x45ca
callq 0x1060
cmpl $0x2, %ebp
jne 0x1f3c
movq 0x8(%rbx), %rdi
leaq 0x2604(%rip), %rsi      # 0x451c
callq 0x1100
testq %rax, %rax
je 0x1f4f
movq %rax, %r14
movq %rax, %rdi
callq 0x1d56
movq %r14, %rdi
callq 0x1080
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x26c0(%rip), %rdi      # 0x4603
callq 0x1060
xorl %edi, %edi
callq 0x1130
movq 0x8(%rbx), %rsi
leaq 0x25c5(%rip), %rdi      # 0x451f
xorl %eax, %eax
callq 0x1090
pushq $0x1
popq %rdi
callq 0x1130
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/demangle.c
// Function: demangle
int demangle(const char *name, char *demangled, int length)
{
  if (name[0] != '?')
  {
    snprintf(demangled, length, "%s", name);
    return -1;
  }

  char temp[length];
  char params[length];
  char return_type[length];

  temp[0] = 0;
  params[0] = 0;
  return_type[0] = 0;

  int offset = demangle_name(name + 1, temp, params, return_type, 0, length);
  demangled[length - 1] = 0;
  if (offset < length) { demangled[offset] = 0; }

  snprintf(demangled, length, "%s %s%s", return_type, temp, params);

  return offset;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %r8
movq %rdi, %rcx
cmpb $0x3f, (%rdi)
jne 0x2014
movq %rsp, -0x30(%rbp)
movl %r14d, %eax
movq %rsp, %r15
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
movq %rsp, %r12
subq %rax, %r12
movq %r12, %rsp
movq %rsp, %r13
subq %rax, %r13
movq %r13, %rsp
xorl %eax, %eax
movb %al, (%r15)
movb %al, (%r12)
movb %al, (%r13)
incq %rcx
movq %rcx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %r8, %rbx
movl %r14d, %r8d
callq 0x203c
movq %rbx, %rdi
movl %eax, %ebx
movslq %r14d, %rsi
xorl %eax, %eax
movb %al, -0x1(%rdi,%rsi)
cmpl %r14d, %ebx
jge 0x1ff7
movslq %ebx, %rax
movb $0x0, (%rdi,%rax)
leaq 0x26de(%rip), %rdx      # 0x46dc
movq %r13, %rcx
movq %r15, %r8
movq %r12, %r9
xorl %eax, %eax
callq 0x10a0
movq -0x30(%rbp), %rsp
jmp 0x202b
movslq %r14d, %rsi
leaq 0x26c3(%rip), %rdx      # 0x46e1
movq %r8, %rdi
xorl %eax, %eax
callq 0x10a0
pushq $-0x1
popq %rbx
movl %ebx, %eax
leaq -0x28(%rbp), %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/demangle.c
// Function: demangle_insert_name
static int demangle_insert_name(
  const char *name,
  char *demangled,
  int offset,
  int length)
{
  while (offset < length)
  {
    if (*name == 0 || *name == '@') { break; }

    if (*name == '?')
    {
      switch (name[1])
      {
        case '0': break;
        case '1': demangled[offset++] = '~'; break;
        case '2':
          offset = demangle_append("operator new ", demangled, offset, length);
          break;
        case '3':
          offset = demangle_append("operator delete ", demangled, offset, length);
          break;
        // FIXME: Add the rest of these.
        default: break;
      }

      name += 2;
      continue;
    }

    demangled[offset++] = *name;
    name++;
  }

  if (offset < length) { demangled[offset] = 0; }

  return offset;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %eax
movq %rsi, %r14
movq %rdi, %r15
pushq $0x2
popq %rbp
leaq 0x23f5(%rip), %r13      # 0x46e4
pushq $0x1
popq %r12
cmpl %ebx, %eax
jge 0x2359
movzbl (%r15), %edx
movslq %eax, %rcx
cmpl $0x3f, %edx
je 0x2317
testl %edx, %edx
je 0x2354
cmpl $0x40, %edx
je 0x2354
incl %eax
movb %dl, (%r14,%rcx)
movq %r12, %rcx
jmp 0x234f
movzbl 0x1(%r15), %edx
cmpl $0x33, %edx
je 0x2339
cmpl $0x32, %edx
je 0x2334
cmpl $0x31, %edx
jne 0x234c
incl %eax
movb $0x7e, (%r14,%rcx)
jmp 0x234c
movq %r13, %rdi
jmp 0x2340
leaq 0x23b2(%rip), %rdi      # 0x46f2
movq %r14, %rsi
movl %eax, %edx
movl %ebx, %ecx
callq 0x2368
movq %rbp, %rcx
addq %rcx, %r15
jmp 0x22f3
movb $0x0, (%r14,%rcx)
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/demangle.c
// Function: demangle_append
static int demangle_append(
  const char *name,
  char *demangled,
  int offset,
  int length)
{
  while (*name != 0)
  {
    if (offset >= length -1) { return offset; }
    demangled[offset++] = *name;
    name++;
  }

  return offset;
}

// Assembly:
decl %ecx
movslq %edx, %rax
movslq %ecx, %rcx
movb (%rdi), %dl
testb %dl, %dl
je 0x2386
cmpq %rcx, %rax
jge 0x2386
movb %dl, (%rsi,%rax)
incq %rax
incq %rdi
jmp 0x2370
retq
nop
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/fileio.c
// Function: read_chars
int read_chars(FILE *in, char *s, int count)
{
  int t;

  for (t = 0; t < count; t++)
  {
    s[t] = getc(in);
  }

  s[t] = 0;

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
testl %edx, %edx
cmovlel %r12d, %ebx
cmpq %r12, %rbx
je 0x24b9
movq %r15, %rdi
callq 0x1150
movb %al, (%r14,%r12)
incq %r12
jmp 0x24a3
movb $0x0, (%r14,%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/fileio.c
// Function: read_chars_bin
int read_chars_bin(FILE *in, uint8_t *s, int count)
{
  int t;

  for (t = 0; t < count; t++)
  {
    s[t] = getc(in);
  }

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
testl %edx, %edx
cmovlel %r12d, %ebx
cmpq %r12, %rbx
je 0x24fb
movq %r15, %rdi
callq 0x1150
movb %al, (%r14,%r12)
incq %r12
jmp 0x24e5
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/fileio.c
// Function: print_string
int print_string(FILE *in, int addr)
{
  int marker;
  int ch;

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

  while (1)
  {
    ch = getc(in);
    if (ch == EOF || ch == 0) { break; }

    printf("%c",ch);
  }

  fseek(in, marker, SEEK_SET);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0x10c0
movq %rax, %r14
movslq %ebp, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10f0
movq %rbx, %rdi
callq 0x1150
leal 0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0x25a3
movl %eax, %edi
callq 0x1040
jmp 0x258a
movslq %r14d, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10f0
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/fileio.c
// Function: get_string
int get_string(FILE *in, char *s, int addr)
{
  int marker;
  int ch;
  int t;

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

  t = 0;

  while (1)
  {
    ch = getc(in);
    if (ch == EOF || ch == 0) { break; }

    s[t++] = ch;
  }

  s[t] = 0;

  fseek(in, marker, SEEK_SET);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x10c0
movq %rax, %r15
movslq %ebp, %rsi
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10f0
movq %rbx, %rdi
callq 0x1150
leal 0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0x25f8
movb %al, (%r14,%r12)
incq %r12
jmp 0x25df
movl %r12d, %eax
movb $0x0, (%r14,%rax)
movslq %r15d, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10f0
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/fileio.c
// Function: get_ptr
int get_ptr(FILE *in, int addr)
{
  int marker;
  int i;

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

  i = read_uint32(in);

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
callq 0x10c0
movq %rax, %r15
movslq %ebx, %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x10f0
movq %r14, %rdi
callq 0x2422
movl %eax, %ebx
movslq %r15d, %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x10f0
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/pdb.c
// Function: read_pdb_header
int read_pdb_header(struct pdb_header_t *pdb_header, FILE *in)
{
  uint8_t magic_2[] = { 0x1a, 0x44, 0x53, 0x00, 0x00, 0x00 };
  int n;

  for (n = 0; n < sizeof(pdb_header->magic); n++)
  {
    pdb_header->magic[n] = getc(in);

    if (pdb_header->magic[n] == '\r') { pdb_header->magic[n] = 0; }
    if (pdb_header->magic[n] == '\n') { break; }
  }

  if (n == sizeof(pdb_header->magic)) { return -1; }

  for (n = 0; n < 6; n++)
  {
    pdb_header->magic_2[n] = getc(in);
    if (pdb_header->magic_2[n] != magic_2[n]) { return -1; }
  }

  pdb_header->block_size = read_uint32(in);
  pdb_header->free_block_map = read_uint32(in);
  pdb_header->number_of_blocks = read_uint32(in);
  pdb_header->number_of_dir_bytes = read_uint32(in);
  pdb_header->reserved = read_uint32(in);
  pdb_header->block_map_address = read_uint32(in);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
xorl %r15d, %r15d
pushq $-0x1
popq %rbp
xorl %r12d, %r12d
cmpq $0x50, %r12
je 0x273d
movq %r14, %rdi
callq 0x1150
cmpb $0xd, %al
cmovel %r15d, %eax
movb %al, (%rbx,%r12)
incq %r12
cmpb $0xa, %al
jne 0x26ab
xorl %r15d, %r15d
leaq 0x2150(%rip), %r12      # 0x4828
movq %r14, %rdi
cmpq $0x6, %r15
je 0x26fc
callq 0x1150
movb %al, 0x50(%rbx,%r15)
movsbl %al, %eax
movzbl (%r15,%r12), %ecx
incq %r15
cmpl %ecx, %eax
je 0x26d8
jmp 0x273d
callq 0x2422
movl %eax, 0x58(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x5c(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x60(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x64(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x68(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x6c(%rbx)
xorl %ebp, %ebp
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/pdb.c
// Function: read_pdb_names
int read_pdb_names(
  struct pdb_dir_t *pdb_dir,
  struct pdb_header_t *pdb_header,
  FILE *in)
{
  const int index = pdb_dir->names_index;
  const int length = pdb_dir->stream_sizes[index];

  if (index == 0)
  {
    printf("Error: No /names stream found.\n");
    return -1;
  }

  read_data(pdb_dir, index, pdb_header->block_size, in);
  pdb_dir->names = (uint8_t *)malloc(length);
  memcpy(pdb_dir->names, pdb_dir->heap, length);

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movslq 0x28(%rdi), %rsi
testq %rsi, %rsi
je 0x2976
movq %rdx, %rcx
movq %rdi, %rbx
movq 0x8(%rdi), %rdx
movslq (%rdx,%rsi,4), %r14
movl 0x58(%rax), %edx
callq 0x298d
movq %r14, %rdi
callq 0x10e0
movq %rax, 0x20(%rbx)
movq 0x18(%rbx), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x10d0
xorl %eax, %eax
jmp 0x2985
leaq 0x2ee7(%rip), %rdi      # 0x5864
callq 0x1060
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/pdb.c
// Function: read_data
static void read_data(
  struct pdb_dir_t *pdb_dir,
  int index,
  int block_size,
  FILE *in)
{
  long marker = ftell(in);
  uint32_t *blocks = get_blocks(pdb_dir, index);
  int block_count = calc_block_count(pdb_dir->stream_sizes[index]);
  int n, offset = 0, length;

  for (n = 0; n < block_count; n++)
  {
    fseek(in, *blocks * block_size, SEEK_SET);
    length = fread(pdb_dir->heap + offset, 4096, 1, in);

    if (length == 0) { printf("Error: fread() 0 bytes.\n"); }

    offset += 4096;
    blocks++;
  }

  fseek(in, marker, SEEK_SET);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %edx, 0xc(%rsp)
movl %esi, %r12d
movq %rdi, %r14
movq %rcx, %rdi
callq 0x10c0
movq %rax, 0x10(%rsp)
xorl %eax, %eax
testl %r12d, %r12d
movl $0x0, %ecx
cmovgl %r12d, %ecx
movl $0xfff, %edx            # imm = 0xFFF
xorl %esi, %esi
cmpq %rax, %rcx
je 0x29e2
movq 0x8(%r14), %rdi
movl (%rdi,%rax,4), %edi
addl %edx, %edi
shrl $0xc, %edi
addl %edi, %esi
incq %rax
jmp 0x29ca
movl %esi, %r15d
shlq $0x2, %r15
addq 0x10(%r14), %r15
movq 0x8(%r14), %rax
movslq %r12d, %rcx
movl $0xfff, %r13d           # imm = 0xFFF
addl (%rax,%rcx,4), %r13d
shrl $0xc, %r13d
xorl %r12d, %r12d
xorl %ebp, %ebp
cmpl %r12d, %r13d
je 0x2a52
movl (%r15,%r12,4), %esi
imull 0xc(%rsp), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10f0
movq 0x18(%r14), %rdi
addq %rbp, %rdi
movl $0x1000, %esi           # imm = 0x1000
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x1070
testl %eax, %eax
jne 0x2a46
leaq 0x2e42(%rip), %rdi      # 0x5883
callq 0x1060
addq $0x1000, %rbp           # imm = 0x1000
incq %r12
jmp 0x2a07
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10f0
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/pdb.c
// Function: print_pdb_header
void print_pdb_header(struct pdb_header_t *pdb_header)
{
  printf(" -------- PDB header -------\n");
  printf("              magic: %s\n", pdb_header->magic);
  printf("             magic2: %02x %02x %02x %02x %02x %02x\n",
    pdb_header->magic_2[0],
    pdb_header->magic_2[1],
    pdb_header->magic_2[2],
    pdb_header->magic_2[3],
    pdb_header->magic_2[4],
    pdb_header->magic_2[5]);
  printf("         block_size: %d\n", pdb_header->block_size);
  printf("     free_block_map: %d\n", pdb_header->free_block_map);
  printf("         num_blocks: %d\n", pdb_header->number_of_blocks);
  printf("      num_dir_bytes: %d\n", pdb_header->number_of_dir_bytes);
  printf("           reserved: %d\n", pdb_header->reserved);
  printf("  block_map_address: %d\n", pdb_header->block_map_address);
  printf("\n");
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x2e1d(%rip), %rdi      # 0x589b
callq 0x1060
leaq 0x1da4(%rip), %rdi      # 0x482e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1090
movsbl 0x50(%rbx), %esi
movsbl 0x51(%rbx), %edx
movsbl 0x52(%rbx), %ecx
movsbl 0x53(%rbx), %r8d
movsbl 0x54(%rbx), %r9d
movsbl 0x55(%rbx), %eax
movl %eax, (%rsp)
leaq 0x1d8f(%rip), %rdi      # 0x4847
xorl %eax, %eax
callq 0x1090
movl 0x58(%rbx), %esi
leaq 0x1db2(%rip), %rdi      # 0x487b
xorl %eax, %eax
callq 0x1090
movl 0x5c(%rbx), %esi
leaq 0x1dba(%rip), %rdi      # 0x4894
xorl %eax, %eax
callq 0x1090
movl 0x60(%rbx), %esi
leaq 0x1dc2(%rip), %rdi      # 0x48ad
xorl %eax, %eax
callq 0x1090
movl 0x64(%rbx), %esi
leaq 0x1dca(%rip), %rdi      # 0x48c6
xorl %eax, %eax
callq 0x1090
movl 0x68(%rbx), %esi
leaq 0x1dd2(%rip), %rdi      # 0x48df
xorl %eax, %eax
callq 0x1090
movl 0x6c(%rbx), %esi
leaq 0x1dda(%rip), %rdi      # 0x48f8
xorl %eax, %eax
callq 0x1090
pushq $0xa
popq %rdi
addq $0x10, %rsp
popq %rbx
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/pdb.c
// Function: print_pdb_dir
void print_pdb_dir(struct pdb_dir_t *pdb_dir)
{
  int ptr = 0;
  int n, i;

  printf(" -- PDB Directory --\n");
  printf("   stream_count: %d\n", pdb_dir->stream_count);
  printf("  stream_blocks:\n");

  for (n = 0; n < pdb_dir->stream_count; n++)
  {
    int count = calc_block_count(pdb_dir->stream_sizes[n]);

    printf("    %d: %6d {", n, pdb_dir->stream_sizes[n]);

    for (i = 0; i < count; i++)
    {
      printf(" %d", pdb_dir->stream_blocks[ptr++]);
    }

    printf(" }\n");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x2d71(%rip), %rdi      # 0x58b8
callq 0x1060
movl (%rbx), %esi
leaq 0x1dbc(%rip), %rdi      # 0x4911
xorl %eax, %eax
callq 0x1090
leaq 0x2d6a(%rip), %rdi      # 0x58cd
callq 0x1060
leaq 0x1dc5(%rip), %r12      # 0x4934
xorl %r13d, %r13d
xorl %ebp, %ebp
movl (%rbx), %eax
cmpq %rax, %r13
jae 0x2bd8
movq 0x8(%rbx), %rax
movl (%rax,%r13,4), %edx
leal 0xfff(%rdx), %r15d
shrl $0xc, %r15d
leaq 0x1d91(%rip), %rdi      # 0x4926
movl %r13d, %esi
xorl %eax, %eax
callq 0x1090
movslq %ebp, %r14
movl %r15d, %ebp
addl %r14d, %ebp
movslq %ebp, %r15
cmpq %r14, %r15
je 0x2bc7
movq 0x10(%rbx), %rax
movl (%rax,%r14,4), %esi
incq %r14
movq %r12, %rdi
xorl %eax, %eax
callq 0x1090
jmp 0x2bab
leaq 0x2ddc(%rip), %rdi      # 0x59aa
callq 0x1060
incq %r13
jmp 0x2b74
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/pdb.c
// Function: dump_pdb_stream
void dump_pdb_stream(
  struct pdb_dir_t *pdb_dir,
  struct pdb_header_t *pdb_header,
  FILE *in,
  int index,
  const char *filename)
{
  read_data(pdb_dir, index, pdb_header->block_size, in);

  uint8_t *data = pdb_dir->heap;

  FILE *fp = fopen(filename, "wb");
  fwrite(data, pdb_dir->stream_sizes[index], 1, fp);
  fclose(fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %ebp
movq %rdx, %rcx
movq %rdi, %r14
movl 0x58(%rsi), %edx
movl %ebp, %esi
callq 0x298d
movq 0x18(%r14), %r15
leaq 0x19e4(%rip), %rsi      # 0x5861
movq %rbx, %rdi
callq 0x1100
movq %rax, %rbx
movq 0x8(%r14), %rax
movslq %ebp, %rcx
movl (%rax,%rcx,4), %esi
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x1140
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1080
// File: /workspace/github_c_makefile_star2_O2/cirocosta[P]stress/src/file-watcher.c
// Function: main
int
main(int argc, char** argv)
{
	stress_args_t args = { 0 };
	int fd;

	setbuf(stdout, NULL);
	stress_parse_args(argc, argv, &args);

	_STRESS_MUST_P((fd = inotify_init()) >= 0,
	               "inotify_init",
	               "couldn't initialize inotify");

	create_files_and_watch(args.n, fd);
	stress_wait_until_signalized();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x2010, %rsp           # imm = 0x2010
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x8(%rsp), %r14
movl $0x2008, %edx           # imm = 0x2008
movq %r14, %rdi
xorl %esi, %esi
callq 0x10e0
movq 0x22da(%rip), %rax      # 0x3fc8
movq (%rax), %rdi
xorl %esi, %esi
callq 0x10c0
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x132d
callq 0x1130
testl %eax, %eax
js 0x1d30
movl 0x8(%rsp), %edi
movl %eax, %esi
callq 0x18a9
callq 0x15fe
xorl %eax, %eax
addq $0x2010, %rsp           # imm = 0x2010
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x22c1(%rip), %r12      # 0x3ff8
movq (%r12), %rcx
leaq 0x47a(%rip), %rdi       # 0x21bc
pushq $0x9
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x11b0
movq (%r12), %rcx
leaq 0x467(%rip), %r14       # 0x21c2
pushq $0x3
popq %r15
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x11b0
movq (%r12), %rcx
leaq 0x509(%rip), %rdi       # 0x2281
pushq $0x1b
popq %rsi
movq %rbx, %rdx
callq 0x11b0
movq (%r12), %rcx
leaq 0x2c4(%rip), %rdi       # 0x2052
pushq $0x2
popq %rsi
movq %rbx, %rdx
callq 0x11b0
movq (%r12), %rdi
leaq 0x2b1(%rip), %rsi       # 0x2055
leaq 0x38d(%rip), %rdx       # 0x2138
xorl %eax, %eax
callq 0x1110
movq (%r12), %rdi
leaq 0x2b4(%rip), %rsi       # 0x2071
pushq $0x56
popq %rdx
xorl %eax, %eax
callq 0x1110
movq (%r12), %rsi
pushq $0xa
popq %rdi
callq 0x10f0
movq (%r12), %rcx
leaq 0x3d7(%rip), %rdi       # 0x21b5
pushq $0x10
popq %rsi
movq %rbx, %rdx
callq 0x11b0
leaq 0x4ad(%rip), %rdi       # 0x229d
callq 0x1170
movq (%r12), %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x11b0
movq (%r12), %rcx
leaq 0x26c(%rip), %rdi       # 0x207e
pushq $0xa
popq %rsi
movq %rbx, %rdx
callq 0x11b0
pushq $0x1
popq %rdi
callq 0x11a0
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/1105.c
// Function: main
int
xmain(int argc, char *argv[])
{
	memset(&cpu, 0, sizeof(KD11B));
	memset(&bus, 0, sizeof(Bus));
	cpu.bus = &bus;
	busadddev(&bus, &membusdev);
	busadddev(&bus, &kebusdev);

	ARGBEGIN{
	}ARGEND;

	if(argc < 0)
		usage();

	loadmem("mem.txt");

	reset(&cpu);

	ttyopen(&cpu.tty);

#ifdef AUTODIAG
	if(rundiag(&cpu, "maindec/ZKAAA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKABA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKACA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKADA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKAEA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKAFA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKAGA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKAHA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKAIA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKAJA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKAKA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKALA0.BIN")) return 0;
	if(rundiag(&cpu, "maindec/ZKAMA0.BIN")) return 0;
//	if(rundiag(&cpu, "maindec/maindec-11-d0nc.pb.bin")) return 0;
	printf("passed all diagnostics\n");
		return 0;
#endif

	cpu.r[7] = 0200;
//	cpu.sw = 0104000;
	run(&cpu);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebx
leaq 0xba6f(%rip), %rdi      # 0xd1e0
movl $0xe8, %edx
xorl %esi, %esi
callq 0x10e0
andq $0x0, 0xbb53(%rip)      # 0xd2d8
xorps %xmm0, %xmm0
movups %xmm0, 0xbb39(%rip)     # 0xd2c8
leaq 0xbb32(%rip), %r15      # 0xd2c8
movq %r15, 0xba6b(%rip)      # 0xd208
leaq 0x5994(%rip), %rsi      # 0x7138
movq %r15, %rdi
callq 0x132c
leaq 0x59c5(%rip), %rsi      # 0x7178
movq %r15, %rdi
callq 0x132c
cmpq $0x0, 0xba15(%rip)      # 0xd1d8
jne 0x17cf
movq (%r14), %rax
movq %rax, 0xba09(%rip)      # 0xd1d8
addq $0x8, %r14
addl $-0x2, %ebx
movq (%r14), %rax
testq %rax, %rax
je 0x1800
cmpb $0x2d, (%rax)
jne 0x1800
movzbl 0x1(%rax), %ecx
cmpl $0x2d, %ecx
je 0x17f2
testl %ecx, %ecx
jne 0x17f8
jmp 0x1800
cmpb $0x0, 0x2(%rax)
je 0x1802
addq $0x8, %r14
decl %ebx
jmp 0x17d6
incl %ebx
testl %ebx, %ebx
js 0x1846
leaq 0x2820(%rip), %rdi      # 0x402d
callq 0x13e7
leaq 0xb9c7(%rip), %rbx      # 0xd1e0
movq %rbx, %rdi
callq 0x1918
leaq 0xba74(%rip), %rdi      # 0xd29c
callq 0x3965
movw $0x80, 0xb9b8(%rip)     # 0xd1ee
movq %rbx, %rdi
callq 0x2f8d
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
callq 0x1739
nop
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/kd11b.c
// Function: fetchop
static int
fetchop(KD11B *cpu, int t, int m, int b, int pse)
{
	int r;
	r = m&7;
	if((m&070) == 0)
		cpu->r[t] = cpu->r[r];
	else{
		if(dati(cpu, b, pse)) return 1;
		cpu->r[t] = cpu->bus->data;
		if(b && cpu->ba&1) cpu->r[t] = cpu->r[t]>>8;
	}
	if(b) cpu->r[t] = sxt(cpu->r[t]);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
testb $0x38, %dl
je 0x2ed1
movq %rbx, %rdi
movl %ebp, %esi
movl %r8d, %edx
callq 0x196a
testl %eax, %eax
je 0x2ee6
pushq $0x1
popq %rax
jmp 0x2f1a
andl $0x7, %edx
movzwl (%rbx,%rdx,2), %eax
movl %r14d, %r14d
movw %ax, (%rbx,%r14,2)
testl %ebp, %ebp
jne 0x2f0b
jmp 0x2f18
movq 0x28(%rbx), %rax
movzwl 0xc(%rax), %eax
movl %r14d, %r14d
movw %ax, (%rbx,%r14,2)
testl %ebp, %ebp
je 0x2f18
testb $0x1, 0x22(%rbx)
je 0x2f0b
movzwl %ax, %eax
shrl $0x8, %eax
movw %ax, (%rbx,%r14,2)
movzbl %al, %edi
callq 0x13e2
movw %ax, (%rbx,%r14,2)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/GangZhuo[P]rbtree/test/asc16.c
// Function: asc16_load
int asc16_load(asc16_t *asc16, const char *filename)
{
	FILE *pf;
	int size;

	pf = fopen(filename, "rb");
	if (pf == NULL)
		return -1;

	size = file_readall(pf, &asc16->data);
	
	fclose(pf);

	if (size == -1)
		return -1;

	asc16->size = size;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x263e(%rip), %rsi      # 0x4004
movq %rax, %rdi
callq 0x1160
testq %rax, %rax
je 0x1a17
movq %rax, %r14
movq %rax, %rdi
callq 0x1100
movq %rax, %r12
pushq $-0x1
popq %r13
movl %r13d, %ebp
cmpl $-0x1, %r12d
je 0x1a02
pushq $0x2
popq %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x1140
movl %r13d, %ebp
testl %eax, %eax
je 0x1a2d
movq %r14, %rdi
callq 0x1090
cmpl $-0x1, %ebp
je 0x1a1b
movl %ebp, 0x8(%rbx)
xorl %r13d, %r13d
jmp 0x1a1b
pushq $-0x1
popq %r13
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x1100
movq %rax, %r15
movl %r13d, %ebp
cmpl $-0x1, %r15d
je 0x1a02
movslq %r12d, %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x1140
movl %r13d, %ebp
testl %eax, %eax
jne 0x1a02
movslq %r15d, %r12
movq %r12, %rdi
callq 0x1110
movl %r13d, %ebp
testq %rax, %rax
je 0x1a02
pushq $0x1
popq %rsi
movq %rax, %rbp
movq %rax, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0x1080
cmpq %r12, %rax
jne 0x1a8c
movq %rbp, (%rbx)
movl %r15d, %ebp
jmp 0x1a02
movq %rbp, %rdi
callq 0x1030
movl %r13d, %ebp
jmp 0x1a02
// File: /workspace/github_c_makefile_star2_O2/GangZhuo[P]rbtree/test/asc16.c
// Function: asc16_gylph_print
void asc16_gylph_print(char *d)
{
	int i, j;
	for (j = 0; j < ASC16_GYLPH_HEIGHT; j++, d++) {
		for (i = 0; i < ASC16_GYLPH_WIDTH; i++) {
			if (asc16_is_setpixel(d, i))
				printf("*");
			else
				printf(" ");
		}
		printf("\n");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r15d, %r15d
pushq $0xa
popq %rbp
pushq $0x20
popq %r12
pushq $0x2a
popq %r13
cmpl $0x10, %r15d
je 0x1af2
xorl %r14d, %r14d
cmpl $0x8, %r14d
je 0x1ae3
movzbl (%rbx), %eax
movl %r14d, %ecx
shll %cl, %eax
movl %r12d, %edi
testb %al, %al
jns 0x1ad9
movl %r13d, %edi
callq 0x1040
incl %r14d
jmp 0x1ac1
movl %ebp, %edi
callq 0x1040
incl %r15d
incq %rbx
jmp 0x1ab8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/GangZhuo[P]rbtree/test/bitmap.c
// Function: free_draw_state
static void free_draw_state(draw_state_t *st)
{
	dlitem_t *curr, *next;
	rbnil_t *nil;

	if (st) {
		free(st->rows);
		dllist_foreach(&st->nils, curr, next, rbnil_t, nil, dlentry) {
			dllist_remove(curr);
			if (rbnode_is_left(&nil->base.rbentry))
				nil->base.rbentry.parent->left = rbnode_nil;
			else if (rbnode_is_right(&nil->base.rbentry))
				nil->base.rbentry.parent->right = rbnode_nil;
			free_nil(nil);
		}
	}
}

// Assembly:
testq %rdi, %rdi
je 0x2131
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
callq 0x1030
movq 0x30(%rbx), %rax
addq $0x30, %rbx
cmpq %rbx, %rax
je 0x212a
leaq -0x40(%rax), %rdi
movq (%rax), %r14
movq 0x8(%rax), %rcx
movq %r14, (%rcx)
movq (%rax), %rdx
movq %rcx, 0x8(%rdx)
movq -0x20(%rax), %rax
cmpq %rdi, 0x10(%rax)
je 0x2118
cmpq %rdi, 0x18(%rax)
jne 0x2120
addq $0x18, %rax
jmp 0x211c
addq $0x10, %rax
andq $0x0, (%rax)
callq 0x1030
movq %r14, %rax
jmp 0x20e8
addq $0x8, %rsp
popq %rbx
popq %r14
retq