#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_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef scalar_t__ uint8_t;
struct TYPE_4__ {
  int e_type;
};
struct TYPE_3__ {
  int e_type;
};
typedef int Elf64_Half;
typedef TYPE_1__ Elf64_Ehdr;
typedef int Elf32_Half;
typedef TYPE_2__ Elf32_Ehdr;

/* Variables and functions */
int EI_CLASS;
int EI_DATA;
size_t EI_NIDENT;
scalar_t__ const ELFCLASS32;
scalar_t__ const ELFCLASS64;
scalar_t__ const ELFDATA2LSB;
scalar_t__ const ELFDATA2MSB;
int /*<<< orphan*/ ELFMAG;
int ET_CORE;
int ET_DYN;
int ET_EXEC;
int ET_HIPROC;
int ET_LOPROC;
int ET_REL;
int /*<<< orphan*/ SELFMAG;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           scalar_t__ const);
scalar_t__ memcmp(void const *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ swab(int *, int *, int);
int filemapIsElf(const char *filename, const void *addr, size_t size) {
  if (size < EI_NIDENT)
    return 0;
  if (memcmp(addr, ELFMAG, SELFMAG) != 0) {
    return 0;
  }
  const uint8_t *elfclass = (uint8_t *)addr + EI_CLASS;
  const uint8_t *elfdata = (uint8_t *)addr + EI_DATA;
  int e_type_norm = 0;
  if (*elfclass == ELFCLASS32) {
    const Elf32_Ehdr *hdr = addr;
    Elf32_Half e_type;
    assert(sizeof e_type == sizeof hdr->e_type);
    if (*elfdata == ELFDATA2LSB) {
      e_type = hdr->e_type;
    } else if (*elfdata == ELFDATA2MSB) {
      swab(&hdr->e_type, &e_type, sizeof e_type);
    } else {
      fprintf(stderr, "%s: unknown ELF data %d\n", filename, *elfdata);
      return -1;
    }
    e_type_norm = e_type;
  } else if (*elfclass == ELFCLASS64) {
    const Elf64_Ehdr *hdr = addr;
    Elf64_Half e_type;
    assert(sizeof e_type == sizeof hdr->e_type);
    if (*elfdata == ELFDATA2LSB) {
      e_type = hdr->e_type;
    } else if (*elfdata == ELFDATA2MSB) {
      swab(&hdr->e_type, &e_type, sizeof e_type);
    } else {
      fprintf(stderr, "%s: unknown ELF data %d\n", filename, *elfdata);
      return -1;
    }
    e_type_norm = e_type;
  } else {
    fprintf(stderr, "%s: unknown ELF class %d\n", filename, *elfclass);
    return -1;
  }
  if (e_type_norm == ET_EXEC || e_type_norm == ET_DYN) {
    return 1;
  } else if (e_type_norm == ET_REL || e_type_norm == ET_CORE ||
             e_type_norm == ET_LOPROC || e_type_norm == ET_HIPROC) {
    return 0;
  } else {
    fprintf(stderr, "%s: unknown ELF type %d\n", filename, e_type_norm);
    return -1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<filemapIsElf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x2e69(%rip),%rcx
cmp    (%rcx),%rax
jae    1174 <filemapIsElf+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1427 <filemapIsElf+0x2e7>
mov    -0x18(%rbp),%rdi
mov    0x2e61(%rip),%rax
mov    (%rax),%esi
mov    0x2e00(%rip),%rax
mov    (%rax),%edx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
je     11a5 <filemapIsElf+0x65>
movl   $0x0,-0x4(%rbp)
jmp    1427 <filemapIsElf+0x2e7>
mov    -0x18(%rbp),%rax
mov    0x2df0(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2de7(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    0x2d84(%rip),%rcx
cmp    (%rcx),%rax
jne    1296 <filemapIsElf+0x156>
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    $0x1,%edi
call   1050 <assert@plt>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    0x2ddb(%rip),%rcx
cmp    (%rcx),%rax
jne    122c <filemapIsElf+0xec>
mov    -0x40(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
jmp    128b <filemapIsElf+0x14b>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    0x2d2e(%rip),%rcx
cmp    (%rcx),%rax
jne    125a <filemapIsElf+0x11a>
mov    -0x40(%rbp),%rdi
lea    -0x44(%rbp),%rsi
mov    $0x4,%edx
call   1030 <swab@plt>
jmp    1286 <filemapIsElf+0x146>
mov    0x2d2f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x30(%rbp),%rax
mov    (%rax),%rcx
lea    0xdab(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1427 <filemapIsElf+0x2e7>
jmp    128b <filemapIsElf+0x14b>
mov    -0x44(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    137f <filemapIsElf+0x23f>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    0x2d14(%rip),%rcx
cmp    (%rcx),%rax
jne    134e <filemapIsElf+0x20e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    $0x1,%edi
call   1050 <assert@plt>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    0x2d23(%rip),%rcx
cmp    (%rcx),%rax
jne    12e4 <filemapIsElf+0x1a4>
mov    -0x50(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
jmp    1343 <filemapIsElf+0x203>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    0x2c76(%rip),%rcx
cmp    (%rcx),%rax
jne    1312 <filemapIsElf+0x1d2>
mov    -0x50(%rbp),%rdi
lea    -0x54(%rbp),%rsi
mov    $0x4,%edx
call   1030 <swab@plt>
jmp    133e <filemapIsElf+0x1fe>
mov    0x2c77(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x30(%rbp),%rax
mov    (%rax),%rcx
lea    0xcf3(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1427 <filemapIsElf+0x2e7>
jmp    1343 <filemapIsElf+0x203>
mov    -0x54(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    137a <filemapIsElf+0x23a>
mov    0x2c3b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
lea    0xcd0(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1427 <filemapIsElf+0x2e7>
jmp    137f <filemapIsElf+0x23f>
mov    -0x34(%rbp),%eax
mov    0x2c0f(%rip),%rcx
cmp    (%rcx),%eax
je     13a3 <filemapIsElf+0x263>
mov    -0x34(%rbp),%eax
mov    0x2be5(%rip),%rcx
cmp    (%rcx),%eax
jne    13af <filemapIsElf+0x26f>
movl   $0x1,-0x4(%rbp)
jmp    1427 <filemapIsElf+0x2e7>
mov    -0x34(%rbp),%eax
mov    0x2c17(%rip),%rcx
cmp    (%rcx),%eax
je     13f7 <filemapIsElf+0x2b7>
mov    -0x34(%rbp),%eax
mov    0x2bf5(%rip),%rcx
cmp    (%rcx),%eax
je     13f7 <filemapIsElf+0x2b7>
mov    -0x34(%rbp),%eax
mov    0x2b9b(%rip),%rcx
cmp    (%rcx),%eax
je     13f7 <filemapIsElf+0x2b7>
mov    -0x34(%rbp),%eax
mov    0x2be9(%rip),%rcx
cmp    (%rcx),%eax
jne    1403 <filemapIsElf+0x2c3>
movl   $0x0,-0x4(%rbp)
jmp    1427 <filemapIsElf+0x2e7>
mov    0x2b86(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
movslq -0x34(%rbp),%rcx
lea    0xc38(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filemapIsElf>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    0x2e92(%rip),%rax
cmp    %rdx,(%rax)
ja     1168 <filemapIsElf+0x38>
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
mov    0x2e3f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
call   1030 <memcmp@plt>
test   %rax,%rax
je     1177 <filemapIsElf+0x47>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2e32(%rip),%rax
movslq (%rax),%rax
mov    (%rbx,%rax,8),%rcx
test   %rcx,%rcx
je     119c <filemapIsElf+0x6c>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
jmp    11ce <filemapIsElf+0x9e>
mov    0x2e1d(%rip),%rax
movslq (%rax),%r15
mov    $0x1,%ebp
mov    $0x1,%edi
call   1040 <assert@plt>
mov    (%rbx,%r15,8),%rcx
test   %rcx,%rcx
je     11dd <filemapIsElf+0xad>
mov    0x2ddb(%rip),%rax
mov    (%rax),%edi
lea    0xe52(%rip),%rsi
mov    %r14,%rdx
call   1050 <fprintf@plt>
mov    $0xffffffff,%ebp
jmp    116a <filemapIsElf+0x3a>
mov    (%rbx),%eax
mov    0x2dc2(%rip),%rcx
cmp    (%rcx),%eax
je     116a <filemapIsElf+0x3a>
mov    0x2d9f(%rip),%rcx
cmp    (%rcx),%eax
je     116a <filemapIsElf+0x3a>
mov    0x2dd8(%rip),%rcx
cmp    (%rcx),%eax
je     1168 <filemapIsElf+0x38>
mov    0x2db9(%rip),%rcx
cmp    (%rcx),%eax
je     1168 <filemapIsElf+0x38>
mov    0x2d6a(%rip),%rcx
cmp    (%rcx),%eax
je     1168 <filemapIsElf+0x38>
mov    0x2db3(%rip),%rcx
mov    $0x0,%ebp
cmp    (%rcx),%eax
je     116a <filemapIsElf+0x3a>
movslq %eax,%rcx
mov    0x2d5c(%rip),%rax
mov    (%rax),%edi
lea    0xe06(%rip),%rsi
jmp    11ce <filemapIsElf+0x9e>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32 }
%struct.TYPE_3__ = type { i32 }
@EI_NIDENT = global i64 0
@ELFMAG = global i32 0
@SELFMAG = global i32 0
@EI_CLASS = global i32 0
@EI_DATA = global i32 0
@ELFCLASS32 = constant i64 0
@ELFDATA2LSB = constant i64 0
@ELFDATA2MSB = constant i64 0
@stderr = global i32 0
@.str = [25 x i8] c"%s: unknown ELF data %d\0A\00"
@ELFCLASS64 = constant i64 0
@.str.1 = [26 x i8] c"%s: unknown ELF class %d\0A\00"
@ET_EXEC = global i32 0
@ET_DYN = global i32 0
@ET_REL = global i32 0
@ET_CORE = global i32 0
@ET_LOPROC = global i32 0
@ET_HIPROC = global i32 0
@.str.2 = [25 x i8] c"%s: unknown ELF type %d\0A\00"
define i32 @filemapIsElf(i8* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64*
%9 = alloca i64*
%10 = alloca i32
%11 = alloca %struct.TYPE_4__*
%12 = alloca i32
%13 = alloca %struct.TYPE_3__*
%14 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%15 = load i64, i64* %7
%16 = load i64, i64* @EI_NIDENT
%17 = icmp ult i64 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %3
store i32 0, i32* %4
br label %145
19: ; preds = %3
%20 = load i8*, i8** %6
%21 = load i32, i32* @ELFMAG
%22 = load i32, i32* @SELFMAG
%23 = call i64 @memcmp(i8* %20, i32 %21, i32 %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %19
store i32 0, i32* %4
br label %145
26: ; preds = %19
%27 = load i8*, i8** %6
%28 = bitcast i8* %27 to i64*
%29 = load i32, i32* @EI_CLASS
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i64, i64* %28, i64 %30
store i64* %31, i64** %8
%32 = load i8*, i8** %6
%33 = bitcast i8* %32 to i64*
%34 = load i32, i32* @EI_DATA
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i64, i64* %33, i64 %35
store i64* %36, i64** %9
store i32 0, i32* %10
%37 = load i64*, i64** %8
%38 = load i64, i64* %37
%39 = load i64, i64* @ELFCLASS32
%40 = icmp eq i64 %38, %39
br i1 %40, label %41, label %71
41: ; preds = %26
%42 = load i8*, i8** %6
%43 = bitcast i8* %42 to %struct.TYPE_4__*
store %struct.TYPE_4__* %43, %struct.TYPE_4__** %11
%44 = call i32 @assert(i32 1)
%45 = load i64*, i64** %9
%46 = load i64, i64* %45
%47 = load i64, i64* @ELFDATA2LSB
%48 = icmp eq i64 %46, %47
br i1 %48, label %49, label %53
49: ; preds = %41
%50 = load %struct.TYPE_4__*, %struct.TYPE_4__** %11
%51 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %50, i32 0, i32 0
%52 = load i32, i32* %51
store i32 %52, i32* %12
br label %69
53: ; preds = %41
%54 = load i64*, i64** %9
%55 = load i64, i64* %54
%56 = load i64, i64* @ELFDATA2MSB
%57 = icmp eq i64 %55, %56
br i1 %57, label %58, label %62
58: ; preds = %53
%59 = load %struct.TYPE_4__*, %struct.TYPE_4__** %11
%60 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %59, i32 0, i32 0
%61 = call i32 @swab(i32* %60, i32* %12, i32 4)
br label %68
62: ; preds = %53
%63 = load i32, i32* @stderr
%64 = load i8*, i8** %5
%65 = load i64*, i64** %9
%66 = load i64, i64* %65
%67 = call i32 @fprintf(i32 %63, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %64, i64 %66)
store i32 -1, i32* %4
br label %145
68: ; preds = %58
br label %69
69: ; preds = %68, %49
%70 = load i32, i32* %12
store i32 %70, i32* %10
br label %113
71: ; preds = %26
%72 = load i64*, i64** %8
%73 = load i64, i64* %72
%74 = load i64, i64* @ELFCLASS64
%75 = icmp eq i64 %73, %74
br i1 %75, label %76, label %106
76: ; preds = %71
%77 = load i8*, i8** %6
%78 = bitcast i8* %77 to %struct.TYPE_3__*
store %struct.TYPE_3__* %78, %struct.TYPE_3__** %13
%79 = call i32 @assert(i32 1)
%80 = load i64*, i64** %9
%81 = load i64, i64* %80
%82 = load i64, i64* @ELFDATA2LSB
%83 = icmp eq i64 %81, %82
br i1 %83, label %84, label %88
84: ; preds = %76
%85 = load %struct.TYPE_3__*, %struct.TYPE_3__** %13
%86 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %85, i32 0, i32 0
%87 = load i32, i32* %86
store i32 %87, i32* %14
br label %104
88: ; preds = %76
%89 = load i64*, i64** %9
%90 = load i64, i64* %89
%91 = load i64, i64* @ELFDATA2MSB
%92 = icmp eq i64 %90, %91
br i1 %92, label %93, label %97
93: ; preds = %88
%94 = load %struct.TYPE_3__*, %struct.TYPE_3__** %13
%95 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %94, i32 0, i32 0
%96 = call i32 @swab(i32* %95, i32* %14, i32 4)
br label %103
97: ; preds = %88
%98 = load i32, i32* @stderr
%99 = load i8*, i8** %5
%100 = load i64*, i64** %9
%101 = load i64, i64* %100
%102 = call i32 @fprintf(i32 %98, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %99, i64 %101)
store i32 -1, i32* %4
br label %145
103: ; preds = %93
br label %104
104: ; preds = %103, %84
%105 = load i32, i32* %14
store i32 %105, i32* %10
br label %112
106: ; preds = %71
%107 = load i32, i32* @stderr
%108 = load i8*, i8** %5
%109 = load i64*, i64** %8
%110 = load i64, i64* %109
%111 = call i32 @fprintf(i32 %107, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %108, i64 %110)
store i32 -1, i32* %4
br label %145
112: ; preds = %104
br label %113
113: ; preds = %112, %69
%114 = load i32, i32* %10
%115 = load i32, i32* @ET_EXEC
%116 = icmp eq i32 %114, %115
br i1 %116, label %121, label %117
117: ; preds = %113
%118 = load i32, i32* %10
%119 = load i32, i32* @ET_DYN
%120 = icmp eq i32 %118, %119
br i1 %120, label %121, label %122
121: ; preds = %117, %113
store i32 1, i32* %4
br label %145
122: ; preds = %117
%123 = load i32, i32* %10
%124 = load i32, i32* @ET_REL
%125 = icmp eq i32 %123, %124
br i1 %125, label %138, label %126
126: ; preds = %122
%127 = load i32, i32* %10
%128 = load i32, i32* @ET_CORE
%129 = icmp eq i32 %127, %128
br i1 %129, label %138, label %130
130: ; preds = %126
%131 = load i32, i32* %10
%132 = load i32, i32* @ET_LOPROC
%133 = icmp eq i32 %131, %132
br i1 %133, label %138, label %134
134: ; preds = %130
%135 = load i32, i32* %10
%136 = load i32, i32* @ET_HIPROC
%137 = icmp eq i32 %135, %136
br i1 %137, label %138, label %139
138: ; preds = %134, %130, %126, %122
store i32 0, i32* %4
br label %145
139: ; preds = %134
%140 = load i32, i32* @stderr
%141 = load i8*, i8** %5
%142 = load i32, i32* %10
%143 = sext i32 %142 to i64
%144 = call i32 @fprintf(i32 %140, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %141, i64 %143)
store i32 -1, i32* %4
br label %145
145: ; preds = %139, %138, %121, %106, %97, %62, %25, %18
%146 = load i32, i32* %4
ret i32 %146
}

LLVM IR (-O2):
@EI_NIDENT = global i64 0
@ELFMAG = global i32 0
@SELFMAG = global i32 0
@EI_CLASS = global i32 0
@EI_DATA = global i32 0
@ELFCLASS32 = constant i64 0
@ELFDATA2LSB = constant i64 0
@ELFDATA2MSB = constant i64 0
@stderr = global i32 0
@.str = [25 x i8] c"%s: unknown ELF data %d\0A\00"
@ELFCLASS64 = constant i64 0
@.str.1 = [26 x i8] c"%s: unknown ELF class %d\0A\00"
@ET_EXEC = global i32 0
@ET_DYN = global i32 0
@ET_REL = global i32 0
@ET_CORE = global i32 0
@ET_LOPROC = global i32 0
@ET_HIPROC = global i32 0
@.str.2 = [25 x i8] c"%s: unknown ELF type %d\0A\00"
define i32 @filemapIsElf(i8* %0, i8* %1, i64 %2) {
%4 = load i64, i64* @EI_NIDENT
%5 = icmp ugt i64 %4, %2
br i1 %5, label %55, label %6
6: ; preds = %3
%7 = load i32, i32* @ELFMAG
%8 = load i32, i32* @SELFMAG
%9 = tail call i64 @memcmp(i8* %1, i32 %7, i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %55
11: ; preds = %6
%12 = bitcast i8* %1 to i64*
%13 = load i32, i32* @EI_CLASS
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i64, i64* %12, i64 %14
%16 = load i64, i64* %15
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %28
18: ; preds = %11
%19 = load i32, i32* @EI_DATA
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i64, i64* %12, i64 %20
%22 = tail call i32 @assert(i32 1)
%23 = load i64, i64* %21
%24 = icmp eq i64 %23, 0
br i1 %24, label %31, label %25
25: ; preds = %18
%26 = load i32, i32* @stderr
%27 = tail call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %23)
br label %55
28: ; preds = %11
%29 = load i32, i32* @stderr
%30 = tail call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %0, i64 %16)
br label %55
31: ; preds = %18
%32 = bitcast i8* %1 to i32*
%33 = load i32, i32* %32
%34 = load i32, i32* @ET_EXEC
%35 = icmp eq i32 %33, %34
%36 = load i32, i32* @ET_DYN
%37 = icmp eq i32 %33, %36
%38 = select i1 %35, i1 true, i1 %37
br i1 %38, label %55, label %39
39: ; preds = %31
%40 = load i32, i32* @ET_REL
%41 = icmp eq i32 %33, %40
%42 = load i32, i32* @ET_CORE
%43 = icmp eq i32 %33, %42
%44 = select i1 %41, i1 true, i1 %43
%45 = load i32, i32* @ET_LOPROC
%46 = icmp eq i32 %33, %45
%47 = select i1 %44, i1 true, i1 %46
%48 = load i32, i32* @ET_HIPROC
%49 = icmp eq i32 %33, %48
%50 = select i1 %47, i1 true, i1 %49
br i1 %50, label %55, label %51
51: ; preds = %39
%52 = load i32, i32* @stderr
%53 = sext i32 %33 to i64
%54 = tail call i32 @fprintf(i32 %52, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %0, i64 %53)
br label %55
55: ; preds = %25, %28, %51, %31, %39, %6, %3
%56 = phi i32 [ 0, %3 ], [ 0, %6 ], [ -1, %51 ], [ -1, %25 ], [ -1, %28 ], [ 1, %31 ], [ 0, %39 ]
ret i32 %56
}