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

/* Variables and functions */
int /*<<< orphan*/ clearerr(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
scalar_t__ ferror(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ fread(short *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(short *);
scalar_t__ fwrite(void *, int, int, int /*<<< orphan*/ *);
void *malloc(int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  FILE *src;
  FILE *dest;
  if (argc != 3) {
    fprintf(stderr,
            "Expected 2 arguments\nUsage: remvocals sourcewav destwav\n");
    exit(1);
  }
  if ((src = fopen(argv[1], "r")) == NULL) {
    fprintf(stderr, "Cannot open sourcefile %s\n", argv[1]);
    exit(1);
  }
  dest = fopen(argv[2], "w");
  void *ptr = malloc(44);
  if (fread(ptr, 1, 44, src) == 0) {
    fprintf(stderr, "Error occurred while reading from %s\n", argv[1]);
    exit(1);
  }
  if (fwrite(ptr, 1, 44, dest) == 0) {
    fprintf(stderr, "Error occurred while writing to %s\n", argv[2]);
    exit(1);
  }
  short left, right;
  short *ptrl = malloc(sizeof(short));
  short *ptrr = malloc(sizeof(short));
  clearerr(src);
  while (fread(ptrl, sizeof(short), 1, src) != 0) {
    left = *ptrl;
    if (fread(ptrr, sizeof(short), 1, src) != 0) {
      right = *ptrr;
      short combined = (left - right) / 2;
      void *ptr2;
      ptr2 = &combined;
      if (fwrite(ptr2, sizeof(short), 1, dest) == 0) {
        fprintf(stderr, "Error occurred while writing to %s\n", argv[2]);
        free(ptrl);
        free(ptrr);
        exit(1);
      }
      if (fwrite(ptr2, sizeof(short), 1, dest) == 0) {
        fprintf(stderr, "Error occurred while writing to %s\n", argv[2]);
        free(ptrl);
        free(ptrr);
        exit(1);
      }
    } else {
      fprintf(stderr, "wav file %s not correctly formatted\n", argv[1]);
      free(ptrl);
      free(ptrr);
      exit(1);
    }
  }
  if (ferror(src) != 0) {
    fprintf(stderr, "Error occurred while reading from %s\n", argv[1]);
    free(ptrl);
    free(ptrr);
    exit(1);
  }
  free(ptrl);
  free(ptrr);
  return 0;
}


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   $0x3,-0x8(%rbp)
je     11d1 <main+0x41>
mov    0x2e29(%rip),%rax
mov    (%rax),%edi
lea    0xe40(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe59(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    121c <main+0x8c>
mov    0x2de6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe30(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe2b(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    $0x2c,%edi
call   1080 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2c,%edx
call   1050 <fread@plt>
cmp    $0x0,%rax
jne    128c <main+0xfc>
mov    0x2d76(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xddd(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2c,%edx
call   10b0 <fwrite@plt>
cmp    $0x0,%rax
jne    12d6 <main+0x146>
mov    0x2d2c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xdb9(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    $0x2,%edi
call   1080 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    $0x2,%edi
call   1080 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <clearerr@plt>
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1050 <fread@plt>
cmp    $0x0,%rax
je     146e <main+0x2de>
mov    -0x38(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x2a(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1050 <fread@plt>
cmp    $0x0,%rax
je     142e <main+0x29e>
mov    -0x40(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x2c(%rbp)
movswl -0x2a(%rbp),%eax
movswl -0x2c(%rbp),%ecx
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %ax,-0x42(%rbp)
lea    -0x42(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   10b0 <fwrite@plt>
cmp    $0x0,%rax
jne    13cd <main+0x23d>
mov    0x2c47(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xcd4(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x50(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   10b0 <fwrite@plt>
cmp    $0x0,%rax
jne    1429 <main+0x299>
mov    0x2beb(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xc78(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
jmp    1469 <main+0x2d9>
mov    0x2bab(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xc5c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
jmp    12fb <main+0x16b>
mov    -0x18(%rbp),%rdi
call   1040 <ferror@plt>
cmp    $0x0,%rax
je     14bc <main+0x32c>
mov    0x2b58(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xbbf(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
cmp    $0x3,%edi
jne    1383 <main+0x1f3>
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
lea    0xe84(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     13a4 <main+0x214>
mov    %rax,%r13
mov    0x10(%r14),%rdi
lea    0xe85(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%rbx
mov    $0x2c,%edi
call   1080 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    $0x1,%esi
mov    $0x2c,%edx
mov    %r13,%rcx
call   1050 <fread@plt>
test   %rax,%rax
je     13ba <main+0x22a>
mov    %r14,0x10(%rsp)
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x2c,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
test   %rax,%rax
je     13d0 <main+0x240>
mov    $0x2,%edi
call   1080 <malloc@plt>
mov    %rax,%r12
mov    $0x2,%edi
call   1080 <malloc@plt>
mov    %rax,%r15
mov    %r13,%rdi
call   1070 <clearerr@plt>
mov    %r12,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1050 <fread@plt>
test   %rax,%rax
je     12fc <main+0x16c>
lea    0xe(%rsp),%rbp
nopl   0x0(%rax)
movswl (%r12),%r14d
mov    %r15,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1050 <fread@plt>
test   %rax,%rax
je     1349 <main+0x1b9>
movswl (%r15),%eax
sub    %eax,%r14d
mov    %r14d,%eax
shr    $0x1f,%eax
add    %r14d,%eax
shr    %eax
mov    %ax,0xe(%rsp)
mov    %rbp,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
test   %rax,%rax
je     132e <main+0x19e>
mov    %rbp,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
test   %rax,%rax
je     132e <main+0x19e>
mov    %r12,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1050 <fread@plt>
test   %rax,%rax
jne    1270 <main+0xe0>
mov    %r13,%rdi
call   1040 <ferror@plt>
test   %rax,%rax
jne    13fa <main+0x26a>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2cab(%rip),%rax
mov    (%rax),%edi
mov    0x10(%rsp),%rax
mov    0x10(%rax),%rdx
lea    0xd37(%rip),%rsi
jmp    1362 <main+0x1d2>
mov    0x2c90(%rip),%rax
mov    (%rax),%edi
mov    0x10(%rsp),%rax
mov    0x8(%rax),%rdx
lea    0xd40(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    0x2c56(%rip),%rax
mov    (%rax),%edi
lea    0xc6d(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    0x2c35(%rip),%rax
mov    (%rax),%edi
mov    0x8(%r14),%rdx
lea    0xc83(%rip),%rsi
jmp    13e9 <main+0x259>
mov    0x2c1f(%rip),%rax
mov    (%rax),%edi
mov    0x8(%r14),%rdx
lea    0xc8a(%rip),%rsi
jmp    13e9 <main+0x259>
mov    0x2c09(%rip),%rax
mov    (%rax),%edi
mov    0x10(%rsp),%rax
mov    0x10(%rax),%rdx
lea    0xc95(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    0x2bdf(%rip),%rax
mov    (%rax),%edi
mov    0x10(%rsp),%rax
mov    0x8(%rax),%rdx
lea    0xc45(%rip),%rsi
jmp    1362 <main+0x1d2>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"Expected 2 arguments\0AUsage: remvocals sourcewav destwav\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [27 x i8] c"Cannot open sourcefile %s\0A\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [38 x i8] c"Error occurred while reading from %s\0A\00"
@.str.5 = [36 x i8] c"Error occurred while writing to %s\0A\00"
@.str.6 = [37 x i8] c"wav file %s not correctly formatted\0A\00"
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 i16
%10 = alloca i16
%11 = alloca i16*
%12 = alloca i16*
%13 = alloca i16
%14 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 3
br i1 %16, label %17, label %21
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32* @fopen(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %25, i32** %6
%26 = icmp eq i32* %25, null
br i1 %26, label %27, label %34
27: ; preds = %21
%28 = load i32, i32* @stderr
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %31)
%33 = call i32 @exit(i32 1)
unreachable
34: ; preds = %21
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = call i32* @fopen(i8* %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %38, i32** %7
%39 = call i8* @malloc(i32 44)
store i8* %39, i8** %8
%40 = load i8*, i8** %8
%41 = bitcast i8* %40 to i16*
%42 = load i32*, i32** %6
%43 = call i64 @fread(i16* %41, i32 1, i32 44, i32* %42)
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %52
45: ; preds = %34
%46 = load i32, i32* @stderr
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 1
%49 = load i8*, i8** %48
%50 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i8* %49)
%51 = call i32 @exit(i32 1)
unreachable
52: ; preds = %34
%53 = load i8*, i8** %8
%54 = load i32*, i32** %7
%55 = call i64 @fwrite(i8* %53, i32 1, i32 44, i32* %54)
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %64
57: ; preds = %52
%58 = load i32, i32* @stderr
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 2
%61 = load i8*, i8** %60
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i8* %61)
%63 = call i32 @exit(i32 1)
unreachable
64: ; preds = %52
%65 = call i8* @malloc(i32 2)
%66 = bitcast i8* %65 to i16*
store i16* %66, i16** %11
%67 = call i8* @malloc(i32 2)
%68 = bitcast i8* %67 to i16*
store i16* %68, i16** %12
%69 = load i32*, i32** %6
%70 = call i32 @clearerr(i32* %69)
br label %71
71: ; preds = %137, %64
%72 = load i16*, i16** %11
%73 = load i32*, i32** %6
%74 = call i64 @fread(i16* %72, i32 2, i32 1, i32* %73)
%75 = icmp ne i64 %74, 0
br i1 %75, label %76, label %138
76: ; preds = %71
%77 = load i16*, i16** %11
%78 = load i16, i16* %77
store i16 %78, i16* %9
%79 = load i16*, i16** %12
%80 = load i32*, i32** %6
%81 = call i64 @fread(i16* %79, i32 2, i32 1, i32* %80)
%82 = icmp ne i64 %81, 0
br i1 %82, label %83, label %126
83: ; preds = %76
%84 = load i16*, i16** %12
%85 = load i16, i16* %84
store i16 %85, i16* %10
%86 = load i16, i16* %9
%87 = sext i16 %86 to i32
%88 = load i16, i16* %10
%89 = sext i16 %88 to i32
%90 = sub nsw i32 %87, %89
%91 = sdiv i32 %90, 2
%92 = trunc i32 %91 to i16
store i16 %92, i16* %13
%93 = bitcast i16* %13 to i8*
store i8* %93, i8** %14
%94 = load i8*, i8** %14
%95 = load i32*, i32** %7
%96 = call i64 @fwrite(i8* %94, i32 2, i32 1, i32* %95)
%97 = icmp eq i64 %96, 0
br i1 %97, label %98, label %109
98: ; preds = %83
%99 = load i32, i32* @stderr
%100 = load i8**, i8*** %5
%101 = getelementptr inbounds i8*, i8** %100, i64 2
%102 = load i8*, i8** %101
%103 = call i32 (i32, i8*, ...) @fprintf(i32 %99, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i8* %102)
%104 = load i16*, i16** %11
%105 = call i32 @free(i16* %104)
%106 = load i16*, i16** %12
%107 = call i32 @free(i16* %106)
%108 = call i32 @exit(i32 1)
unreachable
109: ; preds = %83
%110 = load i8*, i8** %14
%111 = load i32*, i32** %7
%112 = call i64 @fwrite(i8* %110, i32 2, i32 1, i32* %111)
%113 = icmp eq i64 %112, 0
br i1 %113, label %114, label %125
114: ; preds = %109
%115 = load i32, i32* @stderr
%116 = load i8**, i8*** %5
%117 = getelementptr inbounds i8*, i8** %116, i64 2
%118 = load i8*, i8** %117
%119 = call i32 (i32, i8*, ...) @fprintf(i32 %115, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i8* %118)
%120 = load i16*, i16** %11
%121 = call i32 @free(i16* %120)
%122 = load i16*, i16** %12
%123 = call i32 @free(i16* %122)
%124 = call i32 @exit(i32 1)
unreachable
125: ; preds = %109
br label %137
126: ; preds = %76
%127 = load i32, i32* @stderr
%128 = load i8**, i8*** %5
%129 = getelementptr inbounds i8*, i8** %128, i64 1
%130 = load i8*, i8** %129
%131 = call i32 (i32, i8*, ...) @fprintf(i32 %127, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i8* %130)
%132 = load i16*, i16** %11
%133 = call i32 @free(i16* %132)
%134 = load i16*, i16** %12
%135 = call i32 @free(i16* %134)
%136 = call i32 @exit(i32 1)
unreachable
137: ; preds = %125
br label %71
138: ; preds = %71
%139 = load i32*, i32** %6
%140 = call i64 @ferror(i32* %139)
%141 = icmp ne i64 %140, 0
br i1 %141, label %142, label %153
142: ; preds = %138
%143 = load i32, i32* @stderr
%144 = load i8**, i8*** %5
%145 = getelementptr inbounds i8*, i8** %144, i64 1
%146 = load i8*, i8** %145
%147 = call i32 (i32, i8*, ...) @fprintf(i32 %143, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i8* %146)
%148 = load i16*, i16** %11
%149 = call i32 @free(i16* %148)
%150 = load i16*, i16** %12
%151 = call i32 @free(i16* %150)
%152 = call i32 @exit(i32 1)
unreachable
153: ; preds = %138
%154 = load i16*, i16** %11
%155 = call i32 @free(i16* %154)
%156 = load i16*, i16** %12
%157 = call i32 @free(i16* %156)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"Expected 2 arguments\0AUsage: remvocals sourcewav destwav\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [27 x i8] c"Cannot open sourcefile %s\0A\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [38 x i8] c"Error occurred while reading from %s\0A\00"
@.str.5 = [36 x i8] c"Error occurred while writing to %s\0A\00"
@.str.6 = [37 x i8] c"wav file %s not correctly formatted\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i16
%4 = icmp eq i32 %0, 3
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32* @fopen(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %19
14: ; preds = %9
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %10
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %16)
%18 = tail call i32 @exit(i32 1)
unreachable
19: ; preds = %9
%20 = getelementptr inbounds i8*, i8** %1, i64 2
%21 = load i8*, i8** %20
%22 = tail call i32* @fopen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%23 = tail call dereferenceable_or_null(44) i8* @malloc(i32 44)
%24 = bitcast i8* %23 to i16*
%25 = tail call i64 @fread(i16* %24, i32 1, i32 44, i32* %12)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %32
27: ; preds = %19
%28 = load i32, i32* @stderr
%29 = load i8*, i8** %10
%30 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i8* %29)
%31 = tail call i32 @exit(i32 1)
unreachable
32: ; preds = %19
%33 = tail call i64 @fwrite(i8* %23, i32 1, i32 44, i32* %22)
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %40
35: ; preds = %32
%36 = load i32, i32* @stderr
%37 = load i8*, i8** %20
%38 = tail call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i8* %37)
%39 = tail call i32 @exit(i32 1)
unreachable
40: ; preds = %32
%41 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
%42 = bitcast i8* %41 to i16*
%43 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
%44 = bitcast i8* %43 to i16*
%45 = tail call i32 @clearerr(i32* %12)
%46 = tail call i64 @fread(i16* %42, i32 2, i32 1, i32* %12)
%47 = icmp eq i64 %46, 0
br i1 %47, label %90, label %48
48: ; preds = %40
%49 = bitcast i16* %3 to i8*
br label %50
50: ; preds = %48, %80
%51 = load i16, i16* %42
%52 = tail call i64 @fread(i16* %44, i32 2, i32 1, i32* %12)
%53 = icmp eq i64 %52, 0
br i1 %53, label %83, label %54
54: ; preds = %50
%55 = load i16, i16* %44
%56 = sext i16 %51 to i32
%57 = sext i16 %55 to i32
%58 = sub nsw i32 %56, %57
%59 = sdiv i32 %58, 2
%60 = trunc i32 %59 to i16
store i16 %60, i16* %3
%61 = call i64 @fwrite(i8* %49, i32 2, i32 1, i32* %22)
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %70
63: ; preds = %54
%64 = load i32, i32* @stderr
%65 = load i8*, i8** %20
%66 = tail call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i8* %65)
%67 = tail call i32 @free(i16* %42)
%68 = tail call i32 @free(i16* %44)
%69 = tail call i32 @exit(i32 1)
unreachable
70: ; preds = %54
%71 = call i64 @fwrite(i8* %49, i32 2, i32 1, i32* %22)
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %80
73: ; preds = %70
%74 = load i32, i32* @stderr
%75 = load i8*, i8** %20
%76 = tail call i32 (i32, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i8* %75)
%77 = tail call i32 @free(i16* %42)
%78 = tail call i32 @free(i16* %44)
%79 = tail call i32 @exit(i32 1)
unreachable
80: ; preds = %70
%81 = tail call i64 @fread(i16* %42, i32 2, i32 1, i32* %12)
%82 = icmp eq i64 %81, 0
br i1 %82, label %90, label %50
83: ; preds = %50
%84 = load i32, i32* @stderr
%85 = load i8*, i8** %10
%86 = tail call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i8* %85)
%87 = tail call i32 @free(i16* %42)
%88 = tail call i32 @free(i16* %44)
%89 = tail call i32 @exit(i32 1)
unreachable
90: ; preds = %80, %40
%91 = tail call i64 @ferror(i32* %12)
%92 = icmp eq i64 %91, 0
br i1 %92, label %100, label %93
93: ; preds = %90
%94 = load i32, i32* @stderr
%95 = load i8*, i8** %10
%96 = tail call i32 (i32, i8*, ...) @fprintf(i32 %94, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i8* %95)
%97 = tail call i32 @free(i16* %42)
%98 = tail call i32 @free(i16* %44)
%99 = tail call i32 @exit(i32 1)
unreachable
100: ; preds = %90
%101 = tail call i32 @free(i16* %42)
%102 = tail call i32 @free(i16* %44)
ret i32 0
}