#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*/ fprintf(int /*<<< orphan*/ *, char *, ...);
size_t fwrite(char *, int, size_t, int /*<<< orphan*/ *);
int getc(int /*<<< orphan*/ *);
scalar_t__ write_bits(int /*<<< orphan*/ *, char *, int *, char *);
int encode_file(char **table, int n, FILE *f, FILE *f2, unsigned short tw,
                char *key) {
  char bitbuf[65536];
  int i, bits = 0;
  unsigned char cl, ch;
  int cx[2];
  union {
    char c[2];
    unsigned short word;
  } u;
  char *enc = key;
  fprintf(f2, "%s", (key ? "hz1" : "hz0"));
  cl = (unsigned char)(n & 0x00ff);
  ch = (unsigned char)(n >> 8);
  if (key) {
    unsigned char cs;
    for (cs = 0; *enc; enc++)
      cs ^= *enc;
    fprintf(f2, "%c", cs);
    enc = key;
    ch ^= *enc;
    if ((*(++enc)) == '\0')
      enc = key;
    cl ^= *enc;
  }
  fprintf(f2, "%c%c", ch, cl);
  for (i = 0; i < 65536; i++)
    bitbuf[i] = '\0';
  for (i = 0; i < 65536 + 1; i++)
    if (table[i]) {
      size_t nmemb;
      u.word = (unsigned short)i;
      if (i == 65536)
        u.word = tw;
      if (key) {
        if (*(++enc) == '\0')
          enc = key;
        u.c[0] ^= *enc;
        if (*(++enc) == '\0')
          enc = key;
        u.c[1] ^= *enc;
      }
      fprintf(f2, "%c%c", u.c[0], u.c[1]);
      bits = 0;
      if (write_bits(f2, bitbuf, &bits, table[i]) != 0)
        return 1;
      if (key) {
        if (*(++enc) == '\0')
          enc = key;
        fprintf(f2, "%c", ((unsigned char)bits) ^ *enc);
        for (cl = 0; cl <= bits / 8; cl++) {
          if (*(++enc) == '\0')
            enc = key;
          bitbuf[cl] ^= *enc;
        }
      } else
        fprintf(f2, "%c", (unsigned char)bits);
      nmemb = bits / 8 + 1;
      if (fwrite(bitbuf, 1, bits / 8 + 1, f2) != nmemb)
        return 1;
    }
  bits = 0;
  while ((cx[0] = getc(f)) != -1 && (cx[1] = getc(f)) != -1) {
    u.c[0] = cx[0];
    u.c[1] = cx[1];
    if (write_bits(f2, bitbuf, &bits, table[u.word]) != 0)
      return 1;
  }
  if (write_bits(f2, bitbuf, &bits, table[65536]) != 0)
    return 1;
  if (bits > 0) {
    size_t nmemb = bits / 8 + 1;
    if (fwrite(bitbuf, 1, nmemb, f2) != nmemb)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<encode_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10080,%rsp
mov    %r8w,%ax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %ax,-0x2a(%rbp)
mov    %r9,-0x38(%rbp)
movl   $0x0,-0x10048(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x10060(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x38(%rbp),%rcx
lea    0xe7d(%rip),%rdx
lea    0xe72(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xe60(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x10049(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x1004a(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     1296 <encode_file+0x156>
movb   $0x0,-0x10061(%rbp)
mov    -0x10060(%rbp),%rax
cmpb   $0x0,(%rax)
je     1213 <encode_file+0xd3>
mov    -0x10060(%rbp),%rax
movsbl (%rax),%ecx
movzbl -0x10061(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x10061(%rbp)
mov    -0x10060(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10060(%rbp)
jmp    11d3 <encode_file+0x93>
mov    -0x28(%rbp),%rdi
movzbl -0x10061(%rbp),%edx
lea    0xde8(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,-0x10060(%rbp)
mov    -0x10060(%rbp),%rax
movsbl (%rax),%ecx
movzbl -0x1004a(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x1004a(%rbp)
mov    -0x10060(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10060(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    127d <encode_file+0x13d>
mov    -0x38(%rbp),%rax
mov    %rax,-0x10060(%rbp)
mov    -0x10060(%rbp),%rax
movsbl (%rax),%ecx
movzbl -0x10049(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x10049(%rbp)
mov    -0x28(%rbp),%rdi
movzbl -0x1004a(%rbp),%edx
movzbl -0x10049(%rbp),%ecx
lea    0xd5c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x10044(%rbp)
cmpl   $0x10000,-0x10044(%rbp)
jge    12f3 <encode_file+0x1b3>
movslq -0x10044(%rbp),%rax
movb   $0x0,-0x10040(%rbp,%rax,1)
mov    -0x10044(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10044(%rbp)
jmp    12c0 <encode_file+0x180>
movl   $0x0,-0x10044(%rbp)
cmpl   $0x10001,-0x10044(%rbp)
jge    15d5 <encode_file+0x495>
mov    -0x10(%rbp),%rax
movslq -0x10044(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     15bc <encode_file+0x47c>
mov    -0x10044(%rbp),%eax
mov    %ax,-0x10058(%rbp)
cmpl   $0x10000,-0x10044(%rbp)
jne    134b <encode_file+0x20b>
mov    -0x2a(%rbp),%ax
mov    %ax,-0x10058(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     13e2 <encode_file+0x2a2>
mov    -0x10060(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10060(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1383 <encode_file+0x243>
mov    -0x38(%rbp),%rax
mov    %rax,-0x10060(%rbp)
mov    -0x10060(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x10058(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x10058(%rbp)
mov    -0x10060(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10060(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    13c9 <encode_file+0x289>
mov    -0x38(%rbp),%rax
mov    %rax,-0x10060(%rbp)
mov    -0x10060(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x10057(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x10057(%rbp)
mov    -0x28(%rbp),%rdi
movsbl -0x10058(%rbp),%edx
movsbl -0x10057(%rbp),%ecx
lea    0xc10(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x10048(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x10040(%rbp),%rsi
mov    -0x10(%rbp),%rax
movslq -0x10044(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    -0x10048(%rbp),%rdx
call   1030 <write_bits@plt>
cmp    $0x0,%rax
je     1448 <encode_file+0x308>
movl   $0x1,-0x4(%rbp)
jmp    1728 <encode_file+0x5e8>
cmpq   $0x0,-0x38(%rbp)
je     1540 <encode_file+0x400>
mov    -0x10060(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10060(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1480 <encode_file+0x340>
mov    -0x38(%rbp),%rax
mov    %rax,-0x10060(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10048(%rbp),%eax
movzbl %al,%edx
mov    -0x10060(%rbp),%rax
movsbl (%rax),%eax
xor    %eax,%edx
lea    0xb6d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movb   $0x0,-0x10049(%rbp)
movzbl -0x10049(%rbp),%eax
mov    %eax,-0x1007c(%rbp)
mov    -0x10048(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1007c(%rbp),%eax
cmp    %ecx,%eax
jg     153b <encode_file+0x3fb>
mov    -0x10060(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10060(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1506 <encode_file+0x3c6>
mov    -0x38(%rbp),%rax
mov    %rax,-0x10060(%rbp)
mov    -0x10060(%rbp),%rax
movsbl (%rax),%edx
movzbl -0x10049(%rbp),%eax
movsbl -0x10040(%rbp,%rax,1),%ecx
ff
xor    %edx,%ecx
mov    %cl,-0x10040(%rbp,%rax,1)
mov    -0x10049(%rbp),%al
add    $0x1,%al
mov    %al,-0x10049(%rbp)
jmp    14ae <encode_file+0x36e>
jmp    155b <encode_file+0x41b>
mov    -0x28(%rbp),%rdi
mov    -0x10048(%rbp),%eax
movzbl %al,%edx
lea    0xab9(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10048(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
cltq
mov    %rax,-0x10070(%rbp)
lea    -0x10040(%rbp),%rdi
mov    -0x10048(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
movslq %eax,%rdx
mov    -0x28(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fwrite@plt>
cmp    -0x10070(%rbp),%rax
je     15b7 <encode_file+0x477>
movl   $0x1,-0x4(%rbp)
jmp    1728 <encode_file+0x5e8>
jmp    15bc <encode_file+0x47c>
jmp    15c1 <encode_file+0x481>
mov    -0x10044(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10044(%rbp)
jmp    12fd <encode_file+0x1bd>
movl   $0x0,-0x10048(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <getc@plt>
mov    %eax,%ecx
mov    %ecx,-0x10054(%rbp)
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x1007d(%rbp)
je     161c <encode_file+0x4dc>
mov    -0x20(%rbp),%rdi
call   1060 <getc@plt>
mov    %eax,-0x10050(%rbp)
cmp    $0xffffffff,%eax
setne  %al
mov    %al,-0x1007d(%rbp)
mov    -0x1007d(%rbp),%al
test   $0x1,%al
jne    162f <encode_file+0x4ef>
jmp    1688 <encode_file+0x548>
mov    -0x10054(%rbp),%eax
mov    %al,-0x10058(%rbp)
mov    -0x10050(%rbp),%eax
mov    %al,-0x10057(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x10040(%rbp),%rsi
mov    -0x10(%rbp),%rax
movzwl -0x10058(%rbp),%ecx
mov    (%rax,%rcx,8),%rcx
lea    -0x10048(%rbp),%rdx
call   1030 <write_bits@plt>
cmp    $0x0,%rax
je     1683 <encode_file+0x543>
movl   $0x1,-0x4(%rbp)
jmp    1728 <encode_file+0x5e8>
jmp    15df <encode_file+0x49f>
mov    -0x28(%rbp),%rdi
lea    -0x10040(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    0x80000(%rax),%rcx
lea    -0x10048(%rbp),%rdx
call   1030 <write_bits@plt>
cmp    $0x0,%rax
je     16c0 <encode_file+0x580>
movl   $0x1,-0x4(%rbp)
jmp    1728 <encode_file+0x5e8>
cmpl   $0x0,-0x10048(%rbp)
jle    1721 <encode_file+0x5e1>
mov    -0x10048(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
cltq
mov    %rax,-0x10078(%rbp)
lea    -0x10040(%rbp),%rdi
mov    -0x10078(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fwrite@plt>
cmp    -0x10078(%rbp),%rax
je     171c <encode_file+0x5dc>
movl   $0x1,-0x4(%rbp)
jmp    1728 <encode_file+0x5e8>
jmp    1721 <encode_file+0x5e1>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10080,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_file>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10028,%rsp
mov    %r9,%r13
mov    %r8d,0x4(%rsp)
mov    %rcx,%r12
mov    %rdx,%r15
mov    %esi,%r14d
mov    %rdi,0x8(%rsp)
movl   $0x0,(%rsp)
test   %r9,%r9
lea    0xe6c(%rip),%rax
lea    0xe61(%rip),%rdi
cmove  %rax,%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
mov    %r14d,%ebp
shr    $0x8,%ebp
xor    %ebx,%ebx
test   %r13,%r13
mov    %r15,0x18(%rsp)
je     1224 <encode_file+0xc4>
mov    0x0(%r13),%al
test   %al,%al
je     11f0 <encode_file+0x90>
lea    0x1(%r13),%rdx
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %al,%cl
movzbl (%rdx),%eax
add    $0x1,%rdx
test   %al,%al
jne    11e0 <encode_file+0x80>
movzbl %cl,%ebx
mov    %ebx,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
movzbl 0x0(%r13),%eax
movzbl %bpl,%ebp
xor    %eax,%ebp
lea    0x1(%r13),%rbx
xor    %eax,%eax
cmpb   $0x0,0x1(%r13)
cmove  %r13,%rbx
setne  %al
movzbl 0x0(%r13,%rax,1),%eax
movzbl %r14b,%r14d
xor    %eax,%r14d
movzbl %bpl,%edx
movzbl %r14b,%ecx
lea    0xdd5(%rip),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0x20(%rsp),%rdi
mov    $0x10000,%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,%eax
shr    $0x8,%eax
movzbl %al,%eax
mov    %eax,0x14(%rsp)
movzbl %cl,%eax
mov    %eax,0x4(%rsp)
xor    %r15d,%r15d
mov    0x8(%rsp),%rbp
mov    $0x1,%r14d
jmp    12d4 <encode_file+0x174>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsp),%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    (%rsp),%ecx
lea    0x7(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
add    $0x1,%eax
movslq %eax,%rbp
lea    0x20(%rsp),%rdi
mov    $0x1,%esi
mov    %rbp,%rdx
mov    %r12,%rcx
call   1070 <fwrite@plt>
cmp    %rbp,%rax
mov    0x8(%rsp),%rbp
jne    1495 <encode_file+0x335>
add    $0x1,%r15
cmp    $0x10001,%r15
je     13d1 <encode_file+0x271>
cmpq   $0x0,0x0(%rbp,%r15,8)
je     12c3 <encode_file+0x163>
mov    %r15,%rax
shr    $0x8,%rax
cmp    $0x10000,%r15
cmove  0x14(%rsp),%eax
mov    %r15d,%ecx
cmove  0x4(%rsp),%ecx
test   %r13,%r13
je     1318 <encode_file+0x1b8>
lea    0x1(%rbx),%rdx
cmpb   $0x0,0x1(%rbx)
cmove  %r13,%rdx
xor    (%rdx),%cl
lea    0x1(%rdx),%rbx
cmpb   $0x0,0x1(%rdx)
cmove  %r13,%rbx
xor    (%rbx),%al
movsbl %cl,%edx
movsbl %al,%ecx
mov    %r12,%rdi
lea    0xce0(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
movl   $0x0,(%rsp)
mov    0x0(%rbp,%r15,8),%rcx
mov    %r12,%rdi
lea    0x20(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <write_bits@plt>
test   %rax,%rax
jne    1434 <encode_file+0x2d4>
test   %r13,%r13
je     1280 <encode_file+0x120>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
cmove  %r13,%rbx
movzbl (%rsp),%eax
movsbl (%rbx),%edi
xor    %eax,%edi
mov    %r12,%rsi
call   1050 <fputc@plt>
mov    (%rsp),%ecx
lea    0x7(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
cmp    $0xfffffff9,%ecx
jl     129a <encode_file+0x13a>
xor    %ecx,%ecx
jmp    13b7 <encode_file+0x257>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdx),%ebx
movzbl %cl,%ecx
xor    %bl,0x20(%rsp,%rcx,1)
add    $0x1,%cl
movzbl %cl,%esi
mov    %rdx,%rbx
cmp    %esi,%eax
jl     13c9 <encode_file+0x269>
cmpb   $0x0,0x1(%rbx)
mov    %r13,%rdx
je     13a0 <encode_file+0x240>
add    $0x1,%rbx
mov    %rbx,%rdx
jmp    13a0 <encode_file+0x240>
mov    %rdx,%rbx
jmp    129a <encode_file+0x13a>
movl   $0x0,(%rsp)
lea    0x20(%rsp),%r14
mov    %rsp,%r15
mov    0x18(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbp,%rdi
call   1080 <getc@plt>
cmp    $0xffffffff,%eax
je     143c <encode_file+0x2dc>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1080 <getc@plt>
cmp    $0xffffffff,%eax
je     143c <encode_file+0x2dc>
shl    $0x8,%eax
movzbl %bl,%ecx
movzwl %ax,%eax
or     %rcx,%rax
mov    0x8(%rsp),%rcx
mov    (%rcx,%rax,8),%rcx
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <write_bits@plt>
test   %rax,%rax
je     13f0 <encode_file+0x290>
mov    $0x1,%r14d
jmp    1495 <encode_file+0x335>
mov    0x8(%rsp),%rax
mov    0x80000(%rax),%rcx
lea    0x20(%rsp),%rsi
mov    %rsp,%rdx
mov    %r12,%rdi
call   1030 <write_bits@plt>
mov    $0x1,%r14d
test   %rax,%rax
jne    1495 <encode_file+0x335>
mov    (%rsp),%ebx
test   %ebx,%ebx
jle    1492 <encode_file+0x332>
shr    $0x3,%rbx
add    $0x1,%rbx
lea    0x20(%rsp),%rdi
mov    $0x1,%r14d
mov    $0x1,%esi
mov    %rbx,%rdx
mov    %r12,%rcx
call   1070 <fwrite@plt>
cmp    %rbx,%rax
jne    1495 <encode_file+0x335>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x10028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%union.anon = type { i16 }
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"hz1\00"
@.str.2 = [4 x i8] c"hz0\00"
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [5 x i8] c"%c%c\00"
define i32 @encode_file(i8** %0, i32 %1, i32* %2, i32* %3, i16 zeroext %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i16
%13 = alloca i8*
%14 = alloca [65536 x i8]
%15 = alloca i32
%16 = alloca i32
%17 = alloca i8
%18 = alloca i8
%19 = alloca [2 x i32]
%20 = alloca %union.anon
%21 = alloca i8*
%22 = alloca i8
%23 = alloca i64
%24 = alloca i64
store i8** %0, i8*** %8
store i32 %1, i32* %9
store i32* %2, i32** %10
store i32* %3, i32** %11
store i16 %4, i16* %12
store i8* %5, i8** %13
store i32 0, i32* %16
%25 = load i8*, i8** %13
store i8* %25, i8** %21
%26 = load i32*, i32** %11
%27 = load i8*, i8** %13
%28 = icmp ne i8* %27, null
%29 = zext i1 %28 to i64
%30 = select i1 %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %30)
%32 = load i32, i32* %9
%33 = and i32 %32, 255
%34 = trunc i32 %33 to i8
store i8 %34, i8* %17
%35 = load i32, i32* %9
%36 = ashr i32 %35, 8
%37 = trunc i32 %36 to i8
store i8 %37, i8* %18
%38 = load i8*, i8** %13
%39 = icmp ne i8* %38, null
br i1 %39, label %40, label %84
40: ; preds = %6
store i8 0, i8* %22
br label %41
41: ; preds = %53, %40
%42 = load i8*, i8** %21
%43 = load i8, i8* %42
%44 = icmp ne i8 %43, 0
br i1 %44, label %45, label %56
45: ; preds = %41
%46 = load i8*, i8** %21
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = load i8, i8* %22
%50 = zext i8 %49 to i32
%51 = xor i32 %50, %48
%52 = trunc i32 %51 to i8
store i8 %52, i8* %22
br label %53
53: ; preds = %45
%54 = load i8*, i8** %21
%55 = getelementptr inbounds i8, i8* %54, i32 1
store i8* %55, i8** %21
br label %41
56: ; preds = %41
%57 = load i32*, i32** %11
%58 = load i8, i8* %22
%59 = zext i8 %58 to i32
%60 = call i32 (i32*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %59)
%61 = load i8*, i8** %13
store i8* %61, i8** %21
%62 = load i8*, i8** %21
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = load i8, i8* %18
%66 = zext i8 %65 to i32
%67 = xor i32 %66, %64
%68 = trunc i32 %67 to i8
store i8 %68, i8* %18
%69 = load i8*, i8** %21
%70 = getelementptr inbounds i8, i8* %69, i32 1
store i8* %70, i8** %21
%71 = load i8, i8* %70
%72 = sext i8 %71 to i32
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %76
74: ; preds = %56
%75 = load i8*, i8** %13
store i8* %75, i8** %21
br label %76
76: ; preds = %74, %56
%77 = load i8*, i8** %21
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = load i8, i8* %17
%81 = zext i8 %80 to i32
%82 = xor i32 %81, %79
%83 = trunc i32 %82 to i8
store i8 %83, i8* %17
br label %84
84: ; preds = %76, %6
%85 = load i32*, i32** %11
%86 = load i8, i8* %18
%87 = zext i8 %86 to i32
%88 = load i8, i8* %17
%89 = zext i8 %88 to i32
%90 = call i32 (i32*, i8*, ...) @fprintf(i32* %85, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %87, i32 %89)
store i32 0, i32* %15
br label %91
91: ; preds = %98, %84
%92 = load i32, i32* %15
%93 = icmp slt i32 %92, 65536
br i1 %93, label %94, label %101
94: ; preds = %91
%95 = load i32, i32* %15
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [65536 x i8], [65536 x i8]* %14, i64 0, i64 %96
store i8 0, i8* %97
br label %98
98: ; preds = %94
%99 = load i32, i32* %15
%100 = add nsw i32 %99, 1
store i32 %100, i32* %15
br label %91
101: ; preds = %91
store i32 0, i32* %15
br label %102
102: ; preds = %253, %101
%103 = load i32, i32* %15
%104 = icmp slt i32 %103, 65537
br i1 %104, label %105, label %256
105: ; preds = %102
%106 = load i8**, i8*** %8
%107 = load i32, i32* %15
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i8*, i8** %106, i64 %108
%110 = load i8*, i8** %109
%111 = icmp ne i8* %110, null
br i1 %111, label %112, label %252
112: ; preds = %105
%113 = load i32, i32* %15
%114 = trunc i32 %113 to i16
%115 = bitcast %union.anon* %20 to i16*
store i16 %114, i16* %115
%116 = load i32, i32* %15
%117 = icmp eq i32 %116, 65536
br i1 %117, label %118, label %121
118: ; preds = %112
%119 = load i16, i16* %12
%120 = bitcast %union.anon* %20 to i16*
store i16 %119, i16* %120
br label %121
121: ; preds = %118, %112
%122 = load i8*, i8** %13
%123 = icmp ne i8* %122, null
br i1 %123, label %124, label %159
124: ; preds = %121
%125 = load i8*, i8** %21
%126 = getelementptr inbounds i8, i8* %125, i32 1
store i8* %126, i8** %21
%127 = load i8, i8* %126
%128 = sext i8 %127 to i32
%129 = icmp eq i32 %128, 0
br i1 %129, label %130, label %132
130: ; preds = %124
%131 = load i8*, i8** %13
store i8* %131, i8** %21
br label %132
132: ; preds = %130, %124
%133 = load i8*, i8** %21
%134 = load i8, i8* %133
%135 = sext i8 %134 to i32
%136 = bitcast %union.anon* %20 to [2 x i8]*
%137 = getelementptr inbounds [2 x i8], [2 x i8]* %136, i64 0, i64 0
%138 = load i8, i8* %137
%139 = sext i8 %138 to i32
%140 = xor i32 %139, %135
%141 = trunc i32 %140 to i8
store i8 %141, i8* %137
%142 = load i8*, i8** %21
%143 = getelementptr inbounds i8, i8* %142, i32 1
store i8* %143, i8** %21
%144 = load i8, i8* %143
%145 = sext i8 %144 to i32
%146 = icmp eq i32 %145, 0
br i1 %146, label %147, label %149
147: ; preds = %132
%148 = load i8*, i8** %13
store i8* %148, i8** %21
br label %149
149: ; preds = %147, %132
%150 = load i8*, i8** %21
%151 = load i8, i8* %150
%152 = sext i8 %151 to i32
%153 = bitcast %union.anon* %20 to [2 x i8]*
%154 = getelementptr inbounds [2 x i8], [2 x i8]* %153, i64 0, i64 1
%155 = load i8, i8* %154
%156 = sext i8 %155 to i32
%157 = xor i32 %156, %152
%158 = trunc i32 %157 to i8
store i8 %158, i8* %154
br label %159
159: ; preds = %149, %121
%160 = load i32*, i32** %11
%161 = bitcast %union.anon* %20 to [2 x i8]*
%162 = getelementptr inbounds [2 x i8], [2 x i8]* %161, i64 0, i64 0
%163 = load i8, i8* %162
%164 = sext i8 %163 to i32
%165 = bitcast %union.anon* %20 to [2 x i8]*
%166 = getelementptr inbounds [2 x i8], [2 x i8]* %165, i64 0, i64 1
%167 = load i8, i8* %166
%168 = sext i8 %167 to i32
%169 = call i32 (i32*, i8*, ...) @fprintf(i32* %160, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %164, i32 %168)
store i32 0, i32* %16
%170 = load i32*, i32** %11
%171 = getelementptr inbounds [65536 x i8], [65536 x i8]* %14, i64 0, i64 0
%172 = load i8**, i8*** %8
%173 = load i32, i32* %15
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds i8*, i8** %172, i64 %174
%176 = load i8*, i8** %175
%177 = call i64 @write_bits(i32* %170, i8* %171, i32* %16, i8* %176)
%178 = icmp ne i64 %177, 0
br i1 %178, label %179, label %180
179: ; preds = %159
store i32 1, i32* %7
br label %318
180: ; preds = %159
%181 = load i8*, i8** %13
%182 = icmp ne i8* %181, null
br i1 %182, label %183, label %230
183: ; preds = %180
%184 = load i8*, i8** %21
%185 = getelementptr inbounds i8, i8* %184, i32 1
store i8* %185, i8** %21
%186 = load i8, i8* %185
%187 = sext i8 %186 to i32
%188 = icmp eq i32 %187, 0
br i1 %188, label %189, label %191
189: ; preds = %183
%190 = load i8*, i8** %13
store i8* %190, i8** %21
br label %191
191: ; preds = %189, %183
%192 = load i32*, i32** %11
%193 = load i32, i32* %16
%194 = trunc i32 %193 to i8
%195 = zext i8 %194 to i32
%196 = load i8*, i8** %21
%197 = load i8, i8* %196
%198 = sext i8 %197 to i32
%199 = xor i32 %195, %198
%200 = call i32 (i32*, i8*, ...) @fprintf(i32* %192, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %199)
store i8 0, i8* %17
br label %201
201: ; preds = %226, %191
%202 = load i8, i8* %17
%203 = zext i8 %202 to i32
%204 = load i32, i32* %16
%205 = sdiv i32 %204, 8
%206 = icmp sle i32 %203, %205
br i1 %206, label %207, label %229
207: ; preds = %201
%208 = load i8*, i8** %21
%209 = getelementptr inbounds i8, i8* %208, i32 1
store i8* %209, i8** %21
%210 = load i8, i8* %209
%211 = sext i8 %210 to i32
%212 = icmp eq i32 %211, 0
br i1 %212, label %213, label %215
213: ; preds = %207
%214 = load i8*, i8** %13
store i8* %214, i8** %21
br label %215
215: ; preds = %213, %207
%216 = load i8*, i8** %21
%217 = load i8, i8* %216
%218 = sext i8 %217 to i32
%219 = load i8, i8* %17
%220 = zext i8 %219 to i64
%221 = getelementptr inbounds [65536 x i8], [65536 x i8]* %14, i64 0, i64 %220
%222 = load i8, i8* %221
%223 = sext i8 %222 to i32
%224 = xor i32 %223, %218
%225 = trunc i32 %224 to i8
store i8 %225, i8* %221
br label %226
226: ; preds = %215
%227 = load i8, i8* %17
%228 = add i8 %227, 1
store i8 %228, i8* %17
br label %201
229: ; preds = %201
br label %236
230: ; preds = %180
%231 = load i32*, i32** %11
%232 = load i32, i32* %16
%233 = trunc i32 %232 to i8
%234 = zext i8 %233 to i32
%235 = call i32 (i32*, i8*, ...) @fprintf(i32* %231, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %234)
br label %236
236: ; preds = %230, %229
%237 = load i32, i32* %16
%238 = sdiv i32 %237, 8
%239 = add nsw i32 %238, 1
%240 = sext i32 %239 to i64
store i64 %240, i64* %23
%241 = getelementptr inbounds [65536 x i8], [65536 x i8]* %14, i64 0, i64 0
%242 = load i32, i32* %16
%243 = sdiv i32 %242, 8
%244 = add nsw i32 %243, 1
%245 = sext i32 %244 to i64
%246 = load i32*, i32** %11
%247 = call i64 @fwrite(i8* %241, i32 1, i64 %245, i32* %246)
%248 = load i64, i64* %23
%249 = icmp ne i64 %247, %248
br i1 %249, label %250, label %251
250: ; preds = %236
store i32 1, i32* %7
br label %318
251: ; preds = %236
br label %252
252: ; preds = %251, %105
br label %253
253: ; preds = %252
%254 = load i32, i32* %15
%255 = add nsw i32 %254, 1
store i32 %255, i32* %15
br label %102
256: ; preds = %102
store i32 0, i32* %16
br label %257
257: ; preds = %291, %256
%258 = load i32*, i32** %10
%259 = call i32 @getc(i32* %258)
%260 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0, i64 0
store i32 %259, i32* %260
%261 = icmp ne i32 %259, -1
br i1 %261, label %262, label %267
262: ; preds = %257
%263 = load i32*, i32** %10
%264 = call i32 @getc(i32* %263)
%265 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0, i64 1
store i32 %264, i32* %265
%266 = icmp ne i32 %264, -1
br label %267
267: ; preds = %262, %257
%268 = phi i1 [ false, %257 ], [ %266, %262 ]
br i1 %268, label %269, label %292
269: ; preds = %267
%270 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0, i64 0
%271 = load i32, i32* %270
%272 = trunc i32 %271 to i8
%273 = bitcast %union.anon* %20 to [2 x i8]*
%274 = getelementptr inbounds [2 x i8], [2 x i8]* %273, i64 0, i64 0
store i8 %272, i8* %274
%275 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0, i64 1
%276 = load i32, i32* %275
%277 = trunc i32 %276 to i8
%278 = bitcast %union.anon* %20 to [2 x i8]*
%279 = getelementptr inbounds [2 x i8], [2 x i8]* %278, i64 0, i64 1
store i8 %277, i8* %279
%280 = load i32*, i32** %11
%281 = getelementptr inbounds [65536 x i8], [65536 x i8]* %14, i64 0, i64 0
%282 = load i8**, i8*** %8
%283 = bitcast %union.anon* %20 to i16*
%284 = load i16, i16* %283
%285 = zext i16 %284 to i64
%286 = getelementptr inbounds i8*, i8** %282, i64 %285
%287 = load i8*, i8** %286
%288 = call i64 @write_bits(i32* %280, i8* %281, i32* %16, i8* %287)
%289 = icmp ne i64 %288, 0
br i1 %289, label %290, label %291
290: ; preds = %269
store i32 1, i32* %7
br label %318
291: ; preds = %269
br label %257
292: ; preds = %267
%293 = load i32*, i32** %11
%294 = getelementptr inbounds [65536 x i8], [65536 x i8]* %14, i64 0, i64 0
%295 = load i8**, i8*** %8
%296 = getelementptr inbounds i8*, i8** %295, i64 65536
%297 = load i8*, i8** %296
%298 = call i64 @write_bits(i32* %293, i8* %294, i32* %16, i8* %297)
%299 = icmp ne i64 %298, 0
br i1 %299, label %300, label %301
300: ; preds = %292
store i32 1, i32* %7
br label %318
301: ; preds = %292
%302 = load i32, i32* %16
%303 = icmp sgt i32 %302, 0
br i1 %303, label %304, label %317
304: ; preds = %301
%305 = load i32, i32* %16
%306 = sdiv i32 %305, 8
%307 = add nsw i32 %306, 1
%308 = sext i32 %307 to i64
store i64 %308, i64* %24
%309 = getelementptr inbounds [65536 x i8], [65536 x i8]* %14, i64 0, i64 0
%310 = load i64, i64* %24
%311 = load i32*, i32** %11
%312 = call i64 @fwrite(i8* %309, i32 1, i64 %310, i32* %311)
%313 = load i64, i64* %24
%314 = icmp ne i64 %312, %313
br i1 %314, label %315, label %316
315: ; preds = %304
store i32 1, i32* %7
br label %318
316: ; preds = %304
br label %317
317: ; preds = %316, %301
store i32 0, i32* %7
br label %318
318: ; preds = %317, %315, %300, %290, %250, %179
%319 = load i32, i32* %7
ret i32 %319
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"hz1\00"
@.str.2 = [4 x i8] c"hz0\00"
@.str.4 = [5 x i8] c"%c%c\00"
define i32 @encode_file(i8** nocapture %0, i32 %1, i32* nocapture %2, i32* %3, i16 zeroext %4, i8* %5) {
%7 = alloca [65536 x i8]
%8 = getelementptr inbounds [65536 x i8], [65536 x i8]* %7, i64 0, i64 0
%9 = alloca i32
%10 = getelementptr inbounds [65536 x i8], [65536 x i8]* %7, i64 0, i64 0
%11 = bitcast i32* %9 to i8*
store i32 0, i32* %9
%12 = icmp eq i8* %5, null
%13 = select i1 %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%14 = tail call i64 bitcast (i64 (i8*, i32, i64, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* %13, i64 3, i64 1, i32* %3)
%15 = lshr i32 %1, 8
br i1 %12, label %44, label %16
16: ; preds = %6
%17 = load i8, i8* %5
%18 = icmp eq i8 %17, 0
br i1 %18, label %29, label %19
19: ; preds = %16, %19
%20 = phi i8 [ %25, %19 ], [ %17, %16 ]
%21 = phi i8 [ %23, %19 ], [ 0, %16 ]
%22 = phi i8* [ %24, %19 ], [ %5, %16 ]
%23 = xor i8 %20, %21
%24 = getelementptr inbounds i8, i8* %22, i64 1
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 0
br i1 %26, label %27, label %19
27: ; preds = %19
%28 = zext i8 %23 to i32
br label %29
29: ; preds = %27, %16
%30 = phi i32 [ 0, %16 ], [ %28, %27 ]
%31 = tail call i32 @fputc(i32 %30, i32* %3)
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = and i32 %15, 255
%35 = xor i32 %34, %33
%36 = getelementptr inbounds i8, i8* %5, i64 1
%37 = load i8, i8* %36
%38 = icmp eq i8 %37, 0
%39 = select i1 %38, i8* %5, i8* %36
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = and i32 %1, 255
%43 = xor i32 %42, %41
br label %44
44: ; preds = %29, %6
%45 = phi i32 [ %35, %29 ], [ %15, %6 ]
%46 = phi i32 [ %43, %29 ], [ %1, %6 ]
%47 = phi i8* [ %39, %29 ], [ null, %6 ]
%48 = and i32 %45, 255
%49 = and i32 %46, 255
%50 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %48, i32 %49)
%51 = trunc i16 %4 to i8
%52 = lshr i16 %4, 8
%53 = trunc i16 %52 to i8
br label %54
54: ; preds = %44, %133
%55 = phi i64 [ 0, %44 ], [ %135, %133 ]
%56 = phi i8* [ %47, %44 ], [ %134, %133 ]
%57 = getelementptr inbounds i8*, i8** %0, i64 %55
%58 = load i8*, i8** %57
%59 = icmp eq i8* %58, null
br i1 %59, label %133, label %60
60: ; preds = %54
%61 = trunc i64 %55 to i8
%62 = lshr i64 %55, 8
%63 = trunc i64 %62 to i8
%64 = icmp eq i64 %55, 65536
%65 = select i1 %64, i8 %53, i8 %63
%66 = select i1 %64, i8 %51, i8 %61
br i1 %12, label %80, label %67
67: ; preds = %60
%68 = getelementptr inbounds i8, i8* %56, i64 1
%69 = load i8, i8* %68
%70 = icmp eq i8 %69, 0
%71 = select i1 %70, i8* %5, i8* %68
%72 = load i8, i8* %71
%73 = xor i8 %72, %66
%74 = getelementptr inbounds i8, i8* %71, i64 1
%75 = load i8, i8* %74
%76 = icmp eq i8 %75, 0
%77 = select i1 %76, i8* %5, i8* %74
%78 = load i8, i8* %77
%79 = xor i8 %78, %65
br label %80
80: ; preds = %67, %60
%81 = phi i8 [ %79, %67 ], [ %65, %60 ]
%82 = phi i8 [ %73, %67 ], [ %66, %60 ]
%83 = phi i8* [ %77, %67 ], [ %56, %60 ]
%84 = sext i8 %82 to i32
%85 = sext i8 %81 to i32
%86 = call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %84, i32 %85)
store i32 0, i32* %9
%87 = load i8*, i8** %57
%88 = call i64 @write_bits(i32* %3, i8* %10, i32* %9, i8* %87)
%89 = icmp eq i64 %88, 0
br i1 %89, label %90, label %170
90: ; preds = %80
br i1 %12, label %120, label %91
91: ; preds = %90
%92 = getelementptr inbounds i8, i8* %83, i64 1
%93 = load i8, i8* %92
%94 = icmp eq i8 %93, 0
%95 = select i1 %94, i8* %5, i8* %92
%96 = load i32, i32* %9
%97 = and i32 %96, 255
%98 = load i8, i8* %95
%99 = sext i8 %98 to i32
%100 = xor i32 %97, %99
%101 = call i32 @fputc(i32 %100, i32* %3)
%102 = load i32, i32* %9
%103 = sdiv i32 %102, 8
%104 = icmp slt i32 %102, -7
br i1 %104, label %126, label %105
105: ; preds = %91, %105
%106 = phi i8* [ %111, %105 ], [ %95, %91 ]
%107 = phi i8 [ %117, %105 ], [ 0, %91 ]
%108 = getelementptr inbounds i8, i8* %106, i64 1
%109 = load i8, i8* %108
%110 = icmp eq i8 %109, 0
%111 = select i1 %110, i8* %5, i8* %108
%112 = load i8, i8* %111
%113 = zext i8 %107 to i64
%114 = getelementptr inbounds [65536 x i8], [65536 x i8]* %7, i64 0, i64 %113
%115 = load i8, i8* %114
%116 = xor i8 %115, %112
store i8 %116, i8* %114
%117 = add i8 %107, 1
%118 = zext i8 %117 to i32
%119 = icmp slt i32 %103, %118
br i1 %119, label %126, label %105
120: ; preds = %90
%121 = load i32, i32* %9
%122 = and i32 %121, 255
%123 = call i32 @fputc(i32 %122, i32* %3)
%124 = load i32, i32* %9
%125 = sdiv i32 %124, 8
br label %126
126: ; preds = %105, %91, %120
%127 = phi i32 [ %103, %91 ], [ %125, %120 ], [ %103, %105 ]
%128 = phi i8* [ %95, %91 ], [ %83, %120 ], [ %111, %105 ]
%129 = add nsw i32 %127, 1
%130 = sext i32 %129 to i64
%131 = call i64 @fwrite(i8* %10, i32 1, i64 %130, i32* %3)
%132 = icmp eq i64 %131, %130
br i1 %132, label %133, label %170
133: ; preds = %54, %126
%134 = phi i8* [ %128, %126 ], [ %56, %54 ]
%135 = add nuw nsw i64 %55, 1
%136 = icmp eq i64 %135, 65537
br i1 %136, label %137, label %54
137: ; preds = %133
store i32 0, i32* %9
br label %138
138: ; preds = %144, %137
%139 = call i32 @getc(i32* %2)
%140 = icmp eq i32 %139, -1
br i1 %140, label %155, label %141
141: ; preds = %138
%142 = call i32 @getc(i32* %2)
%143 = icmp eq i32 %142, -1
br i1 %143, label %155, label %144
144: ; preds = %141
%145 = zext i32 %142 to i64
%146 = shl nuw nsw i64 %145, 8
%147 = and i32 %139, 255
%148 = zext i32 %147 to i64
%149 = and i64 %146, 65280
%150 = or i64 %149, %148
%151 = getelementptr inbounds i8*, i8** %0, i64 %150
%152 = load i8*, i8** %151
%153 = call i64 @write_bits(i32* %3, i8* %10, i32* %9, i8* %152)
%154 = icmp eq i64 %153, 0
br i1 %154, label %138, label %170
155: ; preds = %138, %141
%156 = getelementptr inbounds i8*, i8** %0, i64 65536
%157 = load i8*, i8** %156
%158 = call i64 @write_bits(i32* %3, i8* %10, i32* %9, i8* %157)
%159 = icmp eq i64 %158, 0
br i1 %159, label %160, label %170
160: ; preds = %155
%161 = load i32, i32* %9
%162 = icmp sgt i32 %161, 0
br i1 %162, label %163, label %169
163: ; preds = %160
%164 = lshr i32 %161, 3
%165 = add nuw nsw i32 %164, 1
%166 = zext i32 %165 to i64
%167 = call i64 @fwrite(i8* %10, i32 1, i64 %166, i32* %3)
%168 = icmp eq i64 %167, %166
br i1 %168, label %169, label %170
169: ; preds = %163, %160
br label %170
170: ; preds = %80, %126, %144, %155, %163, %169
%171 = phi i32 [ 0, %169 ], [ 1, %163 ], [ 1, %155 ], [ 1, %144 ], [ 1, %126 ], [ 1, %80 ]
ret i32 %171
}