#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 ssize_t;

/* Variables and functions */
scalar_t__ EEXIST;
int O_CREAT;
int O_EXCL;
int O_WRONLY;
int atoi(char *);
scalar_t__ errno;
scalar_t__ fsync(int);
char *malloc(int);
scalar_t__ mono_time(double *);
int open(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int strlen(char *);
int write(int, char *, int);
int main(int argc, char **argv) {
  double t0, t1;
  if (argc != 5) {
    puts("Usage: syncbench file write_size write_qty (d|s)");
    return 1;
  }
  if (strlen(argv[4]) != 1) {
    puts("You're a bad person.");
    return 1;
  }
  int d;
  if (argv[4][0] == 'd') {
    d = 1;
  } else if (argv[4][0] == 's') {
    d = 0;
  } else {
    puts("That last parameter should have been either 'd' or 's'.");
    return 1;
  }
  int write_size = atoi(argv[2]);
  int no_of_writes = atoi(argv[3]);
  if ((write_size <= 0) || (no_of_writes <= 0)) {
    puts("You want me to write no bytes?");
    return 1;
  }
  int fd = open(argv[1], O_CREAT | O_WRONLY | O_EXCL);
  if (fd == -1) {
    if (errno == EEXIST) {
      printf("Refusing to nuke existing file %s.\n", argv[1]);
    } else {
      printf("Can't open %s for write.\n", argv[1]);
    }
    return 1;
  }
  char *bytes = malloc(write_size);
  if (bytes == NULL) {
    puts("malloc() failed, FML.");
    return 1;
  }
  int i;
  for (i = 0; i < write_size; i++) {
    bytes[i] = '0' + (i % 10);
  }
  if (mono_time(&t0)) {
    puts("can't consult a clock.");
    return 1;
  }
  for (i = 0; i < no_of_writes; i++) {
    ssize_t r = write(fd, bytes, write_size);
    if (r != write_size) {
      puts("write() failed.");
      return 1;
    }
    if (d) {
      if (fsync(fd)) {
        puts("fdatasync() failed.");
        return 1;
      }
    } else {
      if (fsync(fd)) {
        puts("fsync() failed.");
        return 1;
      }
    }
  }
  if (mono_time(&t1)) {
    puts("really, can't consult the clock?");
    return 1;
  }
  char *c = d ? "fdatasync" : "fsync";
  printf("Performed %d %s()s in %f seconds.\n", no_of_writes, c, t1 - t0);
  double rate = no_of_writes / (t1 - t0);
  printf("That's %f calls/second, or %f seconds/call.\n", rate, 1 / rate);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     11c8 <main+0x38>
lea    0xe51(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1528 <main+0x398>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1060 <strlen@plt>
cmp    $0x1,%eax
je     11f6 <main+0x66>
lea    0xe54(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1528 <main+0x398>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
movsbl (%rax),%eax
cmp    $0x64,%eax
jne    1216 <main+0x86>
movl   $0x1,-0x24(%rbp)
jmp    1253 <main+0xc3>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
movsbl (%rax),%eax
cmp    $0x73,%eax
jne    1236 <main+0xa6>
movl   $0x0,-0x24(%rbp)
jmp    124e <main+0xbe>
lea    0xe11(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1528 <main+0x398>
jmp    1253 <main+0xc3>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x28(%rbp)
jle    1287 <main+0xf7>
cmpl   $0x0,-0x2c(%rbp)
jg     129f <main+0x10f>
lea    0xdf8(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1528 <main+0x398>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2d4a(%rip),%rax
mov    (%rax),%esi
mov    0x2d01(%rip),%rax
or     (%rax),%esi
mov    0x2d10(%rip),%rax
or     (%rax),%esi
call   10a0 <open@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0xffffffff,-0x30(%rbp)
jne    132b <main+0x19b>
mov    0x2ced(%rip),%rax
mov    (%rax),%rax
mov    0x2cf3(%rip),%rcx
cmp    (%rcx),%rax
jne    1309 <main+0x179>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xda8(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    131f <main+0x18f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdb1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1528 <main+0x398>
mov    -0x28(%rbp),%edi
call   1080 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    135a <main+0x1ca>
lea    0xd9a(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1528 <main+0x398>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    1394 <main+0x204>
mov    -0x3c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1361 <main+0x1d1>
lea    -0x18(%rbp),%rdi
call   1050 <mono_time@plt>
cmp    $0x0,%rax
je     13bf <main+0x22f>
lea    0xd4b(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1528 <main+0x398>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1483 <main+0x2f3>
mov    -0x30(%rbp),%edi
mov    -0x38(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1040 <write@plt>
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x28(%rbp),%eax
je     1408 <main+0x278>
lea    0xd19(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1528 <main+0x398>
cmpl   $0x0,-0x24(%rbp)
je     1441 <main+0x2b1>
mov    -0x30(%rbp),%edi
call   1090 <fsync@plt>
cmp    $0x0,%rax
je     143c <main+0x2ac>
lea    0xcf5(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1528 <main+0x398>
jmp    1470 <main+0x2e0>
mov    -0x30(%rbp),%edi
call   1090 <fsync@plt>
cmp    $0x0,%rax
je     146b <main+0x2db>
lea    0xcda(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1528 <main+0x398>
jmp    1470 <main+0x2e0>
jmp    1475 <main+0x2e5>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    13c6 <main+0x236>
lea    -0x20(%rbp),%rdi
call   1050 <mono_time@plt>
cmp    $0x0,%rax
je     14ae <main+0x31e>
lea    0xca7(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1528 <main+0x398>
mov    -0x24(%rbp),%edx
lea    0xcb7(%rip),%rax
lea    0xca6(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x2c(%rbp),%esi
mov    -0x48(%rbp),%rdx
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
lea    0xc93(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
cvtsi2sdl -0x2c(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  0xaf2(%rip),%xmm1
divsd  -0x50(%rbp),%xmm1
lea    0xc7e(%rip),%rdi
mov    $0x2,%al
call   1070 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
cmp    $0x5,%edi
jne    123c <main+0xac>
mov    %rsi,%rbx
mov    0x20(%rsi),%rdi
call   1060 <strlen@plt>
cmp    $0x1,%eax
jne    1245 <main+0xb5>
mov    0x20(%rbx),%rax
mov    (%rax),%r12b
cmp    $0x64,%r12b
je     11cf <main+0x3f>
cmp    $0x73,%r12b
jne    124e <main+0xbe>
mov    0x10(%rbx),%rdi
call   10b0 <atoi@plt>
mov    %eax,%r13d
mov    0x18(%rbx),%rdi
call   10b0 <atoi@plt>
test   %r13d,%r13d
jle    1257 <main+0xc7>
mov    %eax,%r14d
test   %eax,%eax
jle    1257 <main+0xc7>
mov    0x2e01(%rip),%rax
mov    0x2dba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x8(%rbx),%rdi
mov    0x2dc3(%rip),%rax
or     (%rax),%esi
call   10a0 <open@plt>
cmp    $0xffffffff,%eax
je     1277 <main+0xe7>
mov    %eax,%r15d
mov    %r13d,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     12a1 <main+0x111>
mov    %rax,%rbx
mov    %r13d,%ebp
cmp    $0x10,%r13d
jae    12aa <main+0x11a>
xor    %ecx,%ecx
jmp    174d <main+0x5bd>
lea    0xe65(%rip),%rdi
jmp    125e <main+0xce>
lea    0xe8d(%rip),%rdi
jmp    125e <main+0xce>
lea    0xe99(%rip),%rdi
jmp    125e <main+0xce>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d4a(%rip),%rax
mov    (%rax),%rax
mov    0x2d50(%rip),%rcx
mov    0x8(%rbx),%rsi
cmp    (%rcx),%rax
jne    171f <main+0x58f>
lea    0xea9(%rip),%rdi
jmp    1726 <main+0x596>
lea    0xedb(%rip),%rdi
jmp    125e <main+0xce>
mov    %ebp,%ecx
and    $0xfffffff0,%ecx
lea    -0x10(%rcx),%rsi
mov    %rsi,%rdx
shr    $0x4,%rdx
add    $0x1,%rdx
test   %rsi,%rsi
je     1732 <main+0x5a2>
mov    %rdx,%rdi
and    $0xfffffffffffffffe,%rdi
movdqa 0xd3a(%rip),%xmm4
movdqa 0xd41(%rip),%xmm14
movdqa 0xd49(%rip),%xmm6
movdqa 0xd50(%rip),%xmm13
xor    %esi,%esi
movdqa 0xd55(%rip),%xmm12
movdqa 0xd5c(%rip),%xmm11
movdqa 0xd63(%rip),%xmm8
movdqa 0xd6a(%rip),%xmm9
movdqa 0xd71(%rip),%xmm10
nop
movdqa %xmm14,%xmm0
pmuludq %xmm12,%xmm0
pshufd $0xed,%xmm0,%xmm0
pshufd $0xf5,%xmm14,%xmm1
pmuludq %xmm12,%xmm1
pshufd $0xed,%xmm1,%xmm1
punpckldq %xmm1,%xmm0
psrld  $0x3,%xmm0
pshufd $0xf5,%xmm0,%xmm1
pmuludq %xmm11,%xmm0
pshufd $0xe8,%xmm0,%xmm2
pmuludq %xmm11,%xmm1
pshufd $0xe8,%xmm1,%xmm0
punpckldq %xmm0,%xmm2
movdqa %xmm14,%xmm0
psubd  %xmm2,%xmm0
movdqa %xmm4,%xmm1
pmuludq %xmm12,%xmm1
pshufd $0xed,%xmm1,%xmm1
pshufd $0xf5,%xmm4,%xmm2
pmuludq %xmm12,%xmm2
pshufd $0xed,%xmm2,%xmm2
punpckldq %xmm2,%xmm1
psrld  $0x3,%xmm1
pshufd $0xf5,%xmm1,%xmm2
pmuludq %xmm11,%xmm1
pshufd $0xe8,%xmm1,%xmm1
pmuludq %xmm11,%xmm2
pshufd $0xe8,%xmm2,%xmm2
punpckldq %xmm2,%xmm1
movdqa %xmm4,%xmm2
psubd  %xmm1,%xmm2
packuswb %xmm2,%xmm0
movdqa %xmm13,%xmm1
pmuludq %xmm12,%xmm1
pshufd $0xed,%xmm1,%xmm1
pshufd $0xf5,%xmm13,%xmm2
pmuludq %xmm12,%xmm2
pshufd $0xed,%xmm2,%xmm2
punpckldq %xmm2,%xmm1
psrld  $0x3,%xmm1
pshufd $0xf5,%xmm1,%xmm2
pmuludq %xmm11,%xmm1
pshufd $0xe8,%xmm1,%xmm1
pmuludq %xmm11,%xmm2
pshufd $0xe8,%xmm2,%xmm2
punpckldq %xmm2,%xmm1
movdqa %xmm13,%xmm2
psubd  %xmm1,%xmm2
movdqa %xmm6,%xmm1
pmuludq %xmm12,%xmm1
pshufd $0xed,%xmm1,%xmm1
pshufd $0xf5,%xmm6,%xmm5
pmuludq %xmm12,%xmm5
pshufd $0xed,%xmm5,%xmm5
punpckldq %xmm5,%xmm1
psrld  $0x3,%xmm1
pshufd $0xf5,%xmm1,%xmm5
pmuludq %xmm11,%xmm1
pshufd $0xe8,%xmm1,%xmm1
pmuludq %xmm11,%xmm5
pshufd $0xe8,%xmm5,%xmm5
punpckldq %xmm5,%xmm1
movdqa %xmm6,%xmm5
psubd  %xmm1,%xmm5
packuswb %xmm5,%xmm2
packuswb %xmm0,%xmm2
por    %xmm8,%xmm2
movdqu %xmm2,(%rbx,%rsi,1)
movdqa %xmm6,%xmm2
paddd  %xmm9,%xmm2
movdqa %xmm13,%xmm0
paddd  %xmm9,%xmm0
movdqa %xmm4,%xmm5
paddd  %xmm9,%xmm5
movdqa %xmm14,%xmm3
paddd  %xmm9,%xmm3
movdqa %xmm3,%xmm1
pmuludq %xmm12,%xmm1
pshufd $0xed,%xmm1,%xmm1
pshufd $0xf5,%xmm3,%xmm7
pmuludq %xmm12,%xmm7
pshufd $0xed,%xmm7,%xmm7
punpckldq %xmm7,%xmm1
psrld  $0x3,%xmm1
pshufd $0xf5,%xmm1,%xmm7
pmuludq %xmm11,%xmm1
pshufd $0xe8,%xmm1,%xmm1
pmuludq %xmm11,%xmm7
pshufd $0xe8,%xmm7,%xmm7
punpckldq %xmm7,%xmm1
psubd  %xmm1,%xmm3
movdqa %xmm5,%xmm1
pmuludq %xmm12,%xmm1
pshufd $0xed,%xmm1,%xmm1
pshufd $0xf5,%xmm5,%xmm7
pmuludq %xmm12,%xmm7
pshufd $0xed,%xmm7,%xmm7
punpckldq %xmm7,%xmm1
psrld  $0x3,%xmm1
pshufd $0xf5,%xmm1,%xmm7
pmuludq %xmm11,%xmm1
pshufd $0xe8,%xmm1,%xmm1
pmuludq %xmm11,%xmm7
pshufd $0xe8,%xmm7,%xmm7
punpckldq %xmm7,%xmm1
psubd  %xmm1,%xmm5
packuswb %xmm5,%xmm3
movdqa %xmm0,%xmm1
pmuludq %xmm12,%xmm1
pshufd $0xed,%xmm1,%xmm1
pshufd $0xf5,%xmm0,%xmm5
pmuludq %xmm12,%xmm5
pshufd $0xed,%xmm5,%xmm5
punpckldq %xmm5,%xmm1
psrld  $0x3,%xmm1
pshufd $0xf5,%xmm1,%xmm5
pmuludq %xmm11,%xmm1
pshufd $0xe8,%xmm1,%xmm1
pmuludq %xmm11,%xmm5
pshufd $0xe8,%xmm5,%xmm5
punpckldq %xmm5,%xmm1
psubd  %xmm1,%xmm0
movdqa %xmm2,%xmm1
pmuludq %xmm12,%xmm1
pshufd $0xed,%xmm1,%xmm1
pshufd $0xf5,%xmm2,%xmm5
pmuludq %xmm12,%xmm5
pshufd $0xed,%xmm5,%xmm5
punpckldq %xmm5,%xmm1
psrld  $0x3,%xmm1
pshufd $0xf5,%xmm1,%xmm5
pmuludq %xmm11,%xmm1
pshufd $0xe8,%xmm1,%xmm1
pmuludq %xmm11,%xmm5
pshufd $0xe8,%xmm5,%xmm5
punpckldq %xmm5,%xmm1
psubd  %xmm1,%xmm2
packuswb %xmm2,%xmm0
packuswb %xmm3,%xmm0
por    %xmm8,%xmm0
movdqu %xmm0,0x10(%rbx,%rsi,1)
add    $0x20,%rsi
paddd  %xmm10,%xmm13
paddd  %xmm10,%xmm6
paddd  %xmm10,%xmm14
paddd  %xmm10,%xmm4
add    $0xfffffffffffffffe,%rdi
jne    1320 <main+0x190>
movdqa %xmm14,%xmm0
pmuludq %xmm12,%xmm0
pshufd $0xed,%xmm0,%xmm0
pshufd $0xf5,%xmm14,%xmm1
pmuludq %xmm12,%xmm1
pshufd $0xed,%xmm1,%xmm1
punpckldq %xmm1,%xmm0
psrld  $0x3,%xmm0
pshufd $0xf5,%xmm0,%xmm1
pmuludq %xmm11,%xmm0
pshufd $0xe8,%xmm0,%xmm0
pmuludq %xmm11,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpckldq %xmm1,%xmm0
psubd  %xmm0,%xmm14
movdqa %xmm4,%xmm0
pmuludq %xmm12,%xmm0
pshufd $0xed,%xmm0,%xmm0
pshufd $0xf5,%xmm4,%xmm1
pmuludq %xmm12,%xmm1
pshufd $0xed,%xmm1,%xmm1
punpckldq %xmm1,%xmm0
psrld  $0x3,%xmm0
pshufd $0xf5,%xmm0,%xmm1
pmuludq %xmm11,%xmm0
pshufd $0xe8,%xmm0,%xmm0
pmuludq %xmm11,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpckldq %xmm1,%xmm0
psubd  %xmm0,%xmm4
packuswb %xmm4,%xmm14
movdqa %xmm13,%xmm0
pmuludq %xmm12,%xmm0
pshufd $0xed,%xmm0,%xmm0
pshufd $0xf5,%xmm13,%xmm1
pmuludq %xmm12,%xmm1
pshufd $0xed,%xmm1,%xmm1
punpckldq %xmm1,%xmm0
psrld  $0x3,%xmm0
pshufd $0xf5,%xmm0,%xmm1
pmuludq %xmm11,%xmm0
pshufd $0xe8,%xmm0,%xmm0
pmuludq %xmm11,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpckldq %xmm1,%xmm0
psubd  %xmm0,%xmm13
movdqa %xmm6,%xmm0
pmuludq %xmm12,%xmm0
pshufd $0xed,%xmm0,%xmm0
pshufd $0xf5,%xmm6,%xmm1
pmuludq %xmm12,%xmm1
pshufd $0xed,%xmm1,%xmm1
punpckldq %xmm1,%xmm0
psrld  $0x3,%xmm0
pshufd $0xf5,%xmm0,%xmm1
pmuludq %xmm11,%xmm0
pshufd $0xe8,%xmm0,%xmm0
pmuludq %xmm11,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpckldq %xmm1,%xmm0
psubd  %xmm0,%xmm6
packuswb %xmm6,%xmm13
packuswb %xmm14,%xmm13
por    0x953(%rip),%xmm13
jmp    173d <main+0x5ad>
lea    0xa43(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1263 <main+0xd3>
movdqa 0x8c5(%rip),%xmm13
xor    %esi,%esi
test   $0x1,%dl
je     1748 <main+0x5b8>
movdqu %xmm13,(%rbx,%rsi,1)
cmp    %rbp,%rcx
je     1785 <main+0x5f5>
mov    $0xcccccccd,%edx
mov    %rcx,%rsi
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%edi
imul   %rdx,%rdi
shr    $0x23,%rdi
add    %edi,%edi
lea    (%rdi,%rdi,4),%edi
mov    %ecx,%eax
sub    %dil,%al
or     $0x30,%al
mov    %al,(%rbx,%rsi,1)
add    $0x1,%rsi
add    $0x1,%ecx
cmp    %rsi,%rbp
jne    1760 <main+0x5d0>
lea    0x10(%rsp),%rdi
call   1050 <mono_time@plt>
test   %rax,%rax
je     17a0 <main+0x610>
lea    0x9fe(%rip),%rdi
jmp    125e <main+0xce>
test   %r14d,%r14d
jle    17ea <main+0x65a>
mov    %r14d,%ebp
jmp    17b8 <main+0x628>
test   %rax,%rax
jne    187d <main+0x6ed>
add    $0xffffffff,%ebp
je     17ea <main+0x65a>
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %r13d,%edx
call   1040 <write@plt>
cmp    %r13d,%eax
jne    1805 <main+0x675>
mov    %r15d,%edi
call   1090 <fsync@plt>
cmp    $0x64,%r12b
jne    17aa <main+0x61a>
test   %rax,%rax
je     17b3 <main+0x623>
lea    0x9db(%rip),%rdi
jmp    125e <main+0xce>
lea    0x8(%rsp),%rdi
call   1050 <mono_time@plt>
test   %rax,%rax
je     1811 <main+0x681>
lea    0x9e4(%rip),%rdi
jmp    125e <main+0xce>
lea    0x9a4(%rip),%rdi
jmp    125e <main+0xce>
cmp    $0x64,%r12b
lea    0x9e9(%rip),%rax
lea    0x9ec(%rip),%rdx
cmove  %rax,%rdx
movsd  0x8(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
lea    0x9db(%rip),%rdi
mov    %r14d,%esi
mov    $0x1,%al
call   1070 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
movsd  0x8(%rsp),%xmm1
subsd  0x10(%rsp),%xmm1
divsd  %xmm1,%xmm0
movsd  0x83c(%rip),%xmm1
divsd  %xmm0,%xmm1
lea    0x9c9(%rip),%rdi
mov    $0x2,%al
call   1070 <printf@plt>
xor    %eax,%eax
jmp    1268 <main+0xd8>
lea    0x950(%rip),%rdi
jmp    125e <main+0xce>

LLVM IR (-O0):
@.str = [49 x i8] c"Usage: syncbench file write_size write_qty (d|s)\00"
@.str.1 = [21 x i8] c"You're a bad person.\00"
@.str.2 = [56 x i8] c"That last parameter should have been either 'd' or 's'.\00"
@.str.3 = [31 x i8] c"You want me to write no bytes?\00"
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_EXCL = global i32 0
@errno = global i64 0
@EEXIST = global i64 0
@.str.4 = [36 x i8] c"Refusing to nuke existing file %s.\0A\00"
@.str.5 = [26 x i8] c"Can't open %s for write.\0A\00"
@.str.6 = [22 x i8] c"malloc() failed, FML.\00"
@.str.7 = [23 x i8] c"can't consult a clock.\00"
@.str.8 = [16 x i8] c"write() failed.\00"
@.str.9 = [20 x i8] c"fdatasync() failed.\00"
@.str.10 = [16 x i8] c"fsync() failed.\00"
@.str.11 = [33 x i8] c"really, can't consult the clock?\00"
@.str.12 = [10 x i8] c"fdatasync\00"
@.str.13 = [6 x i8] c"fsync\00"
@.str.14 = [35 x i8] c"Performed %d %s()s in %f seconds.\0A\00"
@.str.15 = [45 x i8] c"That's %f calls/second, or %f seconds/call.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 5
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = call i32 @puts(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %184
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 4
%24 = load i8*, i8** %23
%25 = call i32 @strlen(i8* %24)
%26 = icmp ne i32 %25, 1
br i1 %26, label %27, label %29
27: ; preds = %21
%28 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %184
29: ; preds = %21
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 4
%32 = load i8*, i8** %31
%33 = getelementptr inbounds i8, i8* %32, i64 0
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 100
br i1 %36, label %37, label %38
37: ; preds = %29
store i32 1, i32* %8
br label %50
38: ; preds = %29
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 4
%41 = load i8*, i8** %40
%42 = getelementptr inbounds i8, i8* %41, i64 0
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 115
br i1 %45, label %46, label %47
46: ; preds = %38
store i32 0, i32* %8
br label %49
47: ; preds = %38
%48 = call i32 @puts(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %184
49: ; preds = %46
br label %50
50: ; preds = %49, %37
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 2
%53 = load i8*, i8** %52
%54 = call i32 @atoi(i8* %53)
store i32 %54, i32* %9
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 3
%57 = load i8*, i8** %56
%58 = call i32 @atoi(i8* %57)
store i32 %58, i32* %10
%59 = load i32, i32* %9
%60 = icmp sle i32 %59, 0
br i1 %60, label %64, label %61
61: ; preds = %50
%62 = load i32, i32* %10
%63 = icmp sle i32 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %61, %50
%65 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %184
66: ; preds = %61
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 1
%69 = load i8*, i8** %68
%70 = load i32, i32* @O_CREAT
%71 = load i32, i32* @O_WRONLY
%72 = or i32 %70, %71
%73 = load i32, i32* @O_EXCL
%74 = or i32 %72, %73
%75 = call i32 @open(i8* %69, i32 %74)
store i32 %75, i32* %11
%76 = load i32, i32* %11
%77 = icmp eq i32 %76, -1
br i1 %77, label %78, label %93
78: ; preds = %66
%79 = load i64, i64* @errno
%80 = load i64, i64* @EEXIST
%81 = icmp eq i64 %79, %80
br i1 %81, label %82, label %87
82: ; preds = %78
%83 = load i8**, i8*** %5
%84 = getelementptr inbounds i8*, i8** %83, i64 1
%85 = load i8*, i8** %84
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i8* %85)
br label %92
87: ; preds = %78
%88 = load i8**, i8*** %5
%89 = getelementptr inbounds i8*, i8** %88, i64 1
%90 = load i8*, i8** %89
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %90)
br label %92
92: ; preds = %87, %82
store i32 1, i32* %3
br label %184
93: ; preds = %66
%94 = load i32, i32* %9
%95 = call i8* @malloc(i32 %94)
store i8* %95, i8** %12
%96 = load i8*, i8** %12
%97 = icmp eq i8* %96, null
br i1 %97, label %98, label %100
98: ; preds = %93
%99 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %184
100: ; preds = %93
store i32 0, i32* %13
br label %101
101: ; preds = %114, %100
%102 = load i32, i32* %13
%103 = load i32, i32* %9
%104 = icmp slt i32 %102, %103
br i1 %104, label %105, label %117
105: ; preds = %101
%106 = load i32, i32* %13
%107 = srem i32 %106, 10
%108 = add nsw i32 48, %107
%109 = trunc i32 %108 to i8
%110 = load i8*, i8** %12
%111 = load i32, i32* %13
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i8, i8* %110, i64 %112
store i8 %109, i8* %113
br label %114
114: ; preds = %105
%115 = load i32, i32* %13
%116 = add nsw i32 %115, 1
store i32 %116, i32* %13
br label %101
117: ; preds = %101
%118 = call i64 @mono_time(double* %6)
%119 = icmp ne i64 %118, 0
br i1 %119, label %120, label %122
120: ; preds = %117
%121 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %3
br label %184
122: ; preds = %117
store i32 0, i32* %13
br label %123
123: ; preds = %155, %122
%124 = load i32, i32* %13
%125 = load i32, i32* %10
%126 = icmp slt i32 %124, %125
br i1 %126, label %127, label %158
127: ; preds = %123
%128 = load i32, i32* %11
%129 = load i8*, i8** %12
%130 = load i32, i32* %9
%131 = call i32 @write(i32 %128, i8* %129, i32 %130)
store i32 %131, i32* %14
%132 = load i32, i32* %14
%133 = load i32, i32* %9
%134 = icmp ne i32 %132, %133
br i1 %134, label %135, label %137
135: ; preds = %127
%136 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
store i32 1, i32* %3
br label %184
137: ; preds = %127
%138 = load i32, i32* %8
%139 = icmp ne i32 %138, 0
br i1 %139, label %140, label %147
140: ; preds = %137
%141 = load i32, i32* %11
%142 = call i64 @fsync(i32 %141)
%143 = icmp ne i64 %142, 0
br i1 %143, label %144, label %146
144: ; preds = %140
%145 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
store i32 1, i32* %3
br label %184
146: ; preds = %140
br label %154
147: ; preds = %137
%148 = load i32, i32* %11
%149 = call i64 @fsync(i32 %148)
%150 = icmp ne i64 %149, 0
br i1 %150, label %151, label %153
151: ; preds = %147
%152 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0))
store i32 1, i32* %3
br label %184
153: ; preds = %147
br label %154
154: ; preds = %153, %146
br label %155
155: ; preds = %154
%156 = load i32, i32* %13
%157 = add nsw i32 %156, 1
store i32 %157, i32* %13
br label %123
158: ; preds = %123
%159 = call i64 @mono_time(double* %7)
%160 = icmp ne i64 %159, 0
br i1 %160, label %161, label %163
161: ; preds = %158
%162 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0))
store i32 1, i32* %3
br label %184
163: ; preds = %158
%164 = load i32, i32* %8
%165 = icmp ne i32 %164, 0
%166 = zext i1 %165 to i64
%167 = select i1 %165, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0)
store i8* %167, i8** %15
%168 = load i32, i32* %10
%169 = load i8*, i8** %15
%170 = load double, double* %7
%171 = load double, double* %6
%172 = fsub double %170, %171
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0), i32 %168, i8* %169, double %172)
%174 = load i32, i32* %10
%175 = sitofp i32 %174 to double
%176 = load double, double* %7
%177 = load double, double* %6
%178 = fsub double %176, %177
%179 = fdiv double %175, %178
store double %179, double* %16
%180 = load double, double* %16
%181 = load double, double* %16
%182 = fdiv double 1.000000e+00, %181
%183 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.15, i64 0, i64 0), double %180, double %182)
store i32 0, i32* %3
br label %184
184: ; preds = %163, %161, %151, %144, %135, %120, %98, %92, %64, %47, %27, %19
%185 = load i32, i32* %3
ret i32 %185
}

LLVM IR (-O2):
@.str = [49 x i8] c"Usage: syncbench file write_size write_qty (d|s)\00"
@.str.1 = [21 x i8] c"You're a bad person.\00"
@.str.2 = [56 x i8] c"That last parameter should have been either 'd' or 's'.\00"
@.str.3 = [31 x i8] c"You want me to write no bytes?\00"
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_EXCL = global i32 0
@errno = global i64 0
@EEXIST = global i64 0
@.str.4 = [36 x i8] c"Refusing to nuke existing file %s.\0A\00"
@.str.5 = [26 x i8] c"Can't open %s for write.\0A\00"
@.str.6 = [22 x i8] c"malloc() failed, FML.\00"
@.str.7 = [23 x i8] c"can't consult a clock.\00"
@.str.8 = [16 x i8] c"write() failed.\00"
@.str.9 = [20 x i8] c"fdatasync() failed.\00"
@.str.10 = [16 x i8] c"fsync() failed.\00"
@.str.11 = [33 x i8] c"really, can't consult the clock?\00"
@.str.12 = [10 x i8] c"fdatasync\00"
@.str.13 = [6 x i8] c"fsync\00"
@.str.14 = [35 x i8] c"Performed %d %s()s in %f seconds.\0A\00"
@.str.15 = [45 x i8] c"That's %f calls/second, or %f seconds/call.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = icmp eq i32 %0, 5
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
br label %158
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 4
%12 = load i8*, i8** %11
%13 = tail call i32 @strlen(i8* %12)
%14 = icmp eq i32 %13, 1
br i1 %14, label %17, label %15
15: ; preds = %10
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %158
17: ; preds = %10
%18 = load i8*, i8** %11
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 100
switch i8 %19, label %21 [
i8 115, label %23
i8 100, label %23
]
21: ; preds = %17
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
br label %158
23: ; preds = %17, %17
%24 = getelementptr inbounds i8*, i8** %1, i64 2
%25 = load i8*, i8** %24
%26 = tail call i32 @atoi(i8* %25)
%27 = getelementptr inbounds i8*, i8** %1, i64 3
%28 = load i8*, i8** %27
%29 = tail call i32 @atoi(i8* %28)
%30 = icmp slt i32 %26, 1
%31 = icmp slt i32 %29, 1
%32 = select i1 %30, i1 true, i1 %31
br i1 %32, label %33, label %35
33: ; preds = %23
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %158
35: ; preds = %23
%36 = getelementptr inbounds i8*, i8** %1, i64 1
%37 = load i8*, i8** %36
%38 = load i32, i32* @O_CREAT
%39 = load i32, i32* @O_WRONLY
%40 = or i32 %39, %38
%41 = load i32, i32* @O_EXCL
%42 = or i32 %40, %41
%43 = tail call i32 @open(i8* %37, i32 %42)
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %54
45: ; preds = %35
%46 = load i64, i64* @errno
%47 = load i64, i64* @EEXIST
%48 = icmp eq i64 %46, %47
%49 = load i8*, i8** %36
br i1 %48, label %50, label %52
50: ; preds = %45
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i8* %49)
br label %158
52: ; preds = %45
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %49)
br label %158
54: ; preds = %35
%55 = tail call i8* @malloc(i32 %26)
%56 = icmp eq i8* %55, null
br i1 %56, label %104, label %57
57: ; preds = %54
%58 = zext i32 %26 to i64
%59 = icmp ult i32 %26, 16
br i1 %59, label %102, label %60
60: ; preds = %57
%61 = and i64 %58, 4294967280
%62 = add nsw i64 %61, -16
%63 = lshr exact i64 %62, 4
%64 = add nuw nsw i64 %63, 1
%65 = and i64 %64, 1
%66 = icmp eq i64 %62, 0
br i1 %66, label %93, label %67
67: ; preds = %60
%68 = and i64 %64, 2305843009213693950
br label %69
69: ; preds = %69, %67
%70 = phi i64 [ 0, %67 ], [ %85, %69 ]
%71 = phi <16 x i32> [ <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>, %67 ], [ %86, %69 ]
%72 = phi i64 [ 0, %67 ], [ %87, %69 ]
%73 = urem <16 x i32> %71, <i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10>
%74 = trunc <16 x i32> %73 to <16 x i8>
%75 = or <16 x i8> %74, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
%76 = getelementptr inbounds i8, i8* %55, i64 %70
%77 = bitcast i8* %76 to <16 x i8>*
store <16 x i8> %75, <16 x i8>* %77
%78 = or i64 %70, 16
%79 = add <16 x i32> %71, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
%80 = urem <16 x i32> %79, <i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10>
%81 = trunc <16 x i32> %80 to <16 x i8>
%82 = or <16 x i8> %81, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
%83 = getelementptr inbounds i8, i8* %55, i64 %78
%84 = bitcast i8* %83 to <16 x i8>*
store <16 x i8> %82, <16 x i8>* %84
%85 = add nuw i64 %70, 32
%86 = add <16 x i32> %71, <i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32>
%87 = add i64 %72, 2
%88 = icmp eq i64 %87, %68
br i1 %88, label %89, label %69
89: ; preds = %69
%90 = urem <16 x i32> %86, <i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10>
%91 = trunc <16 x i32> %90 to <16 x i8>
%92 = or <16 x i8> %91, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
br label %93
93: ; preds = %89, %60
%94 = phi i64 [ 0, %60 ], [ %85, %89 ]
%95 = phi <16 x i8> [ <i8 48, i8 49, i8 50, i8 51, i8 52, i8 53, i8 54, i8 55, i8 56, i8 57, i8 48, i8 49, i8 50, i8 51, i8 52, i8 53>, %60 ], [ %92, %89 ]
%96 = icmp eq i64 %65, 0
br i1 %96, label %100, label %97
97: ; preds = %93
%98 = getelementptr inbounds i8, i8* %55, i64 %94
%99 = bitcast i8* %98 to <16 x i8>*
store <16 x i8> %95, <16 x i8>* %99
br label %100
100: ; preds = %93, %97
%101 = icmp eq i64 %61, %58
br i1 %101, label %115, label %102
102: ; preds = %57, %100
%103 = phi i64 [ 0, %57 ], [ %61, %100 ]
br label %106
104: ; preds = %54
%105 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
br label %158
106: ; preds = %102, %106
%107 = phi i64 [ %113, %106 ], [ %103, %102 ]
%108 = trunc i64 %107 to i32
%109 = urem i32 %108, 10
%110 = trunc i32 %109 to i8
%111 = or i8 %110, 48
%112 = getelementptr inbounds i8, i8* %55, i64 %107
store i8 %111, i8* %112
%113 = add nuw nsw i64 %107, 1
%114 = icmp eq i64 %113, %58
br i1 %114, label %115, label %106
115: ; preds = %106, %100
%116 = call i64 @mono_time(double* %3)
%117 = icmp eq i64 %116, 0
br i1 %117, label %118, label %120
118: ; preds = %115
%119 = icmp sgt i32 %29, 0
br i1 %119, label %122, label %140
120: ; preds = %115
%121 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
br label %158
122: ; preds = %118, %137
%123 = phi i32 [ %138, %137 ], [ 0, %118 ]
%124 = call i32 @write(i32 %43, i8* %55, i32 %26)
%125 = icmp eq i32 %124, %26
br i1 %125, label %128, label %126
126: ; preds = %122
%127 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
br label %158
128: ; preds = %122
%129 = call i64 @fsync(i32 %43)
%130 = icmp eq i64 %129, 0
br i1 %20, label %131, label %134
131: ; preds = %128
br i1 %130, label %137, label %132
132: ; preds = %131
%133 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
br label %158
134: ; preds = %128
br i1 %130, label %137, label %135
135: ; preds = %134
%136 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0))
br label %158
137: ; preds = %134, %131
%138 = add nuw nsw i32 %123, 1
%139 = icmp eq i32 %138, %29
br i1 %139, label %140, label %122
140: ; preds = %137, %118
%141 = call i64 @mono_time(double* %4)
%142 = icmp eq i64 %141, 0
br i1 %142, label %145, label %143
143: ; preds = %140
%144 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0))
br label %158
145: ; preds = %140
%146 = select i1 %20, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0)
%147 = load double, double* %4
%148 = load double, double* %3
%149 = fsub double %147, %148
%150 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0), i32 %29, i8* %146, double %149)
%151 = sitofp i32 %29 to double
%152 = load double, double* %4
%153 = load double, double* %3
%154 = fsub double %152, %153
%155 = fdiv double %151, %154
%156 = fdiv double 1.000000e+00, %155
%157 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.15, i64 0, i64 0), double %155, double %156)
br label %158
158: ; preds = %126, %132, %135, %21, %52, %50, %120, %143, %145, %104, %33, %15, %8
%159 = phi i32 [ 1, %8 ], [ 1, %15 ], [ 1, %21 ], [ 1, %33 ], [ 1, %52 ], [ 1, %50 ], [ 1, %104 ], [ 1, %120 ], [ 1, %143 ], [ 0, %145 ], [ 1, %135 ], [ 1, %132 ], [ 1, %126 ]
ret i32 %159
}