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

/* Variables and functions */
double fabs(float);
float stub1(float (*)(float), float, float, int);
float qromo(float (*func)(float), float a, float b,
            float (*choose)(float (*)(float), float, float, int)) {
  void polint(float xa[], float ya[], int n, float x, float *y, float *dy);
  void nrerror(char error_text[]);
  int j;
  float ss, dss, h[(14 + 1) + 1], s[(14 + 1)];
  h[1] = 1.0;
  for (j = 1; j <= 14; j++) {
    s[j] = (*choose)(func, a, b, j);
    if (j >= 5) {
      polint(&h[j - 5], &s[j - 5], 5, 0.0, &ss, &dss);
      if (fabs(dss) <= 1.0e-6 * fabs(ss))
        return ss;
    }
    h[j + 1] = h[j] / 9.0;
  }
  nrerror("Too many steps in routing qromo");
  return 0.0;
}


x86 assembly (clang, -O0):
<qromo>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movss  0xeab(%rip),%xmm0
movss  %xmm0,-0x6c(%rbp)
movl   $0x1,-0x24(%rbp)
cmpl   $0xe,-0x24(%rbp)
jg     1262 <qromo+0x132>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rdi
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
mov    -0x24(%rbp),%esi
call   *%rax
movslq -0x24(%rbp),%rax
movss  %xmm0,-0xb0(%rbp,%rax,4)
ff ff
cmpl   $0x5,-0x24(%rbp)
jl     1228 <qromo+0xf8>
mov    -0x24(%rbp),%eax
sub    $0x5,%eax
cltq
lea    -0x70(%rbp),%rdi
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x24(%rbp),%eax
sub    $0x5,%eax
cltq
lea    -0xb0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
mov    $0x5,%edx
xorps  %xmm0,%xmm0
lea    -0x28(%rbp),%rcx
lea    -0x2c(%rbp),%r8
call   1050 <polint@plt>
movss  -0x2c(%rbp),%xmm0
call   1040 <fabs@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
movss  -0x28(%rbp),%xmm0
call   1040 <fabs@plt>
movsd  -0xb8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  0xe02(%rip),%xmm0
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jb     1223 <qromo+0xf3>
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1276 <qromo+0x146>
jmp    1228 <qromo+0xf8>
movslq -0x24(%rbp),%rax
movss  -0x70(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdd2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x24(%rbp),%eax
add    $0x1,%eax
cltq
movss  %xmm0,-0x70(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1161 <qromo+0x31>
lea    0xdaf(%rip),%rdi
call   1030 <nrerror@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qromo>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %rsi,%r14
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0xc(%rsp)
mov    %rdi,%r15
movl   $0x3f800000,0x24(%rsp)
3f
mov    $0x1,%ebx
mov    $0xfffffffc,%ebp
mov    $0xe,%r12d
lea    0x14(%rsp),%r13
jmp    11a6 <qromo+0x76>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  0x20(%rsp,%rbx,4),%xmm0
divss  0xe7a(%rip),%xmm0
movss  %xmm0,0x24(%rsp,%rbx,4)
add    $0x1,%rbx
add    $0x1,%rbp
add    $0xffffffffffffffff,%r12
je     1227 <qromo+0xf7>
mov    %r15,%rdi
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
mov    %ebx,%esi
call   *%r14
movss  %xmm0,0x60(%rsp,%rbx,4)
cmp    $0x5,%rbx
jb     1180 <qromo+0x50>
mov    %ebp,%eax
shl    $0x2,%rax
lea    (%rsp,%rax,1),%rdi
add    $0x20,%rdi
lea    0x60(%rsp,%rax,1),%rsi
xorpd  %xmm0,%xmm0
mov    $0x5,%edx
lea    0x8(%rsp),%rcx
mov    %r13,%r8
call   1050 <polint@plt>
movss  0x14(%rsp),%xmm0
call   1040 <fabs@plt>
movsd  %xmm0,0x18(%rsp)
movss  0x8(%rsp),%xmm0
call   1040 <fabs@plt>
mulsd  0xded(%rip),%xmm0
ucomisd 0x18(%rsp),%xmm0
jb     1180 <qromo+0x50>
movss  0x8(%rsp),%xmm0
jmp    1236 <qromo+0x106>
lea    0xdde(%rip),%rdi
call   1030 <nrerror@plt>
xorps  %xmm0,%xmm0
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Too many steps in routing qromo\00"
define float @qromo(float (float)* %0, float %1, float %2, float (float (float)*, float, float, i32)* %3) {
%5 = alloca float
%6 = alloca float (float)*
%7 = alloca float
%8 = alloca float
%9 = alloca float (float (float)*, float, float, i32)*
%10 = alloca i32
%11 = alloca float
%12 = alloca float
%13 = alloca [16 x float]
%14 = alloca [15 x float]
store float (float)* %0, float (float)** %6
store float %1, float* %7
store float %2, float* %8
store float (float (float)*, float, float, i32)* %3, float (float (float)*, float, float, i32)** %9
%15 = getelementptr inbounds [16 x float], [16 x float]* %13, i64 0, i64 1
store float 1.000000e+00, float* %15
store i32 1, i32* %10
br label %16
16: ; preds = %61, %4
%17 = load i32, i32* %10
%18 = icmp sle i32 %17, 14
br i1 %18, label %19, label %64
19: ; preds = %16
%20 = load float (float (float)*, float, float, i32)*, float (float (float)*, float, float, i32)** %9
%21 = load float (float)*, float (float)** %6
%22 = load float, float* %7
%23 = load float, float* %8
%24 = load i32, i32* %10
%25 = call float %20(float (float)* %21, float %22, float %23, i32 %24)
%26 = load i32, i32* %10
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [15 x float], [15 x float]* %14, i64 0, i64 %27
store float %25, float* %28
%29 = load i32, i32* %10
%30 = icmp sge i32 %29, 5
br i1 %30, label %31, label %49
31: ; preds = %19
%32 = load i32, i32* %10
%33 = sub nsw i32 %32, 5
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [16 x float], [16 x float]* %13, i64 0, i64 %34
%36 = load i32, i32* %10
%37 = sub nsw i32 %36, 5
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [15 x float], [15 x float]* %14, i64 0, i64 %38
%40 = load float, float* %12
%41 = call double @fabs(float %40)
%42 = load float, float* %11
%43 = call double @fabs(float %42)
%44 = fmul double 0x3EB0C6F7A0B5ED8D, %43
%45 = fcmp ole double %41, %44
br i1 %45, label %46, label %48
46: ; preds = %31
%47 = load float, float* %11
store float %47, float* %5
br label %65
48: ; preds = %31
br label %49
49: ; preds = %48, %19
%50 = load i32, i32* %10
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [16 x float], [16 x float]* %13, i64 0, i64 %51
%53 = load float, float* %52
%54 = fpext float %53 to double
%55 = fdiv double %54, 9.000000e+00
%56 = fptrunc double %55 to float
%57 = load i32, i32* %10
%58 = add nsw i32 %57, 1
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [16 x float], [16 x float]* %13, i64 0, i64 %59
store float %56, float* %60
br label %61
61: ; preds = %49
%62 = load i32, i32* %10
%63 = add nsw i32 %62, 1
store i32 %63, i32* %10
br label %16
64: ; preds = %16
store float 0.000000e+00, float* %5
br label %65
65: ; preds = %64, %46
%66 = load float, float* %5
ret float %66
}

LLVM IR (-O2):
@.str = [32 x i8] c"Too many steps in routing qromo\00"
define float @qromo(float (float)* %0, float %1, float %2, float (float (float)*, float, float, i32)* nocapture %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca [16 x float]
%8 = alloca [15 x float]
%9 = bitcast float* %5 to i8*
%10 = bitcast float* %6 to i8*
%11 = bitcast [16 x float]* %7 to i8*
%12 = bitcast [15 x float]* %8 to i8*
%13 = getelementptr inbounds [16 x float], [16 x float]* %7, i64 0, i64 1
store float 1.000000e+00, float* %13
br label %14
14: ; preds = %4, %33
%15 = phi i64 [ 1, %4 ], [ %37, %33 ]
%16 = trunc i64 %15 to i32
%17 = call float %3(float (float)* %0, float %1, float %2, i32 %16)
%18 = getelementptr inbounds [15 x float], [15 x float]* %8, i64 0, i64 %15
store float %17, float* %18
%19 = icmp ugt i64 %15, 4
br i1 %19, label %20, label %33
20: ; preds = %14
%21 = add nuw i64 %15, 4294967291
%22 = and i64 %21, 4294967295
%23 = getelementptr inbounds [16 x float], [16 x float]* %7, i64 0, i64 %22
%24 = getelementptr inbounds [15 x float], [15 x float]* %8, i64 0, i64 %22
%25 = load float, float* %6
%26 = call double @fabs(float %25)
%27 = load float, float* %5
%28 = call double @fabs(float %27)
%29 = fmul double %28, 0x3EB0C6F7A0B5ED8D
%30 = fcmp ugt double %26, %29
br i1 %30, label %33, label %31
31: ; preds = %20
%32 = load float, float* %5
br label %41
33: ; preds = %20, %14
%34 = getelementptr inbounds [16 x float], [16 x float]* %7, i64 0, i64 %15
%35 = load float, float* %34
%36 = fdiv float %35, 9.000000e+00
%37 = add nuw nsw i64 %15, 1
%38 = getelementptr inbounds [16 x float], [16 x float]* %7, i64 0, i64 %37
store float %36, float* %38
%39 = icmp eq i64 %37, 15
br i1 %39, label %40, label %14
40: ; preds = %33
br label %41
41: ; preds = %40, %31
%42 = phi float [ %32, %31 ], [ 0.000000e+00, %40 ]
ret float %42
}