// File: /workspace/github_c_makefile_star2_O0/mikeakohn[P]print_pe/build/../src/file_header.c
// Function: file_header_print
int file_header_print(struct file_header_t *file_header)
{
  printf("---------------------------------------------\n");
  printf("Image File Header\n");
  printf("---------------------------------------------\n");

  const char *machine;

  switch (file_header->Machine)
  {
    case 0x14c: machine = "i386"; break;
    case 0x14d: machine = "i486"; break;
    case 0x14e: machine = "i586"; break;
    case 0x160: machine = "MIPS R3000 Big Endian"; break;
    case 0x162: machine = "MIPS R3000 Little Endian"; break;
    case 0x166: machine = "MIPS R4000 Little Endian"; break;
    case 0x168: machine = "MIPS R10000 Little Endian"; break;
    case 0x169: machine = "MIPS Little Endian WCE v2"; break;
    case 0x184: machine = "Alpha"; break;
    case 0x1a2: machine = "Hitachi SH3"; break;
    case 0x1a3: machine = "Hitachi SH3 DSP"; break;
    case 0x1a8: machine = "Hitachi SH5"; break;
    case 0x1c0: machine = "ARM Little Endian"; break;
    case 0x1c2: machine = "Thumb"; break;
    case 0x1c4: machine = "ARM Thumb-2 Little Endian"; break;
    case 0x1d3: machine = "Matsushita AM33"; break;
    case 0x1f0: machine = "PPC Little Endian"; break;
    case 0x1f1: machine = "PPC w/ FPU"; break;
    case 0x266: machine = "MIPS16"; break;
    case 0x366: machine = "MIPS w/ FPU"; break;
    case 0x466: machine = "MIPS16 w/ FPU"; break;
    case 0xebc: machine = "EFI Byte Code"; break;
    case 0x5032: machine = "RISC-V 32 bit"; break;
    case 0x5064: machine = "RISC-V 64 bit"; break;
    case 0x5128: machine = "RISC-V 128 bit"; break;
    case 0x8664: machine = "x64"; break;
    case 0xaa64: machine = "ARM64 Little Endian"; break;
    default: machine = "Unknown"; break;
  }

  printf("           Machine: 0x%04x (%s)\n", file_header->Machine, machine);
  printf("  NumberOfSections: %d\n", file_header->NumberOfSections);
  printf("     TimeDateStamp: %s", ctime((time_t *)&file_header->TimeDateStamp));
  printf("PointerToSymbolTbl: %d\n", file_header->PointerToSymbolTable);
  printf("   NumberOfSymbols: %d\n", file_header->NumberOfSymbols);
  printf(" SizeOfOptionalHdr: %d\n", file_header->SizeOfOptionalHeader);
  printf("   Characteristics: 0x%04x", file_header->Characteristics);
  if ((file_header->Characteristics & 0x0001) != 0)
  {
    printf(" (Relocations Stripped)");
  }

  if ((file_header->Characteristics & 0x0002) != 0)
  {
    printf(" (Executable Image)");
  }

  if ((file_header->Characteristics & 0x0004) != 0)
  {
    printf(" (Line Numbers Stripped)");
  }

  if ((file_header->Characteristics & 0x0008) != 0)
  {
    printf(" (File Local Symbols Stripped)");
  }

  if ((file_header->Characteristics & 0x0010) != 0)
  {
    printf(" (Agressively Trim Working Set)");
  }

  if ((file_header->Characteristics & 0x0020) != 0)
  {
    printf(" (Large Address Aware)");
  }

  if ((file_header->Characteristics & 0x0080) != 0)
  {
    printf(" (File Bytes Reversed)");
  }

  if ((file_header->Characteristics & 0x0100) != 0)
  {
    printf(" (32 Bit Machine)");
  }

  if ((file_header->Characteristics & 0x0400) != 0)
  {
    printf(" (File Removable, Run From Swap)");
  }

  if ((file_header->Characteristics & 0x0800) != 0)
  {
    printf(" (File Networked, Run From Swap)");
  }

  if ((file_header->Characteristics & 0x1000) != 0)
  {
    printf(" (File System Image)");
  }

  if ((file_header->Characteristics & 0x2000) != 0)
  {
    printf(" (Dynamic Link Library)");
  }

  if ((file_header->Characteristics & 0x4000) != 0)
  {
    printf(" (Uniprocessor Only)");
  }

  if ((file_header->Characteristics & 0x8000) != 0)
  {
    printf(" (File Bytes Reversed Hi)");
  }

  printf("\n\n");

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x48af(%rip), %rdi      # 0xa1f2
movq %rdi, -0x20(%rbp)
xorl %eax, %eax
movb %al, -0x15(%rbp)
callq 0x3080
movb -0x15(%rbp), %al
leaq 0x59ef(%rip), %rdi      # 0xb34a
callq 0x3080
movq -0x20(%rbp), %rdi
movb -0x15(%rbp), %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
movl %eax, -0x14(%rbp)
subl $0x14c, %eax            # imm = 0x14C
je 0x5b26
jmp 0x5983
movl -0x14(%rbp), %eax
subl $0x14d, %eax            # imm = 0x14D
je 0x5b36
jmp 0x5993
movl -0x14(%rbp), %eax
subl $0x14e, %eax            # imm = 0x14E
je 0x5b46
jmp 0x59a3
movl -0x14(%rbp), %eax
subl $0x160, %eax            # imm = 0x160
je 0x5b56
jmp 0x59b3
movl -0x14(%rbp), %eax
subl $0x162, %eax            # imm = 0x162
je 0x5b66
jmp 0x59c3
movl -0x14(%rbp), %eax
subl $0x166, %eax            # imm = 0x166
je 0x5b76
jmp 0x59d3
movl -0x14(%rbp), %eax
subl $0x168, %eax            # imm = 0x168
je 0x5b86
jmp 0x59e3
movl -0x14(%rbp), %eax
subl $0x169, %eax            # imm = 0x169
je 0x5b96
jmp 0x59f3
movl -0x14(%rbp), %eax
subl $0x184, %eax            # imm = 0x184
je 0x5ba6
jmp 0x5a03
movl -0x14(%rbp), %eax
subl $0x1a2, %eax            # imm = 0x1A2
je 0x5bb6
jmp 0x5a13
movl -0x14(%rbp), %eax
subl $0x1a3, %eax            # imm = 0x1A3
je 0x5bc6
jmp 0x5a23
movl -0x14(%rbp), %eax
subl $0x1a8, %eax            # imm = 0x1A8
je 0x5bd6
jmp 0x5a33
movl -0x14(%rbp), %eax
subl $0x1c0, %eax            # imm = 0x1C0
je 0x5be6
jmp 0x5a43
movl -0x14(%rbp), %eax
subl $0x1c2, %eax            # imm = 0x1C2
je 0x5bf6
jmp 0x5a53
movl -0x14(%rbp), %eax
subl $0x1c4, %eax            # imm = 0x1C4
je 0x5c06
jmp 0x5a63
movl -0x14(%rbp), %eax
subl $0x1d3, %eax            # imm = 0x1D3
je 0x5c16
jmp 0x5a73
movl -0x14(%rbp), %eax
subl $0x1f0, %eax            # imm = 0x1F0
je 0x5c26
jmp 0x5a83
movl -0x14(%rbp), %eax
subl $0x1f1, %eax            # imm = 0x1F1
je 0x5c36
jmp 0x5a93
movl -0x14(%rbp), %eax
subl $0x266, %eax            # imm = 0x266
je 0x5c46
jmp 0x5aa3
movl -0x14(%rbp), %eax
subl $0x366, %eax            # imm = 0x366
je 0x5c53
jmp 0x5ab3
movl -0x14(%rbp), %eax
subl $0x466, %eax            # imm = 0x466
je 0x5c60
jmp 0x5ac3
movl -0x14(%rbp), %eax
subl $0xebc, %eax            # imm = 0xEBC
je 0x5c6d
jmp 0x5ad3
movl -0x14(%rbp), %eax
subl $0x5032, %eax           # imm = 0x5032
je 0x5c7a
jmp 0x5ae3
movl -0x14(%rbp), %eax
subl $0x5064, %eax           # imm = 0x5064
je 0x5c87
jmp 0x5af3
movl -0x14(%rbp), %eax
subl $0x5128, %eax           # imm = 0x5128
je 0x5c94
jmp 0x5b03
movl -0x14(%rbp), %eax
subl $0x8664, %eax           # imm = 0x8664
je 0x5ca1
jmp 0x5b13
movl -0x14(%rbp), %eax
subl $0xaa64, %eax           # imm = 0xAA64
je 0x5cae
jmp 0x5cbb
leaq 0x5830(%rip), %rax      # 0xb35d
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x5825(%rip), %rax      # 0xb362
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x581a(%rip), %rax      # 0xb367
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x580f(%rip), %rax      # 0xb36c
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x5815(%rip), %rax      # 0xb382
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x581e(%rip), %rax      # 0xb39b
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x5827(%rip), %rax      # 0xb3b4
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x5831(%rip), %rax      # 0xb3ce
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x583b(%rip), %rax      # 0xb3e8
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x5831(%rip), %rax      # 0xb3ee
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x582d(%rip), %rax      # 0xb3fa
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x582d(%rip), %rax      # 0xb40a
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x5829(%rip), %rax      # 0xb416
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x582b(%rip), %rax      # 0xb428
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x5821(%rip), %rax      # 0xb42e
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x582b(%rip), %rax      # 0xb448
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x582b(%rip), %rax      # 0xb458
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x582d(%rip), %rax      # 0xb46a
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x5828(%rip), %rax      # 0xb475
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x5822(%rip), %rax      # 0xb47c
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x5821(%rip), %rax      # 0xb488
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x5822(%rip), %rax      # 0xb496
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x5823(%rip), %rax      # 0xb4a4
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x5824(%rip), %rax      # 0xb4b2
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x5825(%rip), %rax      # 0xb4c0
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x5827(%rip), %rax      # 0xb4cf
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x581e(%rip), %rax      # 0xb4d3
movq %rax, -0x10(%rbp)
jmp 0x5cc6
leaq 0x4ffc(%rip), %rax      # 0xacbe
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzwl (%rax), %esi
movq -0x10(%rbp), %rdx
leaq 0x580f(%rip), %rdi      # 0xb4e7
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl 0x2(%rax), %esi
leaq 0x581a(%rip), %rdi      # 0xb508
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rdi
addq $0x4, %rdi
callq 0x3070
movq %rax, %rsi
leaq 0x504c(%rip), %rdi      # 0xad58
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movl 0x8(%rax), %esi
leaq 0x57ff(%rip), %rdi      # 0xb520
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movl 0xc(%rax), %esi
leaq 0x5802(%rip), %rdi      # 0xb538
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl 0x10(%rax), %esi
leaq 0x5804(%rip), %rdi      # 0xb550
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl 0x12(%rax), %esi
leaq 0x5806(%rip), %rdi      # 0xb568
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl 0x12(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x5d87
leaq 0x5803(%rip), %rdi      # 0xb583
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl 0x12(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x5da5
leaq 0x57fd(%rip), %rdi      # 0xb59b
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl 0x12(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x5dc3
leaq 0x57f3(%rip), %rdi      # 0xb5af
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl 0x12(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x5de1
leaq 0x57ee(%rip), %rdi      # 0xb5c8
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl 0x12(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x5dff
leaq 0x57ef(%rip), %rdi      # 0xb5e7
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl 0x12(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x5e1d
leaq 0x57f1(%rip), %rdi      # 0xb607
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl 0x12(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x5e3d
leaq 0x57e8(%rip), %rdi      # 0xb61e
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl 0x12(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x5e5d
leaq 0x57df(%rip), %rdi      # 0xb635
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl 0x12(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x5e7d
leaq 0x57d1(%rip), %rdi      # 0xb647
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl 0x12(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x5e9d
leaq 0x57d2(%rip), %rdi      # 0xb668
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl 0x12(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0x5ebd
leaq 0x57d3(%rip), %rdi      # 0xb689
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl 0x12(%rax), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x5edd
leaq 0x57c8(%rip), %rdi      # 0xb69e
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl 0x12(%rax), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0x5efd
leaq 0x57c0(%rip), %rdi      # 0xb6b6
movb $0x0, %al
callq 0x3080
movq -0x8(%rbp), %rax
movzwl 0x12(%rax), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
je 0x5f1d
leaq 0x57b5(%rip), %rdi      # 0xb6cb
movb $0x0, %al
callq 0x3080
leaq 0x4207(%rip), %rdi      # 0xa12b
movb $0x0, %al
callq 0x3080
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)