#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 int /*<<< orphan*/ u_char;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int fread(int /*<<< orphan*/ **, int, int, int /*<<< orphan*/ *);
char getopt(int, char **, char *);
int optind;
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sscanf(char *, char *, unsigned int *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
char *strerror(scalar_t__);
int main(int argc, char *argv[]) {
  char option;
  u_char buf[4];
  unsigned int chr[2];
  int swap, retval;
  FILE *file;
  swap = 0;
  while ((option = getopt(argc, argv, "sh?")) > 0) {
    switch (option) {
    case 's':
      swap = 1;
      break;
    case 'h':
    case '?':
    default:
      printf("Usage: %s [-s] file   (-s swaps byte order)\n", argv[0]);
      exit(EXIT_SUCCESS);
    }
  }
  if (argc - optind < 1) {
    fprintf(stderr, "Error - No filename given.\n");
    exit(EXIT_FAILURE);
  }
  if ((file = fopen(argv[optind++], "r")) == NULL) {
    fprintf(stderr, "Error - Unable to open file: %s.\n", strerror(errno));
    exit(EXIT_FAILURE);
  }
  errno = 0;
  for (;;)
    switch ((retval = fread(&buf, 2, 2, file))) {
    case 0:
      fclose(file);
      if ((retval = EOF) && errno) {
        fprintf(stderr, "Error - Unable to read from file: %s.\n",
                strerror(errno));
        exit(EXIT_FAILURE);
      }
      exit(EXIT_SUCCESS);
    case 1:
      sscanf((char *)buf, "%2x", &chr[0]);
      fprintf(stdout, "%c", chr[0]);
      break;
    case 2:
      sscanf((char *)buf, "%2x%2x", &chr[0], &chr[1]);
      fprintf(stdout, "%c%c", swap ? chr[1] : chr[0], swap ? chr[0] : chr[1]);
      break;
    }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe45(%rip),%rdx
call   1090 <getopt@plt>
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
jle    123d <main+0xad>
movsbl -0x11(%rbp),%eax
mov    %eax,-0x4c(%rbp)
sub    $0x3f,%eax
je     1212 <main+0x82>
jmp    11e4 <main+0x54>
mov    -0x4c(%rbp),%eax
sub    $0x68,%eax
je     1212 <main+0x82>
jmp    11f5 <main+0x65>
mov    -0x4c(%rbp),%eax
sub    $0x73,%eax
jne    1217 <main+0x87>
jmp    1206 <main+0x76>
movl   $0x1,-0x3c(%rbp)
jmp    1238 <main+0xa8>
jmp    1217 <main+0x87>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xddf(%rip),%rdi
call   1050 <printf@plt>
mov    0x2d7f(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
jmp    11ad <main+0x1d>
mov    -0x8(%rbp),%eax
mov    0x2d99(%rip),%rcx
sub    (%rcx),%eax
cmp    $0x1,%eax
jge    1277 <main+0xe7>
mov    0x2d77(%rip),%rax
mov    (%rax),%edi
lea    0xdcf(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2d50(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x2d5e(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    0x2d50(%rip),%rdx
mov    %esi,(%rdx)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdad(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmp    $0x0,%rax
jne    12f0 <main+0x160>
mov    0x2d16(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
mov    0x2d02(%rip),%rax
mov    (%rax),%rdi
call   10b0 <strerror@plt>
mov    -0x50(%rbp),%edi
mov    %rax,%rdx
lea    0xd74(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2cd7(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    0x2cd1(%rip),%rax
movq   $0x0,(%rax)
mov    -0x48(%rbp),%rcx
lea    -0x30(%rbp),%rdi
mov    $0x2,%edx
mov    %edx,%esi
call   1030 <fread@plt>
mov    %eax,-0x40(%rbp)
mov    %eax,%ecx
mov    %ecx,-0x54(%rbp)
test   %eax,%eax
je     1349 <main+0x1b9>
jmp    1327 <main+0x197>
mov    -0x54(%rbp),%eax
sub    $0x1,%eax
je     13c3 <main+0x233>
jmp    1338 <main+0x1a8>
mov    -0x54(%rbp),%eax
sub    $0x2,%eax
je     13f8 <main+0x268>
jmp    1475 <main+0x2e5>
mov    -0x48(%rbp),%rdi
call   1040 <fclose@plt>
mov    0x2c8f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
cmp    $0x0,%eax
je     13b5 <main+0x225>
mov    0x2c5a(%rip),%rax
cmpq   $0x0,(%rax)
je     13b5 <main+0x225>
mov    0x2c51(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
mov    0x2c3d(%rip),%rax
mov    (%rax),%rdi
call   10b0 <strerror@plt>
mov    -0x58(%rbp),%edi
mov    %rax,%rdx
lea    0xcd1(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2c12(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    0x2bf4(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
lea    -0x30(%rbp),%rdi
lea    -0x38(%rbp),%rdx
lea    0xcc9(%rip),%rsi
mov    $0x0,%al
call   1070 <sscanf@plt>
mov    0x2bd8(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%edx
lea    0xcb5(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    1475 <main+0x2e5>
lea    -0x30(%rbp),%rdi
lea    -0x38(%rbp),%rdx
lea    -0x38(%rbp),%rcx
add    $0x4,%rcx
lea    0xc89(%rip),%rsi
mov    $0x0,%al
call   1070 <sscanf@plt>
mov    0x2b9b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     1437 <main+0x2a7>
mov    -0x34(%rbp),%eax
mov    %eax,-0x60(%rbp)
jmp    143d <main+0x2ad>
mov    -0x38(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%eax
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     1458 <main+0x2c8>
mov    -0x38(%rbp),%eax
mov    %eax,-0x68(%rbp)
jmp    145e <main+0x2ce>
mov    -0x34(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x64(%rbp),%edx
mov    -0x5c(%rbp),%edi
mov    -0x68(%rbp),%ecx
lea    0xc31(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    12fe <main+0x16e>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe56(%rip),%rdx
call   1090 <getopt@plt>
mov    %eax,%r15d
test   %al,%al
jle    11d5 <main+0x45>
lea    0xe43(%rip),%r14
mov    %r15d,%eax
cmp    $0x73,%al
jne    123d <main+0xad>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1090 <getopt@plt>
test   %al,%al
jg     11c0 <main+0x30>
mov    0x2e04(%rip),%rax
movslq (%rax),%rcx
cmp    %ebp,%ecx
jge    1221 <main+0x91>
lea    0x1(%rcx),%edx
mov    %edx,(%rax)
mov    (%rbx,%rcx,8),%rdi
lea    0xe5a(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
jne    125a <main+0xca>
mov    0x2dcc(%rip),%rax
mov    (%rax),%ebx
mov    0x2dbb(%rip),%rax
mov    (%rax),%rdi
call   10b0 <strerror@plt>
lea    0xe33(%rip),%rsi
jmp    135c <main+0x1cc>
mov    0x2da8(%rip),%rax
mov    (%rax),%edi
lea    0xe00(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    1368 <main+0x1d8>
mov    (%rbx),%rsi
lea    0xdbd(%rip),%rdi
call   1050 <printf@plt>
mov    0x2d5d(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    %rax,%rbx
mov    0x2d64(%rip),%rax
movq   $0x0,(%rax)
lea    0x10(%rsp),%rbp
lea    0x8(%rsp),%r13
mov    0x2d3c(%rip),%r12
lea    0xe1c(%rip),%r14
jmp    12ca <main+0x13a>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbp,%rdi
lea    0xdfe(%rip),%rsi
mov    %r13,%rdx
lea    0xc(%rsp),%rcx
xor    %eax,%eax
call   1070 <sscanf@plt>
test   %r15b,%r15b
mov    (%r12),%edi
mov    0x8(%rsp),%eax
mov    0xc(%rsp),%ecx
mov    %eax,%edx
cmovg  %ecx,%edx
cmovg  %eax,%ecx
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %rbp,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     12f0 <main+0x160>
cmp    $0x2,%eax
je     1290 <main+0x100>
test   %eax,%eax
jne    12ca <main+0x13a>
jmp    131c <main+0x18c>
nop
mov    %rbp,%rdi
lea    0xda1(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1070 <sscanf@plt>
mov    (%r12),%edi
mov    0x8(%rsp),%edx
lea    0xd8e(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    12ca <main+0x13a>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x2cbd(%rip),%rax
cmpl   $0x0,(%rax)
je     124c <main+0xbc>
mov    0x2c8d(%rip),%rax
mov    (%rax),%rdi
test   %rdi,%rdi
je     124c <main+0xbc>
mov    0x2c82(%rip),%rax
mov    (%rax),%ebx
call   10b0 <strerror@plt>
lea    0xd15(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x2c51(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"sh?\00"
@.str.1 = [45 x i8] c"Usage: %s [-s] file (-s swaps byte order)\0A\00"
@EXIT_SUCCESS = global i32 0
@optind = global i32 0
@stderr = global i32 0
@.str.2 = [28 x i8] c"Error - No filename given.\0A\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [34 x i8] c"Error - Unable to open file: %s.\0A\00"
@errno = global i64 0
@EOF = global i32 0
@.str.5 = [39 x i8] c"Error - Unable to read from file: %s.\0A\00"
@.str.6 = [4 x i8] c"%2x\00"
@stdout = global i32 0
@.str.7 = [3 x i8] c"%c\00"
@.str.8 = [7 x i8] c"%2x%2x\00"
@.str.9 = [5 x i8] c"%c%c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca [4 x i32]
%8 = alloca [2 x i32]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %9
br label %12
12: ; preds = %30, %2
%13 = load i32, i32* %4
%14 = load i8**, i8*** %5
%15 = call signext i8 @getopt(i32 %13, i8** %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8 %15, i8* %6
%16 = sext i8 %15 to i32
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %31
18: ; preds = %12
%19 = load i8, i8* %6
%20 = sext i8 %19 to i32
switch i32 %20, label %23 [
i32 115, label %21
i32 104, label %22
i32 63, label %22
]
21: ; preds = %18
store i32 1, i32* %9
br label %30
22: ; preds = %18, %18
br label %23
23: ; preds = %18, %22
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8* %26)
%28 = load i32, i32* @EXIT_SUCCESS
%29 = call i32 @exit(i32 %28)
unreachable
30: ; preds = %21
br label %12
31: ; preds = %12
%32 = load i32, i32* %4
%33 = load i32, i32* @optind
%34 = sub nsw i32 %32, %33
%35 = icmp slt i32 %34, 1
br i1 %35, label %36, label %41
36: ; preds = %31
%37 = load i32, i32* @stderr
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%39 = load i32, i32* @EXIT_FAILURE
%40 = call i32 @exit(i32 %39)
unreachable
41: ; preds = %31
%42 = load i8**, i8*** %5
%43 = load i32, i32* @optind
%44 = add nsw i32 %43, 1
store i32 %44, i32* @optind
%45 = sext i32 %43 to i64
%46 = getelementptr inbounds i8*, i8** %42, i64 %45
%47 = load i8*, i8** %46
%48 = call i32* @fopen(i8* %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %48, i32** %11
%49 = icmp eq i32* %48, null
br i1 %49, label %50, label %57
50: ; preds = %41
%51 = load i32, i32* @stderr
%52 = load i64, i64* @errno
%53 = call i8* @strerror(i64 %52)
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i8* %53)
%55 = load i32, i32* @EXIT_FAILURE
%56 = call i32 @exit(i32 %55)
unreachable
57: ; preds = %41
store i64 0, i64* @errno
br label %58
58: ; preds = %117, %57
%59 = bitcast [4 x i32]* %7 to i32**
%60 = load i32*, i32** %11
%61 = call i32 @fread(i32** %59, i32 2, i32 2, i32* %60)
store i32 %61, i32* %10
switch i32 %61, label %117 [
i32 0, label %62
i32 1, label %80
i32 2, label %89
]
62: ; preds = %58
%63 = load i32*, i32** %11
%64 = call i32 @fclose(i32* %63)
%65 = load i32, i32* @EOF
store i32 %65, i32* %10
%66 = icmp ne i32 %65, 0
br i1 %66, label %67, label %77
67: ; preds = %62
%68 = load i64, i64* @errno
%69 = icmp ne i64 %68, 0
br i1 %69, label %70, label %77
70: ; preds = %67
%71 = load i32, i32* @stderr
%72 = load i64, i64* @errno
%73 = call i8* @strerror(i64 %72)
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* %73)
%75 = load i32, i32* @EXIT_FAILURE
%76 = call i32 @exit(i32 %75)
unreachable
77: ; preds = %67, %62
%78 = load i32, i32* @EXIT_SUCCESS
%79 = call i32 @exit(i32 %78)
unreachable
80: ; preds = %58
%81 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
%82 = bitcast i32* %81 to i8*
%83 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%84 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %82, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32* %83)
%85 = load i32, i32* @stdout
%86 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%87 = load i32, i32* %86
%88 = call i32 (i32, i8*, ...) @fprintf(i32 %85, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 %87)
br label %117
89: ; preds = %58
%90 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
%91 = bitcast i32* %90 to i8*
%92 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%93 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%94 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %91, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32* %92, i32* %93)
%95 = load i32, i32* @stdout
%96 = load i32, i32* %9
%97 = icmp ne i32 %96, 0
br i1 %97, label %98, label %101
98: ; preds = %89
%99 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%100 = load i32, i32* %99
br label %104
101: ; preds = %89
%102 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%103 = load i32, i32* %102
br label %104
104: ; preds = %101, %98
%105 = phi i32 [ %100, %98 ], [ %103, %101 ]
%106 = load i32, i32* %9
%107 = icmp ne i32 %106, 0
br i1 %107, label %108, label %111
108: ; preds = %104
%109 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%110 = load i32, i32* %109
br label %114
111: ; preds = %104
%112 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%113 = load i32, i32* %112
br label %114
114: ; preds = %111, %108
%115 = phi i32 [ %110, %108 ], [ %113, %111 ]
%116 = call i32 (i32, i8*, ...) @fprintf(i32 %95, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 %105, i32 %115)
br label %117
117: ; preds = %58, %114, %80
br label %58
}

LLVM IR (-O2):
@.str = [4 x i8] c"sh?\00"
@.str.1 = [45 x i8] c"Usage: %s [-s] file (-s swaps byte order)\0A\00"
@EXIT_SUCCESS = global i32 0
@optind = global i32 0
@stderr = global i32 0
@.str.2 = [28 x i8] c"Error - No filename given.\0A\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [34 x i8] c"Error - Unable to open file: %s.\0A\00"
@errno = global i64 0
@EOF = global i32 0
@.str.5 = [39 x i8] c"Error - Unable to read from file: %s.\0A\00"
@.str.6 = [4 x i8] c"%2x\00"
@stdout = global i32 0
@.str.7 = [3 x i8] c"%c\00"
@.str.8 = [7 x i8] c"%2x%2x\00"
@.str.9 = [5 x i8] c"%c%c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [4 x i32]
%4 = alloca [2 x i32]
%5 = bitcast [4 x i32]* %3 to i8*
%6 = bitcast [2 x i32]* %4 to i8*
%7 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = icmp sgt i8 %7, 0
br i1 %8, label %12, label %20
9: ; preds = %12
%10 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = icmp sgt i8 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %2, %9
%13 = phi i8 [ %10, %9 ], [ %7, %2 ]
%14 = icmp eq i8 %13, 115
br i1 %14, label %9, label %15
15: ; preds = %12
%16 = load i8*, i8** %1
%17 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = load i32, i32* @EXIT_SUCCESS
%19 = tail call i32 @exit(i32 %18)
unreachable
20: ; preds = %9, %2
%21 = load i32, i32* @optind
%22 = icmp slt i32 %21, %0
br i1 %22, label %28, label %23
23: ; preds = %20
%24 = load i32, i32* @stderr
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%26 = load i32, i32* @EXIT_FAILURE
%27 = tail call i32 @exit(i32 %26)
unreachable
28: ; preds = %20
%29 = add nsw i32 %21, 1
store i32 %29, i32* @optind
%30 = sext i32 %21 to i64
%31 = getelementptr inbounds i8*, i8** %1, i64 %30
%32 = load i8*, i8** %31
%33 = tail call i32* @fopen(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%34 = icmp eq i32* %33, null
br i1 %34, label %35, label %42
35: ; preds = %28
%36 = load i32, i32* @stderr
%37 = load i64, i64* @errno
%38 = tail call i8* @strerror(i64 %37)
%39 = tail call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i8* %38)
%40 = load i32, i32* @EXIT_FAILURE
%41 = tail call i32 @exit(i32 %40)
unreachable
42: ; preds = %28
store i64 0, i64* @errno
%43 = bitcast [4 x i32]* %3 to i32**
%44 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%45 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
br label %46
46: ; preds = %48, %42
%47 = call i32 @fread(i32** %43, i32 2, i32 2, i32* %33)
switch i32 %47, label %48 [
i32 0, label %49
i32 1, label %65
i32 2, label %70
]
48: ; preds = %46, %70, %65
br label %46
49: ; preds = %46
%50 = call i32 @fclose(i32* %33)
%51 = load i32, i32* @EOF
%52 = icmp ne i32 %51, 0
%53 = load i64, i64* @errno
%54 = icmp ne i64 %53, 0
%55 = select i1 %52, i1 %54, i1 false
br i1 %55, label %56, label %62
56: ; preds = %49
%57 = load i32, i32* @stderr
%58 = call i8* @strerror(i64 %53)
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* %58)
%60 = load i32, i32* @EXIT_FAILURE
%61 = call i32 @exit(i32 %60)
unreachable
62: ; preds = %49
%63 = load i32, i32* @EXIT_SUCCESS
%64 = call i32 @exit(i32 %63)
unreachable
65: ; preds = %46
%66 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32* %44)
%67 = load i32, i32* @stdout
%68 = load i32, i32* %44
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 %68)
br label %48
70: ; preds = %46
%71 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32* %44, i32* %45)
%72 = load i32, i32* @stdout
%73 = load i32, i32* %45
%74 = load i32, i32* %44
%75 = select i1 %8, i32 %73, i32 %74
%76 = select i1 %8, i32 %74, i32 %73
%77 = call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 %75, i32 %76)
br label %48
}