#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 EOF;
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int getc(int /*<<< orphan*/ *);
void compress(FILE *in, FILE *out) {
  static unsigned char data_buf[65526];
  unsigned char number_buf[4];
  int count = 0;
  int zero_mode = -1;
  int input;
  while ((input = getc(in)) != EOF) {
    if (input == 0) {
      if (zero_mode == 1) {
        count++;
      } else {
        if (count > 0) {
          if (zero_mode == 1) {
            number_buf[0] = ((count >> 24) & 0x7f) | 0x80;
            number_buf[1] = (count >> 16) & 0xff;
            number_buf[2] = (count >> 8) & 0xff;
            number_buf[3] = count & 0xff;
            fwrite(number_buf, 4, 1, out);
          } else if (zero_mode == 0) {
            number_buf[0] = (count >> 8) & 0x7f;
            number_buf[1] = count & 0xff;
            fwrite(number_buf, 2, 1, out);
            fwrite(data_buf, count, 1, out);
          }
        }
        zero_mode = 1;
        count = 1;
      }
    } else {
      if (zero_mode == 0 && count < 0x7fff) {
        data_buf[count++] = input;
      } else {
        if (count > 0) {
          if (zero_mode == 1) {
            number_buf[0] = ((count >> 24) & 0x7f) | 0x80;
            number_buf[1] = (count >> 16) & 0xff;
            number_buf[2] = (count >> 8) & 0xff;
            number_buf[3] = count & 0xff;
            fwrite(number_buf, 4, 1, out);
          } else if (zero_mode == 0) {
            number_buf[0] = (count >> 8) & 0x7f;
            number_buf[1] = count & 0xff;
            fwrite(number_buf, 2, 1, out);
            fwrite(data_buf, count, 1, out);
          }
        }
        zero_mode = 0;
        data_buf[0] = input;
        count = 1;
      }
    }
  }
  if (count > 0) {
    if (zero_mode == 1) {
      number_buf[0] = ((count >> 24) & 0x7f) | 0x80;
      number_buf[1] = (count >> 16) & 0xff;
      number_buf[2] = (count >> 8) & 0xff;
      number_buf[3] = count & 0xff;
      fwrite(number_buf, 4, 1, out);
    } else if (zero_mode == 0) {
      number_buf[0] = (count >> 8) & 0x7f;
      number_buf[1] = count & 0xff;
      fwrite(number_buf, 2, 1, out);
      fwrite(data_buf, count, 1, out);
    }
  }
}


