#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_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int n_strx;
};
struct nlist {
  int n_type;
  int n_other;
  int n_desc;
  int n_value;
  TYPE_1__ n_un;
};
struct exec {
  int a_syms;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ stderr;
char *symbol_type(struct nlist *);
void run_symtable(struct exec *exhdr, struct nlist *symtabl, char *stringtable,
                  int strtbl_sz, int sym_names) {
  int i, count;
  if (NULL == exhdr || NULL == symtabl || NULL == stringtable) {
    if (NULL == exhdr)
      fprintf(stderr, "a.out header NULL, ");
    if (NULL == symtabl)
      fprintf(stderr, "symbol table NULL, ");
    if (NULL == stringtable)
      fprintf(stderr, "string table NULL, ");
    fprintf(stderr, " can't possibly list the symbol table meaningfully\n");
    return;
  }
  count = exhdr->a_syms / sizeof(*symtabl);
  printf("%d symbols\n", count);
  for (i = 0; i < count; ++i) {
    if (!sym_names)
      printf("%4d name offset (%d), type 0x%x - %s, other 0x%x, desc 0x%x, "
             "value 0x%x (%d)\n",
             i, symtabl[i].n_un.n_strx, symtabl[i].n_type,
             symbol_type(&symtabl[i]), symtabl[i].n_other, symtabl[i].n_desc,
             symtabl[i].n_value, symtabl[i].n_value);
    else {
      char *sname = "";
      if (symtabl[i].n_un.n_strx >= 0 && symtabl[i].n_un.n_strx < strtbl_sz)
        sname = &stringtable[symtabl[i].n_un.n_strx];
      printf("%4d name \"%s\" (%d), type 0x%x - %s, other 0x%x, desc 0x%x, "
             "value 0x%x (%d)\n",
             i, sname, symtabl[i].n_un.n_strx, symtabl[i].n_type,
             symbol_type(&symtabl[i]), symtabl[i].n_other, symtabl[i].n_desc,
             symtabl[i].n_value, symtabl[i].n_value);
    }
  }
}


x86 assembly (clang, -O0):
<run_symtable>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x78,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
je     1170 <run_symtable+0x40>
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
je     1170 <run_symtable+0x40>
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jne    11ed <run_symtable+0xbd>
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1191 <run_symtable+0x61>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
lea    0xe74(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    11b2 <run_symtable+0x82>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
lea    0xe67(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jne    11d3 <run_symtable+0xa3>
mov    0x2e1b(%rip),%rax
mov    (%rax),%edi
lea    0xe5a(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e06(%rip),%rax
mov    (%rax),%edi
lea    0xe59(%rip),%rsi
call   1040 <fprintf@plt>
jmp    141e <run_symtable+0x2ee>
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
mov    $0x14,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%esi
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    141e <run_symtable+0x2ee>
cmpl   $0x0,-0x28(%rbp)
jne    12e9 <run_symtable+0x1b9>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
mov    0x10(%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x2c(%rbp),%rax
imul   $0x14,%rax,%rax
add    %rax,%rdi
call   1050 <symbol_type@plt>
mov    -0x44(%rbp),%esi
mov    -0x40(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    %rax,%r8
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rdi
imul   $0x14,%rdi,%rdi
add    %rdi,%rax
mov    0x4(%rax),%r9d
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rdi
imul   $0x14,%rdi,%rdi
add    %rdi,%rax
mov    0x8(%rax),%r11d
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rdi
imul   $0x14,%rdi,%rdi
add    %rdi,%rax
mov    0xc(%rax),%r10d
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rdi
imul   $0x14,%rdi,%rdi
add    %rdi,%rax
mov    0xc(%rax),%eax
lea    0xdac(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    140b <run_symtable+0x2db>
lea    0xe25(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
cmpl   $0x0,0x10(%rax)
jl     1346 <run_symtable+0x216>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
mov    0x10(%rax),%eax
cmp    -0x24(%rbp),%eax
jge    1346 <run_symtable+0x216>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
imul   $0x14,%rdx,%rdx
add    %rdx,%rcx
movslq 0x10(%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
mov    0x10(%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%eax
mov    %eax,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x2c(%rbp),%rax
imul   $0x14,%rax,%rax
add    %rax,%rdi
call   1050 <symbol_type@plt>
mov    -0x5c(%rbp),%esi
mov    -0x58(%rbp),%rdx
mov    -0x4c(%rbp),%ecx
mov    -0x48(%rbp),%r8d
mov    %rax,%r9
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rdi
imul   $0x14,%rdi,%rdi
add    %rdi,%rax
mov    0x4(%rax),%ebx
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rdi
imul   $0x14,%rdi,%rdi
add    %rdi,%rax
mov    0x8(%rax),%r11d
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rdi
imul   $0x14,%rdi,%rdi
add    %rdi,%rax
mov    0xc(%rax),%r10d
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rdi
imul   $0x14,%rdi,%rdi
add    %rdi,%rax
mov    0xc(%rax),%eax
lea    0xcd7(%rip),%rdi
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1410 <run_symtable+0x2e0>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1219 <run_symtable+0xe9>
add    $0x78,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_symtable>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,0xc(%rsp)
mov    %ecx,0x8(%rsp)
mov    %rdx,(%rsp)
mov    %rsi,%rbx
test   %rdi,%rdi
je     1262 <run_symtable+0x132>
test   %rbx,%rbx
je     1262 <run_symtable+0x132>
cmpq   $0x0,(%rsp)
je     1262 <run_symtable+0x132>
movslq (%rdi),%rax
movabs $0xcccccccccccccccd,%rcx
cc cc cc
mul    %rcx
mov    %rdx,%r12
shr    $0x4,%r12
lea    0xee7(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
test   %r12d,%r12d
jle    1296 <run_symtable+0x166>
mov    %r12d,%eax
mov    %rax,0x10(%rsp)
xor    %r12d,%r12d
jmp    121d <run_symtable+0xed>
nopl   0x0(%rax)
mov    %r13,%rbp
add    (%rsp),%rbp
cmp    0x8(%rsp),%r13d
lea    0xf52(%rip),%rax
cmovge %rax,%rbp
test   %r13d,%r13d
cmovs  %rax,%rbp
mov    (%rbx),%r15d
mov    %rbx,%rdi
call   1050 <symbol_type@plt>
mov    0x4(%rbx),%r10d
mov    0x8(%rbx),%r11d
mov    0xc(%rbx),%r14d
lea    0xede(%rip),%rdi
mov    %r12d,%esi
mov    %rbp,%rdx
mov    %r13d,%ecx
mov    %r15d,%r8d
mov    %rax,%r9
xor    %eax,%eax
push   %r14
push   %r14
push   %r11
push   %r10
call   1030 <printf@plt>
add    $0x20,%rsp
add    $0x1,%r12
add    $0x14,%rbx
cmp    %r12,0x10(%rsp)
je     1296 <run_symtable+0x166>
movslq 0x10(%rbx),%r13
cmpl   $0x0,0xc(%rsp)
jne    11b0 <run_symtable+0x80>
mov    (%rbx),%r15d
mov    %rbx,%rdi
call   1050 <symbol_type@plt>
mov    0x4(%rbx),%r9d
mov    0x8(%rbx),%r10d
mov    0xc(%rbx),%ebp
sub    $0x8,%rsp
lea    0xe33(%rip),%rdi
mov    %r12d,%esi
mov    %r13d,%edx
mov    %r15d,%ecx
mov    %rax,%r8
xor    %eax,%eax
push   %rbp
push   %rbp
push   %r10
call   1030 <printf@plt>
jmp    120a <run_symtable+0xda>
test   %rdi,%rdi
je     12a5 <run_symtable+0x175>
test   %rbx,%rbx
je     12bf <run_symtable+0x18f>
cmpq   $0x0,(%rsp)
je     12db <run_symtable+0x1ab>
mov    0x2d66(%rip),%rax
mov    (%rax),%edi
lea    0xdb9(%rip),%rsi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d34(%rip),%rax
mov    (%rax),%edi
lea    0xd4b(%rip),%rsi
call   1040 <fprintf@plt>
test   %rbx,%rbx
jne    126c <run_symtable+0x13c>
mov    0x2d1a(%rip),%rax
mov    (%rax),%edi
lea    0xd45(%rip),%rsi
call   1040 <fprintf@plt>
cmpq   $0x0,(%rsp)
jne    1273 <run_symtable+0x143>
mov    0x2cfe(%rip),%rax
mov    (%rax),%edi
lea    0xd3d(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1273 <run_symtable+0x143>

LLVM IR (-O0):
%struct.exec = type { i32 }
%struct.nlist = type { i32, i32, i32, i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@stderr = global i32 0
@.str = [20 x i8] c"a.out header NULL, \00"
@.str.1 = [20 x i8] c"symbol table NULL, \00"
@.str.2 = [20 x i8] c"string table NULL, \00"
@.str.3 = [52 x i8] c" can't possibly list the symbol table meaningfully\0A\00"
@.str.4 = [12 x i8] c"%d symbols\0A\00"
@.str.5 = [78 x i8] c"%4d name offset (%d), type 0x%x - %s, other 0x%x, desc 0x%x, value 0x%x (%d)\0A\00"
@.str.6 = [1 x i8] zeroinitializer
@.str.7 = [76 x i8] c"%4d name \22%s\22 (%d), type 0x%x - %s, other 0x%x, desc 0x%x, value 0x%x (%d)\0A\00"
define void @run_symtable(%struct.exec* %0, %struct.nlist* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca %struct.exec*
%7 = alloca %struct.nlist*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
store %struct.exec* %0, %struct.exec** %6
store %struct.nlist* %1, %struct.nlist** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%14 = load %struct.exec*, %struct.exec** %6
%15 = icmp eq %struct.exec* null, %14
br i1 %15, label %22, label %16
16: ; preds = %5
%17 = load %struct.nlist*, %struct.nlist** %7
%18 = icmp eq %struct.nlist* null, %17
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load i8*, i8** %8
%21 = icmp eq i8* null, %20
br i1 %21, label %22, label %43
22: ; preds = %19, %16, %5
%23 = load %struct.exec*, %struct.exec** %6
%24 = icmp eq %struct.exec* null, %23
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i32, i32* @stderr
%27 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %28
28: ; preds = %25, %22
%29 = load %struct.nlist*, %struct.nlist** %7
%30 = icmp eq %struct.nlist* null, %29
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load i32, i32* @stderr
%33 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %34
34: ; preds = %31, %28
%35 = load i8*, i8** %8
%36 = icmp eq i8* null, %35
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i32, i32* @stderr
%39 = call i32 @fprintf(i32 %38, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %40
40: ; preds = %37, %34
%41 = load i32, i32* @stderr
%42 = call i32 @fprintf(i32 %41, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
br label %184
43: ; preds = %19
%44 = load %struct.exec*, %struct.exec** %6
%45 = getelementptr inbounds %struct.exec, %struct.exec* %44, i32 0, i32 0
%46 = load i32, i32* %45
%47 = sext i32 %46 to i64
%48 = udiv i64 %47, 20
%49 = trunc i64 %48 to i32
store i32 %49, i32* %12
%50 = load i32, i32* %12
%51 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %50)
store i32 0, i32* %11
br label %52
52: ; preds = %181, %43
%53 = load i32, i32* %11
%54 = load i32, i32* %12
%55 = icmp slt i32 %53, %54
br i1 %55, label %56, label %184
56: ; preds = %52
%57 = load i32, i32* %10
%58 = icmp ne i32 %57, 0
br i1 %58, label %104, label %59
59: ; preds = %56
%60 = load i32, i32* %11
%61 = load %struct.nlist*, %struct.nlist** %7
%62 = load i32, i32* %11
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds %struct.nlist, %struct.nlist* %61, i64 %63
%65 = getelementptr inbounds %struct.nlist, %struct.nlist* %64, i32 0, i32 4
%66 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %65, i32 0, i32 0
%67 = load i32, i32* %66
%68 = load %struct.nlist*, %struct.nlist** %7
%69 = load i32, i32* %11
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds %struct.nlist, %struct.nlist* %68, i64 %70
%72 = getelementptr inbounds %struct.nlist, %struct.nlist* %71, i32 0, i32 0
%73 = load i32, i32* %72
%74 = load %struct.nlist*, %struct.nlist** %7
%75 = load i32, i32* %11
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds %struct.nlist, %struct.nlist* %74, i64 %76
%78 = call i8* @symbol_type(%struct.nlist* %77)
%79 = load %struct.nlist*, %struct.nlist** %7
%80 = load i32, i32* %11
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds %struct.nlist, %struct.nlist* %79, i64 %81
%83 = getelementptr inbounds %struct.nlist, %struct.nlist* %82, i32 0, i32 1
%84 = load i32, i32* %83
%85 = load %struct.nlist*, %struct.nlist** %7
%86 = load i32, i32* %11
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds %struct.nlist, %struct.nlist* %85, i64 %87
%89 = getelementptr inbounds %struct.nlist, %struct.nlist* %88, i32 0, i32 2
%90 = load i32, i32* %89
%91 = load %struct.nlist*, %struct.nlist** %7
%92 = load i32, i32* %11
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds %struct.nlist, %struct.nlist* %91, i64 %93
%95 = getelementptr inbounds %struct.nlist, %struct.nlist* %94, i32 0, i32 3
%96 = load i32, i32* %95
%97 = load %struct.nlist*, %struct.nlist** %7
%98 = load i32, i32* %11
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds %struct.nlist, %struct.nlist* %97, i64 %99
%101 = getelementptr inbounds %struct.nlist, %struct.nlist* %100, i32 0, i32 3
%102 = load i32, i32* %101
%103 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.5, i64 0, i64 0), i32 %60, i32 %67, i32 %73, i8* %78, i32 %84, i32 %90, i32 %96, i32 %102)
br label %180
104: ; preds = %56
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), i8** %13
%105 = load %struct.nlist*, %struct.nlist** %7
%106 = load i32, i32* %11
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds %struct.nlist, %struct.nlist* %105, i64 %107
%109 = getelementptr inbounds %struct.nlist, %struct.nlist* %108, i32 0, i32 4
%110 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %109, i32 0, i32 0
%111 = load i32, i32* %110
%112 = icmp sge i32 %111, 0
br i1 %112, label %113, label %134
113: ; preds = %104
%114 = load %struct.nlist*, %struct.nlist** %7
%115 = load i32, i32* %11
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds %struct.nlist, %struct.nlist* %114, i64 %116
%118 = getelementptr inbounds %struct.nlist, %struct.nlist* %117, i32 0, i32 4
%119 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %118, i32 0, i32 0
%120 = load i32, i32* %119
%121 = load i32, i32* %9
%122 = icmp slt i32 %120, %121
br i1 %122, label %123, label %134
123: ; preds = %113
%124 = load i8*, i8** %8
%125 = load %struct.nlist*, %struct.nlist** %7
%126 = load i32, i32* %11
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds %struct.nlist, %struct.nlist* %125, i64 %127
%129 = getelementptr inbounds %struct.nlist, %struct.nlist* %128, i32 0, i32 4
%130 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %129, i32 0, i32 0
%131 = load i32, i32* %130
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i8, i8* %124, i64 %132
store i8* %133, i8** %13
br label %134
134: ; preds = %123, %113, %104
%135 = load i32, i32* %11
%136 = load i8*, i8** %13
%137 = load %struct.nlist*, %struct.nlist** %7
%138 = load i32, i32* %11
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds %struct.nlist, %struct.nlist* %137, i64 %139
%141 = getelementptr inbounds %struct.nlist, %struct.nlist* %140, i32 0, i32 4
%142 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %141, i32 0, i32 0
%143 = load i32, i32* %142
%144 = load %struct.nlist*, %struct.nlist** %7
%145 = load i32, i32* %11
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds %struct.nlist, %struct.nlist* %144, i64 %146
%148 = getelementptr inbounds %struct.nlist, %struct.nlist* %147, i32 0, i32 0
%149 = load i32, i32* %148
%150 = load %struct.nlist*, %struct.nlist** %7
%151 = load i32, i32* %11
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds %struct.nlist, %struct.nlist* %150, i64 %152
%154 = call i8* @symbol_type(%struct.nlist* %153)
%155 = load %struct.nlist*, %struct.nlist** %7
%156 = load i32, i32* %11
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds %struct.nlist, %struct.nlist* %155, i64 %157
%159 = getelementptr inbounds %struct.nlist, %struct.nlist* %158, i32 0, i32 1
%160 = load i32, i32* %159
%161 = load %struct.nlist*, %struct.nlist** %7
%162 = load i32, i32* %11
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds %struct.nlist, %struct.nlist* %161, i64 %163
%165 = getelementptr inbounds %struct.nlist, %struct.nlist* %164, i32 0, i32 2
%166 = load i32, i32* %165
%167 = load %struct.nlist*, %struct.nlist** %7
%168 = load i32, i32* %11
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds %struct.nlist, %struct.nlist* %167, i64 %169
%171 = getelementptr inbounds %struct.nlist, %struct.nlist* %170, i32 0, i32 3
%172 = load i32, i32* %171
%173 = load %struct.nlist*, %struct.nlist** %7
%174 = load i32, i32* %11
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds %struct.nlist, %struct.nlist* %173, i64 %175
%177 = getelementptr inbounds %struct.nlist, %struct.nlist* %176, i32 0, i32 3
%178 = load i32, i32* %177
%179 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.7, i64 0, i64 0), i32 %135, i8* %136, i32 %143, i32 %149, i8* %154, i32 %160, i32 %166, i32 %172, i32 %178)
br label %180
180: ; preds = %134, %59
br label %181
181: ; preds = %180
%182 = load i32, i32* %11
%183 = add nsw i32 %182, 1
store i32 %183, i32* %11
br label %52
184: ; preds = %40, %52
ret void
}

LLVM IR (-O2):
%struct.exec = type { i32 }
%struct.nlist = type { i32, i32, i32, i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@stderr = global i32 0
@.str = [20 x i8] c"a.out header NULL, \00"
@.str.1 = [20 x i8] c"symbol table NULL, \00"
@.str.2 = [20 x i8] c"string table NULL, \00"
@.str.3 = [52 x i8] c" can't possibly list the symbol table meaningfully\0A\00"
@.str.4 = [12 x i8] c"%d symbols\0A\00"
@.str.5 = [78 x i8] c"%4d name offset (%d), type 0x%x - %s, other 0x%x, desc 0x%x, value 0x%x (%d)\0A\00"
@.str.6 = [1 x i8] zeroinitializer
@.str.7 = [76 x i8] c"%4d name \22%s\22 (%d), type 0x%x - %s, other 0x%x, desc 0x%x, value 0x%x (%d)\0A\00"
define void @run_symtable(%struct.exec* %0, %struct.nlist* %1, i8* %2, i32 %3, i32 %4) {
%6 = icmp eq %struct.exec* %0, null
%7 = icmp eq %struct.nlist* %1, null
%8 = or i1 %6, %7
%9 = icmp eq i8* %2, null
%10 = or i1 %8, %9
br i1 %10, label %11, label %26
11: ; preds = %5
br i1 %6, label %12, label %15
12: ; preds = %11
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %12, %11
br i1 %7, label %16, label %19
16: ; preds = %15
%17 = load i32, i32* @stderr
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %16, %15
br i1 %9, label %20, label %23
20: ; preds = %19
%21 = load i32, i32* @stderr
%22 = tail call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %20, %19
%24 = load i32, i32* @stderr
%25 = tail call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
br label %75
26: ; preds = %5
%27 = getelementptr inbounds %struct.exec, %struct.exec* %0, i64 0, i32 0
%28 = load i32, i32* %27
%29 = sext i32 %28 to i64
%30 = udiv i64 %29, 20
%31 = trunc i64 %30 to i32
%32 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %31)
%33 = icmp sgt i32 %31, 0
br i1 %33, label %34, label %75
34: ; preds = %26
%35 = icmp eq i32 %4, 0
%36 = and i64 %30, 4294967295
br label %37
37: ; preds = %34, %72
%38 = phi i64 [ 0, %34 ], [ %73, %72 ]
%39 = getelementptr inbounds %struct.nlist, %struct.nlist* %1, i64 %38
%40 = getelementptr inbounds %struct.nlist, %struct.nlist* %1, i64 %38, i32 4, i32 0
%41 = load i32, i32* %40
br i1 %35, label %42, label %54
42: ; preds = %37
%43 = getelementptr inbounds %struct.nlist, %struct.nlist* %39, i64 0, i32 0
%44 = load i32, i32* %43
%45 = tail call i8* @symbol_type(%struct.nlist* %39)
%46 = getelementptr inbounds %struct.nlist, %struct.nlist* %1, i64 %38, i32 1
%47 = load i32, i32* %46
%48 = getelementptr inbounds %struct.nlist, %struct.nlist* %1, i64 %38, i32 2
%49 = load i32, i32* %48
%50 = getelementptr inbounds %struct.nlist, %struct.nlist* %1, i64 %38, i32 3
%51 = load i32, i32* %50
%52 = trunc i64 %38 to i32
%53 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.5, i64 0, i64 0), i32 %52, i32 %41, i32 %44, i8* %45, i32 %47, i32 %49, i32 %51, i32 %51)
br label %72
54: ; preds = %37
%55 = icmp sgt i32 %41, -1
%56 = icmp slt i32 %41, %3
%57 = and i1 %55, %56
%58 = sext i32 %41 to i64
%59 = getelementptr inbounds i8, i8* %2, i64 %58
%60 = select i1 %57, i8* %59, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0)
%61 = getelementptr inbounds %struct.nlist, %struct.nlist* %39, i64 0, i32 0
%62 = load i32, i32* %61
%63 = tail call i8* @symbol_type(%struct.nlist* %39)
%64 = getelementptr inbounds %struct.nlist, %struct.nlist* %1, i64 %38, i32 1
%65 = load i32, i32* %64
%66 = getelementptr inbounds %struct.nlist, %struct.nlist* %1, i64 %38, i32 2
%67 = load i32, i32* %66
%68 = getelementptr inbounds %struct.nlist, %struct.nlist* %1, i64 %38, i32 3
%69 = load i32, i32* %68
%70 = trunc i64 %38 to i32
%71 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.7, i64 0, i64 0), i32 %70, i8* %60, i32 %41, i32 %62, i8* %63, i32 %65, i32 %67, i32 %69, i32 %69)
br label %72
72: ; preds = %42, %54
%73 = add nuw nsw i64 %38, 1
%74 = icmp eq i64 %73, %36
br i1 %74, label %75, label %37
75: ; preds = %72, %26, %23
ret void
}