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

/* Variables and functions */
long double acos(long double);
int /*<<< orphan*/ acosf(int /*<<< orphan*/);
int /*<<< orphan*/ cov_arr_log(long double *, int, char *, char *);
int /*<<< orphan*/ cov_arr_spec_log(char *, long double, int, long double *);
int /*<<< orphan*/ cov_check(char *, char *, int);
scalar_t__ cov_deserialize(char *, int);
long current_time_ns();
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, long);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *);
long double fun(int);
char *malloc(int);
long double pow(int, long double);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sinf(int /*<<< orphan*/);
long double sqrt(long double);
int /*<<< orphan*/ sqrtf(int /*<<< orphan*/);
int main() {
  int l;
  uint64_t start, end;
  long int diff = 0;
  int i, j, k;
  long double h, t1, t2, dppi, ans = 5.795776322412856L;
  long double s1;
  long double log[10];
  long double threshold = 0.0;
  long double epsilon = -4.0;
  int finputs[10];
  FILE *infile = fopen("final_inputs", "r");
  if (!infile) {
    printf("Could not open final_inputs\n");
  }
  char *s = malloc(10);
  for (i = 0; i < 10; i++) {
    if (!feof(infile)) {
      fscanf(infile, "%s", s);
      finputs[i] = (int)cov_deserialize(s, 10);
    }
  }
  sqrtf(0);
  acosf(0);
  sinf(0);
  start = current_time_ns();
  for (l = 0; l < 10; l++) {
    int n = finputs[l];
    t1 = -1.0;
    dppi = acos(t1);
    s1 = 0.0;
    t1 = 0.0;
    h = dppi / n;
    for (i = 1; i <= n; i++) {
      t2 = fun(i * h);
      s1 = s1 + sqrt(h * h + (t2 - t1) * (t2 - t1));
      t1 = t2;
    }
    log[l] = (long double)s1;
    if (s1 * pow(10, epsilon) > threshold) {
      threshold = s1 * pow(10, epsilon);
    }
  }
  end = current_time_ns();
  diff = (end - start);
  cov_arr_spec_log("spec.cov", threshold, 10, log);
  cov_arr_log(log, 10, "result", "log.cov");
  cov_check("log.cov", "spec.cov", 10);
  FILE *file;
  file = fopen("score.cov", "w");
  fprintf(file, "%ld\n", diff);
  fclose(file);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f0,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x20(%rbp)
fldt   0xdb0(%rip)
fstpt  -0x80(%rbp)
fldz
fstpt  -0x140(%rbp)
flds   0xdaf(%rip)
fstpt  -0x150(%rbp)
lea    0xda6(%rip),%rdi
lea    0xdac(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,-0x188(%rbp)
cmpq   $0x0,-0x188(%rbp)
jne    129b <main+0x6b>
lea    0xd8d(%rip),%rdi
call   1060 <printf@plt>
mov    $0xa,%edi
call   10f0 <malloc@plt>
mov    %rax,-0x190(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
jge    131d <main+0xed>
mov    -0x188(%rbp),%rdi
call   10e0 <feof@plt>
cmp    $0x0,%eax
jne    130a <main+0xda>
mov    -0x188(%rbp),%rdi
mov    -0x190(%rbp),%rdx
lea    0xd59(%rip),%rsi
call   10a0 <fscanf@plt>
mov    -0x190(%rbp),%rdi
mov    $0xa,%esi
call   1150 <cov_deserialize@plt>
mov    %eax,%ecx
movslq -0x24(%rbp),%rax
mov    %ecx,-0x180(%rbp,%rax,4)
jmp    130f <main+0xdf>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12b3 <main+0x83>
xor    %edi,%edi
call   1100 <sqrtf@plt>
xor    %edi,%edi
call   1070 <acosf@plt>
xor    %edi,%edi
call   1030 <sinf@plt>
mov    $0x0,%al
call   1140 <current_time_ns@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    14e2 <main+0x2b2>
movslq -0x8(%rbp),%rax
mov    -0x180(%rbp,%rax,4),%eax
mov    %eax,-0x194(%rbp)
fld1
fchs
fstpt  -0x50(%rbp)
fldt   -0x50(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1090 <acos@plt>
fstpt  -0x70(%rbp)
fldz
fld    %st(0)
fstpt  -0x90(%rbp)
fstpt  -0x50(%rbp)
fldt   -0x70(%rbp)
mov    -0x194(%rbp),%eax
mov    %eax,-0x1a4(%rbp)
fildl  -0x1a4(%rbp)
fdivrp %st,%st(1)
fstpt  -0x40(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x194(%rbp),%eax
jg     144b <main+0x21b>
mov    -0x24(%rbp),%eax
mov    %eax,-0x1ac(%rbp)
fildl  -0x1ac(%rbp)
fldt   -0x40(%rbp)
fmulp  %st,%st(1)
fnstcw -0x1ae(%rbp)
movzwl -0x1ae(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x1b0(%rbp)
fldcw  -0x1b0(%rbp)
fistpl -0x1a8(%rbp)
fldcw  -0x1ae(%rbp)
mov    -0x1a8(%rbp),%edi
call   1050 <fun@plt>
fstpt  -0x60(%rbp)
fldt   -0x90(%rbp)
fstpt  -0x1bc(%rbp)
fldt   -0x40(%rbp)
fldt   -0x60(%rbp)
fldt   -0x50(%rbp)
fsubrp %st,%st(1)
fmul   %st,%st(0)
fxch   %st(1)
fmul   %st,%st(0)
faddp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1130 <sqrt@plt>
fldt   -0x1bc(%rbp)
faddp  %st,%st(1)
fstpt  -0x90(%rbp)
fldt   -0x60(%rbp)
fstpt  -0x50(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    13a4 <main+0x174>
fldt   -0x90(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x4,%rax
fstpt  -0x130(%rbp,%rax,1)
fldt   -0x90(%rbp)
fstpt  -0x1c8(%rbp)
fldt   -0x150(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
mov    $0xa,%edi
call   1120 <pow@plt>
fldt   -0x1c8(%rbp)
fmulp  %st,%st(1)
fldt   -0x140(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    14cf <main+0x29f>
jmp    14a0 <main+0x270>
fldt   -0x90(%rbp)
fstpt  -0x1d4(%rbp)
fldt   -0x150(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
mov    $0xa,%edi
call   1120 <pow@plt>
fldt   -0x1d4(%rbp)
fmulp  %st,%st(1)
fstpt  -0x140(%rbp)
jmp    14d4 <main+0x2a4>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1344 <main+0x114>
xor    %eax,%eax
call   1140 <current_time_ns@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
fldt   -0x140(%rbp)
lea    -0x130(%rbp),%rdx
mov    %rsp,%rax
fstpt  (%rax)
lea    0xb2e(%rip),%rdi
mov    $0xa,%esi
call   1080 <cov_arr_spec_log@plt>
lea    -0x130(%rbp),%rdi
mov    $0xa,%esi
lea    0xb1a(%rip),%rdx
lea    0xb1a(%rip),%rcx
call   10b0 <cov_arr_log@plt>
lea    0xb0e(%rip),%rdi
lea    0xaf7(%rip),%rsi
mov    $0xa,%edx
call   10c0 <cov_check@plt>
lea    0xafe(%rip),%rdi
lea    0xb01(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,-0x1a0(%rbp)
mov    -0x1a0(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xae5(%rip),%rsi
call   10d0 <fprintf@plt>
mov    -0x1a0(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x1f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x120,%rsp
lea    0xdfa(%rip),%rdi
lea    0xdb6(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,%r12
test   %rax,%rax
jne    1267 <main+0x37>
lea    0xdd0(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   10f0 <malloc@plt>
mov    %rax,%r14
xor    %ebx,%ebx
lea    0xd89(%rip),%r15
jmp    128a <main+0x5a>
nop
add    $0x1,%rbx
cmp    $0xa,%rbx
je     12b7 <main+0x87>
mov    %r12,%rdi
call   10e0 <feof@plt>
test   %eax,%eax
jne    1280 <main+0x50>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   10a0 <fscanf@plt>
mov    %r14,%rdi
mov    $0xa,%esi
call   1150 <cov_deserialize@plt>
mov    %eax,0x50(%rsp,%rbx,4)
jmp    1280 <main+0x50>
xor    %r15d,%r15d
xor    %edi,%edi
call   1100 <sqrtf@plt>
xor    %edi,%edi
call   1070 <acosf@plt>
xor    %edi,%edi
call   1030 <sinf@plt>
xor    %eax,%eax
call   1140 <current_time_ns@plt>
mov    %rax,%r14
fldz
fstpt  0x2c(%rsp)
jmp    12fe <main+0xce>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15
cmp    $0xa,%r15
je     1441 <main+0x211>
mov    0x50(%rsp,%r15,4),%r12d
fld1
fchs
fstpt  (%rsp)
call   1090 <acos@plt>
mov    %r12d,0x28(%rsp)
fidivl 0x28(%rsp)
fstpt  0x44(%rsp)
fldz
test   %r12d,%r12d
fldz
jle    13e0 <main+0x1b0>
fstp   %st(1)
fstp   %st(0)
neg    %r12d
fldz
mov    $0x1,%ebx
fld    %st(0)
fxch   %st(1)
jmp    1361 <main+0x131>
nopl   (%rax)
fstp   %st(1)
fldt   0x14(%rsp)
faddp  %st,%st(1)
lea    (%r12,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
fxch   %st(1)
je     13e0 <main+0x1b0>
fxch   %st(1)
fstpt  0x14(%rsp)
mov    %ebx,0x20(%rsp)
fldt   0x44(%rsp)
fimull 0x20(%rsp)
fnstcw 0x10(%rsp)
movzwl 0x10(%rsp),%eax
or     $0xc00,%eax
mov    %ax,0x12(%rsp)
fldcw  0x12(%rsp)
fistpl 0x24(%rsp)
fldcw  0x10(%rsp)
fstpt  0x38(%rsp)
mov    0x24(%rsp),%edi
call   1060 <fun@plt>
fldt   0x38(%rsp)
fsubr  %st(1),%st
fmul   %st,%st(0)
fldt   0x44(%rsp)
fmul   %st,%st(0)
faddp  %st,%st(1)
fld    %st(0)
fsqrt
fldz
fxch   %st(2)
fucomi %st(2),%st
fstp   %st(2)
jae    1340 <main+0x110>
fstp   %st(0)
fstpt  (%rsp)
fstpt  0x38(%rsp)
call   1130 <sqrt@plt>
fldt   0x38(%rsp)
fldz
fxch   %st(1)
fxch   %st(2)
jmp    1340 <main+0x110>
nopw   0x0(%rax,%rax,1)
fstp   %st(0)
fld    %st(0)
fstpt  0x14(%rsp)
mov    %r15,%rax
shl    $0x4,%rax
fstpt  0x80(%rsp,%rax,1)
flds   0xc04(%rip)
fstpt  (%rsp)
mov    $0xa,%edi
call   1120 <pow@plt>
fldt   0x14(%rsp)
fmulp  %st,%st(1)
fldt   0x2c(%rsp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    12f0 <main+0xc0>
flds   0xbdb(%rip)
fstpt  (%rsp)
mov    $0xa,%edi
call   1120 <pow@plt>
fldt   0x14(%rsp)
fmulp  %st,%st(1)
fstpt  0x2c(%rsp)
jmp    12f0 <main+0xc0>
xor    %eax,%eax
call   1140 <current_time_ns@plt>
mov    %rax,%r13
sub    %r14,%r13
fldt   0x2c(%rsp)
fstpt  (%rsp)
lea    0xbad(%rip),%r14
lea    0x80(%rsp),%r15
mov    %r14,%rdi
mov    $0xa,%esi
mov    %r15,%rdx
call   1080 <cov_arr_spec_log@plt>
lea    0xb97(%rip),%rdx
lea    0xb97(%rip),%r12
mov    %r15,%rdi
mov    $0xa,%esi
mov    %r12,%rcx
call   10b0 <cov_arr_log@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   10c0 <cov_check@plt>
lea    0xb78(%rip),%rdi
lea    0xb7b(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,%rbx
lea    0xb6e(%rip),%rsi
mov    %rax,%rdi
mov    %r13,%rdx
call   10d0 <fprintf@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"final_inputs\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [29 x i8] c"Could not open final_inputs\0A\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [9 x i8] c"spec.cov\00"
@.str.5 = [7 x i8] c"result\00"
@.str.6 = [8 x i8] c"log.cov\00"
@.str.7 = [10 x i8] c"score.cov\00"
@.str.8 = [2 x i8] c"w\00"
@.str.9 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca x86_fp80
%10 = alloca x86_fp80
%11 = alloca x86_fp80
%12 = alloca x86_fp80
%13 = alloca x86_fp80
%14 = alloca x86_fp80
%15 = alloca [10 x x86_fp80]
%16 = alloca x86_fp80
%17 = alloca x86_fp80
%18 = alloca [10 x i32]
%19 = alloca i32*
%20 = alloca i8*
%21 = alloca i32
%22 = alloca i32*
store i32 0, i32* %1
store i64 0, i64* %5
store x86_fp80 0xK4001B976FFE7F63843EF, x86_fp80* %13
store x86_fp80 0xK00000000000000000000, x86_fp80* %16
store x86_fp80 0xKC0018000000000000000, x86_fp80* %17
%23 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %23, i32** %19
%24 = load i32*, i32** %19
%25 = icmp ne i32* %24, null
br i1 %25, label %28, label %26
26: ; preds = %0
%27 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %26, %0
%29 = call i8* @malloc(i32 10)
store i8* %29, i8** %20
store i32 0, i32* %6
br label %30
30: ; preds = %48, %28
%31 = load i32, i32* %6
%32 = icmp slt i32 %31, 10
br i1 %32, label %33, label %51
33: ; preds = %30
%34 = load i32*, i32** %19
%35 = call i32 @feof(i32* %34)
%36 = icmp ne i32 %35, 0
br i1 %36, label %47, label %37
37: ; preds = %33
%38 = load i32*, i32** %19
%39 = load i8*, i8** %20
%40 = call i32 @fscanf(i32* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %39)
%41 = load i8*, i8** %20
%42 = call i64 @cov_deserialize(i8* %41, i32 10)
%43 = trunc i64 %42 to i32
%44 = load i32, i32* %6
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [10 x i32], [10 x i32]* %18, i64 0, i64 %45
store i32 %43, i32* %46
br label %47
47: ; preds = %37, %33
br label %48
48: ; preds = %47
%49 = load i32, i32* %6
%50 = add nsw i32 %49, 1
store i32 %50, i32* %6
br label %30
51: ; preds = %30
%52 = call i32 @sqrtf(i32 0)
%53 = call i32 @acosf(i32 0)
%54 = call i32 @sinf(i32 0)
%55 = call i64 (...) @current_time_ns()
store i64 %55, i64* %3
store i32 0, i32* %2
br label %56
56: ; preds = %115, %51
%57 = load i32, i32* %2
%58 = icmp slt i32 %57, 10
br i1 %58, label %59, label %118
59: ; preds = %56
%60 = load i32, i32* %2
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [10 x i32], [10 x i32]* %18, i64 0, i64 %61
%63 = load i32, i32* %62
store i32 %63, i32* %21
store x86_fp80 0xKBFFF8000000000000000, x86_fp80* %10
%64 = load x86_fp80, x86_fp80* %10
%65 = call x86_fp80 @acos(x86_fp80 %64)
store x86_fp80 %65, x86_fp80* %12
store x86_fp80 0xK00000000000000000000, x86_fp80* %14
store x86_fp80 0xK00000000000000000000, x86_fp80* %10
%66 = load x86_fp80, x86_fp80* %12
%67 = load i32, i32* %21
%68 = sitofp i32 %67 to x86_fp80
%69 = fdiv x86_fp80 %66, %68
store x86_fp80 %69, x86_fp80* %9
store i32 1, i32* %6
br label %70
70: ; preds = %95, %59
%71 = load i32, i32* %6
%72 = load i32, i32* %21
%73 = icmp sle i32 %71, %72
br i1 %73, label %74, label %98
74: ; preds = %70
%75 = load i32, i32* %6
%76 = sitofp i32 %75 to x86_fp80
%77 = load x86_fp80, x86_fp80* %9
%78 = fmul x86_fp80 %76, %77
%79 = fptosi x86_fp80 %78 to i32
%80 = call x86_fp80 @fun(i32 %79)
store x86_fp80 %80, x86_fp80* %11
%81 = load x86_fp80, x86_fp80* %14
%82 = load x86_fp80, x86_fp80* %9
%83 = load x86_fp80, x86_fp80* %9
%84 = load x86_fp80, x86_fp80* %11
%85 = load x86_fp80, x86_fp80* %10
%86 = fsub x86_fp80 %84, %85
%87 = load x86_fp80, x86_fp80* %11
%88 = load x86_fp80, x86_fp80* %10
%89 = fsub x86_fp80 %87, %88
%90 = fmul x86_fp80 %86, %89
%91 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %82, x86_fp80 %83, x86_fp80 %90)
%92 = call x86_fp80 @sqrt(x86_fp80 %91)
%93 = fadd x86_fp80 %81, %92
store x86_fp80 %93, x86_fp80* %14
%94 = load x86_fp80, x86_fp80* %11
store x86_fp80 %94, x86_fp80* %10
br label %95
95: ; preds = %74
%96 = load i32, i32* %6
%97 = add nsw i32 %96, 1
store i32 %97, i32* %6
br label %70
98: ; preds = %70
%99 = load x86_fp80, x86_fp80* %14
%100 = load i32, i32* %2
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [10 x x86_fp80], [10 x x86_fp80]* %15, i64 0, i64 %101
store x86_fp80 %99, x86_fp80* %102
%103 = load x86_fp80, x86_fp80* %14
%104 = load x86_fp80, x86_fp80* %17
%105 = call x86_fp80 @pow(i32 10, x86_fp80 %104)
%106 = fmul x86_fp80 %103, %105
%107 = load x86_fp80, x86_fp80* %16
%108 = fcmp ogt x86_fp80 %106, %107
br i1 %108, label %109, label %114
109: ; preds = %98
%110 = load x86_fp80, x86_fp80* %14
%111 = load x86_fp80, x86_fp80* %17
%112 = call x86_fp80 @pow(i32 10, x86_fp80 %111)
%113 = fmul x86_fp80 %110, %112
store x86_fp80 %113, x86_fp80* %16
br label %114
114: ; preds = %109, %98
br label %115
115: ; preds = %114
%116 = load i32, i32* %2
%117 = add nsw i32 %116, 1
store i32 %117, i32* %2
br label %56
118: ; preds = %56
%119 = call i64 (...) @current_time_ns()
store i64 %119, i64* %4
%120 = load i64, i64* %4
%121 = load i64, i64* %3
%122 = sub nsw i64 %120, %121
store i64 %122, i64* %5
%123 = load x86_fp80, x86_fp80* %16
%124 = getelementptr inbounds [10 x x86_fp80], [10 x x86_fp80]* %15, i64 0, i64 0
%125 = call i32 @cov_arr_spec_log(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), x86_fp80 %123, i32 10, x86_fp80* %124)
%126 = getelementptr inbounds [10 x x86_fp80], [10 x x86_fp80]* %15, i64 0, i64 0
%127 = call i32 @cov_arr_log(x86_fp80* %126, i32 10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%128 = call i32 @cov_check(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 10)
%129 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store i32* %129, i32** %22
%130 = load i32*, i32** %22
%131 = load i64, i64* %5
%132 = call i32 @fprintf(i32* %130, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i64 %131)
%133 = load i32*, i32** %22
%134 = call i32 @fclose(i32* %133)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"final_inputs\00"
@.str.1 = [2 x i8] c"r\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [9 x i8] c"spec.cov\00"
@.str.5 = [7 x i8] c"result\00"
@.str.6 = [8 x i8] c"log.cov\00"
@.str.7 = [10 x i8] c"score.cov\00"
@.str.8 = [2 x i8] c"w\00"
@.str.9 = [5 x i8] c"%ld\0A\00"
@str = [28 x i8] c"Could not open final_inputs\00"
define i32 @main() {
%1 = alloca [10 x x86_fp80]
%2 = alloca [10 x i32]
%3 = bitcast [10 x x86_fp80]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
br label %11
11: ; preds = %9, %20
%12 = phi i64 [ 0, %9 ], [ %21, %20 ]
%13 = tail call i32 @feof(i32* %5)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = tail call i32 @fscanf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %10)
%17 = tail call i64 @cov_deserialize(i8* %10, i32 10)
%18 = trunc i64 %17 to i32
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %12
store i32 %18, i32* %19
br label %20
20: ; preds = %11, %15
%21 = add nuw nsw i64 %12, 1
%22 = icmp eq i64 %21, 10
br i1 %22, label %23, label %11
23: ; preds = %20
%24 = tail call i32 @sqrtf(i32 0)
%25 = tail call i32 @acosf(i32 0)
%26 = tail call i32 @sinf(i32 0)
%27 = tail call i64 (...) @current_time_ns()
br label %28
28: ; preds = %23, %61
%29 = phi i64 [ 0, %23 ], [ %63, %61 ]
%30 = phi x86_fp80 [ 0xK00000000000000000000, %23 ], [ %62, %61 ]
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %29
%32 = load i32, i32* %31
%33 = tail call x86_fp80 @acos(x86_fp80 0xKBFFF8000000000000000)
%34 = sitofp i32 %32 to x86_fp80
%35 = fdiv x86_fp80 %33, %34
%36 = icmp slt i32 %32, 1
br i1 %36, label %52, label %37
37: ; preds = %28, %37
%38 = phi i32 [ %50, %37 ], [ 1, %28 ]
%39 = phi x86_fp80 [ %44, %37 ], [ 0xK00000000000000000000, %28 ]
%40 = phi x86_fp80 [ %49, %37 ], [ 0xK00000000000000000000, %28 ]
%41 = sitofp i32 %38 to x86_fp80
%42 = fmul x86_fp80 %35, %41
%43 = fptosi x86_fp80 %42 to i32
%44 = tail call x86_fp80 @fun(i32 %43)
%45 = fsub x86_fp80 %44, %39
%46 = fmul x86_fp80 %45, %45
%47 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %35, x86_fp80 %35, x86_fp80 %46)
%48 = tail call x86_fp80 @sqrt(x86_fp80 %47)
%49 = fadd x86_fp80 %40, %48
%50 = add nuw i32 %38, 1
%51 = icmp eq i32 %38, %32
br i1 %51, label %52, label %37
52: ; preds = %37, %28
%53 = phi x86_fp80 [ 0xK00000000000000000000, %28 ], [ %49, %37 ]
%54 = getelementptr inbounds [10 x x86_fp80], [10 x x86_fp80]* %1, i64 0, i64 %29
store x86_fp80 %53, x86_fp80* %54
%55 = tail call x86_fp80 @pow(i32 10, x86_fp80 0xKC0018000000000000000)
%56 = fmul x86_fp80 %53, %55
%57 = fcmp ogt x86_fp80 %56, %30
br i1 %57, label %58, label %61
58: ; preds = %52
%59 = tail call x86_fp80 @pow(i32 10, x86_fp80 0xKC0018000000000000000)
%60 = fmul x86_fp80 %53, %59
br label %61
61: ; preds = %58, %52
%62 = phi x86_fp80 [ %60, %58 ], [ %30, %52 ]
%63 = add nuw nsw i64 %29, 1
%64 = icmp eq i64 %63, 10
br i1 %64, label %65, label %28
65: ; preds = %61
%66 = tail call i64 (...) @current_time_ns()
%67 = sub nsw i64 %66, %27
%68 = getelementptr inbounds [10 x x86_fp80], [10 x x86_fp80]* %1, i64 0, i64 0
%69 = call i32 @cov_arr_spec_log(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), x86_fp80 %62, i32 10, x86_fp80* %68)
%70 = call i32 @cov_arr_log(x86_fp80* %68, i32 10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%71 = call i32 @cov_check(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 10)
%72 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%73 = call i32 @fprintf(i32* %72, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i64 %67)
%74 = call i32 @fclose(i32* %72)
ret i32 0
}