#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_8__ TYPE_3__;
typedef struct TYPE_7__ TYPE_2__;
typedef struct TYPE_6__ TYPE_1__;

/* Type definitions */
typedef size_t ssize_t;
struct TYPE_6__ {
  int /*<<< orphan*/ d_val;
  int /*<<< orphan*/ d_ptr;
};
struct TYPE_8__ {
  scalar_t__ d_tag;
  TYPE_1__ d_un;
};
struct TYPE_7__ {
  size_t p_filesz;
};
typedef int /*<<< orphan*/ FILE;
typedef TYPE_2__ Elf32_Phdr;
typedef int /*<<< orphan*/ Elf32_Ehdr;
typedef TYPE_3__ Elf32_Dyn;

/* Variables and functions */
scalar_t__ DT_NEEDED;
scalar_t__ DT_NULL;
scalar_t__ DT_RPATH;
scalar_t__ DT_STRTAB;
scalar_t__ _do_phdr_dyn_print32(char *, char const *);
char *_do_string32(char const *, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/, int /*<<< orphan*/);
int _error(char const *, char *, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
int _do_phdr_dyn32(char const *filename, FILE *fp, Elf32_Ehdr *ehdr,
                   Elf32_Phdr *phdr, Elf32_Dyn *dyn, char const *ldpath) {
  ssize_t s = -1;
  ssize_t r = -1;
  size_t i;
  char *p;
  char *rpath = NULL;
  for (i = 0; (i + 1) * sizeof(*dyn) < phdr->p_filesz; i++) {
    if (dyn[i].d_tag == DT_NULL)
      break;
    if (dyn[i].d_tag == DT_STRTAB)
      s = i;
    else if (dyn[i].d_tag == DT_RPATH)
      r = i;
  }
  if (s < 0)
    return -_error(filename, "Missing string section", 1);
  if (s >= 0 && r >= 0)
    rpath =
        _do_string32(filename, fp, ehdr, dyn[s].d_un.d_val, dyn[r].d_un.d_val);
  for (i = 0; (i + 1) * sizeof(*dyn) < phdr->p_filesz; i++) {
    if (dyn[i].d_tag == DT_NULL)
      break;
    if (dyn[i].d_tag != DT_NEEDED)
      continue;
    if ((p = _do_string32(filename, fp, ehdr, dyn[s].d_un.d_ptr,
                          dyn[i].d_un.d_val)) == NULL)
      continue;
    if (_do_phdr_dyn_print32(p, ldpath) != 0 &&
        _do_phdr_dyn_print32(p, rpath) != 0 &&
        _do_phdr_dyn_print32(p, "/usr/lib:/lib") != 0)
      printf("\t%s\n", p);
    free(p);
  }
  return 0;
}


x86 assembly (clang, -O0):
<_do_phdr_dyn32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movq   $0xffffffffffffffff,-0x40(%rbp)
ff
movq   $0xffffffffffffffff,-0x48(%rbp)
ff
movq   $0x0,-0x60(%rbp)
movq   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%rax
add    $0x1,%rax
shl    $0x4,%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jae    1244 <_do_phdr_dyn32+0xf4>
mov    -0x30(%rbp),%rax
mov    -0x50(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rax
mov    0x2e06(%rip),%rcx
cmp    (%rcx),%rax
jne    11d0 <_do_phdr_dyn32+0x80>
jmp    1244 <_do_phdr_dyn32+0xf4>
mov    -0x30(%rbp),%rax
mov    -0x50(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rax
mov    0x2e0f(%rip),%rcx
cmp    (%rcx),%rax
jne    11ff <_do_phdr_dyn32+0xaf>
mov    -0x50(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    122e <_do_phdr_dyn32+0xde>
mov    -0x30(%rbp),%rax
mov    -0x50(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rax
mov    0x2dc0(%rip),%rcx
cmp    (%rcx),%rax
jne    1229 <_do_phdr_dyn32+0xd9>
mov    -0x50(%rbp),%rax
mov    %rax,-0x48(%rbp)
jmp    122e <_do_phdr_dyn32+0xde>
jmp    1233 <_do_phdr_dyn32+0xe3>
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
jmp    1190 <_do_phdr_dyn32+0x40>
cmpq   $0x0,-0x40(%rbp)
jae    1272 <_do_phdr_dyn32+0x122>
mov    -0x10(%rbp),%rdi
lea    0xda6(%rip),%rsi
mov    $0x1,%edx
call   1050 <_error@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    13f3 <_do_phdr_dyn32+0x2a3>
cmpq   $0x0,-0x40(%rbp)
jb     12c2 <_do_phdr_dyn32+0x172>
cmpq   $0x0,-0x48(%rbp)
jb     12c2 <_do_phdr_dyn32+0x172>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rax
mov    -0x40(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%ecx
mov    -0x30(%rbp),%rax
mov    -0x48(%rbp),%r8
shl    $0x4,%r8
add    %r8,%rax
mov    0x8(%rax),%r8d
call   1070 <_do_string32@plt>
mov    %rax,-0x60(%rbp)
movq   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%rax
add    $0x1,%rax
shl    $0x4,%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jae    13ec <_do_phdr_dyn32+0x29c>
mov    -0x30(%rbp),%rax
mov    -0x50(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rax
mov    0x2ccc(%rip),%rcx
cmp    (%rcx),%rax
jne    130a <_do_phdr_dyn32+0x1ba>
jmp    13ec <_do_phdr_dyn32+0x29c>
mov    -0x30(%rbp),%rax
mov    -0x50(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rax
mov    0x2cbd(%rip),%rcx
cmp    (%rcx),%rax
je     1331 <_do_phdr_dyn32+0x1e1>
jmp    13db <_do_phdr_dyn32+0x28b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rax
mov    -0x40(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    0xc(%rax),%ecx
mov    -0x30(%rbp),%rax
mov    -0x50(%rbp),%r8
shl    $0x4,%r8
add    %r8,%rax
mov    0x8(%rax),%r8d
call   1070 <_do_string32@plt>
mov    %rax,-0x58(%rbp)
cmp    $0x0,%rax
jne    137a <_do_phdr_dyn32+0x22a>
jmp    13db <_do_phdr_dyn32+0x28b>
mov    -0x58(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1060 <_do_phdr_dyn_print32@plt>
cmp    $0x0,%rax
je     13d2 <_do_phdr_dyn32+0x282>
mov    -0x58(%rbp),%rdi
mov    -0x60(%rbp),%rsi
call   1060 <_do_phdr_dyn_print32@plt>
cmp    $0x0,%rax
je     13d2 <_do_phdr_dyn32+0x282>
mov    -0x58(%rbp),%rdi
lea    0xc64(%rip),%rsi
call   1060 <_do_phdr_dyn_print32@plt>
cmp    $0x0,%rax
je     13d2 <_do_phdr_dyn32+0x282>
mov    -0x58(%rbp),%rsi
lea    0xc58(%rip),%rdi
call   1040 <printf@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
jmp    12ca <_do_phdr_dyn32+0x17a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_do_phdr_dyn32>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,0x20(%rsp)
mov    %r8,%r12
mov    %rcx,%r15
mov    %rdx,0x10(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rdi,(%rsp)
mov    (%rcx),%r10
mov    $0xffffffffffffffff,%rbp
mov    $0xffffffffffffffff,%rdi
cmp    $0x11,%r10
jb     11ec <_do_phdr_dyn32+0xac>
mov    0x2e43(%rip),%rax
mov    (%rax),%r9
mov    0x2e69(%rip),%rax
mov    (%rax),%r8
mov    0x2e3f(%rip),%rax
mov    (%rax),%rcx
mov    $0xffffffffffffffff,%rdi
mov    $0x10,%ebx
xor    %esi,%esi
mov    $0xffffffffffffffff,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    -0x10(%r12,%rbx,1),%rdx
cmp    %r9,%rdx
je     11ec <_do_phdr_dyn32+0xac>
cmp    %rcx,%rdx
mov    %rdi,%rax
cmove  %rsi,%rax
cmp    %r8,%rdx
cmove  %rsi,%rbp
cmovne %rax,%rdi
add    $0x10,%rbx
add    $0x1,%rsi
cmp    %r10,%rbx
jb     11c0 <_do_phdr_dyn32+0x80>
shl    $0x4,%rbp
mov    0x8(%r12,%rbp,1),%ecx
shl    $0x4,%rdi
mov    0x8(%r12,%rdi,1),%r8d
mov    (%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    0x10(%rsp),%rdx
call   1060 <_do_string32@plt>
mov    %rax,0x18(%rsp)
cmpq   $0x11,(%r15)
jb     12de <_do_phdr_dyn32+0x19e>
lea    (%r12,%rbp,1),%rbx
add    $0xc,%rbx
mov    $0x10,%r13d
mov    0x2d93(%rip),%rbp
jmp    1255 <_do_phdr_dyn32+0x115>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <free@plt>
add    $0x10,%r13
cmp    (%r15),%r13
jae    12de <_do_phdr_dyn32+0x19e>
mov    -0x10(%r12,%r13,1),%rax
cmp    0x0(%rbp),%rax
je     12de <_do_phdr_dyn32+0x19e>
mov    0x2d79(%rip),%rcx
cmp    (%rcx),%rax
jne    1248 <_do_phdr_dyn32+0x108>
mov    (%rbx),%ecx
mov    -0x8(%r12,%r13,1),%r8d
mov    (%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    0x10(%rsp),%rdx
call   1060 <_do_string32@plt>
test   %rax,%rax
je     1248 <_do_phdr_dyn32+0x108>
mov    %rax,%r14
mov    %rax,%rdi
mov    0x20(%rsp),%rsi
call   1050 <_do_phdr_dyn_print32@plt>
test   %rax,%rax
je     1240 <_do_phdr_dyn32+0x100>
mov    %r14,%rdi
mov    0x18(%rsp),%rsi
call   1050 <_do_phdr_dyn_print32@plt>
test   %rax,%rax
je     1240 <_do_phdr_dyn32+0x100>
mov    %r14,%rdi
lea    0xd44(%rip),%rsi
call   1050 <_do_phdr_dyn_print32@plt>
test   %rax,%rax
je     1240 <_do_phdr_dyn32+0x100>
lea    0xd3d(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
jmp    1240 <_do_phdr_dyn32+0x100>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_7__ = type { i64 }
%struct.TYPE_8__ = type { i64, %struct.TYPE_6__ }
%struct.TYPE_6__ = type { i32, i32 }
@DT_NULL = global i64 0
@DT_STRTAB = global i64 0
@DT_RPATH = global i64 0
@.str = [23 x i8] c"Missing string section\00"
@DT_NEEDED = global i64 0
@.str.1 = [14 x i8] c"/usr/lib:/lib\00"
@.str.2 = [5 x i8] c"\09%s\0A\00"
define i32 @_do_phdr_dyn32(i8* %0, i32* %1, i32* %2, %struct.TYPE_7__* %3, %struct.TYPE_8__* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca %struct.TYPE_7__*
%12 = alloca %struct.TYPE_8__*
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i8*
%18 = alloca i8*
store i8* %0, i8** %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store %struct.TYPE_7__* %3, %struct.TYPE_7__** %11
store %struct.TYPE_8__* %4, %struct.TYPE_8__** %12
store i8* %5, i8** %13
store i64 -1, i64* %14
store i64 -1, i64* %15
store i8* null, i8** %18
store i64 0, i64* %16
br label %19
19: ; preds = %58, %6
%20 = load i64, i64* %16
%21 = add i64 %20, 1
%22 = mul i64 %21, 16
%23 = load %struct.TYPE_7__*, %struct.TYPE_7__** %11
%24 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %23, i32 0, i32 0
%25 = load i64, i64* %24
%26 = icmp ult i64 %22, %25
br i1 %26, label %27, label %61
27: ; preds = %19
%28 = load %struct.TYPE_8__*, %struct.TYPE_8__** %12
%29 = load i64, i64* %16
%30 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %28, i64 %29
%31 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %30, i32 0, i32 0
%32 = load i64, i64* %31
%33 = load i64, i64* @DT_NULL
%34 = icmp eq i64 %32, %33
br i1 %34, label %35, label %36
35: ; preds = %27
br label %61
36: ; preds = %27
%37 = load %struct.TYPE_8__*, %struct.TYPE_8__** %12
%38 = load i64, i64* %16
%39 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %37, i64 %38
%40 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %39, i32 0, i32 0
%41 = load i64, i64* %40
%42 = load i64, i64* @DT_STRTAB
%43 = icmp eq i64 %41, %42
br i1 %43, label %44, label %46
44: ; preds = %36
%45 = load i64, i64* %16
store i64 %45, i64* %14
br label %57
46: ; preds = %36
%47 = load %struct.TYPE_8__*, %struct.TYPE_8__** %12
%48 = load i64, i64* %16
%49 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %47, i64 %48
%50 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %49, i32 0, i32 0
%51 = load i64, i64* %50
%52 = load i64, i64* @DT_RPATH
%53 = icmp eq i64 %51, %52
br i1 %53, label %54, label %56
54: ; preds = %46
%55 = load i64, i64* %16
store i64 %55, i64* %15
br label %56
56: ; preds = %54, %46
br label %57
57: ; preds = %56, %44
br label %58
58: ; preds = %57
%59 = load i64, i64* %16
%60 = add i64 %59, 1
store i64 %60, i64* %16
br label %19
61: ; preds = %35, %19
%62 = load i64, i64* %14
%63 = icmp ult i64 %62, 0
br i1 %63, label %64, label %68
64: ; preds = %61
%65 = load i8*, i8** %8
%66 = call i32 @_error(i8* %65, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 1)
%67 = sub nsw i32 0, %66
store i32 %67, i32* %7
br label %161
68: ; preds = %61
%69 = load i64, i64* %14
%70 = icmp uge i64 %69, 0
br i1 %70, label %71, label %91
71: ; preds = %68
%72 = load i64, i64* %15
%73 = icmp uge i64 %72, 0
br i1 %73, label %74, label %91
74: ; preds = %71
%75 = load i8*, i8** %8
%76 = load i32*, i32** %9
%77 = load i32*, i32** %10
%78 = load %struct.TYPE_8__*, %struct.TYPE_8__** %12
%79 = load i64, i64* %14
%80 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %78, i64 %79
%81 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %80, i32 0, i32 1
%82 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %81, i32 0, i32 0
%83 = load i32, i32* %82
%84 = load %struct.TYPE_8__*, %struct.TYPE_8__** %12
%85 = load i64, i64* %15
%86 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %84, i64 %85
%87 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %86, i32 0, i32 1
%88 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %87, i32 0, i32 0
%89 = load i32, i32* %88
%90 = call i8* @_do_string32(i8* %75, i32* %76, i32* %77, i32 %83, i32 %89)
store i8* %90, i8** %18
br label %91
91: ; preds = %74, %71, %68
store i64 0, i64* %16
br label %92
92: ; preds = %157, %91
%93 = load i64, i64* %16
%94 = add i64 %93, 1
%95 = mul i64 %94, 16
%96 = load %struct.TYPE_7__*, %struct.TYPE_7__** %11
%97 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %96, i32 0, i32 0
%98 = load i64, i64* %97
%99 = icmp ult i64 %95, %98
br i1 %99, label %100, label %160
100: ; preds = %92
%101 = load %struct.TYPE_8__*, %struct.TYPE_8__** %12
%102 = load i64, i64* %16
%103 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %101, i64 %102
%104 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %103, i32 0, i32 0
%105 = load i64, i64* %104
%106 = load i64, i64* @DT_NULL
%107 = icmp eq i64 %105, %106
br i1 %107, label %108, label %109
108: ; preds = %100
br label %160
109: ; preds = %100
%110 = load %struct.TYPE_8__*, %struct.TYPE_8__** %12
%111 = load i64, i64* %16
%112 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %110, i64 %111
%113 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %112, i32 0, i32 0
%114 = load i64, i64* %113
%115 = load i64, i64* @DT_NEEDED
%116 = icmp ne i64 %114, %115
br i1 %116, label %117, label %118
117: ; preds = %109
br label %157
118: ; preds = %109
%119 = load i8*, i8** %8
%120 = load i32*, i32** %9
%121 = load i32*, i32** %10
%122 = load %struct.TYPE_8__*, %struct.TYPE_8__** %12
%123 = load i64, i64* %14
%124 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %122, i64 %123
%125 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %124, i32 0, i32 1
%126 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %125, i32 0, i32 1
%127 = load i32, i32* %126
%128 = load %struct.TYPE_8__*, %struct.TYPE_8__** %12
%129 = load i64, i64* %16
%130 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %128, i64 %129
%131 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %130, i32 0, i32 1
%132 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %131, i32 0, i32 0
%133 = load i32, i32* %132
%134 = call i8* @_do_string32(i8* %119, i32* %120, i32* %121, i32 %127, i32 %133)
store i8* %134, i8** %17
%135 = icmp eq i8* %134, null
br i1 %135, label %136, label %137
136: ; preds = %118
br label %157
137: ; preds = %118
%138 = load i8*, i8** %17
%139 = load i8*, i8** %13
%140 = call i64 @_do_phdr_dyn_print32(i8* %138, i8* %139)
%141 = icmp ne i64 %140, 0
br i1 %141, label %142, label %154
142: ; preds = %137
%143 = load i8*, i8** %17
%144 = load i8*, i8** %18
%145 = call i64 @_do_phdr_dyn_print32(i8* %143, i8* %144)
%146 = icmp ne i64 %145, 0
br i1 %146, label %147, label %154
147: ; preds = %142
%148 = load i8*, i8** %17
%149 = call i64 @_do_phdr_dyn_print32(i8* %148, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%150 = icmp ne i64 %149, 0
br i1 %150, label %151, label %154
151: ; preds = %147
%152 = load i8*, i8** %17
%153 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %152)
br label %154
154: ; preds = %151, %147, %142, %137
%155 = load i8*, i8** %17
%156 = call i32 @free(i8* %155)
br label %157
157: ; preds = %154, %136, %117
%158 = load i64, i64* %16
%159 = add i64 %158, 1
store i64 %159, i64* %16
br label %92
160: ; preds = %108, %92
store i32 0, i32* %7
br label %161
161: ; preds = %160, %64
%162 = load i32, i32* %7
ret i32 %162
}

LLVM IR (-O2):
%struct.TYPE_7__ = type { i64 }
%struct.TYPE_8__ = type { i64, %struct.TYPE_6__ }
%struct.TYPE_6__ = type { i32, i32 }
@DT_NULL = global i64 0
@DT_STRTAB = global i64 0
@DT_RPATH = global i64 0
@DT_NEEDED = global i64 0
@.str.1 = [14 x i8] c"/usr/lib:/lib\00"
@.str.2 = [5 x i8] c"\09%s\0A\00"
define i32 @_do_phdr_dyn32(i8* %0, i32* %1, i32* %2, %struct.TYPE_7__* nocapture %3, %struct.TYPE_8__* nocapture %4, i8* %5) {
%7 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %3, i64 0, i32 0
%8 = load i64, i64* %7
%9 = icmp ugt i64 %8, 16
br i1 %9, label %10, label %31
10: ; preds = %6
%11 = load i64, i64* @DT_NULL
%12 = load i64, i64* @DT_STRTAB
%13 = load i64, i64* @DT_RPATH
br label %14
14: ; preds = %10, %22
%15 = phi i64 [ 1, %10 ], [ %28, %22 ]
%16 = phi i64 [ 0, %10 ], [ %15, %22 ]
%17 = phi i64 [ -1, %10 ], [ %27, %22 ]
%18 = phi i64 [ -1, %10 ], [ %26, %22 ]
%19 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %4, i64 %16, i32 0
%20 = load i64, i64* %19
%21 = icmp eq i64 %20, %11
br i1 %21, label %31, label %22
22: ; preds = %14
%23 = icmp eq i64 %20, %12
%24 = icmp eq i64 %20, %13
%25 = select i1 %24, i64 %16, i64 %17
%26 = select i1 %23, i64 %16, i64 %18
%27 = select i1 %23, i64 %17, i64 %25
%28 = add i64 %15, 1
%29 = shl i64 %28, 4
%30 = icmp ult i64 %29, %8
br i1 %30, label %14, label %31
31: ; preds = %22, %14, %6
%32 = phi i64 [ -1, %6 ], [ %18, %14 ], [ %26, %22 ]
%33 = phi i64 [ -1, %6 ], [ %17, %14 ], [ %27, %22 ]
%34 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %4, i64 %32, i32 1, i32 0
%35 = load i32, i32* %34
%36 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %4, i64 %33, i32 1, i32 0
%37 = load i32, i32* %36
%38 = tail call i8* @_do_string32(i8* %0, i32* %1, i32* %2, i32 %35, i32 %37)
%39 = load i64, i64* %7
%40 = icmp ugt i64 %39, 16
br i1 %40, label %41, label %77
41: ; preds = %31
%42 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %4, i64 %32, i32 1, i32 1
br label %43
43: ; preds = %41, %72
%44 = phi i64 [ 1, %41 ], [ %73, %72 ]
%45 = phi i64 [ 0, %41 ], [ %44, %72 ]
%46 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %4, i64 %45, i32 0
%47 = load i64, i64* %46
%48 = load i64, i64* @DT_NULL
%49 = icmp eq i64 %47, %48
br i1 %49, label %77, label %50
50: ; preds = %43
%51 = load i64, i64* @DT_NEEDED
%52 = icmp eq i64 %47, %51
br i1 %52, label %53, label %72
53: ; preds = %50
%54 = load i32, i32* %42
%55 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %4, i64 %45, i32 1, i32 0
%56 = load i32, i32* %55
%57 = tail call i8* @_do_string32(i8* %0, i32* %1, i32* %2, i32 %54, i32 %56)
%58 = icmp eq i8* %57, null
br i1 %58, label %72, label %59
59: ; preds = %53
%60 = tail call i64 @_do_phdr_dyn_print32(i8* %57, i8* %5)
%61 = icmp eq i64 %60, 0
br i1 %61, label %70, label %62
62: ; preds = %59
%63 = tail call i64 @_do_phdr_dyn_print32(i8* %57, i8* %38)
%64 = icmp eq i64 %63, 0
br i1 %64, label %70, label %65
65: ; preds = %62
%66 = tail call i64 @_do_phdr_dyn_print32(i8* %57, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %70, label %68
68: ; preds = %65
%69 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %57)
br label %70
70: ; preds = %68, %65, %62, %59
%71 = tail call i32 @free(i8* %57)
br label %72
72: ; preds = %53, %50, %70
%73 = add i64 %44, 1
%74 = shl i64 %73, 4
%75 = load i64, i64* %7
%76 = icmp ult i64 %74, %75
br i1 %76, label %43, label %77
77: ; preds = %43, %72, %31
ret i32 0
}