#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*/ SEEK_SET;
long long countFileLines(int /*<<< orphan*/ *);
int /*<<< orphan*/ displayUsage(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(long long *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, long long *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(long long *, int /*<<< orphan*/, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  if (argc < 3) {
    displayUsage(argv[0]);
    exit(1);
  }
  int k = 0;
  long long i = 0, j = 0, c = 0;
  long long llLen1 = 0, llLen2 = 0, lines = 0;
  float flSim = 0.0, flDist = 0.0;
  FILE *fListFile1;
  FILE *fListFile2;
  long long *laList1, *laList2;
  if ((fListFile1 = fopen(argv[1], "r")) == NULL) {
    fprintf(stderr, "Can't open file: %s\n", argv[1]);
    exit(1);
  }
  lines = countFileLines(fListFile1);
  if ((laList1 = (long long *)malloc(sizeof(long long) * lines)) == NULL) {
    fprintf(stderr, "Memory allocation failed\n");
    exit(2);
  }
  memset(laList1, 0, sizeof(long long) * lines);
  fseek(fListFile1, 0, SEEK_SET);
  while (!feof(fListFile1)) {
    fscanf(fListFile1, "%lld\n", &laList1[llLen1]);
    llLen1++;
  }
  for (k = 2; k < argc; k++) {
    if ((fListFile2 = fopen(argv[k], "r")) == NULL) {
      fprintf(stderr, "Can't open file: %s\n", argv[k]);
      exit(1);
    }
    lines = countFileLines(fListFile2);
    if ((laList2 = (long long *)malloc(sizeof(long long) * lines)) == NULL) {
      fprintf(stderr, "Memory allocation failed\n");
      exit(2);
    }
    memset(laList2, 0, sizeof(long long) * lines);
    llLen2 = 0;
    fseek(fListFile2, 0, SEEK_SET);
    while (!feof(fListFile2)) {
      fscanf(fListFile2, "%lld\n", &laList2[llLen2]);
      llLen2++;
    }
    i = 0, j = 0, c = 0;
    while (i < llLen1 && j < llLen2) {
      if (laList1[i] == laList2[j]) {
        i++;
        j++;
        c++;
        continue;
      }
      if (laList1[i] > laList2[j]) {
        j++;
      } else {
        i++;
      }
    }
    flSim = (float)c / ((float)llLen2 / 100.0);
    flDist = 100.0 - flSim;
    fprintf(stdout, "%f\t%f\t%s\n", flSim, flDist, argv[k]);
    fclose(fListFile2);
    free(laList2);
  }
  fclose(fListFile1);
  free(laList1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11f9 <main+0x39>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10c0 <displayUsage@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdb9(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x58(%rbp)
cmp    $0x0,%rax
jne    128b <main+0xcb>
mov    0x2d77(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd90(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x58(%rbp),%rdi
call   1070 <countFileLines@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x68(%rbp)
cmp    $0x0,%rax
jne    12d6 <main+0x116>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
lea    0xd5a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x2,%edi
call   10e0 <exit@plt>
mov    -0x68(%rbp),%rdi
mov    -0x48(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x58(%rbp),%rdi
mov    0x2ce2(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x58(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    131d <main+0x15d>
jmp    134d <main+0x18d>
mov    -0x58(%rbp),%rdi
mov    -0x68(%rbp),%rdx
mov    -0x38(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
lea    0xd02(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    12ff <main+0x13f>
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    15ed <main+0x42d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc95(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x60(%rbp)
cmp    $0x0,%rax
jne    13b3 <main+0x1f3>
mov    0x2c53(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xc68(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x60(%rbp),%rdi
call   1070 <countFileLines@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x70(%rbp)
cmp    $0x0,%rax
jne    13fe <main+0x23e>
mov    0x2bfc(%rip),%rax
mov    (%rax),%edi
lea    0xc32(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x2,%edi
call   10e0 <exit@plt>
mov    -0x70(%rbp),%rdi
mov    -0x48(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1050 <memset@plt>
movq   $0x0,-0x40(%rbp)
mov    -0x60(%rbp),%rdi
mov    0x2bb2(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x60(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    144d <main+0x28d>
jmp    147d <main+0x2bd>
mov    -0x60(%rbp),%rdi
mov    -0x70(%rbp),%rdx
mov    -0x40(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
lea    0xbd2(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    142f <main+0x26f>
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
cmp    -0x38(%rbp),%rcx
mov    %al,-0x71(%rbp)
jge    14b6 <main+0x2f6>
mov    -0x28(%rbp),%rax
cmp    -0x40(%rbp),%rax
setl   %al
mov    %al,-0x71(%rbp)
mov    -0x71(%rbp),%al
test   $0x1,%al
jne    14c6 <main+0x306>
jmp    154d <main+0x38d>
mov    -0x68(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x70(%rbp),%rcx
mov    -0x28(%rbp),%rdx
cmp    (%rcx,%rdx,8),%rax
jne    150d <main+0x34d>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1495 <main+0x2d5>
mov    -0x68(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x70(%rbp),%rcx
mov    -0x28(%rbp),%rdx
cmp    (%rcx,%rdx,8),%rax
jle    153c <main+0x37c>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1548 <main+0x388>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1495 <main+0x2d5>
cvtsi2ssq -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtsi2ssq -0x40(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xa97(%rip),%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x4c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xa75(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
mov    0x2a31(%rip),%rax
mov    (%rax),%edi
movss  -0x4c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x50(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xa79(%rip),%rsi
mov    $0x2,%al
call   1080 <fprintf@plt>
mov    -0x60(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1354 <main+0x194>
mov    -0x58(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
cmp    $0x2,%edi
jle    14cf <main+0x30f>
mov    %edi,%r12d
mov    %rsi,(%rsp)
mov    0x8(%rsi),%rdi
lea    0xe23(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     14e1 <main+0x321>
mov    %rax,%rbp
mov    %rax,%rdi
call   1070 <countFileLines@plt>
mov    %rax,%rbx
shl    $0x3,%ebx
mov    %ebx,%edi
call   10a0 <malloc@plt>
test   %rax,%rax
je     1489 <main+0x2c9>
xor    %r15d,%r15d
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebx,%edx
mov    %rax,%rbx
call   1050 <memset@plt>
mov    0x2da7(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    %rbp,%rdi
call   1090 <feof@plt>
test   %eax,%eax
mov    %rbx,0x8(%rsp)
mov    %rbp,0x10(%rsp)
je     1259 <main+0x99>
mov    (%rsp),%rbx
jmp    12a0 <main+0xe0>
xor    %r15d,%r15d
lea    0xdda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <fscanf@plt>
add    $0x1,%r15
mov    %rbp,%rdi
call   1090 <feof@plt>
add    $0x8,%rbx
test   %eax,%eax
je     1270 <main+0xb0>
cmp    $0x3,%r12d
mov    (%rsp),%rbx
jl     1464 <main+0x2a4>
mov    %r12d,%eax
mov    %rax,0x20(%rsp)
mov    $0x2,%r13d
mov    %r15,0x18(%rsp)
jmp    1345 <main+0x185>
nopl   0x0(%rax,%rax,1)
xor    %r8d,%r8d
xor    %r9d,%r9d
xorps  %xmm0,%xmm0
cvtsi2ss %r9,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %r8,%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
divsd  0xd1a(%rip),%xmm1
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movss  0xd08(%rip),%xmm2
subss  %xmm1,%xmm2
mov    0x2cc5(%rip),%rax
mov    (%rax),%edi
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
mov    (%rbx,%r13,8),%rdx
lea    0xd24(%rip),%rsi
mov    $0x2,%al
call   1080 <fprintf@plt>
mov    %r12,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
call   1030 <free@plt>
add    $0x1,%r13
cmp    0x20(%rsp),%r13
je     1464 <main+0x2a4>
mov    (%rbx,%r13,8),%rdi
lea    0xcbc(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     14aa <main+0x2ea>
mov    %rax,%r12
mov    %rax,%rdi
call   1070 <countFileLines@plt>
mov    %rax,%rbp
shl    $0x3,%ebp
mov    %ebp,%edi
call   10a0 <malloc@plt>
test   %rax,%rax
je     1489 <main+0x2c9>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1050 <memset@plt>
mov    0x2c43(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    %r12,%rdi
call   1090 <feof@plt>
test   %eax,%eax
jne    12c0 <main+0x100>
mov    $0xffffffffffffffff,%rbx
mov    %r14,%rbp
lea    0xc7b(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    %r12,%rdi
call   1090 <feof@plt>
add    $0x1,%rbx
add    $0x8,%rbp
test   %eax,%eax
je     13d0 <main+0x210>
lea    0x1(%rbx),%r8
mov    0x18(%rsp),%r15
test   %r15,%r15
jle    1458 <main+0x298>
xor    %edx,%edx
xor    %edi,%edi
xor    %r9d,%r9d
mov    0x8(%rsp),%rbp
mov    %rdi,%rsi
nop
mov    (%r14,%rsi,8),%rax
cmp    %rax,0x0(%rbp,%rdx,8)
je     1440 <main+0x280>
setle  %cl
setg   %al
movzbl %cl,%ecx
add    %rcx,%rdx
cmp    %r15,%rdx
jge    145b <main+0x29b>
movzbl %al,%eax
add    %rax,%rsi
cmp    %rbx,%rsi
jle    1410 <main+0x250>
jmp    145b <main+0x29b>
nopl   0x0(%rax)
add    $0x1,%rdx
add    $0x1,%r9
cmp    %r15,%rdx
jge    145b <main+0x29b>
lea    0x1(%rsi),%rdi
cmp    %rbx,%rsi
jl     140c <main+0x24c>
jmp    145b <main+0x29b>
xor    %r9d,%r9d
mov    (%rsp),%rbx
jmp    12c6 <main+0x106>
mov    0x10(%rsp),%rdi
call   1040 <fclose@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b50(%rip),%rax
mov    (%rax),%edi
lea    0xb8a(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x2,%edi
call   10e0 <exit@plt>
mov    0x2b2f(%rip),%rax
mov    (%rax),%edi
mov    (%rbx,%r13,8),%rdx
lea    0xb50(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    (%rsi),%rdi
call   10c0 <displayUsage@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    0x2af8(%rip),%rax
mov    (%rax),%edi
mov    (%rsp),%rax
mov    0x8(%rax),%rdx
jmp    14b7 <main+0x2f7>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [21 x i8] c"Can't open file: %s\0A\00"
@.str.2 = [26 x i8] c"Memory allocation failed\0A\00"
@SEEK_SET = global i32 0
@.str.3 = [6 x i8] c"%lld\0A\00"
@stdout = global i32 0
@.str.4 = [10 x i8] c"%f\09%f\09%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca float
%14 = alloca float
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i64*
%18 = alloca i64*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%19 = load i32, i32* %4
%20 = icmp slt i32 %19, 3
br i1 %20, label %21, label %27
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 @displayUsage(i8* %24)
%26 = call i32 @exit(i32 1)
unreachable
27: ; preds = %2
store i32 0, i32* %6
store i64 0, i64* %7
store i64 0, i64* %8
store i64 0, i64* %9
store i64 0, i64* %10
store i64 0, i64* %11
store i64 0, i64* %12
store float 0.000000e+00, float* %13
store float 0.000000e+00, float* %14
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32* @fopen(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %31, i32** %15
%32 = icmp eq i32* %31, null
br i1 %32, label %33, label %40
33: ; preds = %27
%34 = load i32, i32* @stderr
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %37)
%39 = call i32 @exit(i32 1)
unreachable
40: ; preds = %27
%41 = load i32*, i32** %15
%42 = call i64 @countFileLines(i32* %41)
store i64 %42, i64* %12
%43 = load i64, i64* %12
%44 = mul i64 8, %43
%45 = trunc i64 %44 to i32
%46 = call i64 @malloc(i32 %45)
%47 = inttoptr i64 %46 to i64*
store i64* %47, i64** %17
%48 = icmp eq i64* %47, null
br i1 %48, label %49, label %53
49: ; preds = %40
%50 = load i32, i32* @stderr
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%52 = call i32 @exit(i32 2)
unreachable
53: ; preds = %40
%54 = load i64*, i64** %17
%55 = load i64, i64* %12
%56 = mul i64 8, %55
%57 = trunc i64 %56 to i32
%58 = call i32 @memset(i64* %54, i32 0, i32 %57)
%59 = load i32*, i32** %15
%60 = load i32, i32* @SEEK_SET
%61 = call i32 @fseek(i32* %59, i32 0, i32 %60)
br label %62
62: ; preds = %67, %53
%63 = load i32*, i32** %15
%64 = call i32 @feof(i32* %63)
%65 = icmp ne i32 %64, 0
%66 = xor i1 %65, true
br i1 %66, label %67, label %75
67: ; preds = %62
%68 = load i32*, i32** %15
%69 = load i64*, i64** %17
%70 = load i64, i64* %10
%71 = getelementptr inbounds i64, i64* %69, i64 %70
%72 = call i32 @fscanf(i32* %68, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i64* %71)
%73 = load i64, i64* %10
%74 = add nsw i64 %73, 1
store i64 %74, i64* %10
br label %62
75: ; preds = %62
store i32 2, i32* %6
br label %76
76: ; preds = %206, %75
%77 = load i32, i32* %6
%78 = load i32, i32* %4
%79 = icmp slt i32 %77, %78
br i1 %79, label %80, label %209
80: ; preds = %76
%81 = load i8**, i8*** %5
%82 = load i32, i32* %6
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8*, i8** %81, i64 %83
%85 = load i8*, i8** %84
%86 = call i32* @fopen(i8* %85, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %86, i32** %16
%87 = icmp eq i32* %86, null
br i1 %87, label %88, label %97
88: ; preds = %80
%89 = load i32, i32* @stderr
%90 = load i8**, i8*** %5
%91 = load i32, i32* %6
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i8*, i8** %90, i64 %92
%94 = load i8*, i8** %93
%95 = call i32 (i32, i8*, ...) @fprintf(i32 %89, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %94)
%96 = call i32 @exit(i32 1)
unreachable
97: ; preds = %80
%98 = load i32*, i32** %16
%99 = call i64 @countFileLines(i32* %98)
store i64 %99, i64* %12
%100 = load i64, i64* %12
%101 = mul i64 8, %100
%102 = trunc i64 %101 to i32
%103 = call i64 @malloc(i32 %102)
%104 = inttoptr i64 %103 to i64*
store i64* %104, i64** %18
%105 = icmp eq i64* %104, null
br i1 %105, label %106, label %110
106: ; preds = %97
%107 = load i32, i32* @stderr
%108 = call i32 (i32, i8*, ...) @fprintf(i32 %107, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%109 = call i32 @exit(i32 2)
unreachable
110: ; preds = %97
%111 = load i64*, i64** %18
%112 = load i64, i64* %12
%113 = mul i64 8, %112
%114 = trunc i64 %113 to i32
%115 = call i32 @memset(i64* %111, i32 0, i32 %114)
store i64 0, i64* %11
%116 = load i32*, i32** %16
%117 = load i32, i32* @SEEK_SET
%118 = call i32 @fseek(i32* %116, i32 0, i32 %117)
br label %119
119: ; preds = %124, %110
%120 = load i32*, i32** %16
%121 = call i32 @feof(i32* %120)
%122 = icmp ne i32 %121, 0
%123 = xor i1 %122, true
br i1 %123, label %124, label %132
124: ; preds = %119
%125 = load i32*, i32** %16
%126 = load i64*, i64** %18
%127 = load i64, i64* %11
%128 = getelementptr inbounds i64, i64* %126, i64 %127
%129 = call i32 @fscanf(i32* %125, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i64* %128)
%130 = load i64, i64* %11
%131 = add nsw i64 %130, 1
store i64 %131, i64* %11
br label %119
132: ; preds = %119
store i64 0, i64* %7
store i64 0, i64* %8
store i64 0, i64* %9
br label %133
133: ; preds = %176, %153, %132
%134 = load i64, i64* %7
%135 = load i64, i64* %10
%136 = icmp slt i64 %134, %135
br i1 %136, label %137, label %141
137: ; preds = %133
%138 = load i64, i64* %8
%139 = load i64, i64* %11
%140 = icmp slt i64 %138, %139
br label %141
141: ; preds = %137, %133
%142 = phi i1 [ false, %133 ], [ %140, %137 ]
br i1 %142, label %143, label %177
143: ; preds = %141
%144 = load i64*, i64** %17
%145 = load i64, i64* %7
%146 = getelementptr inbounds i64, i64* %144, i64 %145
%147 = load i64, i64* %146
%148 = load i64*, i64** %18
%149 = load i64, i64* %8
%150 = getelementptr inbounds i64, i64* %148, i64 %149
%151 = load i64, i64* %150
%152 = icmp eq i64 %147, %151
br i1 %152, label %153, label %160
153: ; preds = %143
%154 = load i64, i64* %7
%155 = add nsw i64 %154, 1
store i64 %155, i64* %7
%156 = load i64, i64* %8
%157 = add nsw i64 %156, 1
store i64 %157, i64* %8
%158 = load i64, i64* %9
%159 = add nsw i64 %158, 1
store i64 %159, i64* %9
br label %133
160: ; preds = %143
%161 = load i64*, i64** %17
%162 = load i64, i64* %7
%163 = getelementptr inbounds i64, i64* %161, i64 %162
%164 = load i64, i64* %163
%165 = load i64*, i64** %18
%166 = load i64, i64* %8
%167 = getelementptr inbounds i64, i64* %165, i64 %166
%168 = load i64, i64* %167
%169 = icmp sgt i64 %164, %168
br i1 %169, label %170, label %173
170: ; preds = %160
%171 = load i64, i64* %8
%172 = add nsw i64 %171, 1
store i64 %172, i64* %8
br label %176
173: ; preds = %160
%174 = load i64, i64* %7
%175 = add nsw i64 %174, 1
store i64 %175, i64* %7
br label %176
176: ; preds = %173, %170
br label %133
177: ; preds = %141
%178 = load i64, i64* %9
%179 = sitofp i64 %178 to float
%180 = fpext float %179 to double
%181 = load i64, i64* %11
%182 = sitofp i64 %181 to float
%183 = fpext float %182 to double
%184 = fdiv double %183, 1.000000e+02
%185 = fdiv double %180, %184
%186 = fptrunc double %185 to float
store float %186, float* %13
%187 = load float, float* %13
%188 = fpext float %187 to double
%189 = fsub double 1.000000e+02, %188
%190 = fptrunc double %189 to float
store float %190, float* %14
%191 = load i32, i32* @stdout
%192 = load float, float* %13
%193 = fpext float %192 to double
%194 = load float, float* %14
%195 = fpext float %194 to double
%196 = load i8**, i8*** %5
%197 = load i32, i32* %6
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds i8*, i8** %196, i64 %198
%200 = load i8*, i8** %199
%201 = call i32 (i32, i8*, ...) @fprintf(i32 %191, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), double %193, double %195, i8* %200)
%202 = load i32*, i32** %16
%203 = call i32 @fclose(i32* %202)
%204 = load i64*, i64** %18
%205 = call i32 @free(i64* %204)
br label %206
206: ; preds = %177
%207 = load i32, i32* %6
%208 = add nsw i32 %207, 1
store i32 %208, i32* %6
br label %76
209: ; preds = %76
%210 = load i32*, i32** %15
%211 = call i32 @fclose(i32* %210)
%212 = load i64*, i64** %17
%213 = call i32 @free(i64* %212)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [21 x i8] c"Can't open file: %s\0A\00"
@.str.2 = [26 x i8] c"Memory allocation failed\0A\00"
@SEEK_SET = global i32 0
@.str.3 = [6 x i8] c"%lld\0A\00"
@stdout = global i32 0
@.str.4 = [10 x i8] c"%f\09%f\09%s\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 i8*, i8** %1
%6 = tail call i32 @displayUsage(i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
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 ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %9
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = tail call i32 @exit(i32 1)
unreachable
18: ; preds = %8
%19 = tail call i64 @countFileLines(i32* %11)
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 3
%22 = tail call i64 @malloc(i32 %21)
%23 = inttoptr i64 %22 to i64*
%24 = icmp eq i64 %22, 0
br i1 %24, label %25, label %29
25: ; preds = %18
%26 = load i32, i32* @stderr
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%28 = tail call i32 @exit(i32 2)
unreachable
29: ; preds = %18
%30 = tail call i32 @memset(i64* %23, i32 0, i32 %21)
%31 = load i32, i32* @SEEK_SET
%32 = tail call i32 @fseek(i32* %11, i32 0, i32 %31)
%33 = tail call i32 @feof(i32* %11)
%34 = icmp eq i32 %33, 0
br i1 %34, label %41, label %37
35: ; preds = %41
%36 = icmp sgt i32 %0, 2
br i1 %36, label %37, label %133
37: ; preds = %29, %35
%38 = phi i64 [ %45, %35 ], [ 0, %29 ]
%39 = icmp sgt i64 %38, 0
%40 = zext i32 %0 to i64
br label %48
41: ; preds = %29, %41
%42 = phi i64 [ %45, %41 ], [ 0, %29 ]
%43 = getelementptr inbounds i64, i64* %23, i64 %42
%44 = tail call i32 @fscanf(i32* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i64* %43)
%45 = add nuw nsw i64 %42, 1
%46 = tail call i32 @feof(i32* %11)
%47 = icmp eq i32 %46, 0
br i1 %47, label %41, label %35
48: ; preds = %37, %113
%49 = phi i64 [ 2, %37 ], [ %131, %113 ]
%50 = getelementptr inbounds i8*, i8** %1, i64 %49
%51 = load i8*, i8** %50
%52 = tail call i32* @fopen(i8* %51, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%53 = icmp eq i32* %52, null
br i1 %53, label %54, label %59
54: ; preds = %48
%55 = load i32, i32* @stderr
%56 = load i8*, i8** %50
%57 = tail call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %56)
%58 = tail call i32 @exit(i32 1)
unreachable
59: ; preds = %48
%60 = tail call i64 @countFileLines(i32* %52)
%61 = trunc i64 %60 to i32
%62 = shl i32 %61, 3
%63 = tail call i64 @malloc(i32 %62)
%64 = inttoptr i64 %63 to i64*
%65 = icmp eq i64 %63, 0
br i1 %65, label %66, label %70
66: ; preds = %59
%67 = load i32, i32* @stderr
%68 = tail call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%69 = tail call i32 @exit(i32 2)
unreachable
70: ; preds = %59
%71 = tail call i32 @memset(i64* %64, i32 0, i32 %62)
%72 = load i32, i32* @SEEK_SET
%73 = tail call i32 @fseek(i32* %52, i32 0, i32 %72)
%74 = tail call i32 @feof(i32* %52)
%75 = icmp eq i32 %74, 0
br i1 %75, label %77, label %113
76: ; preds = %77
br i1 %39, label %99, label %113
77: ; preds = %70, %77
%78 = phi i64 [ %81, %77 ], [ 0, %70 ]
%79 = getelementptr inbounds i64, i64* %64, i64 %78
%80 = tail call i32 @fscanf(i32* %52, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i64* %79)
%81 = add nuw nsw i64 %78, 1
%82 = tail call i32 @feof(i32* %52)
%83 = icmp eq i32 %82, 0
br i1 %83, label %77, label %76
84: ; preds = %99, %103
%85 = phi i64 [ %100, %99 ], [ %109, %103 ]
%86 = phi i64 [ %101, %99 ], [ %106, %103 ]
%87 = getelementptr inbounds i64, i64* %23, i64 %85
%88 = load i64, i64* %87
%89 = getelementptr inbounds i64, i64* %64, i64 %86
%90 = load i64, i64* %89
%91 = icmp eq i64 %88, %90
br i1 %91, label %92, label %103
92: ; preds = %84
%93 = add nsw i64 %85, 1
%94 = add nsw i64 %86, 1
%95 = add nuw nsw i64 %102, 1
%96 = icmp slt i64 %93, %38
%97 = icmp slt i64 %86, %78
%98 = select i1 %96, i1 %97, i1 false
br i1 %98, label %99, label %113
99: ; preds = %76, %92
%100 = phi i64 [ %93, %92 ], [ 0, %76 ]
%101 = phi i64 [ %94, %92 ], [ 0, %76 ]
%102 = phi i64 [ %95, %92 ], [ 0, %76 ]
br label %84
103: ; preds = %84
%104 = icmp sgt i64 %88, %90
%105 = zext i1 %104 to i64
%106 = add nsw i64 %86, %105
%107 = xor i1 %104, true
%108 = zext i1 %107 to i64
%109 = add nsw i64 %85, %108
%110 = icmp slt i64 %109, %38
%111 = icmp sle i64 %106, %78
%112 = select i1 %110, i1 %111, i1 false
br i1 %112, label %84, label %113
113: ; preds = %92, %103, %70, %76
%114 = phi i64 [ %81, %76 ], [ 0, %70 ], [ %81, %103 ], [ %81, %92 ]
%115 = phi i64 [ 0, %76 ], [ 0, %70 ], [ %102, %103 ], [ %95, %92 ]
%116 = sitofp i64 %115 to float
%117 = fpext float %116 to double
%118 = sitofp i64 %114 to float
%119 = fpext float %118 to double
%120 = fdiv double %119, 1.000000e+02
%121 = fdiv double %117, %120
%122 = fptrunc double %121 to float
%123 = fpext float %122 to double
%124 = fsub float 1.000000e+02, %122
%125 = load i32, i32* @stdout
%126 = fpext float %124 to double
%127 = load i8*, i8** %50
%128 = tail call i32 (i32, i8*, ...) @fprintf(i32 %125, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), double %123, double %126, i8* %127)
%129 = tail call i32 @fclose(i32* %52)
%130 = tail call i32 @free(i64* %64)
%131 = add nuw nsw i64 %49, 1
%132 = icmp eq i64 %131, %40
br i1 %132, label %133, label %48
133: ; preds = %113, %35
%134 = tail call i32 @fclose(i32* %11)
%135 = tail call i32 @free(i64* %23)
ret i32 0
}