#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__ {
  size_t sh_name;
  scalar_t__ sh_type;
  int sh_flags;
  int sh_link;
  int sh_info;
  int /*<<< orphan*/ sh_entsize;
  int /*<<< orphan*/ sh_addralign;
  int /*<<< orphan*/ sh_size;
  int /*<<< orphan*/ sh_offset;
  int /*<<< orphan*/ sh_addr;
};
typedef TYPE_1__ Elf32_Shdr;

/* Variables and functions */
int SHF_INFO_LINK;
scalar_t__ SHT_REL;
scalar_t__ SHT_RELA;
int /*<<< orphan*/ beginblock(int);
int /*<<< orphan*/ endblock();
int /*<<< orphan*/ getentsizestr(int /*<<< orphan*/, int);
int getindexfromoffset(int /*<<< orphan*/);
int /*<<< orphan*/ getoffsetstr(int /*<<< orphan*/, int);
char *getpiecestrtable(int, long *);
int /*<<< orphan*/ getsectionid(int);
int /*<<< orphan*/ getsizestr(int /*<<< orphan*/, int);
int /*<<< orphan*/ linebreak();
int /*<<< orphan*/ out(int /*<<< orphan*/);
int /*<<< orphan*/ outcomment(char const *);
int /*<<< orphan*/ straddress(int /*<<< orphan*/);
int /*<<< orphan*/ strdec(int);
int /*<<< orphan*/ strdefflags(int, char *);
int /*<<< orphan*/ strdefint(scalar_t__, char *);
void outshdr32(void const *ptr, long size, int ndx) {
  Elf32_Shdr const *shdrs = ptr;
  long count = size / sizeof *shdrs;
  char const *strtab;
  long i;
  strtab = getpiecestrtable(ndx, &size);
  beginblock(1);
  for (i = 0; i < count; ++i) {
    if (strtab && strtab[shdrs[i].sh_name]) {
      linebreak();
      outcomment(strtab + shdrs[i].sh_name);
    }
    beginblock(0);
    (out(strdec(shdrs[i].sh_name)));
    (out(strdefint(shdrs[i].sh_type, "SHT_")));
    (out(strdefflags(shdrs[i].sh_flags, "SHF_")));
    (out(straddress(shdrs[i].sh_addr)));
    ndx = getindexfromoffset(shdrs[i].sh_offset);
    out(getoffsetstr(shdrs[i].sh_offset, ndx));
    out(getsizestr(shdrs[i].sh_size, ndx));
    out(getsectionid(shdrs[i].sh_link));
    if (shdrs[i].sh_type == SHT_REL || shdrs[i].sh_type == SHT_RELA ||
        (shdrs[i].sh_flags & SHF_INFO_LINK))
      out(getsectionid(shdrs[i].sh_info));
    else
      (out(strdec(shdrs[i].sh_info)));
    out(getentsizestr(shdrs[i].sh_addralign, ndx));
    out(getentsizestr(shdrs[i].sh_entsize, ndx));
    endblock();
  }
  endblock();
}


