#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
struct TYPE_5__ {
  int *e_ident;
  int e_type;
  int e_machine;
  int e_entry;
  int e_phoff;
  int e_shoff;
  int e_phentsize;
  int e_phnum;
  int p_type;
  int p_offset;
  int p_vaddr;
  int p_filesz;
  int p_flags;
  int e_shentsize;
  int e_shnum;
  int sh_type;
  int sh_offset;
  int sh_addr;
  int sh_size;
};
typedef int /*<<< orphan*/ FILE;
typedef TYPE_1__ Elf32_Shdr;
typedef TYPE_1__ Elf32_Phdr;
typedef TYPE_1__ Elf32_Ehdr;

/* Variables and functions */
size_t EI_CLASS;
size_t EI_DATA;
scalar_t__ ELFCLASS32;
scalar_t__ ELFDATA2LSB;
scalar_t__ EM_MIPS;
scalar_t__ ET_EXEC;
int PF_R;
int PF_W;
int PF_X;
scalar_t__ PT_LOAD;
int /*<<< orphan*/ SEEK_SET;
#define SHT_PROGBITS 129
#define SHT_STRTAB 128
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(TYPE_1__ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  FILE *program;
  Elf32_Ehdr elf_header;
  Elf32_Phdr program_header;
  Elf32_Shdr section_header;
  int i;
  if (argc != 2)
    return 1;
  if ((program = fopen(argv[1], "r")) == NULL)
    return 2;
  fread(&elf_header, sizeof(Elf32_Ehdr), 1, program);
  printf("Class: %#x", elf_header.e_ident[EI_CLASS]);
  if (elf_header.e_ident[EI_CLASS] == ELFCLASS32)
    printf(" (32-bit architecture)");
  printf("\n");
  printf("Data: %#x", elf_header.e_ident[EI_DATA]);
  if (elf_header.e_ident[EI_DATA] == ELFDATA2LSB)
    printf(" (Two's complement, little-endian)");
  printf("\n");
  printf("Type: %#x", elf_header.e_type);
  if (elf_header.e_type == ET_EXEC)
    printf(" (Executable file)");
  printf("\n");
  printf("Architecture: %#x", elf_header.e_machine);
  if (elf_header.e_machine == EM_MIPS)
    printf(" (MIPS R3000)");
  printf("\n");
  printf("Entry point: %#x\n", elf_header.e_entry);
  printf("Program header offset: %#x\n", elf_header.e_phoff);
  printf("Section header offset: %#x\n", elf_header.e_shoff);
  printf("Program header size: %#x\n", elf_header.e_phentsize);
  printf("Program header count: %#x\n", elf_header.e_phnum);
  for (i = 0; i < elf_header.e_phnum; ++i) {
    fseek(program, elf_header.e_phoff + (elf_header.e_phentsize * i), SEEK_SET);
    fread(&program_header, sizeof(Elf32_Phdr), 1, program);
    printf("Program header %d type: %#x", i, program_header.p_type);
    if (program_header.p_type == PT_LOAD)
      printf(" (load)");
    printf(", offset: %#x", program_header.p_offset);
    printf(", vaddr: %#x", program_header.p_vaddr);
    printf(", file size: %#x", program_header.p_filesz);
    if ((program_header.p_flags & PF_R) && (program_header.p_flags & PF_X))
      printf(", (text)");
    else if ((program_header.p_flags & PF_R) && (program_header.p_flags & PF_W))
      printf(" (data)");
    printf("\n");
  }
  printf("Section header size: %#x\n", elf_header.e_shentsize);
  printf("Section header count: %#x\n", elf_header.e_shnum);
  for (i = 0; i < elf_header.e_shnum; ++i) {
    fseek(program, elf_header.e_shoff + (elf_header.e_shentsize * i), SEEK_SET);
    fread(&section_header, sizeof(Elf32_Shdr), 1, program);
    printf("Section header %d type: %#x", i, section_header.sh_type);
    switch (section_header.sh_type) {
    case SHT_PROGBITS:
      printf(" (progbits)");
      break;
    case SHT_STRTAB:
      printf(" (string table)");
      break;
    default:
      break;
    }
    printf(", offset: %#x", section_header.sh_offset);
    printf(", addr: %#x", section_header.sh_addr);
    printf(", file size: %#x\n", section_header.sh_size);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     116f <main+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1602 <main+0x4c2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe82(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    119d <main+0x5d>
movl   $0x2,-0x4(%rbp)
jmp    1602 <main+0x4c2>
mov    -0x18(%rbp),%rcx
lea    -0x68(%rbp),%rdi
mov    $0x50,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0x68(%rbp),%rax
mov    0x2e01(%rip),%rcx
mov    (%rcx),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x68(%rbp),%rax
mov    0x2de2(%rip),%rcx
mov    (%rcx),%rcx
movslq (%rax,%rcx,4),%rax
mov    0x2dac(%rip),%rcx
cmp    (%rcx),%rax
jne    1203 <main+0xc3>
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xfed(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x68(%rbp),%rax
mov    0x2db4(%rip),%rcx
mov    (%rcx),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x68(%rbp),%rax
mov    0x2d95(%rip),%rcx
mov    (%rcx),%rcx
movslq (%rax,%rcx,4),%rax
mov    0x2da7(%rip),%rcx
cmp    (%rcx),%rax
jne    1260 <main+0x120>
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf90(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x60(%rbp),%esi
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x60(%rbp),%rax
mov    0x2d2e(%rip),%rcx
cmp    (%rcx),%rax
jne    12a1 <main+0x161>
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x5c(%rbp),%esi
lea    0xdb5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x5c(%rbp),%rax
mov    0x2cbd(%rip),%rcx
cmp    (%rcx),%rax
jne    12e2 <main+0x1a2>
lea    0xda5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf0e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x58(%rbp),%esi
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x54(%rbp),%esi
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%esi
lea    0xda0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4c(%rbp),%esi
lea    0xdab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x48(%rbp),%esi
lea    0xdb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x10c(%rbp)
mov    -0x10c(%rbp),%eax
cmp    -0x48(%rbp),%eax
jge    14bc <main+0x37c>
mov    -0x18(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x4c(%rbp),%eax
imul   -0x10c(%rbp),%eax
add    %eax,%esi
mov    0x2c38(%rip),%rax
mov    (%rax),%edx
call   1050 <fseek@plt>
mov    -0x18(%rbp),%rcx
lea    -0xb8(%rbp),%rdi
mov    $0x50,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0x10c(%rbp),%esi
mov    -0x94(%rbp),%edx
lea    0xd61(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x94(%rbp),%rax
mov    0x2c17(%rip),%rcx
cmp    (%rcx),%rax
jne    13d8 <main+0x298>
lea    0xd58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x90(%rbp),%esi
lea    0xd4c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8c(%rbp),%esi
lea    0xd46(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x88(%rbp),%esi
lea    0xd3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x84(%rbp),%eax
mov    0x2b7f(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1457 <main+0x317>
mov    -0x84(%rbp),%eax
mov    0x2ba7(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1457 <main+0x317>
lea    0xd12(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    149a <main+0x35a>
mov    -0x84(%rbp),%eax
mov    0x2b3c(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1495 <main+0x355>
mov    -0x84(%rbp),%eax
mov    0x2b2c(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1495 <main+0x355>
lea    0xcd8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    149a <main+0x35a>
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10c(%rbp)
jmp    134f <main+0x20f>
mov    -0x30(%rbp),%esi
lea    0xca8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xcb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x10c(%rbp)
mov    -0x10c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    15fb <main+0x4bb>
mov    -0x18(%rbp),%rdi
mov    -0x50(%rbp),%esi
mov    -0x30(%rbp),%eax
mov    -0x10c(%rbp),%ecx
imul   %ecx,%eax
add    %eax,%esi
mov    0x2a9d(%rip),%rax
mov    (%rax),%edx
call   1050 <fseek@plt>
mov    -0x18(%rbp),%rcx
lea    -0x108(%rbp),%rdi
mov    $0x50,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0x10c(%rbp),%esi
mov    -0xc8(%rbp),%edx
lea    0xc5c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0xc8(%rbp),%eax
mov    %eax,-0x110(%rbp)
sub    $0x80,%eax
je     1593 <main+0x453>
jmp    156a <main+0x42a>
mov    -0x110(%rbp),%eax
sub    $0x81,%eax
jne    15a6 <main+0x466>
jmp    1580 <main+0x440>
lea    0xc38(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15ab <main+0x46b>
lea    0xc31(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15ab <main+0x46b>
jmp    15ab <main+0x46b>
mov    -0xc4(%rbp),%esi
lea    0xb79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc0(%rbp),%esi
lea    0xc0f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xbc(%rbp),%esi
lea    0xc07(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10c(%rbp)
jmp    14e8 <main+0x3a8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
mov    $0x1,%r15d
cmp    $0x2,%edi
jne    154a <main+0x3fa>
mov    0x8(%rsi),%rdi
lea    0xe85(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     1544 <main+0x3f4>
mov    %rax,%r14
lea    0x8(%rsp),%rdi
mov    $0x50,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1040 <fread@plt>
mov    0x8(%rsp),%rbx
mov    0x2e11(%rip),%rbp
mov    0x0(%rbp),%rax
mov    (%rbx,%rax,4),%esi
lea    0xe45(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%rbp),%rax
movslq (%rbx,%rax,4),%rax
mov    0x2dc5(%rip),%rcx
cmp    %rax,(%rcx)
jne    11e6 <main+0x96>
lea    0xe2e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2dd9(%rip),%rbp
mov    0x0(%rbp),%rax
mov    (%rbx,%rax,4),%esi
lea    0xe1f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%rbp),%rax
movslq (%rbx,%rax,4),%rax
mov    0x2dd5(%rip),%rcx
cmp    %rax,(%rcx)
jne    122e <main+0xde>
lea    0xe07(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movslq 0x10(%rsp),%rbx
lea    0xe0d(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2d64(%rip),%rax
cmp    %rbx,(%rax)
jne    1267 <main+0x117>
lea    0xdfb(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movslq 0x14(%rsp),%rbx
lea    0xdf1(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2cfb(%rip),%rax
cmp    %rbx,(%rax)
jne    12a0 <main+0x150>
lea    0xde7(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x18(%rsp),%esi
lea    0xdd9(%rip),%rdi
xor    %r15d,%r15d
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1c(%rsp),%ebx
lea    0xdd6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x20(%rsp),%ebp
lea    0xdde(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x24(%rsp),%esi
lea    0xde6(%rip),%rdi
mov    %esi,(%rsp)
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x28(%rsp),%r12d
lea    0xdea(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12d,0x4(%rsp)
test   %r12d,%r12d
jle    1436 <main+0x2e6>
xor    %r12d,%r12d
jmp    1353 <main+0x203>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
add    (%rsp),%ebx
cmp    %r12d,0x4(%rsp)
je     1436 <main+0x2e6>
mov    0x2c56(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1060 <fseek@plt>
lea    0x58(%rsp),%rdi
mov    $0x50,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1040 <fread@plt>
movslq 0x7c(%rsp),%r13
lea    0xd84(%rip),%rdi
mov    %r12d,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2c3b(%rip),%rax
cmp    %r13,(%rax)
jne    13b0 <main+0x260>
lea    0xd80(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x80(%rsp),%esi
lea    0xd73(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x84(%rsp),%esi
lea    0xd6c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x88(%rsp),%esi
lea    0xd64(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8c(%rsp),%eax
mov    0x2ba3(%rip),%rcx
test   %eax,(%rcx)
je     1337 <main+0x1e7>
lea    0xd51(%rip),%rdi
mov    0x2bcd(%rip),%rcx
test   %eax,(%rcx)
jne    1330 <main+0x1e0>
lea    0xd44(%rip),%rdi
mov    0x2b7f(%rip),%rcx
test   %eax,(%rcx)
jne    1330 <main+0x1e0>
jmp    1337 <main+0x1e7>
mov    0x40(%rsp),%esi
lea    0xd2d(%rip),%rdi
mov    %esi,(%rsp)
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x44(%rsp),%r12d
lea    0xd31(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r12d,%r12d
jle    154a <main+0x3fa>
xor    %r13d,%r13d
xor    %r15d,%r15d
jmp    14d2 <main+0x382>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xec(%rsp),%esi
lea    0xc9c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xf0(%rsp),%esi
lea    0xd31(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xf4(%rsp),%esi
lea    0xd28(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r13d
add    (%rsp),%ebp
cmp    %r13d,%r12d
je     154a <main+0x3fa>
mov    0x2ad7(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
mov    %ebp,%esi
call   1060 <fseek@plt>
lea    0xa8(%rsp),%rdi
mov    $0x50,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1040 <fread@plt>
mov    0xe8(%rsp),%ebx
lea    0xc96(%rip),%rdi
mov    %r13d,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc9f(%rip),%rdi
cmp    $0x81,%ebx
je     1480 <main+0x330>
cmp    $0x80,%ebx
jne    1487 <main+0x337>
lea    0xc8c(%rip),%rdi
jmp    1480 <main+0x330>
mov    $0x2,%r15d
mov    %r15d,%eax
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [2 x i8] c"r\00"
@.str.1 = [11 x i8] c"Class: %#x\00"
@EI_CLASS = global i64 0
@ELFCLASS32 = global i64 0
@.str.2 = [23 x i8] c" (32-bit architecture)\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [10 x i8] c"Data: %#x\00"
@EI_DATA = global i64 0
@ELFDATA2LSB = global i64 0
@.str.5 = [35 x i8] c" (Two's complement, little-endian)\00"
@.str.6 = [10 x i8] c"Type: %#x\00"
@ET_EXEC = global i64 0
@.str.7 = [19 x i8] c" (Executable file)\00"
@.str.8 = [18 x i8] c"Architecture: %#x\00"
@EM_MIPS = global i64 0
@.str.9 = [14 x i8] c" (MIPS R3000)\00"
@.str.10 = [18 x i8] c"Entry point: %#x\0A\00"
@.str.11 = [28 x i8] c"Program header offset: %#x\0A\00"
@.str.12 = [28 x i8] c"Section header offset: %#x\0A\00"
@.str.13 = [26 x i8] c"Program header size: %#x\0A\00"
@.str.14 = [27 x i8] c"Program header count: %#x\0A\00"
@SEEK_SET = global i32 0
@.str.15 = [28 x i8] c"Program header %d type: %#x\00"
@PT_LOAD = global i64 0
@.str.16 = [8 x i8] c" (load)\00"
@.str.17 = [14 x i8] c", offset: %#x\00"
@.str.18 = [13 x i8] c", vaddr: %#x\00"
@.str.19 = [17 x i8] c", file size: %#x\00"
@PF_R = global i32 0
@PF_X = global i32 0
@.str.20 = [9 x i8] c", (text)\00"
@PF_W = global i32 0
@.str.21 = [8 x i8] c" (data)\00"
@.str.22 = [26 x i8] c"Section header size: %#x\0A\00"
@.str.23 = [27 x i8] c"Section header count: %#x\0A\00"
@.str.24 = [28 x i8] c"Section header %d type: %#x\00"
@.str.25 = [12 x i8] c" (progbits)\00"
@.str.26 = [16 x i8] c" (string table)\00"
@.str.27 = [12 x i8] c", addr: %#x\00"
@.str.28 = [18 x i8] c", file size: %#x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca %struct.TYPE_5__
%8 = alloca %struct.TYPE_5__
%9 = alloca %struct.TYPE_5__
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 2
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %221
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32* @fopen(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %18, i32** %6
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %21
20: ; preds = %14
store i32 2, i32* %3
br label %221
21: ; preds = %14
%22 = load i32*, i32** %6
%23 = call i32 @fread(%struct.TYPE_5__* %7, i32 80, i32 1, i32* %22)
%24 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 0
%25 = load i32*, i32** %24
%26 = load i64, i64* @EI_CLASS
%27 = getelementptr inbounds i32, i32* %25, i64 %26
%28 = load i32, i32* %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%30 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 0
%31 = load i32*, i32** %30
%32 = load i64, i64* @EI_CLASS
%33 = getelementptr inbounds i32, i32* %31, i64 %32
%34 = load i32, i32* %33
%35 = sext i32 %34 to i64
%36 = load i64, i64* @ELFCLASS32
%37 = icmp eq i64 %35, %36
br i1 %37, label %38, label %40
38: ; preds = %21
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %40
40: ; preds = %38, %21
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%42 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 0
%43 = load i32*, i32** %42
%44 = load i64, i64* @EI_DATA
%45 = getelementptr inbounds i32, i32* %43, i64 %44
%46 = load i32, i32* %45
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %46)
%48 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 0
%49 = load i32*, i32** %48
%50 = load i64, i64* @EI_DATA
%51 = getelementptr inbounds i32, i32* %49, i64 %50
%52 = load i32, i32* %51
%53 = sext i32 %52 to i64
%54 = load i64, i64* @ELFDATA2LSB
%55 = icmp eq i64 %53, %54
br i1 %55, label %56, label %58
56: ; preds = %40
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
br label %58
58: ; preds = %56, %40
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%60 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 1
%61 = load i32, i32* %60
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %61)
%63 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 1
%64 = load i32, i32* %63
%65 = sext i32 %64 to i64
%66 = load i64, i64* @ET_EXEC
%67 = icmp eq i64 %65, %66
br i1 %67, label %68, label %70
68: ; preds = %58
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
br label %70
70: ; preds = %68, %58
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%72 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 2
%73 = load i32, i32* %72
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %73)
%75 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 2
%76 = load i32, i32* %75
%77 = sext i32 %76 to i64
%78 = load i64, i64* @EM_MIPS
%79 = icmp eq i64 %77, %78
br i1 %79, label %80, label %82
80: ; preds = %70
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
br label %82
82: ; preds = %80, %70
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%84 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 3
%85 = load i32, i32* %84
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 %85)
%87 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 4
%88 = load i32, i32* %87
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0), i32 %88)
%90 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 5
%91 = load i32, i32* %90
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.12, i64 0, i64 0), i32 %91)
%93 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 6
%94 = load i32, i32* %93
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i32 %94)
%96 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 7
%97 = load i32, i32* %96
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i32 %97)
store i32 0, i32* %10
br label %99
99: ; preds = %168, %82
%100 = load i32, i32* %10
%101 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 7
%102 = load i32, i32* %101
%103 = icmp slt i32 %100, %102
br i1 %103, label %104, label %171
104: ; preds = %99
%105 = load i32*, i32** %6
%106 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 4
%107 = load i32, i32* %106
%108 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 6
%109 = load i32, i32* %108
%110 = load i32, i32* %10
%111 = mul nsw i32 %109, %110
%112 = add nsw i32 %107, %111
%113 = load i32, i32* @SEEK_SET
%114 = call i32 @fseek(i32* %105, i32 %112, i32 %113)
%115 = load i32*, i32** %6
%116 = call i32 @fread(%struct.TYPE_5__* %8, i32 80, i32 1, i32* %115)
%117 = load i32, i32* %10
%118 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %8, i32 0, i32 8
%119 = load i32, i32* %118
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.15, i64 0, i64 0), i32 %117, i32 %119)
%121 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %8, i32 0, i32 8
%122 = load i32, i32* %121
%123 = sext i32 %122 to i64
%124 = load i64, i64* @PT_LOAD
%125 = icmp eq i64 %123, %124
br i1 %125, label %126, label %128
126: ; preds = %104
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
br label %128
128: ; preds = %126, %104
%129 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %8, i32 0, i32 9
%130 = load i32, i32* %129
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), i32 %130)
%132 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %8, i32 0, i32 10
%133 = load i32, i32* %132
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.18, i64 0, i64 0), i32 %133)
%135 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %8, i32 0, i32 11
%136 = load i32, i32* %135
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.19, i64 0, i64 0), i32 %136)
%138 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %8, i32 0, i32 12
%139 = load i32, i32* %138
%140 = load i32, i32* @PF_R
%141 = and i32 %139, %140
%142 = icmp ne i32 %141, 0
br i1 %142, label %143, label %151
143: ; preds = %128
%144 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %8, i32 0, i32 12
%145 = load i32, i32* %144
%146 = load i32, i32* @PF_X
%147 = and i32 %145, %146
%148 = icmp ne i32 %147, 0
br i1 %148, label %149, label %151
149: ; preds = %143
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i64 0, i64 0))
br label %166
151: ; preds = %143, %128
%152 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %8, i32 0, i32 12
%153 = load i32, i32* %152
%154 = load i32, i32* @PF_R
%155 = and i32 %153, %154
%156 = icmp ne i32 %155, 0
br i1 %156, label %157, label %165
157: ; preds = %151
%158 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %8, i32 0, i32 12
%159 = load i32, i32* %158
%160 = load i32, i32* @PF_W
%161 = and i32 %159, %160
%162 = icmp ne i32 %161, 0
br i1 %162, label %163, label %165
163: ; preds = %157
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i64 0, i64 0))
br label %165
165: ; preds = %163, %157, %151
br label %166
166: ; preds = %165, %149
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %168
168: ; preds = %166
%169 = load i32, i32* %10
%170 = add nsw i32 %169, 1
store i32 %170, i32* %10
br label %99
171: ; preds = %99
%172 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 13
%173 = load i32, i32* %172
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.22, i64 0, i64 0), i32 %173)
%175 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 14
%176 = load i32, i32* %175
%177 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.23, i64 0, i64 0), i32 %176)
store i32 0, i32* %10
br label %178
178: ; preds = %217, %171
%179 = load i32, i32* %10
%180 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 14
%181 = load i32, i32* %180
%182 = icmp slt i32 %179, %181
br i1 %182, label %183, label %220
183: ; preds = %178
%184 = load i32*, i32** %6
%185 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 5
%186 = load i32, i32* %185
%187 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 13
%188 = load i32, i32* %187
%189 = load i32, i32* %10
%190 = mul nsw i32 %188, %189
%191 = add nsw i32 %186, %190
%192 = load i32, i32* @SEEK_SET
%193 = call i32 @fseek(i32* %184, i32 %191, i32 %192)
%194 = load i32*, i32** %6
%195 = call i32 @fread(%struct.TYPE_5__* %9, i32 80, i32 1, i32* %194)
%196 = load i32, i32* %10
%197 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %9, i32 0, i32 15
%198 = load i32, i32* %197
%199 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.24, i64 0, i64 0), i32 %196, i32 %198)
%200 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %9, i32 0, i32 15
%201 = load i32, i32* %200
switch i32 %201, label %206 [
i32 129, label %202
i32 128, label %204
]
202: ; preds = %183
%203 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.25, i64 0, i64 0))
br label %207
204: ; preds = %183
%205 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.26, i64 0, i64 0))
br label %207
206: ; preds = %183
br label %207
207: ; preds = %206, %204, %202
%208 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %9, i32 0, i32 16
%209 = load i32, i32* %208
%210 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), i32 %209)
%211 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %9, i32 0, i32 17
%212 = load i32, i32* %211
%213 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.27, i64 0, i64 0), i32 %212)
%214 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %9, i32 0, i32 18
%215 = load i32, i32* %214
%216 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.28, i64 0, i64 0), i32 %215)
br label %217
217: ; preds = %207
%218 = load i32, i32* %10
%219 = add nsw i32 %218, 1
store i32 %219, i32* %10
br label %178
220: ; preds = %178
store i32 0, i32* %3
br label %221
221: ; preds = %220, %20, %13
%222 = load i32, i32* %3
ret i32 %222
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i32*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [2 x i8] c"r\00"
@.str.1 = [11 x i8] c"Class: %#x\00"
@EI_CLASS = global i64 0
@ELFCLASS32 = global i64 0
@.str.2 = [23 x i8] c" (32-bit architecture)\00"
@.str.4 = [10 x i8] c"Data: %#x\00"
@EI_DATA = global i64 0
@ELFDATA2LSB = global i64 0
@.str.5 = [35 x i8] c" (Two's complement, little-endian)\00"
@.str.6 = [10 x i8] c"Type: %#x\00"
@ET_EXEC = global i64 0
@.str.7 = [19 x i8] c" (Executable file)\00"
@.str.8 = [18 x i8] c"Architecture: %#x\00"
@EM_MIPS = global i64 0
@.str.9 = [14 x i8] c" (MIPS R3000)\00"
@.str.10 = [18 x i8] c"Entry point: %#x\0A\00"
@.str.11 = [28 x i8] c"Program header offset: %#x\0A\00"
@.str.12 = [28 x i8] c"Section header offset: %#x\0A\00"
@.str.13 = [26 x i8] c"Program header size: %#x\0A\00"
@.str.14 = [27 x i8] c"Program header count: %#x\0A\00"
@SEEK_SET = global i32 0
@.str.15 = [28 x i8] c"Program header %d type: %#x\00"
@PT_LOAD = global i64 0
@.str.16 = [8 x i8] c" (load)\00"
@.str.17 = [14 x i8] c", offset: %#x\00"
@.str.18 = [13 x i8] c", vaddr: %#x\00"
@.str.19 = [17 x i8] c", file size: %#x\00"
@PF_R = global i32 0
@PF_X = global i32 0
@.str.20 = [9 x i8] c", (text)\00"
@PF_W = global i32 0
@.str.21 = [8 x i8] c" (data)\00"
@.str.22 = [26 x i8] c"Section header size: %#x\0A\00"
@.str.23 = [27 x i8] c"Section header count: %#x\0A\00"
@.str.24 = [28 x i8] c"Section header %d type: %#x\00"
@.str.25 = [12 x i8] c" (progbits)\00"
@.str.26 = [16 x i8] c" (string table)\00"
@.str.27 = [12 x i8] c", addr: %#x\00"
@.str.28 = [18 x i8] c", file size: %#x\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.TYPE_5__
%4 = alloca %struct.TYPE_5__
%5 = alloca %struct.TYPE_5__
%6 = bitcast %struct.TYPE_5__* %3 to i8*
%7 = bitcast %struct.TYPE_5__* %4 to i8*
%8 = bitcast %struct.TYPE_5__* %5 to i8*
%9 = icmp eq i32 %0, 2
br i1 %9, label %10, label %164
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32* @fopen(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i32* %13, null
br i1 %14, label %164, label %15
15: ; preds = %10
%16 = call i32 @fread(%struct.TYPE_5__* %3, i32 80, i32 1, i32* %13)
%17 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 0
%18 = load i32*, i32** %17
%19 = load i64, i64* @EI_CLASS
%20 = getelementptr inbounds i32, i32* %18, i64 %19
%21 = load i32, i32* %20
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = load i64, i64* @EI_CLASS
%24 = getelementptr inbounds i32, i32* %18, i64 %23
%25 = load i32, i32* %24
%26 = sext i32 %25 to i64
%27 = load i64, i64* @ELFCLASS32
%28 = icmp eq i64 %27, %26
br i1 %28, label %29, label %31
29: ; preds = %15
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %29, %15
%32 = tail call i32 @putchar(i32 10)
%33 = load i64, i64* @EI_DATA
%34 = getelementptr inbounds i32, i32* %18, i64 %33
%35 = load i32, i32* %34
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %35)
%37 = load i64, i64* @EI_DATA
%38 = getelementptr inbounds i32, i32* %18, i64 %37
%39 = load i32, i32* %38
%40 = sext i32 %39 to i64
%41 = load i64, i64* @ELFDATA2LSB
%42 = icmp eq i64 %41, %40
br i1 %42, label %43, label %45
43: ; preds = %31
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
br label %45
45: ; preds = %43, %31
%46 = tail call i32 @putchar(i32 10)
%47 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 1
%48 = load i32, i32* %47
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %48)
%50 = sext i32 %48 to i64
%51 = load i64, i64* @ET_EXEC
%52 = icmp eq i64 %51, %50
br i1 %52, label %53, label %55
53: ; preds = %45
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
br label %55
55: ; preds = %53, %45
%56 = tail call i32 @putchar(i32 10)
%57 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 2
%58 = load i32, i32* %57
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %58)
%60 = sext i32 %58 to i64
%61 = load i64, i64* @EM_MIPS
%62 = icmp eq i64 %61, %60
br i1 %62, label %63, label %65
63: ; preds = %55
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
br label %65
65: ; preds = %63, %55
%66 = tail call i32 @putchar(i32 10)
%67 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 3
%68 = load i32, i32* %67
%69 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 %68)
%70 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 4
%71 = load i32, i32* %70
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0), i32 %71)
%73 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 5
%74 = load i32, i32* %73
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.12, i64 0, i64 0), i32 %74)
%76 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 6
%77 = load i32, i32* %76
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i32 %77)
%79 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 7
%80 = load i32, i32* %79
%81 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i32 %80)
%82 = icmp sgt i32 %80, 0
br i1 %82, label %83, label %129
83: ; preds = %65
%84 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i64 0, i32 8
%85 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i64 0, i32 9
%86 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i64 0, i32 10
%87 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i64 0, i32 11
%88 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i64 0, i32 12
br label %89
89: ; preds = %83, %125
%90 = phi i32 [ 0, %83 ], [ %127, %125 ]
%91 = mul nsw i32 %90, %77
%92 = add nsw i32 %91, %71
%93 = load i32, i32* @SEEK_SET
%94 = tail call i32 @fseek(i32* %13, i32 %92, i32 %93)
%95 = call i32 @fread(%struct.TYPE_5__* %4, i32 80, i32 1, i32* %13)
%96 = load i32, i32* %84
%97 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.15, i64 0, i64 0), i32 %90, i32 %96)
%98 = sext i32 %96 to i64
%99 = load i64, i64* @PT_LOAD
%100 = icmp eq i64 %99, %98
br i1 %100, label %101, label %103
101: ; preds = %89
%102 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
br label %103
103: ; preds = %101, %89
%104 = load i32, i32* %85
%105 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), i32 %104)
%106 = load i32, i32* %86
%107 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.18, i64 0, i64 0), i32 %106)
%108 = load i32, i32* %87
%109 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.19, i64 0, i64 0), i32 %108)
%110 = load i32, i32* %88
%111 = load i32, i32* @PF_R
%112 = and i32 %111, %110
%113 = icmp eq i32 %112, 0
br i1 %113, label %125, label %114
114: ; preds = %103
%115 = load i32, i32* @PF_X
%116 = and i32 %115, %110
%117 = icmp eq i32 %116, 0
br i1 %117, label %118, label %122
118: ; preds = %114
%119 = load i32, i32* @PF_W
%120 = and i32 %119, %110
%121 = icmp eq i32 %120, 0
br i1 %121, label %125, label %122
122: ; preds = %118, %114
%123 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i64 0, i64 0), %114 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i64 0, i64 0), %118 ]
%124 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %123)
br label %125
125: ; preds = %122, %103, %118
%126 = tail call i32 @putchar(i32 10)
%127 = add nuw nsw i32 %90, 1
%128 = icmp eq i32 %127, %80
br i1 %128, label %129, label %89
129: ; preds = %125, %65
%130 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 13
%131 = load i32, i32* %130
%132 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.22, i64 0, i64 0), i32 %131)
%133 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 14
%134 = load i32, i32* %133
%135 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.23, i64 0, i64 0), i32 %134)
%136 = icmp sgt i32 %134, 0
br i1 %136, label %137, label %164
137: ; preds = %129
%138 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i64 0, i32 15
%139 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i64 0, i32 16
%140 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i64 0, i32 17
%141 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i64 0, i32 18
br label %142
142: ; preds = %137, %155
%143 = phi i32 [ 0, %137 ], [ %162, %155 ]
%144 = mul nsw i32 %143, %131
%145 = add nsw i32 %144, %74
%146 = load i32, i32* @SEEK_SET
%147 = tail call i32 @fseek(i32* %13, i32 %145, i32 %146)
%148 = call i32 @fread(%struct.TYPE_5__* %5, i32 80, i32 1, i32* %13)
%149 = load i32, i32* %138
%150 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.24, i64 0, i64 0), i32 %143, i32 %149)
switch i32 %149, label %155 [
i32 129, label %152
i32 128, label %151
]
151: ; preds = %142
br label %152
152: ; preds = %142, %151
%153 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.26, i64 0, i64 0), %151 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.25, i64 0, i64 0), %142 ]
%154 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %153)
br label %155
155: ; preds = %152, %142
%156 = load i32, i32* %139
%157 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), i32 %156)
%158 = load i32, i32* %140
%159 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.27, i64 0, i64 0), i32 %158)
%160 = load i32, i32* %141
%161 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.28, i64 0, i64 0), i32 %160)
%162 = add nuw nsw i32 %143, 1
%163 = icmp eq i32 %162, %134
br i1 %163, label %164, label %142
164: ; preds = %155, %129, %10, %2
%165 = phi i32 [ 1, %2 ], [ 2, %10 ], [ 0, %129 ], [ 0, %155 ]
ret i32 %165
}