x86 assembly (clang, -O0):
<compress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0x20(%rbp)
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%eax
je     136c <compress+0x24c>
cmpl   $0x0,-0x20(%rbp)
jne    1250 <compress+0x130>
cmpl   $0x1,-0x1c(%rbp)
jne    117b <compress+0x5b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    124b <compress+0x12b>
cmpl   $0x0,-0x18(%rbp)
jle    123d <compress+0x11d>
cmpl   $0x1,-0x1c(%rbp)
jne    11e3 <compress+0xc3>
mov    -0x18(%rbp),%eax
sar    $0x18,%eax
and    $0x7f,%eax
or     $0x80,%eax
mov    %al,-0x14(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,-0x13(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x12(%rbp)
mov    -0x18(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x11(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
jmp    1238 <compress+0x118>
cmpl   $0x0,-0x1c(%rbp)
jne    1233 <compress+0x113>
mov    -0x18(%rbp),%eax
sar    $0x8,%eax
and    $0x7f,%eax
mov    %al,-0x14(%rbp)
mov    -0x18(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x13(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rcx
lea    0x2e17(%rip),%rdi
mov    $0x1,%edx
call   1030 <fwrite@plt>
jmp    1238 <compress+0x118>
jmp    123d <compress+0x11d>
movl   $0x1,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
jmp    1367 <compress+0x247>
cmpl   $0x0,-0x1c(%rbp)
jne    1289 <compress+0x169>
cmpl   $0x7fff,-0x18(%rbp)
jge    1289 <compress+0x169>
mov    -0x20(%rbp),%eax
mov    %al,%dl
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x18(%rbp)
movslq %eax,%rcx
lea    0x2dbf(%rip),%rax
mov    %dl,(%rax,%rcx,1)
jmp    1362 <compress+0x242>
cmpl   $0x0,-0x18(%rbp)
jle    134b <compress+0x22b>
cmpl   $0x1,-0x1c(%rbp)
jne    12f1 <compress+0x1d1>
mov    -0x18(%rbp),%eax
sar    $0x18,%eax
and    $0x7f,%eax
or     $0x80,%eax
mov    %al,-0x14(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,-0x13(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x12(%rbp)
mov    -0x18(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x11(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
jmp    1346 <compress+0x226>
cmpl   $0x0,-0x1c(%rbp)
jne    1341 <compress+0x221>
mov    -0x18(%rbp),%eax
sar    $0x8,%eax
and    $0x7f,%eax
mov    %al,-0x14(%rbp)
mov    -0x18(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x13(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rcx
lea    0x2d09(%rip),%rdi
mov    $0x1,%edx
call   1030 <fwrite@plt>
jmp    1346 <compress+0x226>
jmp    134b <compress+0x22b>
movl   $0x0,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
mov    %al,0x2ce5(%rip)
movl   $0x1,-0x18(%rbp)
jmp    1367 <compress+0x247>
jmp    113e <compress+0x1e>
cmpl   $0x0,-0x18(%rbp)
jle    142e <compress+0x30e>
cmpl   $0x1,-0x1c(%rbp)
jne    13d4 <compress+0x2b4>
mov    -0x18(%rbp),%eax
sar    $0x18,%eax
and    $0x7f,%eax
or     $0x80,%eax
mov    %al,-0x14(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,-0x13(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x12(%rbp)
mov    -0x18(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x11(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
jmp    1429 <compress+0x309>
cmpl   $0x0,-0x1c(%rbp)
jne    1424 <compress+0x304>
mov    -0x18(%rbp),%eax
sar    $0x8,%eax
and    $0x7f,%eax
mov    %al,-0x14(%rbp)
mov    -0x18(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x13(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rcx
lea    0x2c26(%rip),%rdi
mov    $0x1,%edx
call   1030 <fwrite@plt>
jmp    1429 <compress+0x309>
jmp    142e <compress+0x30e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compress>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,0x10(%rsp)
mov    %rdi,%r13
call   1040 <getc@plt>
mov    0x2ea6(%rip),%r15
cmp    (%r15),%eax
je     1311 <compress+0x1f1>
mov    %eax,%ebp
mov    $0xffffffff,%r12d
xor    %ebx,%ebx
jmp    118a <compress+0x6a>
nopw   0x0(%rax,%rax,1)
movslq %ebx,%rax
add    $0x1,%ebx
lea    0x2ed3(%rip),%rcx
mov    %bpl,(%rax,%rcx,1)
xor    %r14d,%r14d
xor    %r12d,%r12d
mov    %r13,%rdi
call   1040 <getc@plt>
mov    %eax,%ebp
cmp    (%r15),%eax
je     12d3 <compress+0x1b3>
test   %ebp,%ebp
je     11f0 <compress+0xd0>
test   %r12d,%r12d
jne    119b <compress+0x7b>
cmp    $0x7ffe,%ebx
jle    1160 <compress+0x40>
test   %ebx,%ebx
jle    12b8 <compress+0x198>
cmp    $0x1,%r12d
jne    1272 <compress+0x152>
mov    %ebx,%eax
shr    $0x18,%eax
or     $0x80,%al
mov    %al,0xc(%rsp)
mov    %ebx,%eax
shr    $0x10,%eax
mov    %al,0xd(%rsp)
mov    %bh,0xe(%rsp)
mov    %bl,0xf(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    0x10(%rsp),%rcx
jmp    12b3 <compress+0x193>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x1,%r12d
jne    1207 <compress+0xe7>
add    $0x1,%ebx
mov    $0x1,%r12d
mov    $0x1,%r14b
jmp    1177 <compress+0x57>
mov    $0x1,%r14b
test   %r12d,%r12d
mov    $0x1,%r12d
jne    12c9 <compress+0x1a9>
test   %ebx,%ebx
jle    12c9 <compress+0x1a9>
mov    %ebx,%eax
shr    $0x8,%eax
and    $0x7f,%al
mov    %al,0xc(%rsp)
mov    %bl,0xd(%rsp)
mov    $0x1,%r12d
lea    0xc(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    0x10(%rsp),%rbp
mov    %rbp,%rcx
call   1030 <fwrite@plt>
lea    0x2de7(%rip),%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1030 <fwrite@plt>
mov    $0x1,%ebx
jmp    1177 <compress+0x57>
test   %r12d,%r12d
jne    12b8 <compress+0x198>
mov    %ebx,%eax
shr    $0x8,%eax
and    $0x7f,%al
mov    %al,0xc(%rsp)
mov    %bl,0xd(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    0x10(%rsp),%r14
mov    %r14,%rcx
call   1030 <fwrite@plt>
lea    0x2d97(%rip),%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1030 <fwrite@plt>
mov    %bpl,0x2d81(%rip)
mov    $0x1,%ebx
jmp    1171 <compress+0x51>
mov    $0x1,%ebx
jmp    1177 <compress+0x57>
test   %ebx,%ebx
jle    1311 <compress+0x1f1>
mov    %ebx,%eax
test   %r14b,%r14b
je     1320 <compress+0x200>
shr    $0x18,%eax
or     $0x80,%al
mov    %al,0xc(%rsp)
mov    %ebx,%eax
shr    $0x10,%eax
mov    %al,0xd(%rsp)
mov    %bh,0xe(%rsp)
mov    %bl,0xf(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    0x10(%rsp),%rcx
call   1030 <fwrite@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
shr    $0x8,%eax
and    $0x7f,%al
mov    %al,0xc(%rsp)
mov    %bl,0xd(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    0x10(%rsp),%rbp
mov    %rbp,%rcx
call   1030 <fwrite@plt>
lea    0x2cf0(%rip),%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@compress.data_buf = internal global [65526 x i8] zeroinitializer
@EOF = global i32 0
define void @compress(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [4 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %6
store i32 -1, i32* %7
br label %9
9: ; preds = %144, %2
%10 = load i32*, i32** %3
%11 = call i32 @getc(i32* %10)
store i32 %11, i32* %8
%12 = load i32, i32* @EOF
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %145
14: ; preds = %9
%15 = load i32, i32* %8
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %76
17: ; preds = %14
%18 = load i32, i32* %7
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %75
23: ; preds = %17
%24 = load i32, i32* %6
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %74
26: ; preds = %23
%27 = load i32, i32* %7
%28 = icmp eq i32 %27, 1
br i1 %28, label %29, label %53
29: ; preds = %26
%30 = load i32, i32* %6
%31 = ashr i32 %30, 24
%32 = and i32 %31, 127
%33 = or i32 %32, 128
%34 = trunc i32 %33 to i8
%35 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
store i8 %34, i8* %35
%36 = load i32, i32* %6
%37 = ashr i32 %36, 16
%38 = and i32 %37, 255
%39 = trunc i32 %38 to i8
%40 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 1
store i8 %39, i8* %40
%41 = load i32, i32* %6
%42 = ashr i32 %41, 8
%43 = and i32 %42, 255
%44 = trunc i32 %43 to i8
%45 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 2
store i8 %44, i8* %45
%46 = load i32, i32* %6
%47 = and i32 %46, 255
%48 = trunc i32 %47 to i8
%49 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 3
store i8 %48, i8* %49
%50 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%51 = load i32*, i32** %4
%52 = call i32 @fwrite(i8* %50, i32 4, i32 1, i32* %51)
br label %73
53: ; preds = %26
%54 = load i32, i32* %7
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %72
56: ; preds = %53
%57 = load i32, i32* %6
%58 = ashr i32 %57, 8
%59 = and i32 %58, 127
%60 = trunc i32 %59 to i8
%61 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
store i8 %60, i8* %61
%62 = load i32, i32* %6
%63 = and i32 %62, 255
%64 = trunc i32 %63 to i8
%65 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 1
store i8 %64, i8* %65
%66 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%67 = load i32*, i32** %4
%68 = call i32 @fwrite(i8* %66, i32 2, i32 1, i32* %67)
%69 = load i32, i32* %6
%70 = load i32*, i32** %4
%71 = call i32 @fwrite(i8* getelementptr inbounds ([65526 x i8], [65526 x i8]* @compress.data_buf, i64 0, i64 0), i32 %69, i32 1, i32* %70)
br label %72
72: ; preds = %56, %53
br label %73
73: ; preds = %72, %29
br label %74
74: ; preds = %73, %23
store i32 1, i32* %7
store i32 1, i32* %6
br label %75
75: ; preds = %74, %20
br label %144
76: ; preds = %14
%77 = load i32, i32* %7
%78 = icmp eq i32 %77, 0
br i1 %78, label %79, label %89
79: ; preds = %76
%80 = load i32, i32* %6
%81 = icmp slt i32 %80, 32767
br i1 %81, label %82, label %89
82: ; preds = %79
%83 = load i32, i32* %8
%84 = trunc i32 %83 to i8
%85 = load i32, i32* %6
%86 = add nsw i32 %85, 1
store i32 %86, i32* %6
%87 = sext i32 %85 to i64
%88 = getelementptr inbounds [65526 x i8], [65526 x i8]* @compress.data_buf, i64 0, i64 %87
store i8 %84, i8* %88
br label %143
89: ; preds = %79, %76
%90 = load i32, i32* %6
%91 = icmp sgt i32 %90, 0
br i1 %91, label %92, label %140
92: ; preds = %89
%93 = load i32, i32* %7
%94 = icmp eq i32 %93, 1
br i1 %94, label %95, label %119
95: ; preds = %92
%96 = load i32, i32* %6
%97 = ashr i32 %96, 24
%98 = and i32 %97, 127
%99 = or i32 %98, 128
%100 = trunc i32 %99 to i8
%101 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
store i8 %100, i8* %101
%102 = load i32, i32* %6
%103 = ashr i32 %102, 16
%104 = and i32 %103, 255
%105 = trunc i32 %104 to i8
%106 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 1
store i8 %105, i8* %106
%107 = load i32, i32* %6
%108 = ashr i32 %107, 8
%109 = and i32 %108, 255
%110 = trunc i32 %109 to i8
%111 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 2
store i8 %110, i8* %111
%112 = load i32, i32* %6
%113 = and i32 %112, 255
%114 = trunc i32 %113 to i8
%115 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 3
store i8 %114, i8* %115
%116 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%117 = load i32*, i32** %4
%118 = call i32 @fwrite(i8* %116, i32 4, i32 1, i32* %117)
br label %139
119: ; preds = %92
%120 = load i32, i32* %7
%121 = icmp eq i32 %120, 0
br i1 %121, label %122, label %138
122: ; preds = %119
%123 = load i32, i32* %6
%124 = ashr i32 %123, 8
%125 = and i32 %124, 127
%126 = trunc i32 %125 to i8
%127 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
store i8 %126, i8* %127
%128 = load i32, i32* %6
%129 = and i32 %128, 255
%130 = trunc i32 %129 to i8
%131 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 1
store i8 %130, i8* %131
%132 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%133 = load i32*, i32** %4
%134 = call i32 @fwrite(i8* %132, i32 2, i32 1, i32* %133)
%135 = load i32, i32* %6
%136 = load i32*, i32** %4
%137 = call i32 @fwrite(i8* getelementptr inbounds ([65526 x i8], [65526 x i8]* @compress.data_buf, i64 0, i64 0), i32 %135, i32 1, i32* %136)
br label %138
138: ; preds = %122, %119
br label %139
139: ; preds = %138, %95
br label %140
140: ; preds = %139, %89
store i32 0, i32* %7
%141 = load i32, i32* %8
%142 = trunc i32 %141 to i8
store i8 %142, i8* getelementptr inbounds ([65526 x i8], [65526 x i8]* @compress.data_buf, i64 0, i64 0)
store i32 1, i32* %6
br label %143
143: ; preds = %140, %82
br label %144
144: ; preds = %143, %75
br label %9
145: ; preds = %9
%146 = load i32, i32* %6
%147 = icmp sgt i32 %146, 0
br i1 %147, label %148, label %196
148: ; preds = %145
%149 = load i32, i32* %7
%150 = icmp eq i32 %149, 1
br i1 %150, label %151, label %175
151: ; preds = %148
%152 = load i32, i32* %6
%153 = ashr i32 %152, 24
%154 = and i32 %153, 127
%155 = or i32 %154, 128
%156 = trunc i32 %155 to i8
%157 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
store i8 %156, i8* %157
%158 = load i32, i32* %6
%159 = ashr i32 %158, 16
%160 = and i32 %159, 255
%161 = trunc i32 %160 to i8
%162 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 1
store i8 %161, i8* %162
%163 = load i32, i32* %6
%164 = ashr i32 %163, 8
%165 = and i32 %164, 255
%166 = trunc i32 %165 to i8
%167 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 2
store i8 %166, i8* %167
%168 = load i32, i32* %6
%169 = and i32 %168, 255
%170 = trunc i32 %169 to i8
%171 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 3
store i8 %170, i8* %171
%172 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%173 = load i32*, i32** %4
%174 = call i32 @fwrite(i8* %172, i32 4, i32 1, i32* %173)
br label %195
175: ; preds = %148
%176 = load i32, i32* %7
%177 = icmp eq i32 %176, 0
br i1 %177, label %178, label %194
178: ; preds = %175
%179 = load i32, i32* %6
%180 = ashr i32 %179, 8
%181 = and i32 %180, 127
%182 = trunc i32 %181 to i8
%183 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
store i8 %182, i8* %183
%184 = load i32, i32* %6
%185 = and i32 %184, 255
%186 = trunc i32 %185 to i8
%187 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 1
store i8 %186, i8* %187
%188 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%189 = load i32*, i32** %4
%190 = call i32 @fwrite(i8* %188, i32 2, i32 1, i32* %189)
%191 = load i32, i32* %6
%192 = load i32*, i32** %4
%193 = call i32 @fwrite(i8* getelementptr inbounds ([65526 x i8], [65526 x i8]* @compress.data_buf, i64 0, i64 0), i32 %191, i32 1, i32* %192)
br label %194
194: ; preds = %178, %175
br label %195
195: ; preds = %194, %151
br label %196
196: ; preds = %195, %145
ret void
}

LLVM IR (-O2):
@compress.data_buf = internal global [65526 x i8] zeroinitializer
@EOF = global i32 0
define void @compress(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @getc(i32* %0)
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %96, label %8
8: ; preds = %2
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
br label %12
12: ; preds = %8, %65
%13 = phi i32 [ %5, %8 ], [ %69, %65 ]
%14 = phi i32 [ 0, %8 ], [ %68, %65 ]
%15 = phi i32 [ -1, %8 ], [ %67, %65 ]
%16 = icmp eq i32 %13, 0
br i1 %16, label %17, label %32
17: ; preds = %12
%18 = icmp eq i32 %15, 1
br i1 %18, label %19, label %21
19: ; preds = %17
%20 = add nsw i32 %14, 1
br label %65
21: ; preds = %17
%22 = icmp sgt i32 %14, 0
%23 = icmp eq i32 %15, 0
%24 = and i1 %23, %22
br i1 %24, label %25, label %65
25: ; preds = %21
%26 = lshr i32 %14, 8
%27 = trunc i32 %26 to i8
%28 = and i8 %27, 127
store i8 %28, i8* %4
%29 = trunc i32 %14 to i8
store i8 %29, i8* %9
%30 = call i32 @fwrite(i8* %4, i32 2, i32 1, i32* %1)
%31 = tail call i32 @fwrite(i8* getelementptr inbounds ([65526 x i8], [65526 x i8]* @compress.data_buf, i64 0, i64 0), i32 %14, i32 1, i32* %1)
br label %65
32: ; preds = %12
%33 = icmp eq i32 %15, 0
%34 = icmp slt i32 %14, 32767
%35 = select i1 %33, i1 %34, i1 false
br i1 %35, label %36, label %41
36: ; preds = %32
%37 = trunc i32 %13 to i8
%38 = add nsw i32 %14, 1
%39 = sext i32 %14 to i64
%40 = getelementptr inbounds [65526 x i8], [65526 x i8]* @compress.data_buf, i64 0, i64 %39
store i8 %37, i8* %40
br label %65
41: ; preds = %32
%42 = icmp sgt i32 %14, 0
br i1 %42, label %43, label %63
43: ; preds = %41
%44 = icmp eq i32 %15, 1
br i1 %44, label %45, label %55
45: ; preds = %43
%46 = lshr i32 %14, 24
%47 = trunc i32 %46 to i8
%48 = or i8 %47, -128
store i8 %48, i8* %4
%49 = lshr i32 %14, 16
%50 = trunc i32 %49 to i8
store i8 %50, i8* %9
%51 = lshr i32 %14, 8
%52 = trunc i32 %51 to i8
store i8 %52, i8* %10
%53 = trunc i32 %14 to i8
store i8 %53, i8* %11
%54 = call i32 @fwrite(i8* %4, i32 4, i32 1, i32* %1)
br label %63
55: ; preds = %43
br i1 %33, label %56, label %63
56: ; preds = %55
%57 = lshr i32 %14, 8
%58 = trunc i32 %57 to i8
%59 = and i8 %58, 127
store i8 %59, i8* %4
%60 = trunc i32 %14 to i8
store i8 %60, i8* %9
%61 = call i32 @fwrite(i8* %4, i32 2, i32 1, i32* %1)
%62 = tail call i32 @fwrite(i8* getelementptr inbounds ([65526 x i8], [65526 x i8]* @compress.data_buf, i64 0, i64 0), i32 %14, i32 1, i32* %1)
br label %63
63: ; preds = %45, %56, %55, %41
%64 = trunc i32 %13 to i8
store i8 %64, i8* getelementptr inbounds ([65526 x i8], [65526 x i8]* @compress.data_buf, i64 0, i64 0)
br label %65
65: ; preds = %21, %25, %36, %63, %19
%66 = phi i1 [ true, %21 ], [ true, %25 ], [ false, %36 ], [ false, %63 ], [ true, %19 ]
%67 = phi i32 [ 1, %21 ], [ 1, %25 ], [ 0, %36 ], [ 0, %63 ], [ 1, %19 ]
%68 = phi i32 [ 1, %21 ], [ 1, %25 ], [ %38, %36 ], [ 1, %63 ], [ %20, %19 ]
%69 = tail call i32 @getc(i32* %0)
%70 = load i32, i32* @EOF
%71 = icmp eq i32 %69, %70
br i1 %71, label %72, label %12
72: ; preds = %65
%73 = icmp sgt i32 %68, 0
br i1 %73, label %74, label %96
74: ; preds = %72
br i1 %66, label %75, label %88
75: ; preds = %74
%76 = lshr i32 %68, 24
%77 = trunc i32 %76 to i8
%78 = or i8 %77, -128
store i8 %78, i8* %4
%79 = lshr i32 %68, 16
%80 = trunc i32 %79 to i8
%81 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %80, i8* %81
%82 = lshr i32 %68, 8
%83 = trunc i32 %82 to i8
%84 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 %83, i8* %84
%85 = trunc i32 %68 to i8
%86 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 %85, i8* %86
%87 = call i32 @fwrite(i8* %4, i32 4, i32 1, i32* %1)
br label %96
88: ; preds = %74
%89 = lshr i32 %68, 8
%90 = trunc i32 %89 to i8
%91 = and i8 %90, 127
store i8 %91, i8* %4
%92 = trunc i32 %68 to i8
%93 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %92, i8* %93
%94 = call i32 @fwrite(i8* %4, i32 2, i32 1, i32* %1)
%95 = tail call i32 @fwrite(i8* getelementptr inbounds ([65526 x i8], [65526 x i8]* @compress.data_buf, i64 0, i64 0), i32 %68, i32 1, i32* %1)
br label %96
96: ; preds = %2, %75, %88, %72
ret void
}