#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 BUFSIZ;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, unsigned long long, unsigned long long, ...);
long long remove_commas(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ sscanf(char *, char *, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int i;
  char filename[BUFSIZ];
  char string[BUFSIZ], insn_string[BUFSIZ];
  FILE *fff;
  long long instructions = 0;
  double time;
  unsigned long long instructions_max = 0,
                     instructions_min = 0x7fffffffffffffffULL;
  unsigned long long instructions_total = 0, instructions_average = 0;
  double time_min = 10000.0, time_max = 0.0, time_total = 0, time_average = 0;
  for (i = 1; i <= 30; i++) {
    sprintf(filename, "out.%d", i);
    fff = fopen(filename, "r");
    if (fff == NULL) {
      fprintf(stderr, "Couldn't open %s\n", filename);
    } else {
      fgets(string, BUFSIZ, fff);
      fgets(string, BUFSIZ, fff);
      fgets(string, BUFSIZ, fff);
      fgets(string, BUFSIZ, fff);
      sscanf(string, "%s", insn_string);
      instructions = remove_commas(insn_string);
      fgets(string, BUFSIZ, fff);
      fgets(string, BUFSIZ, fff);
      sscanf(string, "%lf", &time);
      printf("%lf\t%lld\n", time, instructions);
      if (time < time_min)
        time_min = time;
      if (time > time_max)
        time_max = time;
      time_total += time;
      if (instructions < instructions_min)
        instructions_min = instructions;
      if (instructions > instructions_max)
        instructions_max = instructions;
      instructions_total += instructions;
      fclose(fff);
    }
  }
  time_average = time_total / 30;
  instructions_average = instructions_total / 30;
  printf("Average time: %lf (Max %lf Min %lf)\n", time_average, time_max,
         time_min);
  printf("Average instructions: %lld (Max %lld Min %lld)\n",
         instructions_average, instructions_max, instructions_min);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e38(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0xa8(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x28(%rbp)
mov    (%rax),%ecx
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0xa0(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x30(%rbp)
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x98(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x58(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x60(%rbp)
movq   $0x0,-0x68(%rbp)
movq   $0x0,-0x70(%rbp)
movsd  0xdc0(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movl   $0x1,-0x14(%rbp)
cmpl   $0x1e,-0x14(%rbp)
jg     149a <main+0x31a>
mov    -0xa8(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xd93(%rip),%rsi
call   10a0 <sprintf@plt>
mov    -0xa8(%rbp),%rdi
lea    0xd87(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    12cd <main+0x14d>
mov    -0xa8(%rbp),%rdx
mov    0x2d26(%rip),%rax
mov    (%rax),%edi
lea    0xd5e(%rip),%rsi
call   1070 <fprintf@plt>
jmp    1487 <main+0x307>
mov    -0xa0(%rbp),%rdi
mov    0x2cfd(%rip),%rax
mov    %rax,-0xb8(%rbp)
mov    (%rax),%esi
mov    -0x40(%rbp),%rdx
call   1060 <fgets@plt>
mov    -0xa0(%rbp),%rdi
mov    -0xb8(%rbp),%rax
mov    (%rax),%esi
mov    -0x40(%rbp),%rdx
call   1060 <fgets@plt>
mov    -0xa0(%rbp),%rdi
mov    -0xb8(%rbp),%rax
mov    (%rax),%esi
mov    -0x40(%rbp),%rdx
call   1060 <fgets@plt>
mov    -0xa0(%rbp),%rdi
mov    -0xb8(%rbp),%rax
mov    (%rax),%esi
mov    -0x40(%rbp),%rdx
call   1060 <fgets@plt>
mov    -0x98(%rbp),%rdx
mov    -0xa0(%rbp),%rdi
lea    0xce6(%rip),%rsi
xor    %eax,%eax
mov    %al,-0xa9(%rbp)
call   1080 <sscanf@plt>
mov    -0x98(%rbp),%rdi
call   1030 <remove_commas@plt>
mov    -0xa0(%rbp),%rdi
mov    %rax,%rcx
mov    -0xb8(%rbp),%rax
mov    %rcx,-0x48(%rbp)
mov    (%rax),%esi
mov    -0x40(%rbp),%rdx
call   1060 <fgets@plt>
mov    -0xa0(%rbp),%rdi
mov    -0xb8(%rbp),%rax
mov    (%rax),%esi
mov    -0x40(%rbp),%rdx
call   1060 <fgets@plt>
mov    -0xa0(%rbp),%rdi
mov    -0xa9(%rbp),%al
lea    0xc83(%rip),%rsi
lea    -0x50(%rbp),%rdx
call   1080 <sscanf@plt>
movsd  -0x50(%rbp),%xmm0
movsd  0xc47(%rip),%xmm2
movaps %xmm0,%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rax
cvttsd2si %xmm0,%rsi
mov    %rsi,%rcx
sar    $0x3f,%rcx
and    %rcx,%rax
or     %rax,%rsi
mov    -0x48(%rbp),%rdx
lea    0xc48(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsd  -0x50(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1417 <main+0x297>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
ucomisd -0x80(%rbp),%xmm0
jbe    1431 <main+0x2b1>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x50(%rbp),%xmm0
addsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x48(%rbp),%rax
cmp    -0x60(%rbp),%rax
jae    145c <main+0x2dc>
mov    -0x48(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x48(%rbp),%rax
cmp    -0x58(%rbp),%rax
jbe    1472 <main+0x2f2>
mov    -0x48(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x48(%rbp),%rax
add    -0x68(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x40(%rbp),%rdi
call   1040 <fclose@plt>
jmp    148c <main+0x30c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    126a <main+0xea>
movsd  -0x88(%rbp),%xmm0
ff
movsd  0xb5e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x68(%rbp),%rax
movabs $0x8888888888888889,%rcx
88 88 88
mul    %rcx
shr    $0x4,%rdx
mov    %rdx,-0x70(%rbp)
movsd  -0x90(%rbp),%xmm0
ff
movsd  0xb31(%rip),%xmm2
movaps %xmm0,%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rax
cvttsd2si %xmm0,%rsi
mov    %rsi,%rcx
sar    $0x3f,%rcx
and    %rcx,%rax
or     %rax,%rsi
movsd  -0x80(%rbp),%xmm0
movaps %xmm0,%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rax
cvttsd2si %xmm0,%rdx
mov    %rdx,%rcx
sar    $0x3f,%rcx
and    %rcx,%rax
or     %rax,%rdx
movsd  -0x78(%rbp),%xmm0
lea    0xb18(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x70(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    -0x60(%rbp),%rcx
lea    0xb23(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    0x2e40(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rcx,%rsp
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x88(%rbp)
mov    %rcx,%rsp
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x90(%rbp)
mov    %rcx,%rsp
mov    $0x1,%r13d
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x40(%rbp)
movsd  0xe15(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movaps %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
movaps %xmm0,-0x50(%rbp)
xor    %r15d,%r15d
xor    %eax,%eax
mov    %rax,-0x38(%rbp)
jmp    135b <main+0x1db>
nopl   0x0(%rax)
mov    %rax,%r14
mov    0x2dbe(%rip),%r12
mov    (%r12),%esi
mov    -0x88(%rbp),%rbx
mov    %rbx,%rdi
mov    %rax,%rdx
call   1060 <fgets@plt>
mov    (%r12),%esi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1060 <fgets@plt>
mov    (%r12),%esi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1060 <fgets@plt>
mov    (%r12),%esi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1060 <fgets@plt>
mov    %rbx,%rdi
lea    0xdcc(%rip),%rsi
mov    %r15,-0x60(%rbp)
mov    -0x90(%rbp),%r15
mov    %r15,%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
mov    %r15,%rdi
call   1030 <remove_commas@plt>
mov    %rax,%r15
mov    (%r12),%esi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1060 <fgets@plt>
mov    (%r12),%esi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1060 <fgets@plt>
mov    %rbx,%rdi
lea    0xd87(%rip),%rsi
lea    -0x68(%rbp),%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
movsd  -0x68(%rbp),%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,%rcx
sar    $0x3f,%rcx
subsd  0xd35(%rip),%xmm0
cvttsd2si %xmm0,%rsi
and    %rcx,%rsi
or     %rax,%rsi
lea    0xd55(%rip),%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
movsd  -0x68(%rbp),%xmm1
movapd %xmm1,%xmm0
minsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movapd -0x80(%rbp),%xmm0
addsd  %xmm1,%xmm0
movapd %xmm0,-0x80(%rbp)
maxsd  -0x50(%rbp),%xmm1
movsd  %xmm1,-0x50(%rbp)
mov    -0x40(%rbp),%rax
cmp    %rax,%r15
cmovb  %r15,%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
cmp    %rax,%r15
cmova  %r15,%rax
mov    %rax,-0x38(%rbp)
add    %r15,-0x60(%rbp)
mov    -0x60(%rbp),%r15
mov    %r14,%rdi
call   1040 <fclose@plt>
movsd  -0x50(%rbp),%xmm0
movaps %xmm0,-0x50(%rbp)
add    $0x1,%r13d
cmp    $0x1f,%r13d
je     13a4 <main+0x224>
mov    -0x58(%rbp),%rbx
mov    %rbx,%rdi
lea    0xcaf(%rip),%rsi
mov    %r13d,%edx
call   10a0 <sprintf@plt>
mov    %rbx,%rdi
lea    0xca4(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
jne    1210 <main+0x90>
mov    0x2c50(%rip),%rax
mov    (%rax),%edi
lea    0xc88(%rip),%rsi
mov    -0x58(%rbp),%rdx
call   1070 <fprintf@plt>
jmp    1351 <main+0x1d1>
movapd -0x80(%rbp),%xmm0
divsd  0xc5f(%rip),%xmm0
movabs $0x8888888888888889,%rcx
88 88 88
mov    %r15,%rax
mul    %rcx
mov    %rdx,%rbx
cvttsd2si %xmm0,%rax
movsd  0xc37(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
shr    $0x4,%rbx
mov    %rax,%rsi
sar    $0x3f,%rsi
movapd -0x50(%rbp),%xmm0
cvttsd2si %xmm0,%rdi
and    %rcx,%rsi
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
or     %rax,%rsi
mov    %rdi,%rdx
sar    $0x3f,%rdx
and    %rcx,%rdx
or     %rdi,%rdx
lea    0xc32(%rip),%rdi
movsd  -0x30(%rbp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xc44(%rip),%rdi
mov    %rbx,%rsi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rcx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
@.str = [7 x i8] c"out.%d\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [18 x i8] c"Couldn't open %s\0A\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [4 x i8] c"%lf\00"
@.str.5 = [10 x i8] c"%lf\09%lld\0A\00"
@.str.6 = [37 x i8] c"Average time: %lf (Max %lf Min %lf)\0A\00"
@.str.7 = [48 x i8] c"Average instructions: %lld (Max %lld Min %lld)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i32*
%12 = alloca i64
%13 = alloca double
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%22 = load i32, i32* @BUFSIZ
%23 = zext i32 %22 to i64
%24 = call i8* @llvm.stacksave()
store i8* %24, i8** %7
%25 = alloca i8, i64 %23
store i64 %23, i64* %8
%26 = load i32, i32* @BUFSIZ
%27 = zext i32 %26 to i64
%28 = alloca i8, i64 %27
store i64 %27, i64* %9
%29 = load i32, i32* @BUFSIZ
%30 = zext i32 %29 to i64
%31 = alloca i8, i64 %30
store i64 %30, i64* %10
store i64 0, i64* %12
store i64 0, i64* %14
store i64 9223372036854775807, i64* %15
store i64 0, i64* %16
store i64 0, i64* %17
store double 1.000000e+04, double* %18
store double 0.000000e+00, double* %19
store double 0.000000e+00, double* %20
store double 0.000000e+00, double* %21
store i32 1, i32* %6
br label %32
32: ; preds = %103, %2
%33 = load i32, i32* %6
%34 = icmp sle i32 %33, 30
br i1 %34, label %35, label %106
35: ; preds = %32
%36 = load i32, i32* %6
%37 = call i32 @sprintf(i8* %25, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %36)
%38 = call i32* @fopen(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %38, i32** %11
%39 = load i32*, i32** %11
%40 = icmp eq i32* %39, null
br i1 %40, label %41, label %44
41: ; preds = %35
%42 = load i32, i32* @stderr
%43 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %25)
br label %102
44: ; preds = %35
%45 = load i32, i32* @BUFSIZ
%46 = load i32*, i32** %11
%47 = call i32 @fgets(i8* %28, i32 %45, i32* %46)
%48 = load i32, i32* @BUFSIZ
%49 = load i32*, i32** %11
%50 = call i32 @fgets(i8* %28, i32 %48, i32* %49)
%51 = load i32, i32* @BUFSIZ
%52 = load i32*, i32** %11
%53 = call i32 @fgets(i8* %28, i32 %51, i32* %52)
%54 = load i32, i32* @BUFSIZ
%55 = load i32*, i32** %11
%56 = call i32 @fgets(i8* %28, i32 %54, i32* %55)
%57 = call i32 (i8*, i8*, ...) @sscanf(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %31)
%58 = call i64 @remove_commas(i8* %31)
store i64 %58, i64* %12
%59 = load i32, i32* @BUFSIZ
%60 = load i32*, i32** %11
%61 = call i32 @fgets(i8* %28, i32 %59, i32* %60)
%62 = load i32, i32* @BUFSIZ
%63 = load i32*, i32** %11
%64 = call i32 @fgets(i8* %28, i32 %62, i32* %63)
%65 = call i32 (i8*, i8*, ...) @sscanf(i8* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %13)
%66 = load double, double* %13
%67 = fptoui double %66 to i64
%68 = load i64, i64* %12
%69 = call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i64 %67, i64 %68)
%70 = load double, double* %13
%71 = load double, double* %18
%72 = fcmp olt double %70, %71
br i1 %72, label %73, label %75
73: ; preds = %44
%74 = load double, double* %13
store double %74, double* %18
br label %75
75: ; preds = %73, %44
%76 = load double, double* %13
%77 = load double, double* %19
%78 = fcmp ogt double %76, %77
br i1 %78, label %79, label %81
79: ; preds = %75
%80 = load double, double* %13
store double %80, double* %19
br label %81
81: ; preds = %79, %75
%82 = load double, double* %13
%83 = load double, double* %20
%84 = fadd double %83, %82
store double %84, double* %20
%85 = load i64, i64* %12
%86 = load i64, i64* %15
%87 = icmp ult i64 %85, %86
br i1 %87, label %88, label %90
88: ; preds = %81
%89 = load i64, i64* %12
store i64 %89, i64* %15
br label %90
90: ; preds = %88, %81
%91 = load i64, i64* %12
%92 = load i64, i64* %14
%93 = icmp ugt i64 %91, %92
br i1 %93, label %94, label %96
94: ; preds = %90
%95 = load i64, i64* %12
store i64 %95, i64* %14
br label %96
96: ; preds = %94, %90
%97 = load i64, i64* %12
%98 = load i64, i64* %16
%99 = add i64 %98, %97
store i64 %99, i64* %16
%100 = load i32*, i32** %11
%101 = call i32 @fclose(i32* %100)
br label %102
102: ; preds = %96, %41
br label %103
103: ; preds = %102
%104 = load i32, i32* %6
%105 = add nsw i32 %104, 1
store i32 %105, i32* %6
br label %32
106: ; preds = %32
%107 = load double, double* %20
%108 = fdiv double %107, 3.000000e+01
store double %108, double* %21
%109 = load i64, i64* %16
%110 = udiv i64 %109, 30
store i64 %110, i64* %17
%111 = load double, double* %21
%112 = fptoui double %111 to i64
%113 = load double, double* %19
%114 = fptoui double %113 to i64
%115 = load double, double* %18
%116 = call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i64 %112, i64 %114, double %115)
%117 = load i64, i64* %17
%118 = load i64, i64* %14
%119 = load i64, i64* %15
%120 = call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i64 %117, i64 %118, i64 %119)
store i32 0, i32* %3
%121 = load i8*, i8** %7
%122 = load i32, i32* %3
ret i32 %122
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@.str = [7 x i8] c"out.%d\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [18 x i8] c"Couldn't open %s\0A\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [4 x i8] c"%lf\00"
@.str.5 = [10 x i8] c"%lf\09%lld\0A\00"
@.str.6 = [37 x i8] c"Average time: %lf (Max %lf Min %lf)\0A\00"
@.str.7 = [48 x i8] c"Average instructions: %lld (Max %lld Min %lld)\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = load i32, i32* @BUFSIZ
%5 = zext i32 %4 to i64
%6 = alloca i8, i64 %5
%7 = alloca i8, i64 %5
%8 = alloca i8, i64 %5
%9 = bitcast double* %3 to i8*
br label %10
10: ; preds = %2, %55
%11 = phi double [ 0.000000e+00, %2 ], [ %61, %55 ]
%12 = phi double [ 0.000000e+00, %2 ], [ %60, %55 ]
%13 = phi double [ 1.000000e+04, %2 ], [ %59, %55 ]
%14 = phi i64 [ 0, %2 ], [ %58, %55 ]
%15 = phi i64 [ 9223372036854775807, %2 ], [ %57, %55 ]
%16 = phi i64 [ 0, %2 ], [ %56, %55 ]
%17 = phi i32 [ 1, %2 ], [ %62, %55 ]
%18 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %24
21: ; preds = %10
%22 = load i32, i32* @stderr
%23 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %6)
br label %55
24: ; preds = %10
%25 = load i32, i32* @BUFSIZ
%26 = call i32 @fgets(i8* %7, i32 %25, i32* %19)
%27 = load i32, i32* @BUFSIZ
%28 = call i32 @fgets(i8* %7, i32 %27, i32* %19)
%29 = load i32, i32* @BUFSIZ
%30 = call i32 @fgets(i8* %7, i32 %29, i32* %19)
%31 = load i32, i32* @BUFSIZ
%32 = call i32 @fgets(i8* %7, i32 %31, i32* %19)
%33 = call i32 (i8*, i8*, ...) @sscanf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%34 = call i64 @remove_commas(i8* %8)
%35 = load i32, i32* @BUFSIZ
%36 = call i32 @fgets(i8* %7, i32 %35, i32* %19)
%37 = load i32, i32* @BUFSIZ
%38 = call i32 @fgets(i8* %7, i32 %37, i32* %19)
%39 = call i32 (i8*, i8*, ...) @sscanf(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %3)
%40 = load double, double* %3
%41 = fptoui double %40 to i64
%42 = call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i64 %41, i64 %34)
%43 = load double, double* %3
%44 = fcmp olt double %43, %13
%45 = select i1 %44, double %43, double %13
%46 = fcmp ogt double %43, %12
%47 = select i1 %46, double %43, double %12
%48 = fadd double %11, %43
%49 = icmp ult i64 %34, %15
%50 = select i1 %49, i64 %34, i64 %15
%51 = icmp ugt i64 %34, %16
%52 = select i1 %51, i64 %34, i64 %16
%53 = add i64 %34, %14
%54 = call i32 @fclose(i32* %19)
br label %55
55: ; preds = %21, %24
%56 = phi i64 [ %16, %21 ], [ %52, %24 ]
%57 = phi i64 [ %15, %21 ], [ %50, %24 ]
%58 = phi i64 [ %14, %21 ], [ %53, %24 ]
%59 = phi double [ %13, %21 ], [ %45, %24 ]
%60 = phi double [ %12, %21 ], [ %47, %24 ]
%61 = phi double [ %11, %21 ], [ %48, %24 ]
%62 = add nuw nsw i32 %17, 1
%63 = icmp eq i32 %62, 31
br i1 %63, label %64, label %10
64: ; preds = %55
%65 = fdiv double %61, 3.000000e+01
%66 = udiv i64 %58, 30
%67 = fptoui double %65 to i64
%68 = fptoui double %60 to i64
%69 = call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i64 %67, i64 %68, double %59)
%70 = call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i64 %66, i64 %56, i64 %57)
ret i32 0
}