x86 assembly (clang, -O0):
<outshdr32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x30,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   10e0 <getpiecestrtable@plt>
mov    %rax,-0x30(%rbp)
mov    $0x1,%edi
call   10b0 <beginblock@plt>
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1479 <outshdr32+0x289>
cmpq   $0x0,-0x30(%rbp)
je     1297 <outshdr32+0xa7>
mov    -0x30(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   $0x30,-0x38(%rbp),%rdx
add    %rdx,%rcx
mov    (%rcx),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1297 <outshdr32+0xa7>
mov    $0x0,%al
call   1110 <linebreak@plt>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%rax
imul   $0x30,-0x38(%rbp),%rcx
add    %rcx,%rax
add    (%rax),%rdi
call   10d0 <outcomment@plt>
xor    %edi,%edi
call   10b0 <beginblock@plt>
mov    -0x20(%rbp),%rax
imul   $0x30,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    (%rax),%rax
mov    %eax,%edi
call   1080 <strdec@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    -0x20(%rbp),%rax
imul   $0x30,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x8(%rax),%rdi
lea    0xd2e(%rip),%rsi
call   1040 <strdefint@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    -0x20(%rbp),%rax
imul   $0x30,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x10(%rax),%edi
lea    0xd11(%rip),%rsi
call   1050 <strdefflags@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    -0x20(%rbp),%rax
imul   $0x30,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x2c(%rax),%edi
call   1100 <straddress@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    -0x20(%rbp),%rax
imul   $0x30,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x28(%rax),%edi
call   1030 <getindexfromoffset@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
imul   $0x30,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x28(%rax),%edi
mov    -0x14(%rbp),%esi
call   10c0 <getoffsetstr@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    -0x20(%rbp),%rax
imul   $0x30,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x24(%rax),%edi
mov    -0x14(%rbp),%esi
call   1070 <getsizestr@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    -0x20(%rbp),%rax
imul   $0x30,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x14(%rax),%edi
call   10a0 <getsectionid@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    -0x20(%rbp),%rax
imul   $0x30,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
mov    0x2c38(%rip),%rcx
cmp    (%rcx),%rax
je     13ea <outshdr32+0x1fa>
mov    -0x20(%rbp),%rax
imul   $0x30,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
mov    0x2c28(%rip),%rcx
cmp    (%rcx),%rax
je     13ea <outshdr32+0x1fa>
mov    -0x20(%rbp),%rax
imul   $0x30,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x10(%rax),%eax
mov    0x2c01(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     140a <outshdr32+0x21a>
mov    -0x20(%rbp),%rax
imul   $0x30,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x18(%rax),%edi
call   10a0 <getsectionid@plt>
mov    %eax,%edi
call   10f0 <out@plt>
jmp    1425 <outshdr32+0x235>
mov    -0x20(%rbp),%rax
imul   $0x30,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x18(%rax),%edi
call   1080 <strdec@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    -0x20(%rbp),%rax
imul   $0x30,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x20(%rax),%edi
mov    -0x14(%rbp),%esi
call   1090 <getentsizestr@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    -0x20(%rbp),%rax
imul   $0x30,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x1c(%rax),%edi
mov    -0x14(%rbp),%esi
call   1090 <getentsizestr@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    $0x0,%al
call   1060 <endblock@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    123f <outshdr32+0x4f>
mov    $0x0,%al
call   1060 <endblock@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outshdr32>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbp
mov    %rdi,%rbx
mov    %rsi,(%rsp)
mov    %rsp,%rsi
mov    %edx,%edi
call   10e0 <getpiecestrtable@plt>
mov    %rax,%r14
mov    $0x1,%edi
call   10b0 <beginblock@plt>
cmp    $0x30,%rbp
jae    1238 <outshdr32+0x48>
xor    %eax,%eax
call   1060 <endblock@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mov    %rbp,%rax
mul    %rcx
mov    %rdx,%r15
shr    $0x5,%r15
lea    0xdaa(%rip),%r12
lea    0xda8(%rip),%r13
jmp    12a2 <outshdr32+0xb2>
nop
mov    0x18(%rbx),%edi
call   10a0 <getsectionid@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    0x20(%rbx),%edi
mov    %ebp,%esi
call   1090 <getentsizestr@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    0x1c(%rbx),%edi
mov    %ebp,%esi
call   1090 <getentsizestr@plt>
mov    %eax,%edi
call   10f0 <out@plt>
xor    %eax,%eax
call   1060 <endblock@plt>
add    $0x30,%rbx
add    $0xffffffffffffffff,%r15
je     1222 <outshdr32+0x32>
test   %r14,%r14
je     12c3 <outshdr32+0xd3>
mov    (%rbx),%rax
cmpb   $0x0,(%r14,%rax,1)
je     12c3 <outshdr32+0xd3>
xor    %eax,%eax
call   1110 <linebreak@plt>
mov    (%rbx),%rdi
add    %r14,%rdi
call   10d0 <outcomment@plt>
xor    %edi,%edi
call   10b0 <beginblock@plt>
mov    (%rbx),%edi
call   1080 <strdec@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    0x8(%rbx),%rdi
mov    %r12,%rsi
call   1040 <strdefint@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    0x10(%rbx),%edi
mov    %r13,%rsi
call   1050 <strdefflags@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    0x2c(%rbx),%edi
call   1100 <straddress@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    0x28(%rbx),%edi
call   1030 <getindexfromoffset@plt>
mov    %eax,%ebp
mov    0x28(%rbx),%edi
mov    %eax,%esi
call   10c0 <getoffsetstr@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    0x24(%rbx),%edi
mov    %ebp,%esi
call   1070 <getsizestr@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    0x14(%rbx),%edi
call   10a0 <getsectionid@plt>
mov    %eax,%edi
call   10f0 <out@plt>
mov    0x8(%rbx),%rax
mov    0x2c86(%rip),%rcx
cmp    (%rcx),%rax
je     1260 <outshdr32+0x70>
mov    0x2c86(%rip),%rcx
cmp    (%rcx),%rax
je     1260 <outshdr32+0x70>
mov    0x2c6e(%rip),%rax
mov    (%rax),%eax
test   %eax,0x10(%rbx)
jne    1260 <outshdr32+0x70>
mov    0x18(%rbx),%edi
call   1080 <strdec@plt>
jmp    1268 <outshdr32+0x78>

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64, i64, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [5 x i8] c"SHT_\00"
@.str.1 = [5 x i8] c"SHF_\00"
@SHT_REL = global i64 0
@SHT_RELA = global i64 0
@SHF_INFO_LINK = global i32 0
define void @outshdr32(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = alloca %struct.TYPE_2__*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to %struct.TYPE_2__*
store %struct.TYPE_2__* %12, %struct.TYPE_2__** %7
%13 = load i64, i64* %5
%14 = udiv i64 %13, 48
store i64 %14, i64* %8
%15 = load i32, i32* %6
%16 = call i8* @getpiecestrtable(i32 %15, i64* %5)
store i8* %16, i8** %9
%17 = call i32 @beginblock(i32 1)
store i64 0, i64* %10
br label %18
18: ; preds = %164, %3
%19 = load i64, i64* %10
%20 = load i64, i64* %8
%21 = icmp slt i64 %19, %20
br i1 %21, label %22, label %167
22: ; preds = %18
%23 = load i8*, i8** %9
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %46
25: ; preds = %22
%26 = load i8*, i8** %9
%27 = load %struct.TYPE_2__*, %struct.TYPE_2__** %7
%28 = load i64, i64* %10
%29 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %27, i64 %28
%30 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %29, i32 0, i32 0
%31 = load i64, i64* %30
%32 = getelementptr inbounds i8, i8* %26, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %46
36: ; preds = %25
%37 = call i32 (...) @linebreak()
%38 = load i8*, i8** %9
%39 = load %struct.TYPE_2__*, %struct.TYPE_2__** %7
%40 = load i64, i64* %10
%41 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %39, i64 %40
%42 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %41, i32 0, i32 0
%43 = load i64, i64* %42
%44 = getelementptr inbounds i8, i8* %38, i64 %43
%45 = call i32 @outcomment(i8* %44)
br label %46
46: ; preds = %36, %25, %22
%47 = call i32 @beginblock(i32 0)
%48 = load %struct.TYPE_2__*, %struct.TYPE_2__** %7
%49 = load i64, i64* %10
%50 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %48, i64 %49
%51 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %50, i32 0, i32 0
%52 = load i64, i64* %51
%53 = trunc i64 %52 to i32
%54 = call i32 @strdec(i32 %53)
%55 = call i32 @out(i32 %54)
%56 = load %struct.TYPE_2__*, %struct.TYPE_2__** %7
%57 = load i64, i64* %10
%58 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %56, i64 %57
%59 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %58, i32 0, i32 1
%60 = load i64, i64* %59
%61 = call i32 @strdefint(i64 %60, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%62 = call i32 @out(i32 %61)
%63 = load %struct.TYPE_2__*, %struct.TYPE_2__** %7
%64 = load i64, i64* %10
%65 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %63, i64 %64
%66 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %65, i32 0, i32 2
%67 = load i32, i32* %66
%68 = call i32 @strdefflags(i32 %67, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%69 = call i32 @out(i32 %68)
%70 = load %struct.TYPE_2__*, %struct.TYPE_2__** %7
%71 = load i64, i64* %10
%72 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %70, i64 %71
%73 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %72, i32 0, i32 9
%74 = load i32, i32* %73
%75 = call i32 @straddress(i32 %74)
%76 = call i32 @out(i32 %75)
%77 = load %struct.TYPE_2__*, %struct.TYPE_2__** %7
%78 = load i64, i64* %10
%79 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %77, i64 %78
%80 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %79, i32 0, i32 8
%81 = load i32, i32* %80
%82 = call i32 @getindexfromoffset(i32 %81)
store i32 %82, i32* %6
%83 = load %struct.TYPE_2__*, %struct.TYPE_2__** %7
%84 = load i64, i64* %10
%85 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %83, i64 %84
%86 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %85, i32 0, i32 8
%87 = load i32, i32* %86
%88 = load i32, i32* %6
%89 = call i32 @getoffsetstr(i32 %87, i32 %88)
%90 = call i32 @out(i32 %89)
%91 = load %struct.TYPE_2__*, %struct.TYPE_2__** %7
%92 = load i64, i64* %10
%93 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %91, i64 %92
%94 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %93, i32 0, i32 7
%95 = load i32, i32* %94
%96 = load i32, i32* %6
%97 = call i32 @getsizestr(i32 %95, i32 %96)
%98 = call i32 @out(i32 %97)
%99 = load %struct.TYPE_2__*, %struct.TYPE_2__** %7
%100 = load i64, i64* %10
%101 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %99, i64 %100
%102 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %101, i32 0, i32 3
%103 = load i32, i32* %102
%104 = call i32 @getsectionid(i32 %103)
%105 = call i32 @out(i32 %104)
%106 = load %struct.TYPE_2__*, %struct.TYPE_2__** %7
%107 = load i64, i64* %10
%108 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %106, i64 %107
%109 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %108, i32 0, i32 1
%110 = load i64, i64* %109
%111 = load i64, i64* @SHT_REL
%112 = icmp eq i64 %110, %111
br i1 %112, label %130, label %113
113: ; preds = %46
%114 = load %struct.TYPE_2__*, %struct.TYPE_2__** %7
%115 = load i64, i64* %10
%116 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %114, i64 %115
%117 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %116, i32 0, i32 1
%118 = load i64, i64* %117
%119 = load i64, i64* @SHT_RELA
%120 = icmp eq i64 %118, %119
br i1 %120, label %130, label %121
121: ; preds = %113
%122 = load %struct.TYPE_2__*, %struct.TYPE_2__** %7
%123 = load i64, i64* %10
%124 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %122, i64 %123
%125 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %124, i32 0, i32 2
%126 = load i32, i32* %125
%127 = load i32, i32* @SHF_INFO_LINK
%128 = and i32 %126, %127
%129 = icmp ne i32 %128, 0
br i1 %129, label %130, label %138
130: ; preds = %121, %113, %46
%131 = load %struct.TYPE_2__*, %struct.TYPE_2__** %7
%132 = load i64, i64* %10
%133 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %131, i64 %132
%134 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %133, i32 0, i32 4
%135 = load i32, i32* %134
%136 = call i32 @getsectionid(i32 %135)
%137 = call i32 @out(i32 %136)
br label %146
138: ; preds = %121
%139 = load %struct.TYPE_2__*, %struct.TYPE_2__** %7
%140 = load i64, i64* %10
%141 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %139, i64 %140
%142 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %141, i32 0, i32 4
%143 = load i32, i32* %142
%144 = call i32 @strdec(i32 %143)
%145 = call i32 @out(i32 %144)
br label %146
146: ; preds = %138, %130
%147 = load %struct.TYPE_2__*, %struct.TYPE_2__** %7
%148 = load i64, i64* %10
%149 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %147, i64 %148
%150 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %149, i32 0, i32 6
%151 = load i32, i32* %150
%152 = load i32, i32* %6
%153 = call i32 @getentsizestr(i32 %151, i32 %152)
%154 = call i32 @out(i32 %153)
%155 = load %struct.TYPE_2__*, %struct.TYPE_2__** %7
%156 = load i64, i64* %10
%157 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %155, i64 %156
%158 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %157, i32 0, i32 5
%159 = load i32, i32* %158
%160 = load i32, i32* %6
%161 = call i32 @getentsizestr(i32 %159, i32 %160)
%162 = call i32 @out(i32 %161)
%163 = call i32 (...) @endblock()
br label %164
164: ; preds = %146
%165 = load i64, i64* %10
%166 = add nsw i64 %165, 1
store i64 %166, i64* %10
br label %18
167: ; preds = %18
%168 = call i32 (...) @endblock()
ret void
}

LLVM IR (-O2):
%struct.TYPE_2__ = type { i64, i64, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [5 x i8] c"SHT_\00"
@.str.1 = [5 x i8] c"SHF_\00"
@SHT_REL = global i64 0
@SHT_RELA = global i64 0
@SHF_INFO_LINK = global i32 0
define void @outshdr32(i8* nocapture %0, i64 %1, i32 %2) {
%4 = alloca i64
store i64 %1, i64* %4
%5 = bitcast i8* %0 to %struct.TYPE_2__*
%6 = call i8* @getpiecestrtable(i32 %2, i64* %4)
%7 = call i32 @beginblock(i32 1)
%8 = icmp ult i64 %1, 48
br i1 %8, label %91, label %9
9: ; preds = %3
%10 = udiv i64 %1, 48
%11 = icmp eq i8* %6, null
br label %12
12: ; preds = %9, %77
%13 = phi i64 [ 0, %9 ], [ %89, %77 ]
br i1 %11, label %25, label %14
14: ; preds = %12
%15 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i64 %13, i32 0
%16 = load i64, i64* %15
%17 = getelementptr inbounds i8, i8* %6, i64 %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %25, label %20
20: ; preds = %14
%21 = call i32 (...) @linebreak()
%22 = load i64, i64* %15
%23 = getelementptr inbounds i8, i8* %6, i64 %22
%24 = call i32 @outcomment(i8* %23)
br label %25
25: ; preds = %20, %14, %12
%26 = call i32 @beginblock(i32 0)
%27 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i64 %13, i32 0
%28 = load i64, i64* %27
%29 = trunc i64 %28 to i32
%30 = call i32 @strdec(i32 %29)
%31 = call i32 @out(i32 %30)
%32 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i64 %13, i32 1
%33 = load i64, i64* %32
%34 = call i32 @strdefint(i64 %33, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%35 = call i32 @out(i32 %34)
%36 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i64 %13, i32 2
%37 = load i32, i32* %36
%38 = call i32 @strdefflags(i32 %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%39 = call i32 @out(i32 %38)
%40 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i64 %13, i32 9
%41 = load i32, i32* %40
%42 = call i32 @straddress(i32 %41)
%43 = call i32 @out(i32 %42)
%44 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i64 %13, i32 8
%45 = load i32, i32* %44
%46 = call i32 @getindexfromoffset(i32 %45)
%47 = load i32, i32* %44
%48 = call i32 @getoffsetstr(i32 %47, i32 %46)
%49 = call i32 @out(i32 %48)
%50 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i64 %13, i32 7
%51 = load i32, i32* %50
%52 = call i32 @getsizestr(i32 %51, i32 %46)
%53 = call i32 @out(i32 %52)
%54 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i64 %13, i32 3
%55 = load i32, i32* %54
%56 = call i32 @getsectionid(i32 %55)
%57 = call i32 @out(i32 %56)
%58 = load i64, i64* %32
%59 = load i64, i64* @SHT_REL
%60 = icmp eq i64 %58, %59
%61 = load i64, i64* @SHT_RELA
%62 = icmp eq i64 %58, %61
%63 = select i1 %60, i1 true, i1 %62
br i1 %63, label %69, label %64
64: ; preds = %25
%65 = load i32, i32* %36
%66 = load i32, i32* @SHF_INFO_LINK
%67 = and i32 %66, %65
%68 = icmp eq i32 %67, 0
br i1 %68, label %73, label %69
69: ; preds = %64, %25
%70 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i64 %13, i32 4
%71 = load i32, i32* %70
%72 = call i32 @getsectionid(i32 %71)
br label %77
73: ; preds = %64
%74 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i64 %13, i32 4
%75 = load i32, i32* %74
%76 = call i32 @strdec(i32 %75)
br label %77
77: ; preds = %73, %69
%78 = phi i32 [ %76, %73 ], [ %72, %69 ]
%79 = call i32 @out(i32 %78)
%80 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i64 %13, i32 6
%81 = load i32, i32* %80
%82 = call i32 @getentsizestr(i32 %81, i32 %46)
%83 = call i32 @out(i32 %82)
%84 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i64 %13, i32 5
%85 = load i32, i32* %84
%86 = call i32 @getentsizestr(i32 %85, i32 %46)
%87 = call i32 @out(i32 %86)
%88 = call i32 (...) @endblock()
%89 = add nuw nsw i64 %13, 1
%90 = icmp eq i64 %89, %10
br i1 %90, label %91, label %12
91: ; preds = %77, %3
%92 = call i32 (...) @endblock()
ret void
}