#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 */
struct timeval {
  double tv_sec;
  double tv_usec;
};
typedef int ssize_t;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int O_CREAT;
int O_WRONLY;
scalar_t__ calloc(int, int);
int /*<<< orphan*/ close(int);
scalar_t__ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int open(char const *, int, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ print_global_performance(double, int, int);
int /*<<< orphan*/ printf(char *, double, ...);
int /*<<< orphan*/ stderr;
int write(int, char *, int);
int measure_write_through(const char *testfile_name, int request_size,
                          int requests_number) {
  ssize_t bytes_written, local_request_size, local_requests_number,
      total_size = 0;
  int i, testfile_descriptor;
  char *write_buffer;
  struct timeval start_timer;
  struct timeval stop_timer;
  double time_elapsed, total_time_elapsed = 0;
  if ((local_request_size = request_size * 1024) <= 0)
    local_request_size = 64 * 1024;
  if ((local_requests_number = requests_number) <= 0)
    local_requests_number = 50;
  testfile_descriptor = open(testfile_name, O_WRONLY | O_CREAT, 0644);
  if (testfile_descriptor < 0) {
    perror("open");
    return (EXIT_FAILURE);
  }
  write_buffer = (char *)calloc(local_request_size, sizeof(char));
  for (i = 0; i < local_requests_number; i++) {
    gettimeofday(&start_timer, NULL);
    bytes_written = write(testfile_descriptor, write_buffer,
                          local_request_size * sizeof(char));
    gettimeofday(&stop_timer, NULL);
    if (bytes_written > 0) {
      time_elapsed = (stop_timer.tv_sec - start_timer.tv_sec) * 1000.0;
      time_elapsed += (stop_timer.tv_usec - start_timer.tv_usec) / 1000.0;
      total_time_elapsed += time_elapsed;
      total_size += bytes_written;
      printf("%d\t%f\n", i, time_elapsed);
    } else {
      perror("write");
      fprintf(stderr, "Writing problem, abandoning writing measurment\n");
      break;
    }
  }
  gettimeofday(&start_timer, NULL);
  if (fflush(NULL) != 0) {
    perror("fflush");
    close(testfile_descriptor);
    free(write_buffer);
    return EXIT_FAILURE;
  }
  printf("#local_request_size %d Bytes\n", (int)local_request_size);
  printf("#total_size %d Bytes\n", (int)total_size);
  printf("#total_time_elapsed %f ms\n", total_time_elapsed);
  close(testfile_descriptor);
  print_global_performance(total_time_elapsed, total_size, request_size);
  free(write_buffer);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<measure_write_through>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x14(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jg     11ea <measure_write_through+0x3a>
movl   $0x10000,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
jg     1200 <measure_write_through+0x50>
movl   $0x32,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2dad(%rip),%rax
mov    (%rax),%esi
mov    0x2de4(%rip),%rax
or     (%rax),%esi
mov    $0x1a4,%edx
call   10b0 <open@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
jge    124a <measure_write_through+0x9a>
lea    0xdd4(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2d90(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1408 <measure_write_through+0x258>
mov    -0x20(%rbp),%edi
mov    $0x1,%esi
call   1080 <calloc@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1354 <measure_write_through+0x1a4>
lea    -0x48(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
mov    -0x30(%rbp),%edi
mov    -0x38(%rbp),%rsi
movslq -0x20(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edx
call   1040 <write@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x58(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
cmpl   $0x0,-0x1c(%rbp)
jle    131b <measure_write_through+0x16b>
movsd  -0x58(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  0xd43(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  0xd28(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
cvtsi2sdl -0x2c(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
lea    0xcfe(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
jmp    1341 <measure_write_through+0x191>
lea    0xcf2(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2caa(%rip),%rax
mov    (%rax),%edi
lea    0xce3(%rip),%rsi
call   1090 <fprintf@plt>
jmp    1354 <measure_write_through+0x1a4>
jmp    1346 <measure_write_through+0x196>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1262 <measure_write_through+0xb2>
lea    -0x48(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <fflush@plt>
cmp    $0x0,%rax
je     13a2 <measure_write_through+0x1f2>
lea    0xccf(%rip),%rdi
call   10c0 <perror@plt>
mov    -0x30(%rbp),%edi
call   1070 <close@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    0x2c38(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1408 <measure_write_through+0x258>
cvtsi2sdl -0x20(%rbp),%xmm0
lea    0xca3(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
cvtsi2sdl -0x28(%rbp),%xmm0
lea    0xcae(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  -0x68(%rbp),%xmm0
lea    0xcb1(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x30(%rbp),%edi
call   1070 <close@plt>
movsd  -0x68(%rbp),%xmm0
mov    -0x28(%rbp),%edi
mov    -0x14(%rbp),%esi
call   10d0 <print_global_performance@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    0x2bc5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<measure_write_through>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %esi,%ebp
mov    %esi,%eax
shl    $0xa,%eax
test   %esi,%esi
mov    $0x10000,%ebx
cmovg  %eax,%ebx
test   %edx,%edx
mov    $0x32,%r13d
cmovg  %edx,%r13d
mov    0x2dd6(%rip),%rax
mov    0x2e0f(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    $0x1a4,%edx
call   10b0 <open@plt>
test   %eax,%eax
js     1356 <measure_write_through+0x1a6>
mov    %eax,%r12d
mov    %ebp,0x14(%rsp)
mov    %ebx,%edi
mov    $0x1,%esi
call   1080 <calloc@plt>
mov    %rax,0x8(%rsp)
xor    %r15d,%r15d
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x18(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    %r12d,%edi
mov    0x8(%rsp),%rsi
mov    %ebx,%edx
call   1040 <write@plt>
mov    %eax,%r14d
lea    0x28(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
test   %r14d,%r14d
jle    136b <measure_write_through+0x1bb>
movsd  0x28(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
subsd  0x18(%rsp),%xmm0
movsd  0xd83(%rip),%xmm2
mulsd  %xmm2,%xmm0
subsd  0x20(%rsp),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
add    %r14d,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
lea    0xd5e(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
add    $0x1,%r15d
cmp    %r15d,%r13d
jne    1230 <measure_write_through+0x80>
lea    0x18(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
xor    %edi,%edi
call   10a0 <fflush@plt>
test   %rax,%rax
jne    1391 <measure_write_through+0x1e1>
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
lea    0xd64(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
lea    0xd6d(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xd75(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    %r12d,%edi
call   1070 <close@plt>
movsd  (%rsp),%xmm0
mov    %ebp,%edi
mov    0x14(%rsp),%esi
call   10d0 <print_global_performance@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x2c83(%rip),%rax
mov    (%rax),%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcab(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2c67(%rip),%rax
jmp    1345 <measure_write_through+0x195>
lea    0xca2(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2c5a(%rip),%rax
mov    (%rax),%edi
lea    0xc93(%rip),%rsi
call   1090 <fprintf@plt>
jmp    12c3 <measure_write_through+0x113>
lea    0xcb2(%rip),%rdi
call   10c0 <perror@plt>
mov    %r12d,%edi
call   1070 <close@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x2c1a(%rip),%rax
jmp    1345 <measure_write_through+0x195>

LLVM IR (-O0):
%struct.timeval = type { double, double }
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@.str = [5 x i8] c"open\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [7 x i8] c"%d\09%f\0A\00"
@.str.2 = [6 x i8] c"write\00"
@stderr = global i32 0
@.str.3 = [48 x i8] c"Writing problem, abandoning writing measurment\0A\00"
@.str.4 = [7 x i8] c"fflush\00"
@.str.5 = [30 x i8] c"#local_request_size %d Bytes\0A\00"
@.str.6 = [22 x i8] c"#total_size %d Bytes\0A\00"
@.str.7 = [27 x i8] c"#total_time_elapsed %f ms\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @measure_write_through(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
%15 = alloca %struct.timeval
%16 = alloca %struct.timeval
%17 = alloca double
%18 = alloca double
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 0, i32* %11
store double 0.000000e+00, double* %18
%19 = load i32, i32* %6
%20 = mul nsw i32 %19, 1024
store i32 %20, i32* %9
%21 = icmp sle i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %3
store i32 65536, i32* %9
br label %23
23: ; preds = %22, %3
%24 = load i32, i32* %7
store i32 %24, i32* %10
%25 = icmp sle i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %23
store i32 50, i32* %10
br label %27
27: ; preds = %26, %23
%28 = load i8*, i8** %5
%29 = load i32, i32* @O_WRONLY
%30 = load i32, i32* @O_CREAT
%31 = or i32 %29, %30
%32 = call i32 @open(i8* %28, i32 %31, i32 420)
store i32 %32, i32* %13
%33 = load i32, i32* %13
%34 = icmp slt i32 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %27
%36 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%37 = load i32, i32* @EXIT_FAILURE
store i32 %37, i32* %4
br label %120
38: ; preds = %27
%39 = load i32, i32* %9
%40 = call i64 @calloc(i32 %39, i32 1)
%41 = inttoptr i64 %40 to i8*
store i8* %41, i8** %14
store i32 0, i32* %12
br label %42
42: ; preds = %88, %38
%43 = load i32, i32* %12
%44 = load i32, i32* %10
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %91
46: ; preds = %42
%47 = call i32 @gettimeofday(%struct.timeval* %15, i32* null)
%48 = load i32, i32* %13
%49 = load i8*, i8** %14
%50 = load i32, i32* %9
%51 = sext i32 %50 to i64
%52 = mul i64 %51, 1
%53 = trunc i64 %52 to i32
%54 = call i32 @write(i32 %48, i8* %49, i32 %53)
store i32 %54, i32* %8
%55 = call i32 @gettimeofday(%struct.timeval* %16, i32* null)
%56 = load i32, i32* %8
%57 = icmp sgt i32 %56, 0
br i1 %57, label %58, label %83
58: ; preds = %46
%59 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 0
%60 = load double, double* %59
%61 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 0
%62 = load double, double* %61
%63 = fsub double %60, %62
%64 = fmul double %63, 1.000000e+03
store double %64, double* %17
%65 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 1
%66 = load double, double* %65
%67 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 1
%68 = load double, double* %67
%69 = fsub double %66, %68
%70 = fdiv double %69, 1.000000e+03
%71 = load double, double* %17
%72 = fadd double %71, %70
store double %72, double* %17
%73 = load double, double* %17
%74 = load double, double* %18
%75 = fadd double %74, %73
store double %75, double* %18
%76 = load i32, i32* %8
%77 = load i32, i32* %11
%78 = add nsw i32 %77, %76
store i32 %78, i32* %11
%79 = load i32, i32* %12
%80 = sitofp i32 %79 to double
%81 = load double, double* %17
%82 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %80, double %81)
br label %87
83: ; preds = %46
%84 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%85 = load i32, i32* @stderr
%86 = call i32 @fprintf(i32 %85, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
br label %91
87: ; preds = %58
br label %88
88: ; preds = %87
%89 = load i32, i32* %12
%90 = add nsw i32 %89, 1
store i32 %90, i32* %12
br label %42
91: ; preds = %83, %42
%92 = call i32 @gettimeofday(%struct.timeval* %15, i32* null)
%93 = call i64 @fflush(i32* null)
%94 = icmp ne i64 %93, 0
br i1 %94, label %95, label %102
95: ; preds = %91
%96 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%97 = load i32, i32* %13
%98 = call i32 @close(i32 %97)
%99 = load i8*, i8** %14
%100 = call i32 @free(i8* %99)
%101 = load i32, i32* @EXIT_FAILURE
store i32 %101, i32* %4
br label %120
102: ; preds = %91
%103 = load i32, i32* %9
%104 = sitofp i32 %103 to double
%105 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), double %104)
%106 = load i32, i32* %11
%107 = sitofp i32 %106 to double
%108 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double %107)
%109 = load double, double* %18
%110 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), double %109)
%111 = load i32, i32* %13
%112 = call i32 @close(i32 %111)
%113 = load double, double* %18
%114 = load i32, i32* %11
%115 = load i32, i32* %6
%116 = call i32 @print_global_performance(double %113, i32 %114, i32 %115)
%117 = load i8*, i8** %14
%118 = call i32 @free(i8* %117)
%119 = load i32, i32* @EXIT_SUCCESS
store i32 %119, i32* %4
br label %120
120: ; preds = %102, %95, %35
%121 = load i32, i32* %4
ret i32 %121
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@.str = [5 x i8] c"open\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [7 x i8] c"%d\09%f\0A\00"
@.str.2 = [6 x i8] c"write\00"
@stderr = global i32 0
@.str.3 = [48 x i8] c"Writing problem, abandoning writing measurment\0A\00"
@.str.4 = [7 x i8] c"fflush\00"
@.str.5 = [30 x i8] c"#local_request_size %d Bytes\0A\00"
@.str.6 = [22 x i8] c"#total_size %d Bytes\0A\00"
@.str.7 = [27 x i8] c"#total_time_elapsed %f ms\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @measure_write_through(i8* nocapture %0, i32 %1, i32 %2) {
%4 = alloca %struct.timeval
%5 = alloca %struct.timeval
%6 = bitcast %struct.timeval* %4 to i8*
%7 = bitcast %struct.timeval* %5 to i8*
%8 = shl nsw i32 %1, 10
%9 = icmp slt i32 %1, 1
%10 = select i1 %9, i32 65536, i32 %8
%11 = icmp slt i32 %2, 1
%12 = select i1 %11, i32 50, i32 %2
%13 = load i32, i32* @O_WRONLY
%14 = load i32, i32* @O_CREAT
%15 = or i32 %14, %13
%16 = tail call i32 @open(i8* %0, i32 %15, i32 420)
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %3
%19 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %74
20: ; preds = %3
%21 = tail call i64 @calloc(i32 %10, i32 1)
%22 = inttoptr i64 %21 to i8*
%23 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
%24 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
%25 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 1
%26 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 1
br label %27
27: ; preds = %20, %35
%28 = phi double [ 0.000000e+00, %20 ], [ %45, %35 ]
%29 = phi i32 [ 0, %20 ], [ %49, %35 ]
%30 = phi i32 [ 0, %20 ], [ %46, %35 ]
%31 = call i32 @gettimeofday(%struct.timeval* %4, i32* null)
%32 = tail call i32 @write(i32 %16, i8* %22, i32 %10)
%33 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%34 = icmp sgt i32 %32, 0
br i1 %34, label %35, label %51
35: ; preds = %27
%36 = load double, double* %23
%37 = load double, double* %24
%38 = fsub double %36, %37
%39 = fmul double %38, 1.000000e+03
%40 = load double, double* %25
%41 = load double, double* %26
%42 = fsub double %40, %41
%43 = fdiv double %42, 1.000000e+03
%44 = fadd double %39, %43
%45 = fadd double %28, %44
%46 = add nsw i32 %32, %30
%47 = sitofp i32 %29 to double
%48 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %47, double %44)
%49 = add nuw nsw i32 %29, 1
%50 = icmp eq i32 %49, %12
br i1 %50, label %55, label %27
51: ; preds = %27
%52 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%53 = load i32, i32* @stderr
%54 = tail call i32 @fprintf(i32 %53, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
br label %55
55: ; preds = %35, %51
%56 = phi i32 [ %30, %51 ], [ %46, %35 ]
%57 = phi double [ %28, %51 ], [ %45, %35 ]
%58 = call i32 @gettimeofday(%struct.timeval* %4, i32* null)
%59 = tail call i64 @fflush(i32* null)
%60 = icmp eq i64 %59, 0
br i1 %60, label %65, label %61
61: ; preds = %55
%62 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%63 = tail call i32 @close(i32 %16)
%64 = tail call i32 @free(i8* %22)
br label %74
65: ; preds = %55
%66 = sitofp i32 %10 to double
%67 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), double %66)
%68 = sitofp i32 %56 to double
%69 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double %68)
%70 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), double %57)
%71 = tail call i32 @close(i32 %16)
%72 = tail call i32 @print_global_performance(double %57, i32 %56, i32 %1)
%73 = tail call i32 @free(i8* %22)
br label %74
74: ; preds = %65, %61, %18
%75 = phi i32* [ @EXIT_FAILURE, %18 ], [ @EXIT_FAILURE, %61 ], [ @EXIT_SUCCESS, %65 ]
%76 = load i32, i32* %75
ret i32 %76
}