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

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ O_WRONLY;
int PATH_MAX;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fstat(int, struct stat *);
char *getenv(char *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
char *malloc(int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char *);
int /*<<< orphan*/ stderr;
int write(int, char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int fd;
  int rank, number, i = 0;
  char *buffer = NULL;
  size_t total_size = 0;
  ssize_t ret;
  struct stat file_stat;
  char test;
  struct timeval st, et;
  char file_path[PATH_MAX];
  const char *mount_point = getenv("CBB_CLIENT_MOUNT_POINT");
  if (NULL == mount_point) {
    fprintf(stderr, "please set CBB_CLIENT_MOUNT_POINT");
    return EXIT_FAILURE;
  }
  sprintf(file_path, "%s%s", mount_point, "/test1");
  fd = open(file_path, O_WRONLY);
  fstat(fd, &file_stat);
  if (NULL == (buffer = malloc(file_stat.st_size))) {
    perror("malloc");
    return EXIT_FAILURE;
  }
  gettimeofday(&st, NULL);
  if (-1 == (ret = write(fd, buffer, file_stat.st_size))) {
    perror("read");
    return EXIT_FAILURE;
  }
  if (-1 == (ret = lseek(fd, 0, SEEK_SET))) {
    perror("lseek");
    return EXIT_FAILURE;
  }
  printf("seek to begin\n");
  printf("read again\n");
  scanf("%c", &test);
  if (-1 == (ret = write(fd, buffer, file_stat.st_size))) {
    perror("read");
    return EXIT_FAILURE;
  }
  total_size += ret;
  gettimeofday(&et, NULL);
  printf("total size %lu\n", total_size);
  printf("throughput %fMB/s\n",
         (double)total_size / (((et).tv_sec - (st).tv_sec) * 1000000 +
                               (et).tv_usec - (st).tv_usec));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    0x2df9(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x88(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x70(%rbp)
lea    0xe05(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x78(%rbp)
xor    %eax,%eax
cmp    -0x78(%rbp),%rax
jne    1268 <main+0xa8>
mov    0x2d96(%rip),%rax
mov    (%rax),%edi
lea    0xdd5(%rip),%rsi
call   1080 <fprintf@plt>
mov    0x2d71(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x7c(%rbp)
jmp    1492 <main+0x2d2>
mov    -0x88(%rbp),%rdi
mov    -0x78(%rbp),%rdx
lea    0xdc8(%rip),%rsi
lea    0xdc6(%rip),%rcx
call   10d0 <sprintf@plt>
mov    -0x88(%rbp),%rdi
mov    0x2d1c(%rip),%rax
mov    (%rax),%esi
call   10b0 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x38(%rbp),%rsi
call   10e0 <fstat@plt>
mov    -0x38(%rbp),%edi
call   1090 <malloc@plt>
mov    %rax,%rcx
mov    %rcx,-0x28(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    12e8 <main+0x128>
lea    0xd83(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2cf1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x7c(%rbp)
jmp    1492 <main+0x2d2>
lea    -0x50(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gettimeofday@plt>
mov    -0x14(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x38(%rbp),%edx
call   1040 <write@plt>
mov    %eax,%ecx
mov    %ecx,-0x34(%rbp)
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    133a <main+0x17a>
lea    0xd38(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2c9f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x7c(%rbp)
jmp    1492 <main+0x2d2>
mov    -0x14(%rbp),%edi
mov    0x2c8c(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1060 <lseek@plt>
mov    %eax,%ecx
mov    %ecx,-0x34(%rbp)
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1383 <main+0x1c3>
lea    0xcf4(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2c56(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x7c(%rbp)
jmp    1492 <main+0x2d2>
lea    0xcd6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xcd7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xcd5(%rip),%rdi
lea    -0x39(%rbp),%rsi
call   10a0 <scanf@plt>
mov    -0x14(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x38(%rbp),%edx
call   1040 <write@plt>
mov    %eax,%ecx
mov    %ecx,-0x34(%rbp)
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    13f4 <main+0x234>
lea    0xc7e(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2be5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x7c(%rbp)
jmp    1492 <main+0x2d2>
movslq -0x34(%rbp),%rcx
mov    -0x30(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
xor    %eax,%eax
mov    %eax,-0x8c(%rbp)
mov    %eax,%esi
lea    -0x60(%rbp),%rdi
call   1070 <gettimeofday@plt>
mov    -0x8c(%rbp),%eax
mov    -0x30(%rbp),%rsi
lea    0xc57(%rip),%rdi
call   1050 <printf@plt>
movaps 0xbcd(%rip),%xmm1
movq   -0x30(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xbcc(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x60(%rbp),%eax
sub    -0x50(%rbp),%eax
imul   $0xf4240,%eax,%eax
cvtsi2sd %eax,%xmm1
addsd  -0x58(%rbp),%xmm1
subsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xc16(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x2b3a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x7c(%rbp)
mov    -0x68(%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   %r12
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%r12
mov    0x2e07(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xe28(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     134f <main+0x17f>
lea    0xe2a(%rip),%rsi
lea    0xe28(%rip),%rcx
mov    %rbx,%rdi
mov    %rax,%rdx
call   10e0 <sprintf@plt>
mov    0x2d7f(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   10c0 <open@plt>
mov    %eax,%ebx
lea    -0x28(%rbp),%rsi
mov    %eax,%edi
call   10f0 <fstat@plt>
mov    -0x28(%rbp),%r14d
mov    %r14d,%edi
call   10a0 <malloc@plt>
test   %rax,%rax
je     136f <main+0x19f>
mov    %rax,%r15
lea    -0x48(%rbp),%rdi
xor    %esi,%esi
call   1080 <gettimeofday@plt>
mov    %ebx,%edi
mov    %r15,%rsi
mov    %r14d,%edx
call   1050 <write@plt>
cmp    $0xffffffff,%eax
je     1366 <main+0x196>
mov    0x2d48(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
xor    %esi,%esi
call   1070 <lseek@plt>
cmp    $0xffffffff,%eax
je     1378 <main+0x1a8>
lea    0xde3(%rip),%rdi
call   1040 <puts@plt>
lea    0xde5(%rip),%rdi
call   1040 <puts@plt>
lea    0xda5(%rip),%rdi
lea    -0x21(%rbp),%rsi
call   10b0 <scanf@plt>
mov    %ebx,%edi
mov    %r15,%rsi
mov    %r14d,%edx
call   1050 <write@plt>
cmp    $0xffffffff,%eax
je     1366 <main+0x196>
movslq %eax,%rbx
lea    -0x38(%rbp),%rdi
xor    %esi,%esi
call   1080 <gettimeofday@plt>
lea    0xd74(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
movq   %rbx,%xmm1
punpckldq 0xcfa(%rip),%xmm1
subpd  0xd02(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
mov    -0x38(%rbp),%eax
sub    -0x48(%rbp),%eax
imul   $0xf4240,%eax,%eax
cvtsi2sd %eax,%xmm2
addsd  -0x30(%rbp),%xmm2
addsd  %xmm1,%xmm0
subsd  -0x40(%rbp),%xmm2
divsd  %xmm2,%xmm0
lea    0xd34(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    0x2c73(%rip),%rax
jmp    138b <main+0x1bb>
mov    0x2c82(%rip),%rax
mov    (%rax),%edi
lea    0xcc1(%rip),%rsi
call   1090 <fprintf@plt>
jmp    1384 <main+0x1b4>
lea    0xce8(%rip),%rdi
jmp    137f <main+0x1af>
lea    0xcd8(%rip),%rdi
jmp    137f <main+0x1af>
lea    0xcdb(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2c3d(%rip),%rax
mov    (%rax),%eax
mov    %r12,%rsp
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.timeval = type { i32, double }
@PATH_MAX = global i32 0
@.str = [23 x i8] c"CBB_CLIENT_MOUNT_POINT\00"
@stderr = global i32 0
@.str.1 = [34 x i8] c"please set CBB_CLIENT_MOUNT_POINT\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [5 x i8] c"%s%s\00"
@.str.3 = [7 x i8] c"/test1\00"
@O_WRONLY = global i32 0
@.str.4 = [7 x i8] c"malloc\00"
@.str.5 = [5 x i8] c"read\00"
@SEEK_SET = global i32 0
@.str.6 = [6 x i8] c"lseek\00"
@.str.7 = [15 x i8] c"seek to begin\0A\00"
@.str.8 = [12 x i8] c"read again\0A\00"
@.str.9 = [3 x i8] c"%c\00"
@.str.10 = [16 x i8] c"total size %lu\0A\00"
@.str.11 = [19 x i8] c"throughput %fMB/s\0A\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 i8*
%11 = alloca i64
%12 = alloca i32
%13 = alloca %struct.stat
%14 = alloca i8
%15 = alloca %struct.timeval
%16 = alloca %struct.timeval
%17 = alloca i8*
%18 = alloca i64
%19 = alloca i8*
%20 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %9
store i8* null, i8** %10
store i64 0, i64* %11
%21 = load i32, i32* @PATH_MAX
%22 = zext i32 %21 to i64
%23 = call i8* @llvm.stacksave()
store i8* %23, i8** %17
%24 = alloca i8, i64 %22
store i64 %22, i64* %18
%25 = call i8* @getenv(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i8* %25, i8** %19
%26 = load i8*, i8** %19
%27 = icmp eq i8* null, %26
br i1 %27, label %28, label %32
28: ; preds = %2
%29 = load i32, i32* @stderr
%30 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%31 = load i32, i32* @EXIT_FAILURE
store i32 %31, i32* %3
store i32 1, i32* %20
br label %104
32: ; preds = %2
%33 = load i8*, i8** %19
%34 = call i32 @sprintf(i8* %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %33, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%35 = load i32, i32* @O_WRONLY
%36 = call i32 @open(i8* %24, i32 %35)
store i32 %36, i32* %6
%37 = load i32, i32* %6
%38 = call i32 @fstat(i32 %37, %struct.stat* %13)
%39 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 0
%40 = load i32, i32* %39
%41 = call i8* @malloc(i32 %40)
store i8* %41, i8** %10
%42 = icmp eq i8* null, %41
br i1 %42, label %43, label %46
43: ; preds = %32
%44 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%45 = load i32, i32* @EXIT_FAILURE
store i32 %45, i32* %3
store i32 1, i32* %20
br label %104
46: ; preds = %32
%47 = call i32 @gettimeofday(%struct.timeval* %15, i32* null)
%48 = load i32, i32* %6
%49 = load i8*, i8** %10
%50 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 0
%51 = load i32, i32* %50
%52 = call i32 @write(i32 %48, i8* %49, i32 %51)
store i32 %52, i32* %12
%53 = icmp eq i32 -1, %52
br i1 %53, label %54, label %57
54: ; preds = %46
%55 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%56 = load i32, i32* @EXIT_FAILURE
store i32 %56, i32* %3
store i32 1, i32* %20
br label %104
57: ; preds = %46
%58 = load i32, i32* %6
%59 = load i32, i32* @SEEK_SET
%60 = call i32 @lseek(i32 %58, i32 0, i32 %59)
store i32 %60, i32* %12
%61 = icmp eq i32 -1, %60
br i1 %61, label %62, label %65
62: ; preds = %57
%63 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%64 = load i32, i32* @EXIT_FAILURE
store i32 %64, i32* %3
store i32 1, i32* %20
br label %104
65: ; preds = %57
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%68 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %14)
%69 = load i32, i32* %6
%70 = load i8*, i8** %10
%71 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 0
%72 = load i32, i32* %71
%73 = call i32 @write(i32 %69, i8* %70, i32 %72)
store i32 %73, i32* %12
%74 = icmp eq i32 -1, %73
br i1 %74, label %75, label %78
75: ; preds = %65
%76 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%77 = load i32, i32* @EXIT_FAILURE
store i32 %77, i32* %3
store i32 1, i32* %20
br label %104
78: ; preds = %65
%79 = load i32, i32* %12
%80 = sext i32 %79 to i64
%81 = load i64, i64* %11
%82 = add i64 %81, %80
store i64 %82, i64* %11
%83 = call i32 @gettimeofday(%struct.timeval* %16, i32* null)
%84 = load i64, i64* %11
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i64 %84)
%86 = load i64, i64* %11
%87 = uitofp i64 %86 to double
%88 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 0
%89 = load i32, i32* %88
%90 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 0
%91 = load i32, i32* %90
%92 = sub nsw i32 %89, %91
%93 = mul nsw i32 %92, 1000000
%94 = sitofp i32 %93 to double
%95 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 1
%96 = load double, double* %95
%97 = fadd double %94, %96
%98 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 1
%99 = load double, double* %98
%100 = fsub double %97, %99
%101 = fdiv double %87, %100
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), double %101)
%103 = load i32, i32* @EXIT_SUCCESS
store i32 %103, i32* %3
store i32 1, i32* %20
br label %104
104: ; preds = %78, %75, %62, %54, %43, %28
%105 = load i8*, i8** %17
%106 = load i32, i32* %3
ret i32 %106
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.timeval = type { i32, double }
@PATH_MAX = global i32 0
@.str = [23 x i8] c"CBB_CLIENT_MOUNT_POINT\00"
@stderr = global i32 0
@.str.1 = [34 x i8] c"please set CBB_CLIENT_MOUNT_POINT\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [5 x i8] c"%s%s\00"
@.str.3 = [7 x i8] c"/test1\00"
@O_WRONLY = global i32 0
@.str.4 = [7 x i8] c"malloc\00"
@.str.5 = [5 x i8] c"read\00"
@SEEK_SET = global i32 0
@.str.6 = [6 x i8] c"lseek\00"
@.str.9 = [3 x i8] c"%c\00"
@.str.10 = [16 x i8] c"total size %lu\0A\00"
@.str.11 = [19 x i8] c"throughput %fMB/s\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [14 x i8] c"seek to begin\00"
@str.12 = [11 x i8] c"read again\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.stat
%4 = alloca i8
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = bitcast %struct.stat* %3 to i8*
%8 = bitcast %struct.timeval* %5 to i8*
%9 = bitcast %struct.timeval* %6 to i8*
%10 = load i32, i32* @PATH_MAX
%11 = zext i32 %10 to i64
%12 = tail call i8* @llvm.stacksave()
%13 = alloca i8, i64 %11
%14 = tail call i8* @getenv(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %70
19: ; preds = %2
%20 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%21 = load i32, i32* @O_WRONLY
%22 = call i32 @open(i8* %13, i32 %21)
%23 = call i32 @fstat(i32 %22, %struct.stat* %3)
%24 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%25 = load i32, i32* %24
%26 = tail call i8* @malloc(i32 %25)
%27 = icmp eq i8* %26, null
br i1 %27, label %28, label %30
28: ; preds = %19
%29 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %70
30: ; preds = %19
%31 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%32 = tail call i32 @write(i32 %22, i8* %26, i32 %25)
%33 = icmp eq i32 %32, -1
br i1 %33, label %34, label %36
34: ; preds = %30
%35 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %70
36: ; preds = %30
%37 = load i32, i32* @SEEK_SET
%38 = tail call i32 @lseek(i32 %22, i32 0, i32 %37)
%39 = icmp eq i32 %38, -1
br i1 %39, label %40, label %42
40: ; preds = %36
%41 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %70
42: ; preds = %36
%43 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%44 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.12, i64 0, i64 0))
%45 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %4)
%46 = call i32 @write(i32 %22, i8* %26, i32 %25)
%47 = icmp eq i32 %46, -1
br i1 %47, label %48, label %50
48: ; preds = %42
%49 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %70
50: ; preds = %42
%51 = sext i32 %46 to i64
%52 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i64 %51)
%54 = uitofp i64 %51 to double
%55 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 0
%56 = load i32, i32* %55
%57 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
%58 = load i32, i32* %57
%59 = sub nsw i32 %56, %58
%60 = mul nsw i32 %59, 1000000
%61 = sitofp i32 %60 to double
%62 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 1
%63 = load double, double* %62
%64 = fadd double %63, %61
%65 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 1
%66 = load double, double* %65
%67 = fsub double %64, %66
%68 = fdiv double %54, %67
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), double %68)
br label %70
70: ; preds = %50, %48, %40, %34, %28, %16
%71 = phi i32* [ @EXIT_FAILURE, %16 ], [ @EXIT_FAILURE, %28 ], [ @EXIT_FAILURE, %34 ], [ @EXIT_FAILURE, %40 ], [ @EXIT_FAILURE, %48 ], [ @EXIT_SUCCESS, %50 ]
%72 = load i32, i32* %71
ret i32 %72
}