#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 */

/* Type definitions */
typedef char uint8_t;
typedef int uint64_t;
typedef scalar_t__ uint32_t;
typedef scalar_t__ uint16_t;
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ S_ISREG(int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errx(int, char *, ...);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *get_abi(scalar_t__, int, scalar_t__);
int get_endian(char);
int get_wordsize(char);
int lseek(int, int, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int read(int, char *, int);
scalar_t__ read_endian(int, int, int);
int stat(char *, struct stat *);
scalar_t__ strncmp(char *, char *, int);
int main(int argc, char *argv[]) {
  int width;
  int endian;
  char *abi;
  int fd;
  struct stat s;
  char magic[4];
  uint8_t ei_class;
  uint8_t ei_data;
  uint16_t e_machine;
  uint32_t e_flags;
  uint64_t e_machine_offset, e_flags_offset;
  if (argc != 2)
    errx(1, "Usage: %s <file>", argv[0]);
  if (stat(argv[1], &s) == -1)
    errx(1, "%s does not exist", argv[1]);
  if (!S_ISREG(s.st_mode))
    errx(1, "%s is not a regular file", argv[1]);
  if ((fd = open(argv[1], O_RDONLY)) == -1)
    errx(1, "failed to open %s", argv[1]);
  if (read(fd, magic, 4) == -1)
    errx(1, "read() magic failed");
  if (strncmp(magic, "\177ELF", 4))
    errx(1, "%s is not an ELF object", argv[1]);
  if (read(fd, &ei_class, 1) == -1)
    errx(1, "read() ei_class failed");
  width = get_wordsize(ei_class);
  if (read(fd, &ei_data, 1) == -1)
    errx(1, "read() ei_data failed");
  endian = get_endian(ei_data);
  e_machine_offset = 18;
  if (width == 32)
    e_flags_offset = 36;
  else
    e_flags_offset = 48;
  if (lseek(fd, e_machine_offset, SEEK_SET) == -1)
    errx(1, "lseek() e_machine failed");
  e_machine = (uint16_t)read_endian(fd, 2, endian);
  if (lseek(fd, e_flags_offset, SEEK_SET) == -1)
    errx(1, "lseek() e_flags failed");
  e_flags = (uint32_t)read_endian(fd, 4, endian);
  abi = get_abi(e_machine, width, e_flags);
  printf("%s\n", abi);
  close(fd);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     121a <main+0x3a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    $0x1,%edi
lea    0xded(%rip),%rsi
mov    $0x0,%al
call   1040 <errx@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x28(%rbp),%rsi
call   10b0 <stat@plt>
cmp    $0xffffffff,%eax
jne    124f <main+0x6f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    $0x1,%edi
lea    0xdc9(%rip),%rsi
mov    $0x0,%al
call   1040 <errx@plt>
mov    -0x28(%rbp),%edi
call   10c0 <S_ISREG@plt>
cmp    $0x0,%eax
jne    127b <main+0x9b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    $0x1,%edi
lea    0xdaf(%rip),%rsi
mov    $0x0,%al
call   1040 <errx@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2d5e(%rip),%rax
mov    (%rax),%esi
call   10e0 <open@plt>
mov    %eax,-0x24(%rbp)
cmp    $0xffffffff,%eax
jne    12b8 <main+0xd8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    $0x1,%edi
lea    0xd8b(%rip),%rsi
mov    $0x0,%al
call   1040 <errx@plt>
mov    -0x24(%rbp),%edi
lea    -0x2c(%rbp),%rsi
mov    $0x4,%edx
call   10a0 <read@plt>
cmp    $0xffffffff,%eax
jne    12e5 <main+0x105>
mov    $0x1,%edi
lea    0xd70(%rip),%rsi
mov    $0x0,%al
call   1040 <errx@plt>
lea    -0x2c(%rbp),%rdi
lea    0xd72(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     131f <main+0x13f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    $0x1,%edi
lea    0xd4f(%rip),%rsi
mov    $0x0,%al
call   1040 <errx@plt>
mov    -0x24(%rbp),%edi
lea    -0x2d(%rbp),%rsi
mov    $0x1,%edx
call   10a0 <read@plt>
cmp    $0xffffffff,%eax
jne    134c <main+0x16c>
mov    $0x1,%edi
lea    0xd3a(%rip),%rsi
mov    $0x0,%al
call   1040 <errx@plt>
movsbl -0x2d(%rbp),%edi
call   1100 <get_wordsize@plt>
mov    %eax,-0x14(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x2e(%rbp),%rsi
mov    $0x1,%edx
call   10a0 <read@plt>
cmp    $0xffffffff,%eax
jne    1385 <main+0x1a5>
mov    $0x1,%edi
lea    0xd18(%rip),%rsi
mov    $0x0,%al
call   1040 <errx@plt>
movsbl -0x2e(%rbp),%edi
call   1090 <get_endian@plt>
mov    %eax,-0x18(%rbp)
movl   $0x12,-0x44(%rbp)
cmpl   $0x20,-0x14(%rbp)
jne    13ae <main+0x1ce>
movl   $0x24,-0x48(%rbp)
jmp    13b5 <main+0x1d5>
movl   $0x30,-0x48(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x44(%rbp),%esi
mov    0x2c16(%rip),%rax
mov    (%rax),%edx
call   1060 <lseek@plt>
cmp    $0xffffffff,%eax
jne    13e5 <main+0x205>
mov    $0x1,%edi
lea    0xcce(%rip),%rsi
mov    $0x0,%al
call   1040 <errx@plt>
mov    -0x24(%rbp),%edi
mov    -0x18(%rbp),%edx
mov    $0x2,%esi
call   1070 <read_endian@plt>
mov    %rax,-0x38(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x48(%rbp),%esi
mov    0x2bd2(%rip),%rax
mov    (%rax),%edx
call   1060 <lseek@plt>
cmp    $0xffffffff,%eax
jne    1429 <main+0x249>
mov    $0x1,%edi
lea    0xca3(%rip),%rsi
mov    $0x0,%al
call   1040 <errx@plt>
mov    -0x24(%rbp),%edi
mov    -0x18(%rbp),%edx
mov    $0x4,%esi
call   1070 <read_endian@plt>
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x40(%rbp),%rdx
call   10d0 <get_abi@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xc80(%rip),%rdi
call   1050 <printf@plt>
mov    -0x24(%rbp),%edi
call   1080 <close@plt>
mov    0x2b60(%rip),%rax
mov    (%rax),%edi
call   10f0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
cmp    $0x2,%edi
je     120c <main+0x2c>
mov    (%r14),%rdx
lea    0xe00(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <errx@plt>
mov    0x8(%r14),%rdi
lea    0x10(%rsp),%rsi
call   10b0 <stat@plt>
cmp    $0xffffffff,%eax
jne    1236 <main+0x56>
mov    0x8(%r14),%rdx
lea    0xde7(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <errx@plt>
mov    0x10(%rsp),%edi
call   10c0 <S_ISREG@plt>
test   %eax,%eax
jne    125a <main+0x7a>
mov    0x8(%r14),%rdx
lea    0xdd5(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <errx@plt>
mov    0x8(%r14),%rdi
mov    0x2d83(%rip),%rax
mov    (%rax),%esi
call   10e0 <open@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    128a <main+0xaa>
mov    0x8(%r14),%rdx
lea    0xdbe(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <errx@plt>
lea    0x14(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
call   10a0 <read@plt>
cmp    $0xffffffff,%eax
jne    12b3 <main+0xd3>
lea    0xda7(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <errx@plt>
lea    0xda8(%rip),%rsi
lea    0x14(%rsp),%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12e5 <main+0x105>
mov    0x8(%r14),%rdx
lea    0xd8e(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <errx@plt>
lea    0xf(%rsp),%rsi
mov    %ebx,%edi
mov    $0x1,%edx
call   10a0 <read@plt>
cmp    $0xffffffff,%eax
jne    130e <main+0x12e>
lea    0xd7d(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <errx@plt>
movsbl 0xf(%rsp),%edi
call   1100 <get_wordsize@plt>
mov    %eax,%r14d
lea    0xe(%rsp),%rsi
mov    %ebx,%edi
mov    $0x1,%edx
call   10a0 <read@plt>
cmp    $0xffffffff,%eax
jne    1344 <main+0x164>
lea    0xd5e(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <errx@plt>
movsbl 0xe(%rsp),%edi
call   1090 <get_endian@plt>
mov    %eax,%r15d
cmp    $0x20,%r14d
mov    $0x24,%eax
mov    $0x30,%ebp
cmove  %eax,%ebp
mov    0x2c6f(%rip),%r13
mov    0x0(%r13),%edx
mov    %ebx,%edi
mov    $0x12,%esi
call   1060 <lseek@plt>
cmp    $0xffffffff,%eax
jne    1391 <main+0x1b1>
lea    0xd27(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <errx@plt>
mov    %ebx,%edi
mov    $0x2,%esi
mov    %r15d,%edx
call   1070 <read_endian@plt>
mov    %rax,%r12
mov    0x0(%r13),%edx
mov    %ebx,%edi
mov    %ebp,%esi
call   1060 <lseek@plt>
cmp    $0xffffffff,%eax
jne    13c8 <main+0x1e8>
lea    0xd09(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <errx@plt>
mov    %ebx,%edi
mov    $0x4,%esi
mov    %r15d,%edx
call   1070 <read_endian@plt>
mov    %r12,%rdi
mov    %r14d,%esi
mov    %rax,%rdx
call   10d0 <get_abi@plt>
lea    0xcf0(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %ebx,%edi
call   1080 <close@plt>
mov    0x2bce(%rip),%rax
mov    (%rax),%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [17 x i8] c"Usage: %s <file>\00"
@.str.1 = [18 x i8] c"%s does not exist\00"
@.str.2 = [25 x i8] c"%s is not a regular file\00"
@O_RDONLY = global i32 0
@.str.3 = [18 x i8] c"failed to open %s\00"
@.str.4 = [20 x i8] c"read() magic failed\00"
@.str.5 = [5 x i8] c"\7FELF\00"
@.str.6 = [24 x i8] c"%s is not an ELF object\00"
@.str.7 = [23 x i8] c"read() ei_class failed\00"
@.str.8 = [22 x i8] c"read() ei_data failed\00"
@SEEK_SET = global i32 0
@.str.9 = [25 x i8] c"lseek() e_machine failed\00"
@.str.10 = [23 x i8] c"lseek() e_flags failed\00"
@.str.11 = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca %struct.stat
%11 = alloca [4 x i8]
%12 = alloca i8
%13 = alloca i8
%14 = alloca i64
%15 = alloca i64
%16 = alloca i32
%17 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 2
br i1 %19, label %20, label %25
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %23)
br label %25
25: ; preds = %20, %2
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @stat(i8* %28, %struct.stat* %10)
%30 = icmp eq i32 %29, -1
br i1 %30, label %31, label %36
31: ; preds = %25
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %34)
br label %36
36: ; preds = %31, %25
%37 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%38 = load i32, i32* %37
%39 = call i32 @S_ISREG(i32 %38)
%40 = icmp ne i32 %39, 0
br i1 %40, label %46, label %41
41: ; preds = %36
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 1
%44 = load i8*, i8** %43
%45 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %44)
br label %46
46: ; preds = %41, %36
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 1
%49 = load i8*, i8** %48
%50 = load i32, i32* @O_RDONLY
%51 = call i32 @open(i8* %49, i32 %50)
store i32 %51, i32* %9
%52 = icmp eq i32 %51, -1
br i1 %52, label %53, label %58
53: ; preds = %46
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 1
%56 = load i8*, i8** %55
%57 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %56)
br label %58
58: ; preds = %53, %46
%59 = load i32, i32* %9
%60 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%61 = call i32 @read(i32 %59, i8* %60, i32 4)
%62 = icmp eq i32 %61, -1
br i1 %62, label %63, label %65
63: ; preds = %58
%64 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %65
65: ; preds = %63, %58
%66 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%67 = call i64 @strncmp(i8* %66, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%68 = icmp ne i64 %67, 0
br i1 %68, label %69, label %74
69: ; preds = %65
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 1
%72 = load i8*, i8** %71
%73 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %72)
br label %74
74: ; preds = %69, %65
%75 = load i32, i32* %9
%76 = call i32 @read(i32 %75, i8* %12, i32 1)
%77 = icmp eq i32 %76, -1
br i1 %77, label %78, label %80
78: ; preds = %74
%79 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
br label %80
80: ; preds = %78, %74
%81 = load i8, i8* %12
%82 = call i32 @get_wordsize(i8 signext %81)
store i32 %82, i32* %6
%83 = load i32, i32* %9
%84 = call i32 @read(i32 %83, i8* %13, i32 1)
%85 = icmp eq i32 %84, -1
br i1 %85, label %86, label %88
86: ; preds = %80
%87 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
br label %88
88: ; preds = %86, %80
%89 = load i8, i8* %13
%90 = call i32 @get_endian(i8 signext %89)
store i32 %90, i32* %7
store i32 18, i32* %16
%91 = load i32, i32* %6
%92 = icmp eq i32 %91, 32
br i1 %92, label %93, label %94
93: ; preds = %88
store i32 36, i32* %17
br label %95
94: ; preds = %88
store i32 48, i32* %17
br label %95
95: ; preds = %94, %93
%96 = load i32, i32* %9
%97 = load i32, i32* %16
%98 = load i32, i32* @SEEK_SET
%99 = call i32 @lseek(i32 %96, i32 %97, i32 %98)
%100 = icmp eq i32 %99, -1
br i1 %100, label %101, label %103
101: ; preds = %95
%102 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0))
br label %103
103: ; preds = %101, %95
%104 = load i32, i32* %9
%105 = load i32, i32* %7
%106 = call i64 @read_endian(i32 %104, i32 2, i32 %105)
store i64 %106, i64* %14
%107 = load i32, i32* %9
%108 = load i32, i32* %17
%109 = load i32, i32* @SEEK_SET
%110 = call i32 @lseek(i32 %107, i32 %108, i32 %109)
%111 = icmp eq i32 %110, -1
br i1 %111, label %112, label %114
112: ; preds = %103
%113 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0))
br label %114
114: ; preds = %112, %103
%115 = load i32, i32* %9
%116 = load i32, i32* %7
%117 = call i64 @read_endian(i32 %115, i32 4, i32 %116)
store i64 %117, i64* %15
%118 = load i64, i64* %14
%119 = load i32, i32* %6
%120 = load i64, i64* %15
%121 = call i8* @get_abi(i64 %118, i32 %119, i64 %120)
store i8* %121, i8** %8
%122 = load i8*, i8** %8
%123 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* %122)
%124 = load i32, i32* %9
%125 = call i32 @close(i32 %124)
%126 = load i32, i32* @EXIT_SUCCESS
%127 = call i32 @exit(i32 %126)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [17 x i8] c"Usage: %s <file>\00"
@.str.1 = [18 x i8] c"%s does not exist\00"
@.str.2 = [25 x i8] c"%s is not a regular file\00"
@O_RDONLY = global i32 0
@.str.3 = [18 x i8] c"failed to open %s\00"
@.str.4 = [20 x i8] c"read() magic failed\00"
@.str.5 = [5 x i8] c"\7FELF\00"
@.str.6 = [24 x i8] c"%s is not an ELF object\00"
@.str.7 = [23 x i8] c"read() ei_class failed\00"
@.str.8 = [22 x i8] c"read() ei_data failed\00"
@SEEK_SET = global i32 0
@.str.9 = [25 x i8] c"lseek() e_machine failed\00"
@.str.10 = [23 x i8] c"lseek() e_flags failed\00"
@.str.11 = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = alloca [4 x i8]
%5 = alloca i8
%6 = alloca i8
%7 = bitcast %struct.stat* %3 to i8*
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%9 = icmp eq i32 %0, 2
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i8*, i8** %1
%12 = tail call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @stat(i8* %15, %struct.stat* %3)
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = load i8*, i8** %14
%20 = tail call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %18, %13
%22 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%23 = load i32, i32* %22
%24 = tail call i32 @S_ISREG(i32 %23)
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %21
%27 = load i8*, i8** %14
%28 = tail call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %27)
br label %29
29: ; preds = %26, %21
%30 = load i8*, i8** %14
%31 = load i32, i32* @O_RDONLY
%32 = tail call i32 @open(i8* %30, i32 %31)
%33 = icmp eq i32 %32, -1
br i1 %33, label %34, label %37
34: ; preds = %29
%35 = load i8*, i8** %14
%36 = tail call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %35)
br label %37
37: ; preds = %34, %29
%38 = call i32 @read(i32 %32, i8* %8, i32 4)
%39 = icmp eq i32 %38, -1
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = tail call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %42
42: ; preds = %40, %37
%43 = call i64 @strncmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%44 = icmp eq i64 %43, 0
br i1 %44, label %48, label %45
45: ; preds = %42
%46 = load i8*, i8** %14
%47 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %46)
br label %48
48: ; preds = %45, %42
%49 = call i32 @read(i32 %32, i8* %5, i32 1)
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
br label %53
53: ; preds = %51, %48
%54 = load i8, i8* %5
%55 = call i32 @get_wordsize(i8 signext %54)
%56 = call i32 @read(i32 %32, i8* %6, i32 1)
%57 = icmp eq i32 %56, -1
br i1 %57, label %58, label %60
58: ; preds = %53
%59 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
br label %60
60: ; preds = %58, %53
%61 = load i8, i8* %6
%62 = call i32 @get_endian(i8 signext %61)
%63 = icmp eq i32 %55, 32
%64 = select i1 %63, i32 36, i32 48
%65 = load i32, i32* @SEEK_SET
%66 = call i32 @lseek(i32 %32, i32 18, i32 %65)
%67 = icmp eq i32 %66, -1
br i1 %67, label %68, label %70
68: ; preds = %60
%69 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0))
br label %70
70: ; preds = %68, %60
%71 = call i64 @read_endian(i32 %32, i32 2, i32 %62)
%72 = load i32, i32* @SEEK_SET
%73 = call i32 @lseek(i32 %32, i32 %64, i32 %72)
%74 = icmp eq i32 %73, -1
br i1 %74, label %75, label %77
75: ; preds = %70
%76 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0))
br label %77
77: ; preds = %75, %70
%78 = call i64 @read_endian(i32 %32, i32 4, i32 %62)
%79 = call i8* @get_abi(i64 %71, i32 %55, i64 %78)
%80 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* %79)
%81 = call i32 @close(i32 %32)
%82 = load i32, i32* @EXIT_SUCCESS
%83 = call i32 @exit(i32 %82)
unreachable
}