#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*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ commitChunk(unsigned char, unsigned short,
                               int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  FILE *in_fptr, *out_fptr;
  unsigned char buf[32];
  int res;
  unsigned short current_value = 0;
  unsigned char current_stride = 0;
  long insize;
  if (argc != 3) {
    printf("Usage: ./pitcomp input.bin output.bin\n");
    return 1;
  }
  in_fptr = fopen(argv[1], "rb");
  if (!in_fptr) {
    perror("fopen");
    return -1;
  }
  fseek(in_fptr, 0, SEEK_END);
  insize = ftell(in_fptr);
  fseek(in_fptr, 0, SEEK_SET);
  out_fptr = fopen(argv[2], "wb");
  if (!out_fptr) {
    perror("fopen");
    return -1;
  }
  printf("Compressing music '%s' into '%s'....", argv[1], argv[2]);
  do {
    unsigned short val;
    res = fread(buf, 2, 1, in_fptr);
    if (res != 1) {
      if (feof(in_fptr))
        break;
      perror("fread");
      goto error;
    }
    if (insize - ftell(in_fptr) <= 3)
      break;
    val = buf[0] | buf[1] << 8;
    if (current_value != val) {
      if (current_stride) {
        commitChunk(current_stride, current_value, out_fptr);
      }
      current_value = val;
      current_stride = 1;
    } else {
      current_stride++;
      if (current_stride == 255) {
        commitChunk(current_stride, current_value, out_fptr);
      }
    }
  } while (!feof(in_fptr));
  if (current_stride) {
    commitChunk(current_stride, current_value, out_fptr);
  }
  printf(" Done. Input bytes: %ld, Output bytes: %ld\n", ftell(in_fptr),
         ftell(out_fptr));
  fclose(in_fptr);
  fclose(out_fptr);
  return 0;
