#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 */
int /*<<< orphan*/ exit(int);
double fabs(float);
int /*<<< orphan*/ p_polint(float *, float *, int, double, float *, float *);
int /*<<< orphan*/ printf(char *, ...);
float stub1(float (*)(float), float, float, int);
float p_qromo(float (*func)(float), float a, float b,
              float (*choose)(float (*)(float), float, float, int)) {
  int j;
  float ss, dss, h[(14 + 1) + 1], s[(14 + 1) + 1];
  h[1] = 1.0;
  for (j = 1; j <= 14; j++) {
    s[j] = (*choose)(func, a, b, j);
    if (j >= 5) {
      p_polint(&h[j - 5], &s[j - 5], 5, 0.0, &ss, &dss);
      if (fabs(dss) < 1.0e-4 * fabs(ss) || ss < 1.0e-4)
        return ss;
    }
    s[j + 1] = s[j];
    h[j + 1] = h[j] / 9.0;
  }
  printf("%le %le\n", dss, ss);
  printf("Too many steps in routing qromo");
  exit(1);
  return 0.0;
}


x86 assembly (clang, -O0):
<p_qromo>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  0xe9b(%rip),%xmm0
movss  %xmm0,-0x6c(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0xe,-0x1c(%rbp)
jg     12aa <p_qromo+0x16a>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
mov    -0x1c(%rbp),%esi
call   *%rax
movslq -0x1c(%rbp),%rax
movss  %xmm0,-0xb0(%rbp,%rax,4)
ff ff
cmpl   $0x5,-0x1c(%rbp)
jl     1252 <p_qromo+0x112>
mov    -0x1c(%rbp),%eax
sub    $0x5,%eax
cltq
lea    -0x70(%rbp),%rdi
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x1c(%rbp),%eax
sub    $0x5,%eax
cltq
lea    -0xb0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
mov    $0x5,%edx
xorps  %xmm0,%xmm0
lea    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%r8
call   1040 <p_polint@plt>
movss  -0x24(%rbp),%xmm0
call   1050 <fabs@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
movss  -0x20(%rbp),%xmm0
call   1050 <fabs@plt>
movsd  -0xb8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  0xdf2(%rip),%xmm0
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
ja     123f <p_qromo+0xff>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdd3(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    124d <p_qromo+0x10d>
movss  -0x20(%rbp),%xmm0
add    $0xc0,%rsp
pop    %rbp
ret
jmp    1252 <p_qromo+0x112>
movslq -0x1c(%rbp),%rax
movss  -0xb0(%rbp,%rax,4),%xmm0
ff ff
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
movss  %xmm0,-0xb0(%rbp,%rax,4)
ff ff
movslq -0x1c(%rbp),%rax
movss  -0x70(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd8a(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
movss  %xmm0,-0x70(%rbp,%rax,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1171 <p_qromo+0x31>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x20(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xd55(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xd50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<p_qromo>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %rsi,%r14
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
mov    %rdi,%r13
movl   $0x3f800000,0x64(%rsp)
3f
mov    $0x1,%ebx
mov    $0xfffffffc,%ebp
mov    $0xe,%r15d
lea    0xc(%rsp),%r12
jmp    11bc <p_qromo+0x7c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  %xmm0,0x24(%rsp,%rbx,4)
movss  0x60(%rsp,%rbx,4),%xmm0
divss  0xe64(%rip),%xmm0
movss  %xmm0,0x64(%rsp,%rbx,4)
add    $0x1,%rbx
add    $0x1,%rbp
add    $0xffffffffffffffff,%r15
je     1264 <p_qromo+0x124>
mov    %r13,%rdi
movss  0x10(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
mov    %ebx,%esi
call   *%r14
movss  %xmm0,0x20(%rsp,%rbx,4)
cmp    $0x5,%rbx
jb     1190 <p_qromo+0x50>
mov    %ebp,%eax
shl    $0x2,%rax
lea    (%rsp,%rax,1),%rdi
add    $0x60,%rdi
lea    0x20(%rsp,%rax,1),%rsi
xorps  %xmm0,%xmm0
mov    $0x5,%edx
lea    0x8(%rsp),%rcx
mov    %r12,%r8
call   1040 <p_polint@plt>
movss  0xc(%rsp),%xmm0
call   1050 <fabs@plt>
movsd  %xmm0,0x18(%rsp)
movss  0x8(%rsp),%xmm0
call   1050 <fabs@plt>
movsd  0xdd8(%rip),%xmm2
mulsd  %xmm2,%xmm0
ucomisd 0x18(%rsp),%xmm0
movss  0x8(%rsp),%xmm0
ja     1252 <p_qromo+0x112>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
ucomisd %xmm1,%xmm2
ja     1252 <p_qromo+0x112>
movss  0x20(%rsp,%rbx,4),%xmm0
jmp    1190 <p_qromo+0x50>
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x8(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xd8d(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xd88(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"%le %le\0A\00"
@.str.1 = [32 x i8] c"Too many steps in routing qromo\00"
define float @p_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 [16 x float]
%9 = bitcast float* %5 to i8*
%10 = bitcast float* %6 to i8*
%11 = bitcast [16 x float]* %7 to i8*
%12 = bitcast [16 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, %39
%15 = phi i64 [ 1, %4 ], [ %41, %39 ]
%16 = trunc i64 %15 to i32
%17 = call float %3(float (float)* %0, float %1, float %2, i32 %16)
%18 = getelementptr inbounds [16 x float], [16 x float]* %8, i64 0, i64 %15
store float %17, float* %18
%19 = icmp ugt i64 %15, 4
br i1 %19, label %20, label %39
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 [16 x float], [16 x float]* %8, i64 0, i64 %22
%25 = call i32 @p_polint(float* %23, float* %24, i32 5, double 0.000000e+00, float* %5, float* %6)
%26 = load float, float* %6
%27 = call double @fabs(float %26)
%28 = load float, float* %5
%29 = call double @fabs(float %28)
%30 = fmul double %29, 1.000000e-04
%31 = fcmp olt double %27, %30
%32 = load float, float* %5
%33 = fpext float %32 to double
%34 = fcmp olt double %33, 1.000000e-04
%35 = select i1 %31, i1 true, i1 %34
br i1 %35, label %38, label %36
36: ; preds = %20
%37 = load float, float* %18
br label %39
38: ; preds = %20
ret float %32
39: ; preds = %36, %14
%40 = phi float [ %37, %36 ], [ %17, %14 ]
%41 = add nuw nsw i64 %15, 1
%42 = getelementptr inbounds [16 x float], [16 x float]* %8, i64 0, i64 %41
store float %40, float* %42
%43 = getelementptr inbounds [16 x float], [16 x float]* %7, i64 0, i64 %15
%44 = load float, float* %43
%45 = fdiv float %44, 9.000000e+00
%46 = getelementptr inbounds [16 x float], [16 x float]* %7, i64 0, i64 %41
store float %45, float* %46
%47 = icmp eq i64 %41, 15
br i1 %47, label %48, label %14
48: ; preds = %39
%49 = load float, float* %6
%50 = fpext float %49 to double
%51 = load float, float* %5
%52 = fpext float %51 to double
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %50, double %52)
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%55 = call i32 @exit(i32 1)
unreachable
}