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

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ lz68k_pack(char *, int, int /*<<< orphan*/ *);
int lz68k_unpack(char *, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc < 3) {
    fprintf(stderr, "Usage: %s input output\n", argv[0]);
    return 1;
  }
  FILE *infile = fopen(argv[1], "rb");
  fseek(infile, 0, SEEK_END);
  uint32_t insize = ftell(infile);
  fseek(infile, 0, SEEK_SET);
  char *indata = (char *)malloc(insize);
  fread(indata, 1, insize, infile);
  fclose(infile);
  FILE *outfile = fopen(argv[2], "wb");
  lz68k_pack(indata, insize, outfile);
  printf("Packed data :\n  insize = %u\n outsize = %u\n factor = %f\n",
         (unsigned int)insize, (unsigned int)ftell(outfile),
         (float)ftell(outfile) / (float)insize);
  fclose(outfile);
  if (argc >= 4) {
    uint32_t verifsize = insize;
    char *outdata = (char *)malloc(verifsize * 10);
    infile = fopen(argv[2], "rb");
    fseek(infile, 0, SEEK_END);
    insize = ftell(infile);
    char *data = (char *)malloc(insize);
    fseek(infile, 0, SEEK_SET);
    fread(data, 1, insize, infile);
    fclose(infile);
    uint32_t outsize = lz68k_unpack(data, outdata);
    if (outsize != verifsize) {
      uint32_t i;
      for (i = 0; i < (outsize > verifsize ? verifsize : outsize); ++i) {
        if (indata[i] != outdata[i]) {
          printf("First error at %X\n", i);
          break;
        }
      }
      printf("Error : Output %X bytes instead of %X\n", outsize, verifsize);
    }
    outfile = fopen(argv[3], "wb");
    fwrite(outdata, 1, outsize, outfile);
    fclose(outfile);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11f8 <main+0x48>
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe19(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1460 <main+0x2b0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe11(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2dcd(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   1080 <ftell@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d95(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x1c(%rbp),%edi
call   10a0 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd9e(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x30(%rbp),%rdx
call   1090 <lz68k_pack@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x30(%rbp),%rdi
call   1080 <ftell@plt>
mov    %eax,-0x54(%rbp)
mov    -0x30(%rbp),%rdi
call   1080 <ftell@plt>
mov    -0x58(%rbp),%esi
mov    -0x54(%rbp),%edx
cvtsi2ss %eax,%xmm0
cvtsi2ssl -0x1c(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd4f(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1040 <fclose@plt>
cmpl   $0x4,-0x8(%rbp)
jl     1459 <main+0x2a9>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
imul   $0xa,-0x34(%rbp),%edi
call   10a0 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd0d(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2cc9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   1080 <ftell@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   10a0 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2c85(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x48(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1060 <lz68k_unpack@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x34(%rbp),%eax
je     1423 <main+0x273>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jle    13b2 <main+0x202>
mov    -0x34(%rbp),%eax
mov    %eax,-0x60(%rbp)
jmp    13b8 <main+0x208>
mov    -0x4c(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x5c(%rbp),%eax
mov    -0x60(%rbp),%ecx
cmp    %ecx,%eax
jge    140f <main+0x25f>
mov    -0x28(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x40(%rbp),%rcx
movslq -0x50(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     13fc <main+0x24c>
mov    -0x50(%rbp),%esi
lea    0xc66(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    140f <main+0x25f>
jmp    1401 <main+0x251>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1395 <main+0x1e5>
mov    -0x4c(%rbp),%esi
mov    -0x34(%rbp),%edx
lea    0xc4d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xbe9(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x4c(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    $0x1,%esi
call   10d0 <fwrite@plt>
mov    -0x30(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
cmp    $0x2,%edi
jg     11e5 <main+0x35>
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xe2a(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%eax
jmp    13cb <main+0x21b>
mov    %edi,%r12d
mov    0x8(%r15),%rdi
lea    0xe25(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%rbp
mov    0x2de6(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    %rbp,%rdi
call   1080 <ftell@plt>
mov    %eax,%r14d
mov    0x2db0(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    %r14d,%edi
call   10a0 <malloc@plt>
mov    %rax,%r13
mov    %rax,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
mov    %rbp,%rcx
call   1030 <fread@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
mov    0x10(%r15),%rdi
lea    0xdbe(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%rbp
mov    %r13,%rdi
mov    %r14d,%esi
mov    %rax,%rdx
call   1090 <lz68k_pack@plt>
mov    %rbp,%rdi
call   1080 <ftell@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1080 <ftell@plt>
cvtsi2ss %eax,%xmm0
cvtsi2ss %r14d,%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd81(%rip),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
cmp    $0x3,%r12d
je     13cb <main+0x21b>
lea    (%r14,%r14,1),%eax
lea    (%rax,%rax,4),%edi
call   10a0 <malloc@plt>
mov    %rax,%r12
mov    %r15,(%rsp)
mov    0x10(%r15),%rdi
lea    0xd3d(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%rbx
mov    0x2cfe(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    %rbx,%rdi
call   1080 <ftell@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,%r15
mov    0x2cbf(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <lz68k_unpack@plt>
mov    %eax,%ebx
cmp    %r14d,%eax
je     1398 <main+0x1e8>
mov    %ebx,%eax
cmovg  %r14d,%eax
test   %eax,%eax
jle    1385 <main+0x1d5>
mov    %eax,%eax
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
movzbl 0x0(%r13,%rsi,1),%ecx
cmp    (%r12,%rsi,1),%cl
jne    1377 <main+0x1c7>
add    $0x1,%rsi
cmp    %rsi,%rax
jne    1360 <main+0x1b0>
jmp    1385 <main+0x1d5>
lea    0xcd8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xcdd(%rip),%rdi
mov    %ebx,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%rax
mov    0x18(%rax),%rdi
lea    0xc74(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%rbp
mov    %r12,%rdi
mov    $0x1,%esi
mov    %ebx,%edx
mov    %rax,%rcx
call   10d0 <fwrite@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: %s input output\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [56 x i8] c"Packed data :\0A insize = %u\0A outsize = %u\0A factor = %f\0A\00"
@.str.4 = [19 x i8] c"First error at %X\0A\00"
@.str.5 = [39 x i8] c"Error : Output %X bytes instead of %X\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 3
br i1 %16, label %17, label %23
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %21)
store i32 1, i32* %3
br label %151
23: ; preds = %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32* @fopen(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %27, i32** %6
%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 i32 @ftell(i32* %31)
store i32 %32, i32* %7
%33 = load i32*, i32** %6
%34 = load i32, i32* @SEEK_SET
%35 = call i32 @fseek(i32* %33, i32 0, i32 %34)
%36 = load i32, i32* %7
%37 = call i64 @malloc(i32 %36)
%38 = inttoptr i64 %37 to i8*
store i8* %38, i8** %8
%39 = load i8*, i8** %8
%40 = load i32, i32* %7
%41 = load i32*, i32** %6
%42 = call i32 @fread(i8* %39, i32 1, i32 %40, i32* %41)
%43 = load i32*, i32** %6
%44 = call i32 @fclose(i32* %43)
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 2
%47 = load i8*, i8** %46
%48 = call i32* @fopen(i8* %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %48, i32** %9
%49 = load i8*, i8** %8
%50 = load i32, i32* %7
%51 = load i32*, i32** %9
%52 = call i32 @lz68k_pack(i8* %49, i32 %50, i32* %51)
%53 = load i32, i32* %7
%54 = load i32*, i32** %9
%55 = call i32 @ftell(i32* %54)
%56 = load i32*, i32** %9
%57 = call i32 @ftell(i32* %56)
%58 = sitofp i32 %57 to float
%59 = load i32, i32* %7
%60 = sitofp i32 %59 to float
%61 = fdiv float %58, %60
%62 = fpext float %61 to double
%63 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0), i32 %53, i32 %55, double %62)
%64 = load i32*, i32** %9
%65 = call i32 @fclose(i32* %64)
%66 = load i32, i32* %4
%67 = icmp sge i32 %66, 4
br i1 %67, label %68, label %150
68: ; preds = %23
%69 = load i32, i32* %7
store i32 %69, i32* %10
%70 = load i32, i32* %10
%71 = mul nsw i32 %70, 10
%72 = call i64 @malloc(i32 %71)
%73 = inttoptr i64 %72 to i8*
store i8* %73, i8** %11
%74 = load i8**, i8*** %5
%75 = getelementptr inbounds i8*, i8** %74, i64 2
%76 = load i8*, i8** %75
%77 = call i32* @fopen(i8* %76, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %77, i32** %6
%78 = load i32*, i32** %6
%79 = load i32, i32* @SEEK_END
%80 = call i32 @fseek(i32* %78, i32 0, i32 %79)
%81 = load i32*, i32** %6
%82 = call i32 @ftell(i32* %81)
store i32 %82, i32* %7
%83 = load i32, i32* %7
%84 = call i64 @malloc(i32 %83)
%85 = inttoptr i64 %84 to i8*
store i8* %85, i8** %12
%86 = load i32*, i32** %6
%87 = load i32, i32* @SEEK_SET
%88 = call i32 @fseek(i32* %86, i32 0, i32 %87)
%89 = load i8*, i8** %12
%90 = load i32, i32* %7
%91 = load i32*, i32** %6
%92 = call i32 @fread(i8* %89, i32 1, i32 %90, i32* %91)
%93 = load i32*, i32** %6
%94 = call i32 @fclose(i32* %93)
%95 = load i8*, i8** %12
%96 = load i8*, i8** %11
%97 = call i32 @lz68k_unpack(i8* %95, i8* %96)
store i32 %97, i32* %13
%98 = load i32, i32* %13
%99 = load i32, i32* %10
%100 = icmp ne i32 %98, %99
br i1 %100, label %101, label %139
101: ; preds = %68
store i32 0, i32* %14
br label %102
102: ; preds = %132, %101
%103 = load i32, i32* %14
%104 = load i32, i32* %13
%105 = load i32, i32* %10
%106 = icmp sgt i32 %104, %105
br i1 %106, label %107, label %109
107: ; preds = %102
%108 = load i32, i32* %10
br label %111
109: ; preds = %102
%110 = load i32, i32* %13
br label %111
111: ; preds = %109, %107
%112 = phi i32 [ %108, %107 ], [ %110, %109 ]
%113 = icmp slt i32 %103, %112
br i1 %113, label %114, label %135
114: ; preds = %111
%115 = load i8*, i8** %8
%116 = load i32, i32* %14
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds i8, i8* %115, i64 %117
%119 = load i8, i8* %118
%120 = sext i8 %119 to i32
%121 = load i8*, i8** %11
%122 = load i32, i32* %14
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i8, i8* %121, i64 %123
%125 = load i8, i8* %124
%126 = sext i8 %125 to i32
%127 = icmp ne i32 %120, %126
br i1 %127, label %128, label %131
128: ; preds = %114
%129 = load i32, i32* %14
%130 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %129)
br label %135
131: ; preds = %114
br label %132
132: ; preds = %131
%133 = load i32, i32* %14
%134 = add nsw i32 %133, 1
store i32 %134, i32* %14
br label %102
135: ; preds = %128, %111
%136 = load i32, i32* %13
%137 = load i32, i32* %10
%138 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i32 %136, i32 %137)
br label %139
139: ; preds = %135, %68
%140 = load i8**, i8*** %5
%141 = getelementptr inbounds i8*, i8** %140, i64 3
%142 = load i8*, i8** %141
%143 = call i32* @fopen(i8* %142, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %143, i32** %9
%144 = load i8*, i8** %11
%145 = load i32, i32* %13
%146 = load i32*, i32** %9
%147 = call i32 @fwrite(i8* %144, i32 1, i32 %145, i32* %146)
%148 = load i32*, i32** %9
%149 = call i32 @fclose(i32* %148)
br label %150
150: ; preds = %139, %23
store i32 0, i32* %3
br label %151
151: ; preds = %150, %17
%152 = load i32, i32* %3
ret i32 %152
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: %s input output\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [56 x i8] c"Packed data :\0A insize = %u\0A outsize = %u\0A factor = %f\0A\00"
@.str.4 = [19 x i8] c"First error at %X\0A\00"
@.str.5 = [39 x i8] c"Error : Output %X bytes instead of %X\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %78
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 = load i32, i32* @SEEK_END
%13 = tail call i32 @fseek(i32* %11, i32 0, i32 %12)
%14 = tail call i32 @ftell(i32* %11)
%15 = load i32, i32* @SEEK_SET
%16 = tail call i32 @fseek(i32* %11, i32 0, i32 %15)
%17 = tail call i64 @malloc(i32 %14)
%18 = inttoptr i64 %17 to i8*
%19 = tail call i32 @fread(i8* %18, i32 1, i32 %14, i32* %11)
%20 = tail call i32 @fclose(i32* %11)
%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.2, i64 0, i64 0))
%24 = tail call i32 @lz68k_pack(i8* %18, i32 %14, i32* %23)
%25 = tail call i32 @ftell(i32* %23)
%26 = tail call i32 @ftell(i32* %23)
%27 = sitofp i32 %26 to float
%28 = sitofp i32 %14 to float
%29 = fdiv float %27, %28
%30 = fpext float %29 to double
%31 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0), i32 %14, i32 %25, double %30)
%32 = tail call i32 @fclose(i32* %23)
%33 = icmp eq i32 %0, 3
br i1 %33, label %78, label %34
34: ; preds = %8
%35 = mul nsw i32 %14, 10
%36 = tail call i64 @malloc(i32 %35)
%37 = inttoptr i64 %36 to i8*
%38 = load i8*, i8** %21
%39 = tail call i32* @fopen(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%40 = load i32, i32* @SEEK_END
%41 = tail call i32 @fseek(i32* %39, i32 0, i32 %40)
%42 = tail call i32 @ftell(i32* %39)
%43 = tail call i64 @malloc(i32 %42)
%44 = inttoptr i64 %43 to i8*
%45 = load i32, i32* @SEEK_SET
%46 = tail call i32 @fseek(i32* %39, i32 0, i32 %45)
%47 = tail call i32 @fread(i8* %44, i32 1, i32 %42, i32* %39)
%48 = tail call i32 @fclose(i32* %39)
%49 = tail call i32 @lz68k_unpack(i8* %44, i8* %37)
%50 = icmp eq i32 %49, %14
br i1 %50, label %72, label %51
51: ; preds = %34
%52 = icmp sgt i32 %49, %14
%53 = select i1 %52, i32 %14, i32 %49
%54 = icmp sgt i32 %53, 0
br i1 %54, label %55, label %70
55: ; preds = %51
%56 = zext i32 %53 to i64
br label %57
57: ; preds = %55, %67
%58 = phi i64 [ 0, %55 ], [ %68, %67 ]
%59 = getelementptr inbounds i8, i8* %18, i64 %58
%60 = load i8, i8* %59
%61 = getelementptr inbounds i8, i8* %37, i64 %58
%62 = load i8, i8* %61
%63 = icmp eq i8 %60, %62
br i1 %63, label %67, label %64
64: ; preds = %57
%65 = trunc i64 %58 to i32
%66 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %65)
br label %70
67: ; preds = %57
%68 = add nuw nsw i64 %58, 1
%69 = icmp eq i64 %68, %56
br i1 %69, label %70, label %57
70: ; preds = %67, %51, %64
%71 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i32 %49, i32 %14)
br label %72
72: ; preds = %70, %34
%73 = getelementptr inbounds i8*, i8** %1, i64 3
%74 = load i8*, i8** %73
%75 = tail call i32* @fopen(i8* %74, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%76 = tail call i32 @fwrite(i8* %37, i32 1, i32 %49, i32* %75)
%77 = tail call i32 @fclose(i32* %75)
br label %78
78: ; preds = %8, %72, %4
%79 = phi i32 [ 1, %4 ], [ 0, %72 ], [ 0, %8 ]
ret i32 %79
}