#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*/ clock_t;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ clock();
float f_if(float);
float f_im(float);
int /*<<< orphan*/ free(float *);
float *get_random(int);
double log(int);
float *malloc(int);
int /*<<< orphan*/ memcpy(void *, void *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ setup_mpfr_f_im();
double sqrt(int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
unsigned long long ulp(float, float);
int main(int argc, char **argv) {
  clock_t start, end, zero;
  int i, j, k;
  double total, r1, r2, r1old;
  float *rands, *out, *correct;
  int count, mcount;
  srand(time(NULL));
  setup_mpfr_f_im();
  ;
  int iter, repet;
  iter = 1 << 15;
  repet = 100;
  if (argc > 1)
    iter = atoi(argv[1]);
  if (argc > 2)
    repet = atoi(argv[2]);
  printf("pts,repet,avg,se\n");
  for (j = 2; j < iter; j *= 2) {
    r1 = r2 = 0;
    mcount = -1;
    for (k = 0; k < repet; k++) {
      rands = get_random(j);
      out = malloc(sizeof(float) * j);
      ;
      start = clock();
      for (i = 0; i < j; i++) {
        out[i] = f_im(rands[i]);
      }
      end = clock();
      ;
      correct = malloc(sizeof(float) * j);
      memcpy((void *)correct, (void *)out, sizeof(float) * j);
      count = 0;
      for (i = 0; i < j; i++) {
        if (1 / correct[i] != 0 && correct[i] == correct[i]) {
          count += 1;
        }
      };
      start = clock();
      for (i = 0; i < j; i++) {
        out[i] = f_if(rands[i]);
      }
      end = clock();
      ;
      total = 0;
      for (i = 0; i < j; i++) {
        if (1 / correct[i] != 0 && correct[i] == correct[i]) {
          unsigned long long int error = ulp(out[i], correct[i]);
          total += log(error + 1.0) / log(2);
        }
      }
      r1old = r1;
      r1 += (total / count - r1) / (k + 1);
      r2 += (total / count - r1old) * (total / count - r1);
      if (mcount == -1 || count < mcount)
        mcount = count;
      free(rands);
      free(out);
      free(correct);
    }
    printf("%i,%i,%g,%g\n", mcount, repet, r1,
           sqrt(r2 / (repet - 1.5)) / sqrt(repet));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
mov    $0x0,%al
call   10e0 <setup_mpfr_f_im@plt>
movl   $0x8000,-0x6c(%rbp)
movl   $0x64,-0x70(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1248 <main+0x58>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,-0x6c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1262 <main+0x72>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,-0x70(%rbp)
lea    0xdd7(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x2,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jge    1667 <main+0x477>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0xffffffff,-0x68(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x70(%rbp),%eax
jge    15d6 <main+0x3e6>
mov    -0x24(%rbp),%edi
call   1040 <get_random@plt>
mov    %rax,-0x50(%rbp)
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    $0x0,%al
call   1060 <clock@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1316 <main+0x126>
mov    -0x50(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1050 <f_im@plt>
mov    -0x58(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12dd <main+0xed>
mov    $0x0,%al
call   1060 <clock@plt>
mov    %eax,-0x18(%rbp)
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x58(%rbp),%rsi
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1090 <memcpy@plt>
movl   $0x0,-0x64(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    13d1 <main+0x1e1>
mov    -0x60(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  0xc9c(%rip),%xmm0
divss  (%rax,%rcx,4),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1390 <main+0x1a0>
jp     1390 <main+0x1a0>
jmp    13be <main+0x1ce>
mov    -0x60(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x60(%rbp),%rax
movslq -0x20(%rbp),%rcx
ucomiss (%rax,%rcx,4),%xmm0
jne    13be <main+0x1ce>
jp     13be <main+0x1ce>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    13c3 <main+0x1d3>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1358 <main+0x168>
mov    $0x0,%al
call   1060 <clock@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    141b <main+0x22b>
mov    -0x50(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   10c0 <f_if@plt>
mov    -0x58(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    13e2 <main+0x1f2>
mov    $0x0,%al
call   1060 <clock@plt>
mov    %eax,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1524 <main+0x334>
mov    -0x60(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  0xbc0(%rip),%xmm0
divss  (%rax,%rcx,4),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    146c <main+0x27c>
jp     146c <main+0x27c>
jmp    1511 <main+0x321>
mov    -0x60(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x60(%rbp),%rax
movslq -0x20(%rbp),%rcx
ucomiss (%rax,%rcx,4),%xmm0
jne    1511 <main+0x321>
jp     1511 <main+0x321>
mov    -0x58(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x60(%rbp),%rax
movss  (%rax,%rcx,4),%xmm1
call   10d0 <ulp@plt>
mov    %rax,-0x78(%rbp)
movaps 0xb69(%rip),%xmm1
movq   -0x78(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xb68(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xb29(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   10f0 <log@plt>
movsd  %xmm0,-0x80(%rbp)
mov    $0x2,%edi
call   10f0 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
divsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1516 <main+0x326>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1434 <main+0x244>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
cvtsi2sdl -0x64(%rbp),%xmm1
divsd  %xmm1,%xmm0
subsd  -0x38(%rbp),%xmm0
mov    -0x28(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
cvtsi2sdl -0x64(%rbp),%xmm1
divsd  %xmm1,%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
cvtsi2sdl -0x64(%rbp),%xmm1
divsd  %xmm1,%xmm2
subsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
cmpl   $0xffffffff,-0x68(%rbp)
je     15a7 <main+0x3b7>
mov    -0x64(%rbp),%eax
cmp    -0x68(%rbp),%eax
jge    15ad <main+0x3bd>
mov    -0x64(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12a1 <main+0xb1>
mov    -0x68(%rbp),%eax
mov    %eax,-0x90(%rbp)
mov    -0x70(%rbp),%eax
mov    %eax,-0x8c(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
cvtsi2sdl -0x70(%rbp),%xmm1
movsd  0x9f9(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1110 <sqrt@plt>
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x70(%rbp),%edi
call   1110 <sqrt@plt>
movsd  -0x98(%rbp),%xmm1
ff
mov    -0x90(%rbp),%esi
mov    -0x8c(%rbp),%edx
movaps %xmm0,%xmm2
movsd  -0x88(%rbp),%xmm0
ff
divsd  %xmm2,%xmm1
lea    0xa00(%rip),%rdi
mov    $0x2,%al
call   1070 <printf@plt>
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1277 <main+0x87>
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
call   10b0 <time@plt>
mov    %eax,%edi
call   1090 <srand@plt>
xor    %eax,%eax
call   10f0 <setup_mpfr_f_im@plt>
cmp    $0x1,%ebp
jle    1273 <main+0x73>
mov    0x8(%rbx),%rdi
call   1110 <atoi@plt>
mov    %eax,0x4(%rsp)
cmp    $0x2,%ebp
mov    $0x64,%ebp
je     124f <main+0x4f>
mov    0x10(%rbx),%rdi
call   1110 <atoi@plt>
mov    %eax,%ebp
lea    0xdfb(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x3,0x4(%rsp)
jge    128c <main+0x8c>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdd7(%rip),%rdi
call   1040 <puts@plt>
movl   $0x8000,0x4(%rsp)
mov    $0x64,%ebp
cvtsi2sd %ebp,%xmm0
addsd  0xd68(%rip),%xmm0
movsd  %xmm0,0x48(%rsp)
mov    $0x2,%eax
mov    %ebp,0x34(%rsp)
jmp    1320 <main+0x120>
nopl   0x0(%rax)
mov    $0xffffffff,%r12d
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x18(%rsp),%xmm0
divsd  0x48(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1120 <sqrt@plt>
movsd  %xmm0,0x28(%rsp)
mov    %ebp,%edi
call   1120 <sqrt@plt>
movsd  0x28(%rsp),%xmm1
divsd  %xmm0,%xmm1
lea    0xd47(%rip),%rdi
mov    %r12d,%esi
mov    %ebp,%edx
movsd  0x8(%rsp),%xmm0
mov    $0x2,%al
call   1080 <printf@plt>
mov    0x20(%rsp),%rax
add    %eax,%eax
cmp    0x4(%rsp),%eax
jge    1262 <main+0x62>
test   %ebp,%ebp
mov    %rax,0x20(%rsp)
jle    12b0 <main+0xb0>
lea    0x0(,%rax,4),%ecx
mov    %ecx,0x38(%rsp)
mov    %eax,%r13d
mov    %r13d,%eax
and    $0xfffffff8,%eax
mov    %rax,0x58(%rsp)
lea    0x0(,%r13,4),%rax
and    $0xffffffffffffffe0,%rax
mov    %rax,0x50(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x18(%rsp)
movl   $0x0,0x14(%rsp)
mov    $0xffffffff,%eax
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
jmp    1427 <main+0x227>
nopl   0x0(%rax)
xor    %ebx,%ebx
xor    %eax,%eax
call   1070 <clock@plt>
xor    %eax,%eax
call   1070 <clock@plt>
xorps  %xmm4,%xmm4
movsd  0x8(%rsp),%xmm3
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
divsd  %xmm0,%xmm4
movapd %xmm4,%xmm0
mov    0x14(%rsp),%ebp
add    $0x1,%ebp
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
subsd  %xmm3,%xmm0
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
addsd  %xmm2,%xmm3
movsd  %xmm3,0x8(%rsp)
subsd  %xmm3,%xmm4
mulsd  %xmm0,%xmm4
mov    0x3c(%rsp),%eax
cmp    %eax,%ebx
mov    %eax,%r12d
cmovl  %ebx,%r12d
movsd  0x18(%rsp),%xmm0
addsd  %xmm4,%xmm0
movsd  %xmm0,0x18(%rsp)
cmp    $0xffffffff,%eax
cmove  %ebx,%r12d
mov    0x40(%rsp),%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r12d,%eax
mov    %ebp,0x14(%rsp)
mov    0x34(%rsp),%ecx
cmp    %ecx,%ebp
mov    %ecx,%ebp
je     12ca <main+0xca>
mov    %eax,0x3c(%rsp)
mov    0x20(%rsp),%rbx
mov    %ebx,%edi
call   1050 <get_random@plt>
mov    %rax,%rbp
mov    0x38(%rsp),%r12d
mov    %r12d,%edi
call   10c0 <malloc@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1070 <clock@plt>
test   %ebx,%ebx
jle    147a <main+0x27a>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movss  0x0(%rbp,%rbx,4),%xmm0
call   1060 <f_im@plt>
movss  %xmm0,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1460 <main+0x260>
mov    %rbp,0x40(%rsp)
xor    %eax,%eax
call   1070 <clock@plt>
mov    %r12d,%edi
call   10c0 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r12d,%edx
call   10a0 <memcpy@plt>
mov    0x20(%rsp),%r12
test   %r12d,%r12d
jle    1380 <main+0x180>
cmp    $0x8,%r12d
jae    14d0 <main+0x2d0>
xor    %eax,%eax
xor    %ebx,%ebx
movss  0xb81(%rip),%xmm2
xorps  %xmm3,%xmm3
jmp    1560 <main+0x360>
nopw   0x0(%rax,%rax,1)
xorpd  %xmm0,%xmm0
xor    %eax,%eax
pxor   %xmm1,%xmm1
movaps 0xb2f(%rip),%xmm6
xorps  %xmm7,%xmm7
mov    0x50(%rsp),%rcx
nopl   0x0(%rax)
movups (%r14,%rax,1),%xmm2
movups 0x10(%r14,%rax,1),%xmm3
movaps %xmm6,%xmm4
divps  %xmm2,%xmm4
movaps %xmm6,%xmm5
divps  %xmm3,%xmm5
cmpneqps %xmm7,%xmm4
cmpneqps %xmm7,%xmm5
cmpordps %xmm7,%xmm2
andps  %xmm4,%xmm2
psubd  %xmm2,%xmm0
cmpordps %xmm7,%xmm3
andps  %xmm5,%xmm3
psubd  %xmm3,%xmm1
add    $0x20,%rax
cmp    %rax,%rcx
jne    14f0 <main+0x2f0>
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%ebx
mov    0x58(%rsp),%rcx
mov    %rcx,%rax
cmp    %r13,%rcx
movss  0xae5(%rip),%xmm2
xorps  %xmm3,%xmm3
je     158e <main+0x38e>
movss  (%r14,%rax,4),%xmm0
movaps %xmm2,%xmm1
divss  %xmm0,%xmm1
ucomiss %xmm3,%xmm1
setp   %cl
setne  %dl
or     %cl,%dl
ucomiss %xmm0,%xmm0
setnp  %cl
and    %dl,%cl
movzbl %cl,%ecx
add    %ecx,%ebx
add    $0x1,%rax
cmp    %rax,%r13
jne    1560 <main+0x360>
xor    %eax,%eax
call   1070 <clock@plt>
test   %r12d,%r12d
jle    1389 <main+0x189>
xor    %ebp,%ebp
mov    0x40(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nop
movss  (%r12,%rbp,4),%xmm0
call   10d0 <f_if@plt>
movss  %xmm0,(%r15,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%r13
jne    15b0 <main+0x3b0>
xor    %eax,%eax
call   1070 <clock@plt>
cmpl   $0x0,0x20(%rsp)
jle    1390 <main+0x190>
xorps  %xmm4,%xmm4
xor    %ebp,%ebp
movss  0xa57(%rip),%xmm2
xorps  %xmm3,%xmm3
jmp    15fd <main+0x3fd>
xchg   %ax,%ax
add    $0x1,%rbp
cmp    %rbp,%r13
je     1393 <main+0x193>
movss  (%r14,%rbp,4),%xmm1
ucomiss %xmm1,%xmm1
jp     15f0 <main+0x3f0>
movaps %xmm2,%xmm0
divss  %xmm1,%xmm0
ucomiss %xmm3,%xmm0
jne    1616 <main+0x416>
jnp    15f0 <main+0x3f0>
movss  (%r15,%rbp,4),%xmm0
movsd  %xmm4,0x28(%rsp)
call   10e0 <ulp@plt>
movq   %rax,%xmm0
punpckldq 0x9ec(%rip),%xmm0
subpd  0x9f4(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
addsd  0x9b8(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1100 <log@plt>
movsd  %xmm0,0x60(%rsp)
mov    $0x2,%edi
call   1100 <log@plt>
movsd  0x28(%rsp),%xmm4
xorps  %xmm3,%xmm3
movss  0x9c6(%rip),%xmm2
movsd  0x60(%rsp),%xmm1
divsd  %xmm0,%xmm1
addsd  %xmm1,%xmm4
jmp    15f0 <main+0x3f0>

LLVM IR (-O0):
@.str = [18 x i8] c"pts,repet,avg,se\0A\00"
@.str.1 = [13 x i8] c"%i,%i,%g,%g\0A\00"
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 i32
%11 = alloca i32
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca float*
%17 = alloca float*
%18 = alloca float*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%24 = call i32 @time(i32* null)
%25 = call i32 @srand(i32 %24)
%26 = call i32 (...) @setup_mpfr_f_im()
store i32 32768, i32* %21
store i32 100, i32* %22
%27 = load i32, i32* %4
%28 = icmp sgt i32 %27, 1
br i1 %28, label %29, label %34
29: ; preds = %2
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32 @atoi(i8* %32)
store i32 %33, i32* %21
br label %34
34: ; preds = %29, %2
%35 = load i32, i32* %4
%36 = icmp sgt i32 %35, 2
br i1 %36, label %37, label %42
37: ; preds = %34
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 2
%40 = load i8*, i8** %39
%41 = call i32 @atoi(i8* %40)
store i32 %41, i32* %22
br label %42
42: ; preds = %37, %34
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %10
br label %44
44: ; preds = %259, %42
%45 = load i32, i32* %10
%46 = load i32, i32* %21
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %262
48: ; preds = %44
store double 0.000000e+00, double* %14
store double 0.000000e+00, double* %13
store i32 -1, i32* %20
store i32 0, i32* %11
br label %49
49: ; preds = %241, %48
%50 = load i32, i32* %11
%51 = load i32, i32* %22
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %244
53: ; preds = %49
%54 = load i32, i32* %10
%55 = call float* @get_random(i32 %54)
store float* %55, float** %16
%56 = load i32, i32* %10
%57 = sext i32 %56 to i64
%58 = mul i64 4, %57
%59 = trunc i64 %58 to i32
%60 = call float* @malloc(i32 %59)
store float* %60, float** %17
%61 = call i32 (...) @clock()
store i32 %61, i32* %6
store i32 0, i32* %9
br label %62
62: ; preds = %77, %53
%63 = load i32, i32* %9
%64 = load i32, i32* %10
%65 = icmp slt i32 %63, %64
br i1 %65, label %66, label %80
66: ; preds = %62
%67 = load float*, float** %16
%68 = load i32, i32* %9
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds float, float* %67, i64 %69
%71 = load float, float* %70
%72 = call float @f_im(float %71)
%73 = load float*, float** %17
%74 = load i32, i32* %9
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds float, float* %73, i64 %75
store float %72, float* %76
br label %77
77: ; preds = %66
%78 = load i32, i32* %9
%79 = add nsw i32 %78, 1
store i32 %79, i32* %9
br label %62
80: ; preds = %62
%81 = call i32 (...) @clock()
store i32 %81, i32* %7
%82 = load i32, i32* %10
%83 = sext i32 %82 to i64
%84 = mul i64 4, %83
%85 = trunc i64 %84 to i32
%86 = call float* @malloc(i32 %85)
store float* %86, float** %18
%87 = load float*, float** %18
%88 = bitcast float* %87 to i8*
%89 = load float*, float** %17
%90 = bitcast float* %89 to i8*
%91 = load i32, i32* %10
%92 = sext i32 %91 to i64
%93 = mul i64 4, %92
%94 = trunc i64 %93 to i32
%95 = call i32 @memcpy(i8* %88, i8* %90, i32 %94)
store i32 0, i32* %19
store i32 0, i32* %9
br label %96
96: ; preds = %124, %80
%97 = load i32, i32* %9
%98 = load i32, i32* %10
%99 = icmp slt i32 %97, %98
br i1 %99, label %100, label %127
100: ; preds = %96
%101 = load float*, float** %18
%102 = load i32, i32* %9
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds float, float* %101, i64 %103
%105 = load float, float* %104
%106 = fdiv float 1.000000e+00, %105
%107 = fcmp une float %106, 0.000000e+00
br i1 %107, label %108, label %123
108: ; preds = %100
%109 = load float*, float** %18
%110 = load i32, i32* %9
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds float, float* %109, i64 %111
%113 = load float, float* %112
%114 = load float*, float** %18
%115 = load i32, i32* %9
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds float, float* %114, i64 %116
%118 = load float, float* %117
%119 = fcmp oeq float %113, %118
br i1 %119, label %120, label %123
120: ; preds = %108
%121 = load i32, i32* %19
%122 = add nsw i32 %121, 1
store i32 %122, i32* %19
br label %123
123: ; preds = %120, %108, %100
br label %124
124: ; preds = %123
%125 = load i32, i32* %9
%126 = add nsw i32 %125, 1
store i32 %126, i32* %9
br label %96
127: ; preds = %96
%128 = call i32 (...) @clock()
store i32 %128, i32* %6
store i32 0, i32* %9
br label %129
129: ; preds = %144, %127
%130 = load i32, i32* %9
%131 = load i32, i32* %10
%132 = icmp slt i32 %130, %131
br i1 %132, label %133, label %147
133: ; preds = %129
%134 = load float*, float** %16
%135 = load i32, i32* %9
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds float, float* %134, i64 %136
%138 = load float, float* %137
%139 = call float @f_if(float %138)
%140 = load float*, float** %17
%141 = load i32, i32* %9
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds float, float* %140, i64 %142
store float %139, float* %143
br label %144
144: ; preds = %133
%145 = load i32, i32* %9
%146 = add nsw i32 %145, 1
store i32 %146, i32* %9
br label %129
147: ; preds = %129
%148 = call i32 (...) @clock()
store i32 %148, i32* %7
store double 0.000000e+00, double* %12
store i32 0, i32* %9
br label %149
149: ; preds = %195, %147
%150 = load i32, i32* %9
%151 = load i32, i32* %10
%152 = icmp slt i32 %150, %151
br i1 %152, label %153, label %198
153: ; preds = %149
%154 = load float*, float** %18
%155 = load i32, i32* %9
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds float, float* %154, i64 %156
%158 = load float, float* %157
%159 = fdiv float 1.000000e+00, %158
%160 = fcmp une float %159, 0.000000e+00
br i1 %160, label %161, label %194
161: ; preds = %153
%162 = load float*, float** %18
%163 = load i32, i32* %9
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds float, float* %162, i64 %164
%166 = load float, float* %165
%167 = load float*, float** %18
%168 = load i32, i32* %9
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds float, float* %167, i64 %169
%171 = load float, float* %170
%172 = fcmp oeq float %166, %171
br i1 %172, label %173, label %194
173: ; preds = %161
%174 = load float*, float** %17
%175 = load i32, i32* %9
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds float, float* %174, i64 %176
%178 = load float, float* %177
%179 = load float*, float** %18
%180 = load i32, i32* %9
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds float, float* %179, i64 %181
%183 = load float, float* %182
%184 = call i64 @ulp(float %178, float %183)
store i64 %184, i64* %23
%185 = load i64, i64* %23
%186 = uitofp i64 %185 to double
%187 = fadd double %186, 1.000000e+00
%188 = fptosi double %187 to i32
%189 = call double @log(i32 %188)
%190 = call double @log(i32 2)
%191 = fdiv double %189, %190
%192 = load double, double* %12
%193 = fadd double %192, %191
store double %193, double* %12
br label %194
194: ; preds = %173, %161, %153
br label %195
195: ; preds = %194
%196 = load i32, i32* %9
%197 = add nsw i32 %196, 1
store i32 %197, i32* %9
br label %149
198: ; preds = %149
%199 = load double, double* %13
store double %199, double* %15
%200 = load double, double* %12
%201 = load i32, i32* %19
%202 = sitofp i32 %201 to double
%203 = fdiv double %200, %202
%204 = load double, double* %13
%205 = fsub double %203, %204
%206 = load i32, i32* %11
%207 = add nsw i32 %206, 1
%208 = sitofp i32 %207 to double
%209 = fdiv double %205, %208
%210 = load double, double* %13
%211 = fadd double %210, %209
store double %211, double* %13
%212 = load double, double* %12
%213 = load i32, i32* %19
%214 = sitofp i32 %213 to double
%215 = fdiv double %212, %214
%216 = load double, double* %15
%217 = fsub double %215, %216
%218 = load double, double* %12
%219 = load i32, i32* %19
%220 = sitofp i32 %219 to double
%221 = fdiv double %218, %220
%222 = load double, double* %13
%223 = fsub double %221, %222
%224 = load double, double* %14
%225 = call double @llvm.fmuladd.f64(double %217, double %223, double %224)
store double %225, double* %14
%226 = load i32, i32* %20
%227 = icmp eq i32 %226, -1
br i1 %227, label %232, label %228
228: ; preds = %198
%229 = load i32, i32* %19
%230 = load i32, i32* %20
%231 = icmp slt i32 %229, %230
br i1 %231, label %232, label %234
232: ; preds = %228, %198
%233 = load i32, i32* %19
store i32 %233, i32* %20
br label %234
234: ; preds = %232, %228
%235 = load float*, float** %16
%236 = call i32 @free(float* %235)
%237 = load float*, float** %17
%238 = call i32 @free(float* %237)
%239 = load float*, float** %18
%240 = call i32 @free(float* %239)
br label %241
241: ; preds = %234
%242 = load i32, i32* %11
%243 = add nsw i32 %242, 1
store i32 %243, i32* %11
br label %49
244: ; preds = %49
%245 = load i32, i32* %20
%246 = load i32, i32* %22
%247 = load double, double* %13
%248 = load double, double* %14
%249 = load i32, i32* %22
%250 = sitofp i32 %249 to double
%251 = fsub double %250, 1.500000e+00
%252 = fdiv double %248, %251
%253 = fptosi double %252 to i32
%254 = call double @sqrt(i32 %253)
%255 = load i32, i32* %22
%256 = call double @sqrt(i32 %255)
%257 = fdiv double %254, %256
%258 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %245, i32 %246, double %247, double %257)
br label %259
259: ; preds = %244
%260 = load i32, i32* %10
%261 = mul nsw i32 %260, 2
store i32 %261, i32* %10
br label %44
262: ; preds = %44
%263 = load i32, i32* %3
ret i32 %263
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"%i,%i,%g,%g\0A\00"
@str = [17 x i8] c"pts,repet,avg,se\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 (...) @setup_mpfr_f_im()
%6 = icmp sgt i32 %0, 1
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %22
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = icmp eq i32 %0, 2
br i1 %13, label %18, label %14
14: ; preds = %9
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
br label %18
18: ; preds = %14, %9
%19 = phi i32 [ %17, %14 ], [ 100, %9 ]
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%21 = icmp sgt i32 %12, 2
br i1 %21, label %22, label %180
22: ; preds = %7, %18
%23 = phi i32 [ 100, %7 ], [ %19, %18 ]
%24 = phi i32 [ 32768, %7 ], [ %12, %18 ]
%25 = icmp sgt i32 %23, 0
%26 = sitofp i32 %23 to double
%27 = fadd double %26, -1.500000e+00
br label %28
28: ; preds = %22, %168
%29 = phi i32 [ 2, %22 ], [ %178, %168 ]
br i1 %25, label %30, label %168
30: ; preds = %28
%31 = shl i32 %29, 2
%32 = icmp sgt i32 %29, 0
%33 = zext i32 %29 to i64
%34 = zext i32 %29 to i64
%35 = zext i32 %29 to i64
%36 = zext i32 %29 to i64
%37 = icmp ult i32 %29, 8
%38 = and i64 %33, 4294967288
%39 = icmp eq i64 %38, %33
br label %40
40: ; preds = %30, %148
%41 = phi i32 [ -1, %30 ], [ %163, %148 ]
%42 = phi i32 [ 0, %30 ], [ %154, %148 ]
%43 = phi double [ 0.000000e+00, %30 ], [ %159, %148 ]
%44 = phi double [ 0.000000e+00, %30 ], [ %157, %148 ]
%45 = tail call float* @get_random(i32 %29)
%46 = tail call float* @malloc(i32 %31)
%47 = tail call i32 (...) @clock()
br i1 %32, label %48, label %56
48: ; preds = %40, %48
%49 = phi i64 [ %54, %48 ], [ 0, %40 ]
%50 = getelementptr inbounds float, float* %45, i64 %49
%51 = load float, float* %50
%52 = tail call float @f_im(float %51)
%53 = getelementptr inbounds float, float* %46, i64 %49
store float %52, float* %53
%54 = add nuw nsw i64 %49, 1
%55 = icmp eq i64 %54, %33
br i1 %55, label %56, label %48
56: ; preds = %48, %40
%57 = tail call i32 (...) @clock()
%58 = tail call float* @malloc(i32 %31)
%59 = bitcast float* %58 to i8*
%60 = bitcast float* %46 to i8*
%61 = tail call i32 @memcpy(i8* %59, i8* %60, i32 %31)
br i1 %32, label %62, label %93
62: ; preds = %56
br i1 %37, label %90, label %63
63: ; preds = %62, %63
%64 = phi i64 [ %85, %63 ], [ 0, %62 ]
%65 = phi <4 x i32> [ %83, %63 ], [ zeroinitializer, %62 ]
%66 = phi <4 x i32> [ %84, %63 ], [ zeroinitializer, %62 ]
%67 = getelementptr inbounds float, float* %58, i64 %64
%68 = bitcast float* %67 to <4 x float>*
%69 = load <4 x float>, <4 x float>* %68
%70 = getelementptr inbounds float, float* %67, i64 4
%71 = bitcast float* %70 to <4 x float>*
%72 = load <4 x float>, <4 x float>* %71
%73 = fdiv <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, %69
%74 = fdiv <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, %72
%75 = fcmp une <4 x float> %73, zeroinitializer
%76 = fcmp une <4 x float> %74, zeroinitializer
%77 = fcmp ord <4 x float> %69, zeroinitializer
%78 = fcmp ord <4 x float> %72, zeroinitializer
%79 = and <4 x i1> %77, %75
%80 = and <4 x i1> %78, %76
%81 = zext <4 x i1> %79 to <4 x i32>
%82 = zext <4 x i1> %80 to <4 x i32>
%83 = add <4 x i32> %65, %81
%84 = add <4 x i32> %66, %82
%85 = add nuw i64 %64, 8
%86 = icmp eq i64 %85, %38
br i1 %86, label %87, label %63
87: ; preds = %63
%88 = add <4 x i32> %84, %83
%89 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %88)
br i1 %39, label %108, label %90
90: ; preds = %62, %87
%91 = phi i64 [ 0, %62 ], [ %38, %87 ]
%92 = phi i32 [ 0, %62 ], [ %89, %87 ]
br label %95
93: ; preds = %56
%94 = tail call i32 (...) @clock()
br label %119
95: ; preds = %90, %95
%96 = phi i64 [ %106, %95 ], [ %91, %90 ]
%97 = phi i32 [ %105, %95 ], [ %92, %90 ]
%98 = getelementptr inbounds float, float* %58, i64 %96
%99 = load float, float* %98
%100 = fdiv float 1.000000e+00, %99
%101 = fcmp une float %100, 0.000000e+00
%102 = fcmp ord float %99, 0.000000e+00
%103 = and i1 %102, %101
%104 = zext i1 %103 to i32
%105 = add nuw nsw i32 %97, %104
%106 = add nuw nsw i64 %96, 1
%107 = icmp eq i64 %106, %34
br i1 %107, label %108, label %95
108: ; preds = %95, %87
%109 = phi i32 [ %89, %87 ], [ %105, %95 ]
%110 = tail call i32 (...) @clock()
br i1 %32, label %111, label %119
111: ; preds = %108, %111
%112 = phi i64 [ %117, %111 ], [ 0, %108 ]
%113 = getelementptr inbounds float, float* %45, i64 %112
%114 = load float, float* %113
%115 = tail call float @f_if(float %114)
%116 = getelementptr inbounds float, float* %46, i64 %112
store float %115, float* %116
%117 = add nuw nsw i64 %112, 1
%118 = icmp eq i64 %117, %35
br i1 %118, label %122, label %111
119: ; preds = %93, %108
%120 = phi i32 [ %109, %108 ], [ 0, %93 ]
%121 = tail call i32 (...) @clock()
br label %148
122: ; preds = %111
%123 = tail call i32 (...) @clock()
br i1 %32, label %124, label %148
124: ; preds = %122, %144
%125 = phi i64 [ %146, %144 ], [ 0, %122 ]
%126 = phi double [ %145, %144 ], [ 0.000000e+00, %122 ]
%127 = getelementptr inbounds float, float* %58, i64 %125
%128 = load float, float* %127
%129 = fdiv float 1.000000e+00, %128
%130 = fcmp une float %129, 0.000000e+00
%131 = fcmp ord float %128, 0.000000e+00
%132 = and i1 %131, %130
br i1 %132, label %133, label %144
133: ; preds = %124
%134 = getelementptr inbounds float, float* %46, i64 %125
%135 = load float, float* %134
%136 = tail call i64 @ulp(float %135, float %128)
%137 = uitofp i64 %136 to double
%138 = fadd double %137, 1.000000e+00
%139 = fptosi double %138 to i32
%140 = tail call double @log(i32 %139)
%141 = tail call double @log(i32 2)
%142 = fdiv double %140, %141
%143 = fadd double %126, %142
br label %144
144: ; preds = %124, %133
%145 = phi double [ %143, %133 ], [ %126, %124 ]
%146 = add nuw nsw i64 %125, 1
%147 = icmp eq i64 %146, %36
br i1 %147, label %148, label %124
148: ; preds = %144, %119, %122
%149 = phi i32 [ %109, %122 ], [ %120, %119 ], [ %109, %144 ]
%150 = phi double [ 0.000000e+00, %122 ], [ 0.000000e+00, %119 ], [ %145, %144 ]
%151 = sitofp i32 %149 to double
%152 = fdiv double %150, %151
%153 = fsub double %152, %44
%154 = add nuw nsw i32 %42, 1
%155 = sitofp i32 %154 to double
%156 = fdiv double %153, %155
%157 = fadd double %44, %156
%158 = fsub double %152, %157
%159 = tail call double @llvm.fmuladd.f64(double %153, double %158, double %43)
%160 = icmp eq i32 %41, -1
%161 = icmp slt i32 %149, %41
%162 = select i1 %160, i1 true, i1 %161
%163 = select i1 %162, i32 %149, i32 %41
%164 = tail call i32 @free(float* %45)
%165 = tail call i32 @free(float* %46)
%166 = tail call i32 @free(float* %58)
%167 = icmp eq i32 %154, %23
br i1 %167, label %168, label %40
168: ; preds = %148, %28
%169 = phi double [ 0.000000e+00, %28 ], [ %157, %148 ]
%170 = phi double [ 0.000000e+00, %28 ], [ %159, %148 ]
%171 = phi i32 [ -1, %28 ], [ %163, %148 ]
%172 = fdiv double %170, %27
%173 = fptosi double %172 to i32
%174 = tail call double @sqrt(i32 %173)
%175 = tail call double @sqrt(i32 %23)
%176 = fdiv double %174, %175
%177 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %171, i32 %23, double %169, double %176)
%178 = shl nsw i32 %29, 1
%179 = icmp slt i32 %178, %24
br i1 %179, label %28, label %180
180: ; preds = %168, %18
ret i32 0
}