error:
  if (in_fptr)
    fclose(in_fptr);
  return -1;
}


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)
movw   $0x0,-0x46(%rbp)
movb   $0x0,-0x47(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11d4 <main+0x44>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    143b <main+0x2ab>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe44(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    120f <main+0x7f>
lea    0xe2c(%rip),%rdi
call   10b0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    143b <main+0x2ab>
mov    -0x18(%rbp),%rdi
mov    0x2dce(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1090 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   1070 <ftell@plt>
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d9d(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1090 <fseek@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xddd(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    127f <main+0xef>
lea    0xdbc(%rip),%rdi
call   10b0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    143b <main+0x2ab>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xd9d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x1,-0x44(%rbp)
je     12ea <main+0x15a>
mov    -0x18(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%rax
je     12d9 <main+0x149>
jmp    13b7 <main+0x227>
lea    0xd78(%rip),%rdi
call   10b0 <perror@plt>
jmp    1420 <main+0x290>
mov    -0x50(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <ftell@plt>
mov    %rax,%rcx
mov    -0x60(%rbp),%rax
sub    %rcx,%rax
cmp    $0x3,%rax
jg     1314 <main+0x184>
jmp    13b7 <main+0x227>
movzbl -0x40(%rbp),%eax
movzbl -0x3f(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %ax,-0x52(%rbp)
movzwl -0x46(%rbp),%eax
movzwl -0x52(%rbp),%ecx
cmp    %ecx,%eax
je     1366 <main+0x1d6>
cmpb   $0x0,-0x47(%rbp)
je     1355 <main+0x1c5>
mov    -0x47(%rbp),%cl
mov    -0x46(%rbp),%ax
mov    -0x20(%rbp),%rdx
movzbl %cl,%edi
movzwl %ax,%esi
call   1040 <commitChunk@plt>
mov    -0x52(%rbp),%ax
mov    %ax,-0x46(%rbp)
movb   $0x1,-0x47(%rbp)
jmp    1398 <main+0x208>
mov    -0x47(%rbp),%al
add    $0x1,%al
mov    %al,-0x47(%rbp)
movzbl -0x47(%rbp),%eax
cmp    $0xff,%eax
jne    1393 <main+0x203>
mov    -0x47(%rbp),%cl
mov    -0x46(%rbp),%ax
mov    -0x20(%rbp),%rdx
movzbl %cl,%edi
movzwl %ax,%esi
call   1040 <commitChunk@plt>
jmp    1398 <main+0x208>
jmp    139d <main+0x20d>
mov    -0x18(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    129d <main+0x10d>
cmpb   $0x0,-0x47(%rbp)
je     13d7 <main+0x247>
mov    -0x47(%rbp),%cl
mov    -0x46(%rbp),%ax
mov    -0x20(%rbp),%rdx
movzbl %cl,%edi
movzwl %ax,%esi
call   1040 <commitChunk@plt>
mov    -0x18(%rbp),%rdi
call   1070 <ftell@plt>
mov    %rax,-0x68(%rbp)
mov    -0x20(%rbp),%rdi
call   1070 <ftell@plt>
mov    -0x68(%rbp),%rsi
mov    %rax,%rdx
lea    0xc63(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
jmp    143b <main+0x2ab>
cmpq   $0x0,-0x18(%rbp)
je     1434 <main+0x2a4>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
cmp    $0x3,%edi
jne    12de <main+0x13e>
mov    %rsi,%r12
mov    0x8(%rsi),%rdi
lea    0xe3b(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1389 <main+0x1e9>
mov    %rax,%r13
mov    0x2e0b(%rip),%rax
mov    (%rax),%edx
mov    %r13,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    %r13,%rdi
call   1080 <ftell@plt>
mov    %rax,%r15
mov    0x2ddd(%rip),%rax
mov    (%rax),%edx
mov    %r13,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    0x10(%r12),%rdi
lea    0xdf6(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1389 <main+0x1e9>
mov    %rax,0x8(%rsp)
mov    0x8(%r12),%rsi
mov    0x10(%r12),%rdx
lea    0xdd5(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1070 <printf@plt>
xor    %ebx,%ebx
jmp    1275 <main+0xd5>
mov    $0xff,%bpl
mov    $0xff,%r12b
mov    %ebx,%r14d
movzbl %bpl,%edi
movzwl %bx,%esi
mov    0x8(%rsp),%rdx
call   1050 <commitChunk@plt>
mov    %r13,%rdi
call   1090 <feof@plt>
mov    %r12d,%ebp
mov    %r14d,%ebx
test   %rax,%rax
jne    1325 <main+0x185>
lea    0x10(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1040 <fread@plt>
mov    %r13,%rdi
cmp    $0x1,%eax
jne    12f4 <main+0x154>
call   1080 <ftell@plt>
mov    %r15,%rcx
sub    %rax,%rcx
cmp    $0x4,%rcx
jl     131f <main+0x17f>
movzwl 0x10(%rsp),%r14d
cmp    %r14w,%bx
jne    12d0 <main+0x130>
add    $0x1,%bpl
cmp    $0xff,%bpl
je     1244 <main+0xa4>
mov    %ebp,%r12d
mov    %ebx,%r14d
jmp    125e <main+0xbe>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x1,%r12b
test   %bpl,%bpl
jne    124d <main+0xad>
jmp    125e <main+0xbe>
lea    0xd7e(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebp
jmp    1378 <main+0x1d8>
call   1090 <feof@plt>
mov    %ebx,%r14d
mov    %ebp,%r12d
test   %rax,%rax
jne    1325 <main+0x185>
lea    0xd26(%rip),%rdi
call   10c0 <perror@plt>
mov    %r13,%rdi
call   1060 <fclose@plt>
mov    $0xffffffff,%ebp
jmp    1378 <main+0x1d8>
mov    %ebx,%r14d
mov    %ebp,%r12d
test   %r12b,%r12b
mov    0x8(%rsp),%rbx
je     133f <main+0x19f>
movzbl %r12b,%edi
movzwl %r14w,%esi
mov    %rbx,%rdx
call   1050 <commitChunk@plt>
mov    %r13,%rdi
call   1080 <ftell@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1080 <ftell@plt>
lea    0xcde(%rip),%rdi
xor    %ebp,%ebp
mov    %r15,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r13,%rdi
call   1060 <fclose@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
mov    %ebp,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc73(%rip),%rdi
call   10c0 <perror@plt>
mov    $0xffffffff,%ebp
jmp    1378 <main+0x1d8>

LLVM IR (-O0):
@.str = [39 x i8] c"Usage: ./pitcomp input.bin output.bin\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [6 x i8] c"fopen\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.3 = [3 x i8] c"wb\00"
@.str.4 = [37 x i8] c"Compressing music '%s' into '%s'....\00"
@.str.5 = [6 x i8] c"fread\00"
@.str.6 = [44 x i8] c" Done. Input bytes: %ld, Output bytes: %ld\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 [32 x i8]
%9 = alloca i32
%10 = alloca i16
%11 = alloca i8
%12 = alloca i64
%13 = alloca i16
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i16 0, i16* %10
store i8 0, i8* %11
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 3
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %140
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32* @fopen(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %22, i32** %6
%23 = load i32*, i32** %6
%24 = icmp ne i32* %23, null
br i1 %24, label %27, label %25
25: ; preds = %18
%26 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %140
27: ; preds = %18
%28 = load i32*, i32** %6
%29 = load i32, i32* @SEEK_END
%30 = call i32 @fseek(i32* %28, i32 0, i32 %29)
%31 = load i32*, i32** %6
%32 = call i64 @ftell(i32* %31)
store i64 %32, i64* %12
%33 = load i32*, i32** %6
%34 = load i32, i32* @SEEK_SET
%35 = call i32 @fseek(i32* %33, i32 0, i32 %34)
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 2
%38 = load i8*, i8** %37
%39 = call i32* @fopen(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %39, i32** %7
%40 = load i32*, i32** %7
%41 = icmp ne i32* %40, null
br i1 %41, label %44, label %42
42: ; preds = %27
%43 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %140
44: ; preds = %27
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 1
%47 = load i8*, i8** %46
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 2
%50 = load i8*, i8** %49
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8* %47, i8* %50)
br label %52
52: ; preds = %110, %44
%53 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%54 = load i32*, i32** %6
%55 = call i32 @fread(i8* %53, i32 2, i32 1, i32* %54)
store i32 %55, i32* %9
%56 = load i32, i32* %9
%57 = icmp ne i32 %56, 1
br i1 %57, label %58, label %65
58: ; preds = %52
%59 = load i32*, i32** %6
%60 = call i64 @feof(i32* %59)
%61 = icmp ne i64 %60, 0
br i1 %61, label %62, label %63
62: ; preds = %58
br label %115
63: ; preds = %58
%64 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %133
65: ; preds = %52
%66 = load i64, i64* %12
%67 = load i32*, i32** %6
%68 = call i64 @ftell(i32* %67)
%69 = sub nsw i64 %66, %68
%70 = icmp sle i64 %69, 3
br i1 %70, label %71, label %72
71: ; preds = %65
br label %115
72: ; preds = %65
%73 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%74 = load i8, i8* %73
%75 = zext i8 %74 to i32
%76 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 1
%77 = load i8, i8* %76
%78 = zext i8 %77 to i32
%79 = shl i32 %78, 8
%80 = or i32 %75, %79
%81 = trunc i32 %80 to i16
store i16 %81, i16* %13
%82 = load i16, i16* %10
%83 = zext i16 %82 to i32
%84 = load i16, i16* %13
%85 = zext i16 %84 to i32
%86 = icmp ne i32 %83, %85
br i1 %86, label %87, label %97
87: ; preds = %72
%88 = load i8, i8* %11
%89 = icmp ne i8 %88, 0
br i1 %89, label %90, label %95
90: ; preds = %87
%91 = load i8, i8* %11
%92 = load i16, i16* %10
%93 = load i32*, i32** %7
%94 = call i32 @commitChunk(i8 zeroext %91, i16 zeroext %92, i32* %93)
br label %95
95: ; preds = %90, %87
%96 = load i16, i16* %13
store i16 %96, i16* %10
store i8 1, i8* %11
br label %109
97: ; preds = %72
%98 = load i8, i8* %11
%99 = add i8 %98, 1
store i8 %99, i8* %11
%100 = load i8, i8* %11
%101 = zext i8 %100 to i32
%102 = icmp eq i32 %101, 255
br i1 %102, label %103, label %108
103: ; preds = %97
%104 = load i8, i8* %11
%105 = load i16, i16* %10
%106 = load i32*, i32** %7
%107 = call i32 @commitChunk(i8 zeroext %104, i16 zeroext %105, i32* %106)
br label %108
108: ; preds = %103, %97
br label %109
109: ; preds = %108, %95
br label %110
110: ; preds = %109
%111 = load i32*, i32** %6
%112 = call i64 @feof(i32* %111)
%113 = icmp ne i64 %112, 0
%114 = xor i1 %113, true
br i1 %114, label %52, label %115
115: ; preds = %110, %71, %62
%116 = load i8, i8* %11
%117 = icmp ne i8 %116, 0
br i1 %117, label %118, label %123
118: ; preds = %115
%119 = load i8, i8* %11
%120 = load i16, i16* %10
%121 = load i32*, i32** %7
%122 = call i32 @commitChunk(i8 zeroext %119, i16 zeroext %120, i32* %121)
br label %123
123: ; preds = %118, %115
%124 = load i32*, i32** %6
%125 = call i64 @ftell(i32* %124)
%126 = load i32*, i32** %7
%127 = call i64 @ftell(i32* %126)
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), i64 %125, i64 %127)
%129 = load i32*, i32** %6
%130 = call i32 @fclose(i32* %129)
%131 = load i32*, i32** %7
%132 = call i32 @fclose(i32* %131)
store i32 0, i32* %3
br label %140
133: ; preds = %63
%134 = load i32*, i32** %6
%135 = icmp ne i32* %134, null
br i1 %135, label %136, label %139
136: ; preds = %133
%137 = load i32*, i32** %6
%138 = call i32 @fclose(i32* %137)
br label %139
139: ; preds = %136, %133
store i32 -1, i32* %3
br label %140
140: ; preds = %139, %123, %42, %25, %16
%141 = load i32, i32* %3
ret i32 %141
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [6 x i8] c"fopen\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.3 = [3 x i8] c"wb\00"
@.str.4 = [37 x i8] c"Compressing music '%s' into '%s'....\00"
@.str.5 = [6 x i8] c"fread\00"
@.str.6 = [44 x i8] c" Done. Input bytes: %ld, Output bytes: %ld\0A\00"
@str = [38 x i8] c"Usage: ./pitcomp input.bin output.bin\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 3
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
br label %82
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32* @fopen(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %82
15: ; preds = %8
%16 = load i32, i32* @SEEK_END
%17 = tail call i32 @fseek(i32* %11, i32 0, i32 %16)
%18 = tail call i64 @ftell(i32* %11)
%19 = load i32, i32* @SEEK_SET
%20 = tail call i32 @fseek(i32* %11, i32 0, i32 %19)
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = tail call i32* @fopen(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %27
25: ; preds = %15
%26 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %82
27: ; preds = %15
%28 = load i8*, i8** %9
%29 = load i8*, i8** %21
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8* %28, i8* %29)
%31 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 1
br label %32
32: ; preds = %62, %27
%33 = phi i8 [ 0, %27 ], [ %63, %62 ]
%34 = phi i16 [ 0, %27 ], [ %64, %62 ]
%35 = call i32 @fread(i8* %4, i32 2, i32 1, i32* %11)
%36 = icmp eq i32 %35, 1
br i1 %36, label %40, label %37
37: ; preds = %32
%38 = tail call i64 @feof(i32* %11)
%39 = icmp eq i64 %38, 0
br i1 %39, label %79, label %67
40: ; preds = %32
%41 = tail call i64 @ftell(i32* %11)
%42 = sub nsw i64 %18, %41
%43 = icmp slt i64 %42, 4
br i1 %43, label %67, label %44
44: ; preds = %40
%45 = load i8, i8* %4
%46 = zext i8 %45 to i16
%47 = load i8, i8* %31
%48 = zext i8 %47 to i16
%49 = shl nuw i16 %48, 8
%50 = or i16 %49, %46
%51 = icmp eq i16 %34, %50
br i1 %51, label %54, label %52
52: ; preds = %44
%53 = icmp eq i8 %33, 0
br i1 %53, label %62, label %57
54: ; preds = %44
%55 = add i8 %33, 1
%56 = icmp eq i8 %55, -1
br i1 %56, label %57, label %62
57: ; preds = %54, %52
%58 = phi i8 [ %33, %52 ], [ -1, %54 ]
%59 = phi i8 [ 1, %52 ], [ -1, %54 ]
%60 = phi i16 [ %50, %52 ], [ %34, %54 ]
%61 = tail call i32 @commitChunk(i8 zeroext %58, i16 zeroext %34, i32* %23)
br label %62
62: ; preds = %57, %52, %54
%63 = phi i8 [ 1, %52 ], [ %55, %54 ], [ %59, %57 ]
%64 = phi i16 [ %50, %52 ], [ %34, %54 ], [ %60, %57 ]
%65 = tail call i64 @feof(i32* %11)
%66 = icmp eq i64 %65, 0
br i1 %66, label %32, label %67
67: ; preds = %40, %62, %37
%68 = phi i16 [ %34, %37 ], [ %34, %40 ], [ %64, %62 ]
%69 = phi i8 [ %33, %37 ], [ %33, %40 ], [ %63, %62 ]
%70 = icmp eq i8 %69, 0
br i1 %70, label %73, label %71
71: ; preds = %67
%72 = tail call i32 @commitChunk(i8 zeroext %69, i16 zeroext %68, i32* %23)
br label %73
73: ; preds = %71, %67
%74 = tail call i64 @ftell(i32* %11)
%75 = tail call i64 @ftell(i32* %23)
%76 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), i64 %74, i64 %75)
%77 = tail call i32 @fclose(i32* %11)
%78 = tail call i32 @fclose(i32* %23)
br label %82
79: ; preds = %37
%80 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%81 = tail call i32 @fclose(i32* %11)
br label %82
82: ; preds = %79, %73, %25, %13, %6
%83 = phi i32 [ 1, %6 ], [ -1, %79 ], [ 0, %73 ], [ -1, %25 ], [ -1, %13 ]
ret i32 %83
}