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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  int i;
  {
    FILE *tga = fopen("dat/piresy.tga", "rb");
    FILE *dat = fopen("dat/piresy.bin", "wb");
    for (i = 0; i < 18; i++)
      fgetc(tga);
    for (i = 0; i < 320 * 240; i++) {
      int b = (int)(uint8_t)fgetc(tga);
      int g = (int)(uint8_t)fgetc(tga);
      int r = (int)(uint8_t)fgetc(tga);
      int a = (int)(uint8_t)fgetc(tga);
      b >>= 3;
      g >>= 3;
      r >>= 3;
      int c = (b << 10) | (g << 5) | r;
      fputc((c & 255), dat);
      fputc((c >> 8), dat);
    }
    fclose(dat);
    fclose(tga);
  }
  {
    FILE *tga = fopen("dat/skydome.tga", "rb");
    FILE *dat = fopen("dat/skydome.bin", "wb");
    for (i = 0; i < 18; i++)
      fgetc(tga);
    for (i = 0; i < 16; i++) {
      int b = (int)(uint8_t)fgetc(tga);
      int g = (int)(uint8_t)fgetc(tga);
      int r = (int)(uint8_t)fgetc(tga);
      b >>= 3;
      g >>= 3;
      r >>= 3;
      int c = (b << 10) | (g << 5) | r;
      fputc((c & 255), dat);
      fputc((c >> 8), dat);
    }
    for (i = 0; i < 64 * 32; i++) {
      int c0 = (int)(uint8_t)fgetc(tga);
      int c1 = (int)(uint8_t)fgetc(tga);
      c0 &= 0xF;
      c1 &= 0xF;
      fputc((c0 | (c1 << 4)), dat);
    }
    fclose(dat);
    fclose(tga);
  }
  return 0;
}


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)
lea    0xea3(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x20(%rbp)
lea    0xe9e(%rip),%rdi
lea    0xea6(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x12,-0x14(%rbp)
jge    11ac <main+0x6c>
mov    -0x20(%rbp),%rdi
call   1040 <fgetc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118b <main+0x4b>
movl   $0x0,-0x14(%rbp)
cmpl   $0x12c00,-0x14(%rbp)
jge    124e <main+0x10e>
mov    -0x20(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x34(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x30(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x30(%rbp)
mov    -0x34(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x34(%rbp)
mov    -0x2c(%rbp),%eax
shl    $0xa,%eax
mov    -0x30(%rbp),%ecx
shl    $0x5,%ecx
or     %ecx,%eax
or     -0x34(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%edi
and    $0xff,%edi
mov    -0x28(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x3c(%rbp),%edi
sar    $0x8,%edi
mov    -0x28(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b3 <main+0x73>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xdbd(%rip),%rdi
lea    0xda1(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x48(%rbp)
lea    0xdb6(%rip),%rdi
lea    0xd9c(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x12,-0x14(%rbp)
jge    12b6 <main+0x176>
mov    -0x48(%rbp),%rdi
call   1040 <fgetc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1295 <main+0x155>
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    1349 <main+0x209>
mov    -0x48(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x54(%rbp)
mov    -0x48(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x58(%rbp)
mov    -0x48(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x54(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x54(%rbp)
mov    -0x58(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x58(%rbp)
mov    -0x5c(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x54(%rbp),%eax
shl    $0xa,%eax
mov    -0x58(%rbp),%ecx
shl    $0x5,%ecx
or     %ecx,%eax
or     -0x5c(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%edi
and    $0xff,%edi
mov    -0x50(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x60(%rbp),%edi
sar    $0x8,%edi
mov    -0x50(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12bd <main+0x17d>
movl   $0x0,-0x14(%rbp)
cmpl   $0x800,-0x14(%rbp)
jge    13a9 <main+0x269>
mov    -0x48(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x64(%rbp)
mov    -0x48(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x68(%rbp)
mov    -0x64(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x64(%rbp)
mov    -0x68(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x68(%rbp)
mov    -0x64(%rbp),%edi
mov    -0x68(%rbp),%eax
shl    $0x4,%eax
or     %eax,%edi
mov    -0x50(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1350 <main+0x210>
mov    -0x50(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x48(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xeae(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r15
lea    0xeaa(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    $0x12c00,%ebp
nopl   0x0(%rax)
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %rax,%r12
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %rax,%r13
mov    %r15,%rdi
call   1040 <fgetc@plt>
sar    $0x3,%r13d
and    $0xfffffff8,%r12d
shl    $0x7,%r12d
shl    $0x2,%ebx
and    $0xffffffe0,%ebx
or     %r12d,%ebx
or     %r13d,%ebx
movzbl %bl,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
sar    $0x8,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
add    $0xffffffff,%ebp
jne    1210 <main+0xd0>
mov    %r14,%rdi
call   1030 <fclose@plt>
mov    %r15,%rdi
call   1030 <fclose@plt>
lea    0xd9f(%rip),%rdi
lea    0xd83(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r15
lea    0xd99(%rip),%rdi
lea    0xd7f(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    $0x10,%ebp
nop
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %rax,%r12
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1040 <fgetc@plt>
sar    $0x3,%eax
and    $0xfffffff8,%r12d
shl    $0x7,%r12d
shl    $0x2,%ebx
and    $0xffffffe0,%ebx
or     %r12d,%ebx
or     %eax,%ebx
movzbl %bl,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
sar    $0x8,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
add    $0xffffffff,%ebp
jne    1340 <main+0x200>
mov    $0x800,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1040 <fgetc@plt>
and    $0xf,%ebx
shl    $0x4,%eax
movzbl %al,%edi
or     %ebx,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
add    $0xffffffff,%ebp
jne    13a0 <main+0x260>
mov    %r14,%rdi
call   1030 <fclose@plt>
mov    %r15,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"dat/piresy.tga\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [15 x i8] c"dat/piresy.bin\00"
@.str.3 = [3 x i8] c"wb\00"
@.str.4 = [16 x i8] c"dat/skydome.tga\00"
@.str.5 = [16 x i8] c"dat/skydome.bin\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 i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%22 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %22, i32** %7
%23 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %23, i32** %8
store i32 0, i32* %6
br label %24
24: ; preds = %30, %2
%25 = load i32, i32* %6
%26 = icmp slt i32 %25, 18
br i1 %26, label %27, label %33
27: ; preds = %24
%28 = load i32*, i32** %7
%29 = call i64 @fgetc(i32* %28)
br label %30
30: ; preds = %27
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %24
33: ; preds = %24
store i32 0, i32* %6
br label %34
34: ; preds = %71, %33
%35 = load i32, i32* %6
%36 = icmp slt i32 %35, 76800
br i1 %36, label %37, label %74
37: ; preds = %34
%38 = load i32*, i32** %7
%39 = call i64 @fgetc(i32* %38)
%40 = trunc i64 %39 to i32
store i32 %40, i32* %9
%41 = load i32*, i32** %7
%42 = call i64 @fgetc(i32* %41)
%43 = trunc i64 %42 to i32
store i32 %43, i32* %10
%44 = load i32*, i32** %7
%45 = call i64 @fgetc(i32* %44)
%46 = trunc i64 %45 to i32
store i32 %46, i32* %11
%47 = load i32*, i32** %7
%48 = call i64 @fgetc(i32* %47)
%49 = trunc i64 %48 to i32
store i32 %49, i32* %12
%50 = load i32, i32* %9
%51 = ashr i32 %50, 3
store i32 %51, i32* %9
%52 = load i32, i32* %10
%53 = ashr i32 %52, 3
store i32 %53, i32* %10
%54 = load i32, i32* %11
%55 = ashr i32 %54, 3
store i32 %55, i32* %11
%56 = load i32, i32* %9
%57 = shl i32 %56, 10
%58 = load i32, i32* %10
%59 = shl i32 %58, 5
%60 = or i32 %57, %59
%61 = load i32, i32* %11
%62 = or i32 %60, %61
store i32 %62, i32* %13
%63 = load i32, i32* %13
%64 = and i32 %63, 255
%65 = load i32*, i32** %8
%66 = call i32 @fputc(i32 %64, i32* %65)
%67 = load i32, i32* %13
%68 = ashr i32 %67, 8
%69 = load i32*, i32** %8
%70 = call i32 @fputc(i32 %68, i32* %69)
br label %71
71: ; preds = %37
%72 = load i32, i32* %6
%73 = add nsw i32 %72, 1
store i32 %73, i32* %6
br label %34
74: ; preds = %34
%75 = load i32*, i32** %8
%76 = call i32 @fclose(i32* %75)
%77 = load i32*, i32** %7
%78 = call i32 @fclose(i32* %77)
%79 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %79, i32** %14
%80 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %80, i32** %15
store i32 0, i32* %6
br label %81
81: ; preds = %87, %74
%82 = load i32, i32* %6
%83 = icmp slt i32 %82, 18
br i1 %83, label %84, label %90
84: ; preds = %81
%85 = load i32*, i32** %14
%86 = call i64 @fgetc(i32* %85)
br label %87
87: ; preds = %84
%88 = load i32, i32* %6
%89 = add nsw i32 %88, 1
store i32 %89, i32* %6
br label %81
90: ; preds = %81
store i32 0, i32* %6
br label %91
91: ; preds = %125, %90
%92 = load i32, i32* %6
%93 = icmp slt i32 %92, 16
br i1 %93, label %94, label %128
94: ; preds = %91
%95 = load i32*, i32** %14
%96 = call i64 @fgetc(i32* %95)
%97 = trunc i64 %96 to i32
store i32 %97, i32* %16
%98 = load i32*, i32** %14
%99 = call i64 @fgetc(i32* %98)
%100 = trunc i64 %99 to i32
store i32 %100, i32* %17
%101 = load i32*, i32** %14
%102 = call i64 @fgetc(i32* %101)
%103 = trunc i64 %102 to i32
store i32 %103, i32* %18
%104 = load i32, i32* %16
%105 = ashr i32 %104, 3
store i32 %105, i32* %16
%106 = load i32, i32* %17
%107 = ashr i32 %106, 3
store i32 %107, i32* %17
%108 = load i32, i32* %18
%109 = ashr i32 %108, 3
store i32 %109, i32* %18
%110 = load i32, i32* %16
%111 = shl i32 %110, 10
%112 = load i32, i32* %17
%113 = shl i32 %112, 5
%114 = or i32 %111, %113
%115 = load i32, i32* %18
%116 = or i32 %114, %115
store i32 %116, i32* %19
%117 = load i32, i32* %19
%118 = and i32 %117, 255
%119 = load i32*, i32** %15
%120 = call i32 @fputc(i32 %118, i32* %119)
%121 = load i32, i32* %19
%122 = ashr i32 %121, 8
%123 = load i32*, i32** %15
%124 = call i32 @fputc(i32 %122, i32* %123)
br label %125
125: ; preds = %94
%126 = load i32, i32* %6
%127 = add nsw i32 %126, 1
store i32 %127, i32* %6
br label %91
128: ; preds = %91
store i32 0, i32* %6
br label %129
129: ; preds = %149, %128
%130 = load i32, i32* %6
%131 = icmp slt i32 %130, 2048
br i1 %131, label %132, label %152
132: ; preds = %129
%133 = load i32*, i32** %14
%134 = call i64 @fgetc(i32* %133)
%135 = trunc i64 %134 to i32
store i32 %135, i32* %20
%136 = load i32*, i32** %14
%137 = call i64 @fgetc(i32* %136)
%138 = trunc i64 %137 to i32
store i32 %138, i32* %21
%139 = load i32, i32* %20
%140 = and i32 %139, 15
store i32 %140, i32* %20
%141 = load i32, i32* %21
%142 = and i32 %141, 15
store i32 %142, i32* %21
%143 = load i32, i32* %20
%144 = load i32, i32* %21
%145 = shl i32 %144, 4
%146 = or i32 %143, %145
%147 = load i32*, i32** %15
%148 = call i32 @fputc(i32 %146, i32* %147)
br label %149
149: ; preds = %132
%150 = load i32, i32* %6
%151 = add nsw i32 %150, 1
store i32 %151, i32* %6
br label %129
152: ; preds = %129
%153 = load i32*, i32** %15
%154 = call i32 @fclose(i32* %153)
%155 = load i32*, i32** %14
%156 = call i32 @fclose(i32* %155)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"dat/piresy.tga\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [15 x i8] c"dat/piresy.bin\00"
@.str.3 = [3 x i8] c"wb\00"
@.str.4 = [16 x i8] c"dat/skydome.tga\00"
@.str.5 = [16 x i8] c"dat/skydome.bin\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i64 @fgetc(i32* %3)
%6 = tail call i64 @fgetc(i32* %3)
%7 = tail call i64 @fgetc(i32* %3)
%8 = tail call i64 @fgetc(i32* %3)
%9 = tail call i64 @fgetc(i32* %3)
%10 = tail call i64 @fgetc(i32* %3)
%11 = tail call i64 @fgetc(i32* %3)
%12 = tail call i64 @fgetc(i32* %3)
%13 = tail call i64 @fgetc(i32* %3)
%14 = tail call i64 @fgetc(i32* %3)
%15 = tail call i64 @fgetc(i32* %3)
%16 = tail call i64 @fgetc(i32* %3)
%17 = tail call i64 @fgetc(i32* %3)
%18 = tail call i64 @fgetc(i32* %3)
%19 = tail call i64 @fgetc(i32* %3)
%20 = tail call i64 @fgetc(i32* %3)
%21 = tail call i64 @fgetc(i32* %3)
%22 = tail call i64 @fgetc(i32* %3)
br label %23
23: ; preds = %2, %23
%24 = phi i32 [ %43, %23 ], [ 0, %2 ]
%25 = tail call i64 @fgetc(i32* %3)
%26 = trunc i64 %25 to i32
%27 = tail call i64 @fgetc(i32* %3)
%28 = trunc i64 %27 to i32
%29 = tail call i64 @fgetc(i32* %3)
%30 = trunc i64 %29 to i32
%31 = tail call i64 @fgetc(i32* %3)
%32 = ashr i32 %30, 3
%33 = shl i32 %26, 7
%34 = and i32 %33, -1024
%35 = shl i32 %28, 2
%36 = and i32 %35, -32
%37 = or i32 %36, %34
%38 = or i32 %37, %32
%39 = and i32 %38, 255
%40 = tail call i32 @fputc(i32 %39, i32* %4)
%41 = ashr i32 %38, 8
%42 = tail call i32 @fputc(i32 %41, i32* %4)
%43 = add nuw nsw i32 %24, 1
%44 = icmp eq i32 %43, 76800
br i1 %44, label %45, label %23
45: ; preds = %23
%46 = tail call i32 @fclose(i32* %4)
%47 = tail call i32 @fclose(i32* %3)
%48 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%49 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%50 = tail call i64 @fgetc(i32* %48)
%51 = tail call i64 @fgetc(i32* %48)
%52 = tail call i64 @fgetc(i32* %48)
%53 = tail call i64 @fgetc(i32* %48)
%54 = tail call i64 @fgetc(i32* %48)
%55 = tail call i64 @fgetc(i32* %48)
%56 = tail call i64 @fgetc(i32* %48)
%57 = tail call i64 @fgetc(i32* %48)
%58 = tail call i64 @fgetc(i32* %48)
%59 = tail call i64 @fgetc(i32* %48)
%60 = tail call i64 @fgetc(i32* %48)
%61 = tail call i64 @fgetc(i32* %48)
%62 = tail call i64 @fgetc(i32* %48)
%63 = tail call i64 @fgetc(i32* %48)
%64 = tail call i64 @fgetc(i32* %48)
%65 = tail call i64 @fgetc(i32* %48)
%66 = tail call i64 @fgetc(i32* %48)
%67 = tail call i64 @fgetc(i32* %48)
br label %68
68: ; preds = %45, %68
%69 = phi i32 [ %87, %68 ], [ 0, %45 ]
%70 = tail call i64 @fgetc(i32* %48)
%71 = trunc i64 %70 to i32
%72 = tail call i64 @fgetc(i32* %48)
%73 = trunc i64 %72 to i32
%74 = tail call i64 @fgetc(i32* %48)
%75 = trunc i64 %74 to i32
%76 = ashr i32 %75, 3
%77 = shl i32 %71, 7
%78 = and i32 %77, -1024
%79 = shl i32 %73, 2
%80 = and i32 %79, -32
%81 = or i32 %80, %78
%82 = or i32 %81, %76
%83 = and i32 %82, 255
%84 = tail call i32 @fputc(i32 %83, i32* %49)
%85 = ashr i32 %82, 8
%86 = tail call i32 @fputc(i32 %85, i32* %49)
%87 = add nuw nsw i32 %69, 1
%88 = icmp eq i32 %87, 16
br i1 %88, label %89, label %68
89: ; preds = %68, %89
%90 = phi i32 [ %100, %89 ], [ 0, %68 ]
%91 = tail call i64 @fgetc(i32* %48)
%92 = trunc i64 %91 to i32
%93 = tail call i64 @fgetc(i32* %48)
%94 = trunc i64 %93 to i32
%95 = and i32 %92, 15
%96 = shl i32 %94, 4
%97 = and i32 %96, 240
%98 = or i32 %97, %95
%99 = tail call i32 @fputc(i32 %98, i32* %49)
%100 = add nuw nsw i32 %90, 1
%101 = icmp eq i32 %100, 2048
br i1 %101, label %102, label %89
102: ; preds = %89
%103 = tail call i32 @fclose(i32* %49)
%104 = tail call i32 @fclose(i32* %48)
ret i32 0
}