#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*/ ulong;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int atoi(char *);
double compareFiles(char *, char *, int);
int createFileDouble(char *, int, int);
int /*<<< orphan*/ getFileSize(char *);
float lzCompressFile(char *, char *, int, int, int);
float lzUncompressFile(char *, char *, int);
int /*<<< orphan*/ printResults(char *, int, int /*<<< orphan*/,
                                int /*<<< orphan*/, float, float, double);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int main(int argc, char *argv[]) {
  int i, res, level = 9, size = 1024, prec = sizeof(double);
  char pSrcFn[64], pCmzFn[64], pUmzFn[64], pClzFn[64], pUlzFn[64];
  float cmpTime, dcpTime;
  double error;
  ulong inSize, outSize;
  if (argc == 2) {
    sprintf(pSrcFn, "doubleDataset");
    prec = atoi(argv[1]);
    if ((prec != 32) && (prec != 64)) {
      printf("Precision needs to be equal to 32 or 64\n");
      return EXIT_FAILURE;
    }
    prec = prec / 8;
    res = createFileDouble(pSrcFn, size, prec);
    if (res == EXIT_FAILURE) {
      printf("Error creating floating point data file\n");
      return EXIT_FAILURE;
    }
  } else {
    if (argc == 3) {
      sprintf(pSrcFn, "%s", argv[1]);
      prec = atoi(argv[2]);
      if ((prec != 32) && (prec != 64)) {
        printf("Precision needs to be equal to 32 or 64\n");
        return EXIT_FAILURE;
      }
      prec = prec / 8;
    } else {
      printf("Usage: \n");
      printf("   ./example precision(32 or 64)\n");
      printf("   ./example filename precision(32 or 64)\n");
      return EXIT_FAILURE;
    }
  }
  double bound = 0.000001;
  inSize = getFileSize(pSrcFn);
  sprintf(pCmzFn, "%s.cmz", pSrcFn);
  sprintf(pUmzFn, "%s.umz", pSrcFn);
  printf("====================================================================="
         "===================\n");
  printf("| Bits | In (MB) | Out (MB) | CR (%%) | (X:1)  | Compress | Decomp | "
         "Error Bound | File \n");
  printf("====================================================================="
         "===================\n");
  for (i = 1; i <= (prec * 8); i++) {
    sprintf(pClzFn, "%s.clz%i", pSrcFn, i);
    sprintf(pUlzFn, "%s.ulz%i", pSrcFn, i);
    cmpTime = lzCompressFile(pSrcFn, pClzFn, prec, level, i);
    if (res == EXIT_FAILURE)
      return EXIT_FAILURE;
    dcpTime = lzUncompressFile(pClzFn, pUlzFn, prec);
    if (res == EXIT_FAILURE)
      return EXIT_FAILURE;
    error = compareFiles(pSrcFn, pUlzFn, prec);
    outSize = getFileSize(pClzFn);
    if (error <= bound) {
      printResults(pSrcFn, i, inSize, outSize, cmpTime, dcpTime, error);
      break;
    } else {
      remove(pClzFn);
      remove(pUlzFn);
    }
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x9,-0x1c(%rbp)
movl   $0x400,-0x20(%rbp)
movl   $0x8,-0x24(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    127f <main+0xdf>
lea    -0x70(%rbp),%rdi
lea    0xe25(%rip),%rsi
mov    $0x0,%al
call   10b0 <sprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x20,-0x24(%rbp)
je     122b <main+0x8b>
cmpl   $0x40,-0x24(%rbp)
je     122b <main+0x8b>
lea    0xe01(%rip),%rdi
call   1040 <printf@plt>
mov    0x2dbf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    152f <main+0x38f>
mov    -0x24(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x24(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
call   1070 <createFileDouble@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    0x2d8b(%rip),%rcx
cmp    (%rcx),%eax
jne    127a <main+0xda>
lea    0xddb(%rip),%rdi
call   1040 <printf@plt>
mov    0x2d70(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    152f <main+0x38f>
jmp    1331 <main+0x191>
cmpl   $0x3,-0x8(%rbp)
jne    12f7 <main+0x157>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xdcc(%rip),%rsi
mov    $0x0,%al
call   10b0 <sprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x20,-0x24(%rbp)
je     12e4 <main+0x144>
cmpl   $0x40,-0x24(%rbp)
je     12e4 <main+0x144>
lea    0xd48(%rip),%rdi
call   1040 <printf@plt>
mov    0x2d06(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    152f <main+0x38f>
mov    -0x24(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x24(%rbp)
jmp    132c <main+0x18c>
lea    0xd6d(%rip),%rdi
call   1040 <printf@plt>
lea    0xd6a(%rip),%rdi
call   1040 <printf@plt>
lea    0xd80(%rip),%rdi
call   1040 <printf@plt>
mov    0x2cbe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    152f <main+0x38f>
jmp    1331 <main+0x191>
movsd  0xcc7(%rip),%xmm0
movsd  %xmm0,-0x190(%rbp)
ff
lea    -0x70(%rbp),%rdi
call   1050 <getFileSize@plt>
mov    %eax,-0x184(%rbp)
lea    -0xb0(%rbp),%rdi
lea    -0x70(%rbp),%rdx
lea    0xd5f(%rip),%rsi
mov    $0x0,%al
call   10b0 <sprintf@plt>
lea    -0xf0(%rbp),%rdi
lea    -0x70(%rbp),%rdx
lea    0xd4d(%rip),%rsi
mov    $0x0,%al
call   10b0 <sprintf@plt>
lea    0xd46(%rip),%rdi
call   1040 <printf@plt>
lea    0xd94(%rip),%rdi
call   1040 <printf@plt>
lea    0xd2e(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x24(%rbp),%ecx
shl    $0x3,%ecx
cmp    %ecx,%eax
jg     1523 <main+0x383>
lea    -0x130(%rbp),%rdi
lea    -0x70(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xdb0(%rip),%rsi
mov    $0x0,%al
call   10b0 <sprintf@plt>
lea    -0x170(%rbp),%rdi
lea    -0x70(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xd9d(%rip),%rsi
mov    $0x0,%al
call   10b0 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    -0x130(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1080 <lzCompressFile@plt>
movss  %xmm0,-0x174(%rbp)
ff
mov    -0x18(%rbp),%eax
mov    0x2bbe(%rip),%rcx
cmp    (%rcx),%eax
jne    143b <main+0x29b>
mov    0x2baf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    152f <main+0x38f>
lea    -0x130(%rbp),%rdi
lea    -0x170(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   10c0 <lzUncompressFile@plt>
movss  %xmm0,-0x178(%rbp)
ff
mov    -0x18(%rbp),%eax
mov    0x2b7d(%rip),%rcx
cmp    (%rcx),%eax
jne    147c <main+0x2dc>
mov    0x2b6e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    152f <main+0x38f>
lea    -0x70(%rbp),%rdi
lea    -0x170(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1060 <compareFiles@plt>
movsd  %xmm0,-0x180(%rbp)
ff
lea    -0x130(%rbp),%rdi
call   1050 <getFileSize@plt>
mov    %eax,-0x188(%rbp)
movsd  -0x180(%rbp),%xmm1
ff
movsd  -0x190(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     14f8 <main+0x358>
lea    -0x70(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x184(%rbp),%edx
mov    -0x188(%rbp),%ecx
movss  -0x174(%rbp),%xmm0
ff
movss  -0x178(%rbp),%xmm1
ff
movsd  -0x180(%rbp),%xmm2
ff
call   1090 <printResults@plt>
jmp    1523 <main+0x383>
lea    -0x130(%rbp),%rdi
call   1030 <remove@plt>
lea    -0x170(%rbp),%rdi
call   1030 <remove@plt>
jmp    1515 <main+0x375>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13ad <main+0x20d>
mov    0x2aae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x168,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
je     1251 <main+0x91>
cmp    $0x2,%edi
jne    13e5 <main+0x225>
movabs $0x74657361746144,%rax
mov    %rax,0x26(%rsp)
movabs $0x6144656c62756f64,%rax
65 44 61
mov    %rax,0x20(%rsp)
mov    0x8(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,%ebx
cmp    $0x20,%eax
je     1219 <main+0x59>
cmp    $0x40,%ebx
jne    1406 <main+0x246>
shr    $0x3,%ebx
lea    0x20(%rsp),%rdi
mov    $0x400,%esi
mov    %ebx,%edx
call   1090 <createFileDouble@plt>
mov    %eax,%r15d
mov    0x2da9(%rip),%rbp
cmp    0x0(%rbp),%eax
jne    127b <main+0xbb>
lea    0xef9(%rip),%rdi
call   1050 <puts@plt>
mov    0x0(%rbp),%r15d
jmp    1443 <main+0x283>
mov    0x8(%rbx),%rsi
lea    0x20(%rsp),%rdi
call   1040 <strcpy@plt>
mov    0x10(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,%ebx
cmp    $0x20,%eax
je     1278 <main+0xb8>
cmp    $0x40,%ebx
jne    1406 <main+0x246>
shr    $0x3,%ebx
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
call   1070 <getFileSize@plt>
mov    %eax,0x4(%rsp)
lea    0xd83(%rip),%rsi
lea    0x120(%rsp),%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   10d0 <sprintf@plt>
lea    0xd71(%rip),%rsi
lea    0xe0(%rsp),%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   10d0 <sprintf@plt>
lea    0xe1e(%rip),%rbp
mov    %rbp,%rdi
call   1050 <puts@plt>
lea    0xd50(%rip),%rdi
call   1060 <printf@plt>
mov    %rbp,%rdi
call   1050 <puts@plt>
test   %ebx,%ebx
je     1439 <main+0x279>
lea    0x0(,%rbx,8),%eax
neg    %eax
mov    %rax,0x10(%rsp)
mov    $0x1,%ebp
lea    0xa0(%rsp),%r13
lea    0x20(%rsp),%r14
lea    0x60(%rsp),%r12
xchg   %ax,%ax
mov    %r13,%rdi
lea    0xd64(%rip),%rsi
mov    %r14,%rdx
mov    %ebp,%ecx
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    %r12,%rdi
lea    0xd57(%rip),%rsi
mov    %r14,%rdx
mov    %ebp,%ecx
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    %r14,%rdi
mov    %r13,%rsi
mov    %ebx,%edx
mov    $0x9,%ecx
mov    %ebp,%r8d
call   10a0 <lzCompressFile@plt>
mov    0x2c88(%rip),%rax
cmp    (%rax),%r15d
je     1443 <main+0x283>
movss  %xmm0,0xc(%rsp)
mov    %r13,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   10e0 <lzUncompressFile@plt>
mov    0x2c65(%rip),%rax
cmp    (%rax),%r15d
je     1443 <main+0x283>
movss  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   1080 <compareFiles@plt>
movsd  %xmm0,0x18(%rsp)
mov    %r13,%rdi
call   1070 <getFileSize@plt>
movsd  0x18(%rsp),%xmm2
movsd  0xc4d(%rip),%xmm0
ucomisd %xmm2,%xmm0
jae    141b <main+0x25b>
mov    %r13,%rdi
call   1030 <remove@plt>
mov    %r12,%rdi
call   1030 <remove@plt>
mov    0x10(%rsp),%rax
add    %ebp,%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
cmp    $0x1,%eax
jne    1310 <main+0x150>
jmp    1439 <main+0x279>
lea    0xca4(%rip),%rdi
call   1050 <puts@plt>
lea    0xca0(%rip),%rdi
call   1050 <puts@plt>
lea    0xcb5(%rip),%rdi
jmp    140d <main+0x24d>
lea    0xd57(%rip),%rdi
call   1050 <puts@plt>
mov    0x2bc7(%rip),%rax
jmp    1440 <main+0x280>
lea    0x20(%rsp),%rdi
mov    %ebp,%esi
mov    0x4(%rsp),%edx
mov    %eax,%ecx
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
call   10b0 <printResults@plt>
mov    0x2b98(%rip),%rax
mov    (%rax),%r15d
mov    %r15d,%eax
add    $0x168,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"doubleDataset\00"
@.str.1 = [41 x i8] c"Precision needs to be equal to 32 or 64\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [41 x i8] c"Error creating floating point data file\0A\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [9 x i8] c"Usage: \0A\00"
@.str.5 = [34 x i8] c" ./example precision(32 or 64)\0A\00"
@.str.6 = [43 x i8] c" ./example filename precision(32 or 64)\0A\00"
@.str.7 = [7 x i8] c"%s.cmz\00"
@.str.8 = [7 x i8] c"%s.umz\00"
@.str.9 = [90 x i8] c"========================================================================================\0A\00"
@.str.10 = [90 x i8] c"| Bits | In (MB) | Out (MB) | CR (%%) | (X:1) | Compress | Decomp | Error Bound | File \0A\00"
@.str.11 = [9 x i8] c"%s.clz%i\00"
@.str.12 = [9 x i8] c"%s.ulz%i\00"
@EXIT_SUCCESS = global i32 0
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 [64 x i8]
%12 = alloca [64 x i8]
%13 = alloca [64 x i8]
%14 = alloca [64 x i8]
%15 = alloca [64 x i8]
%16 = alloca float
%17 = alloca float
%18 = alloca double
%19 = alloca i32
%20 = alloca i32
%21 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 9, i32* %8
store i32 1024, i32* %9
store i32 8, i32* %10
%22 = load i32, i32* %4
%23 = icmp eq i32 %22, 2
br i1 %23, label %24, label %53
24: ; preds = %2
%25 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%26 = call i32 (i8*, i8*, ...) @sprintf(i8* %25, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 @atoi(i8* %29)
store i32 %30, i32* %10
%31 = load i32, i32* %10
%32 = icmp ne i32 %31, 32
br i1 %32, label %33, label %39
33: ; preds = %24
%34 = load i32, i32* %10
%35 = icmp ne i32 %34, 64
br i1 %35, label %36, label %39
36: ; preds = %33
%37 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%38 = load i32, i32* @EXIT_FAILURE
store i32 %38, i32* %3
br label %160
39: ; preds = %33, %24
%40 = load i32, i32* %10
%41 = sdiv i32 %40, 8
store i32 %41, i32* %10
%42 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%43 = load i32, i32* %9
%44 = load i32, i32* %10
%45 = call i32 @createFileDouble(i8* %42, i32 %43, i32 %44)
store i32 %45, i32* %7
%46 = load i32, i32* %7
%47 = load i32, i32* @EXIT_FAILURE
%48 = icmp eq i32 %46, %47
br i1 %48, label %49, label %52
49: ; preds = %39
%50 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%51 = load i32, i32* @EXIT_FAILURE
store i32 %51, i32* %3
br label %160
52: ; preds = %39
br label %83
53: ; preds = %2
%54 = load i32, i32* %4
%55 = icmp eq i32 %54, 3
br i1 %55, label %56, label %77
56: ; preds = %53
%57 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 1
%60 = load i8*, i8** %59
%61 = call i32 (i8*, i8*, ...) @sprintf(i8* %57, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %60)
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 2
%64 = load i8*, i8** %63
%65 = call i32 @atoi(i8* %64)
store i32 %65, i32* %10
%66 = load i32, i32* %10
%67 = icmp ne i32 %66, 32
br i1 %67, label %68, label %74
68: ; preds = %56
%69 = load i32, i32* %10
%70 = icmp ne i32 %69, 64
br i1 %70, label %71, label %74
71: ; preds = %68
%72 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%73 = load i32, i32* @EXIT_FAILURE
store i32 %73, i32* %3
br label %160
74: ; preds = %68, %56
%75 = load i32, i32* %10
%76 = sdiv i32 %75, 8
store i32 %76, i32* %10
br label %82
77: ; preds = %53
%78 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%79 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
%80 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0))
%81 = load i32, i32* @EXIT_FAILURE
store i32 %81, i32* %3
br label %160
82: ; preds = %74
br label %83
83: ; preds = %82, %52
store double 0x3EB0C6F7A0B5ED8D, double* %21
%84 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%85 = call i32 @getFileSize(i8* %84)
store i32 %85, i32* %19
%86 = getelementptr inbounds [64 x i8], [64 x i8]* %12, i64 0, i64 0
%87 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%88 = call i32 (i8*, i8*, ...) @sprintf(i8* %86, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %87)
%89 = getelementptr inbounds [64 x i8], [64 x i8]* %13, i64 0, i64 0
%90 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%91 = call i32 (i8*, i8*, ...) @sprintf(i8* %89, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %90)
%92 = call i32 @printf(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.9, i64 0, i64 0))
%93 = call i32 @printf(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.10, i64 0, i64 0))
%94 = call i32 @printf(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.9, i64 0, i64 0))
store i32 1, i32* %6
br label %95
95: ; preds = %155, %83
%96 = load i32, i32* %6
%97 = load i32, i32* %10
%98 = mul nsw i32 %97, 8
%99 = icmp sle i32 %96, %98
br i1 %99, label %100, label %158
100: ; preds = %95
%101 = getelementptr inbounds [64 x i8], [64 x i8]* %14, i64 0, i64 0
%102 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%103 = load i32, i32* %6
%104 = call i32 (i8*, i8*, ...) @sprintf(i8* %101, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* %102, i32 %103)
%105 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%106 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%107 = load i32, i32* %6
%108 = call i32 (i8*, i8*, ...) @sprintf(i8* %105, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8* %106, i32 %107)
%109 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%110 = getelementptr inbounds [64 x i8], [64 x i8]* %14, i64 0, i64 0
%111 = load i32, i32* %10
%112 = load i32, i32* %8
%113 = load i32, i32* %6
%114 = call float @lzCompressFile(i8* %109, i8* %110, i32 %111, i32 %112, i32 %113)
store float %114, float* %16
%115 = load i32, i32* %7
%116 = load i32, i32* @EXIT_FAILURE
%117 = icmp eq i32 %115, %116
br i1 %117, label %118, label %120
118: ; preds = %100
%119 = load i32, i32* @EXIT_FAILURE
store i32 %119, i32* %3
br label %160
120: ; preds = %100
%121 = getelementptr inbounds [64 x i8], [64 x i8]* %14, i64 0, i64 0
%122 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%123 = load i32, i32* %10
%124 = call float @lzUncompressFile(i8* %121, i8* %122, i32 %123)
store float %124, float* %17
%125 = load i32, i32* %7
%126 = load i32, i32* @EXIT_FAILURE
%127 = icmp eq i32 %125, %126
br i1 %127, label %128, label %130
128: ; preds = %120
%129 = load i32, i32* @EXIT_FAILURE
store i32 %129, i32* %3
br label %160
130: ; preds = %120
%131 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%132 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%133 = load i32, i32* %10
%134 = call double @compareFiles(i8* %131, i8* %132, i32 %133)
store double %134, double* %18
%135 = getelementptr inbounds [64 x i8], [64 x i8]* %14, i64 0, i64 0
%136 = call i32 @getFileSize(i8* %135)
store i32 %136, i32* %20
%137 = load double, double* %18
%138 = load double, double* %21
%139 = fcmp ole double %137, %138
br i1 %139, label %140, label %149
140: ; preds = %130
%141 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%142 = load i32, i32* %6
%143 = load i32, i32* %19
%144 = load i32, i32* %20
%145 = load float, float* %16
%146 = load float, float* %17
%147 = load double, double* %18
%148 = call i32 @printResults(i8* %141, i32 %142, i32 %143, i32 %144, float %145, float %146, double %147)
br label %158
149: ; preds = %130
%150 = getelementptr inbounds [64 x i8], [64 x i8]* %14, i64 0, i64 0
%151 = call i32 @remove(i8* %150)
%152 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%153 = call i32 @remove(i8* %152)
br label %154
154: ; preds = %149
br label %155
155: ; preds = %154
%156 = load i32, i32* %6
%157 = add nsw i32 %156, 1
store i32 %157, i32* %6
br label %95
158: ; preds = %140, %95
%159 = load i32, i32* @EXIT_SUCCESS
store i32 %159, i32* %3
br label %160
160: ; preds = %158, %128, %118, %77, %71, %49, %36
%161 = load i32, i32* %3
ret i32 %161
}

LLVM IR (-O2):
@.str = [14 x i8] c"doubleDataset\00"
@EXIT_FAILURE = global i32 0
@.str.7 = [7 x i8] c"%s.cmz\00"
@.str.8 = [7 x i8] c"%s.umz\00"
@.str.10 = [90 x i8] c"| Bits | In (MB) | Out (MB) | CR (%%) | (X:1) | Compress | Decomp | Error Bound | File \0A\00"
@.str.11 = [9 x i8] c"%s.clz%i\00"
@.str.12 = [9 x i8] c"%s.ulz%i\00"
@EXIT_SUCCESS = global i32 0
@str = [8 x i8] c"Usage: \00"
@str.13 = [33 x i8] c" ./example precision(32 or 64)\00"
@str.14 = [42 x i8] c" ./example filename precision(32 or 64)\00"
@str.16 = [89 x i8] c"========================================================================================\00"
@str.18 = [40 x i8] c"Error creating floating point data file\00"
@str.19 = [40 x i8] c"Precision needs to be equal to 32 or 64\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [64 x i8]
%4 = alloca [64 x i8]
%5 = alloca [64 x i8]
%6 = alloca [64 x i8]
%7 = alloca [64 x i8]
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
switch i32 %0, label %40 [
i32 2, label %13
i32 3, label %28
]
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = tail call i32 @atoi(i8* %15)
switch i32 %16, label %17 [
i32 64, label %20
i32 32, label %20
]
17: ; preds = %13
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.19, i64 0, i64 0))
%19 = load i32, i32* @EXIT_FAILURE
br label %81
20: ; preds = %13, %13
%21 = lshr i32 %16, 3
%22 = call i32 @createFileDouble(i8* %8, i32 1024, i32 %21)
%23 = load i32, i32* @EXIT_FAILURE
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %45
25: ; preds = %20
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.18, i64 0, i64 0))
%27 = load i32, i32* @EXIT_FAILURE
br label %81
28: ; preds = %2
%29 = getelementptr inbounds i8*, i8** %1, i64 1
%30 = load i8*, i8** %29
%31 = call i8* @strcpy(i8* %8, i8* dereferenceable(1) %30)
%32 = getelementptr inbounds i8*, i8** %1, i64 2
%33 = load i8*, i8** %32
%34 = call i32 @atoi(i8* %33)
switch i32 %34, label %35 [
i32 64, label %38
i32 32, label %38
]
35: ; preds = %28
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.19, i64 0, i64 0))
%37 = load i32, i32* @EXIT_FAILURE
br label %81
38: ; preds = %28, %28
%39 = lshr i32 %34, 3
br label %45
40: ; preds = %2
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%42 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.13, i64 0, i64 0))
%43 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.14, i64 0, i64 0))
%44 = load i32, i32* @EXIT_FAILURE
br label %81
45: ; preds = %20, %38
%46 = phi i32 [ %21, %20 ], [ %39, %38 ]
%47 = phi i32 [ %22, %20 ], [ undef, %38 ]
%48 = call i32 @getFileSize(i8* %8)
%49 = call i32 (i8*, i8*, ...) @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %8)
%50 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %8)
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([89 x i8], [89 x i8]* @str.16, i64 0, i64 0))
%52 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([90 x i8], [90 x i8]* @.str.10, i64 0, i64 0))
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([89 x i8], [89 x i8]* @str.16, i64 0, i64 0))
%54 = icmp eq i32 %46, 0
br i1 %54, label %79, label %55
55: ; preds = %45
%56 = shl nuw nsw i32 %46, 3
br label %57
57: ; preds = %55, %74
%58 = phi i32 [ %77, %74 ], [ 1, %55 ]
%59 = call i32 (i8*, i8*, ...) @sprintf(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* %8, i32 %58)
%60 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8* %8, i32 %58)
%61 = call float @lzCompressFile(i8* %8, i8* %11, i32 %46, i32 9, i32 %58)
%62 = load i32, i32* @EXIT_FAILURE
%63 = icmp eq i32 %47, %62
br i1 %63, label %81, label %64
64: ; preds = %57
%65 = call float @lzUncompressFile(i8* %11, i8* %12, i32 %46)
%66 = load i32, i32* @EXIT_FAILURE
%67 = icmp eq i32 %47, %66
br i1 %67, label %81, label %68
68: ; preds = %64
%69 = call double @compareFiles(i8* %8, i8* %12, i32 %46)
%70 = call i32 @getFileSize(i8* %11)
%71 = fcmp ugt double %69, 0x3EB0C6F7A0B5ED8D
br i1 %71, label %74, label %72
72: ; preds = %68
%73 = call i32 @printResults(i8* %8, i32 %58, i32 %48, i32 %70, float %61, float %65, double %69)
br label %79
74: ; preds = %68
%75 = call i32 @remove(i8* %11)
%76 = call i32 @remove(i8* %12)
%77 = add nuw nsw i32 %58, 1
%78 = icmp eq i32 %58, %56
br i1 %78, label %79, label %57
79: ; preds = %74, %45, %72
%80 = load i32, i32* @EXIT_SUCCESS
br label %81
81: ; preds = %57, %64, %79, %40, %35, %25, %17
%82 = phi i32 [ %19, %17 ], [ %27, %25 ], [ %37, %35 ], [ %44, %40 ], [ %80, %79 ], [ %47, %64 ], [ %47, %57 ]
ret i32 %82
}