#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 fabs(float);
float sqrt(float);
float stub1(float);
float stub2(float);
float adapt24(float (*func)(float), float a, float b, float f2, float f3,
              float acc, float eps, float *error) {
  float h = b - a, f1, f4;
#pragma omp parallel
  {
#pragma omp sections
    {
#pragma omp section
      f1 = (*func)(a + h / 6);
#pragma omp section
      f4 = (*func)(a + 5 * h / 6);
    }
  }
  float q4 = (f1 + f4) * h / 3 + (f2 + f3) * h / 6;
  float q2 = (f1 + f2 + f3 + f4) * h / 4;
  float tol = acc + eps * fabs(q4);
  *error = fabs(q4 - q2) / 3;
  if (*error < tol)
    return q4;
  else {
    float i1, i2, error1, error2;
    {
      i1 = adapt24(func, a, (a + b) / 2, f1, f2, acc / sqrt(2.), eps, &error1);
      i2 = adapt24(func, (a + b) / 2, b, f3, f4, acc / sqrt(2.), eps, &error2);
    }
    *error = sqrt(error1 * error1 + error2 * error2);
    return i1 + i2;
  }
}


x86 assembly (clang, -O0):
<adapt24>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
movss  %xmm2,-0x1c(%rbp)
movss  %xmm3,-0x20(%rbp)
movss  %xmm4,-0x24(%rbp)
movss  %xmm5,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
movss  -0x18(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x10(%rbp),%rax
movss  -0x14(%rbp),%xmm0
movss  -0x34(%rbp),%xmm1
movss  0xe7e(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
call   *%rax
movss  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movss  -0x14(%rbp),%xmm0
movss  0xe66(%rip),%xmm1
mulss  -0x34(%rbp),%xmm1
movss  0xe51(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
call   *%rax
movss  %xmm0,-0x3c(%rbp)
movss  -0x38(%rbp),%xmm0
addss  -0x3c(%rbp),%xmm0
mulss  -0x34(%rbp),%xmm0
movss  0xe2f(%rip),%xmm1
divss  %xmm1,%xmm0
movss  -0x1c(%rbp),%xmm1
addss  -0x20(%rbp),%xmm1
mulss  -0x34(%rbp),%xmm1
movss  0xe10(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x38(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
addss  -0x3c(%rbp),%xmm0
mulss  -0x34(%rbp),%xmm0
movss  0xdde(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x60(%rbp)
movss  -0x40(%rbp),%xmm0
call   1030 <fabs@plt>
movss  -0x60(%rbp),%xmm0
movss  -0x5c(%rbp),%xmm1
cvtsi2ss %eax,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x48(%rbp)
movss  -0x40(%rbp),%xmm0
subss  -0x44(%rbp),%xmm0
call   1030 <fabs@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm1
movss  -0x48(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    12ac <adapt24+0x17c>
movss  -0x40(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1420 <adapt24+0x2f0>
mov    -0x10(%rbp),%rax
mov    %rax,-0x98(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x80(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  0xd3d(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
movss  -0x38(%rbp),%xmm0
movss  %xmm0,-0x88(%rbp)
ff
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x9c(%rbp)
ff
movss  0xd02(%rip),%xmm0
call   1050 <sqrt@plt>
movss  -0x9c(%rbp),%xmm4
ff
mov    -0x98(%rbp),%rdi
movss  -0x8c(%rbp),%xmm1
ff
movss  -0x88(%rbp),%xmm2
ff
movss  -0x84(%rbp),%xmm3
ff
movaps %xmm0,%xmm5
movss  -0x80(%rbp),%xmm0
divss  %xmm5,%xmm4
movss  -0x28(%rbp),%xmm5
lea    -0x54(%rbp),%rsi
call   1040 <adapt24@plt>
movss  %xmm0,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x78(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  0xc9d(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x64(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x70(%rbp)
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x6c(%rbp)
movss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x68(%rbp)
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  0xc64(%rip),%xmm0
call   1050 <sqrt@plt>
movss  -0x7c(%rbp),%xmm4
mov    -0x78(%rbp),%rdi
movss  -0x70(%rbp),%xmm1
movss  -0x6c(%rbp),%xmm2
movss  -0x68(%rbp),%xmm3
movaps %xmm0,%xmm5
movss  -0x64(%rbp),%xmm0
divss  %xmm5,%xmm4
movss  -0x28(%rbp),%xmm5
lea    -0x58(%rbp),%rsi
call   1040 <adapt24@plt>
movss  %xmm0,-0x50(%rbp)
movss  -0x54(%rbp),%xmm0
movss  -0x54(%rbp),%xmm2
movss  -0x58(%rbp),%xmm1
mulss  -0x58(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1050 <sqrt@plt>
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x4c(%rbp),%xmm0
addss  -0x50(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adapt24>:
push   %r14
push   %rbx
sub    $0x98,%rsp
mov    %rsi,%r14
movss  %xmm5,0xc(%rsp)
movss  %xmm4,0x8(%rsp)
movaps %xmm3,0x60(%rsp)
movaps %xmm2,0x50(%rsp)
movaps %xmm0,%xmm2
mov    %rdi,%rbx
movss  %xmm1,0x10(%rsp)
movaps %xmm1,%xmm0
movss  %xmm2,0x14(%rsp)
subss  %xmm2,%xmm0
movaps %xmm0,0x20(%rsp)
divss  0xe87(%rip),%xmm0
addss  %xmm2,%xmm0
call   *%rdi
movaps %xmm0,0x40(%rsp)
movss  0xe78(%rip),%xmm0
mulss  0x20(%rsp),%xmm0
divss  0xe66(%rip),%xmm0
addss  0x14(%rsp),%xmm0
call   *%rbx
movaps 0x50(%rsp),%xmm4
movaps %xmm4,%xmm2
movaps 0x40(%rsp),%xmm6
unpcklps %xmm6,%xmm2
movaps 0x60(%rsp),%xmm3
movaps %xmm3,%xmm1
unpcklps %xmm0,%xmm1
addps  %xmm2,%xmm1
movaps 0x20(%rsp),%xmm5
movaps %xmm5,%xmm2
shufps $0x0,%xmm5,%xmm2
mulps  %xmm1,%xmm2
divps  0xe4a(%rip),%xmm2
movaps %xmm2,%xmm1
shufps $0x55,%xmm2,%xmm1
addss  %xmm2,%xmm1
movaps %xmm1,0x30(%rsp)
addss  %xmm4,%xmm6
addss  %xmm3,%xmm6
movaps %xmm0,0x70(%rsp)
addss  %xmm0,%xmm6
mulss  %xmm5,%xmm6
mulss  0xe05(%rip),%xmm6
movaps %xmm6,0x80(%rsp)
movaps %xmm1,%xmm0
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0xc(%rsp),%xmm0
addss  0x8(%rsp),%xmm0
movss  %xmm0,0x20(%rsp)
movaps 0x80(%rsp),%xmm0
addss  0x30(%rsp),%xmm0
call   1030 <fabs@plt>
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,(%r14)
movss  0x20(%rsp),%xmm1
ucomiss %xmm0,%xmm1
movaps 0x30(%rsp),%xmm0
ja     133f <adapt24+0x20f>
movss  0x14(%rsp),%xmm0
movaps %xmm0,%xmm1
addss  0x10(%rsp),%xmm1
mulss  0xd80(%rip),%xmm1
movss  %xmm1,0x20(%rsp)
movss  0x8(%rsp),%xmm4
divss  0xd70(%rip),%xmm4
movss  %xmm4,0x8(%rsp)
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
movaps 0x40(%rsp),%xmm2
movaps 0x50(%rsp),%xmm3
movss  0xc(%rsp),%xmm5
call   1040 <adapt24@plt>
movaps %xmm0,0x30(%rsp)
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
movss  0x20(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movaps 0x60(%rsp),%xmm2
movaps 0x70(%rsp),%xmm3
movss  0x8(%rsp),%xmm4
movss  0xc(%rsp),%xmm5
call   1040 <adapt24@plt>
movaps %xmm0,%xmm2
movss  0x1c(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1320 <adapt24+0x1f0>
sqrtss %xmm0,%xmm0
jmp    1331 <adapt24+0x201>
movss  %xmm2,0x8(%rsp)
call   1050 <sqrt@plt>
movss  0x8(%rsp),%xmm2
movss  %xmm0,(%r14)
movaps 0x30(%rsp),%xmm0
addss  %xmm2,%xmm0
add    $0x98,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float @adapt24(float (float)* %0, float %1, float %2, float %3, float %4, float %5, float %6, float* %7) {
%9 = alloca float
%10 = alloca float (float)*
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float*
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca float
%23 = alloca float
%24 = alloca float
%25 = alloca float
%26 = alloca float
%27 = alloca float
store float (float)* %0, float (float)** %10
store float %1, float* %11
store float %2, float* %12
store float %3, float* %13
store float %4, float* %14
store float %5, float* %15
store float %6, float* %16
store float* %7, float** %17
%28 = load float, float* %12
%29 = load float, float* %11
%30 = fsub float %28, %29
store float %30, float* %18
%31 = load float (float)*, float (float)** %10
%32 = load float, float* %11
%33 = load float, float* %18
%34 = fdiv float %33, 6.000000e+00
%35 = fadd float %32, %34
%36 = call float %31(float %35)
store float %36, float* %19
%37 = load float (float)*, float (float)** %10
%38 = load float, float* %11
%39 = load float, float* %18
%40 = fmul float 5.000000e+00, %39
%41 = fdiv float %40, 6.000000e+00
%42 = fadd float %38, %41
%43 = call float %37(float %42)
store float %43, float* %20
%44 = load float, float* %19
%45 = load float, float* %20
%46 = fadd float %44, %45
%47 = load float, float* %18
%48 = fmul float %46, %47
%49 = fdiv float %48, 3.000000e+00
%50 = load float, float* %13
%51 = load float, float* %14
%52 = fadd float %50, %51
%53 = load float, float* %18
%54 = fmul float %52, %53
%55 = fdiv float %54, 6.000000e+00
%56 = fadd float %49, %55
store float %56, float* %21
%57 = load float, float* %19
%58 = load float, float* %13
%59 = fadd float %57, %58
%60 = load float, float* %14
%61 = fadd float %59, %60
%62 = load float, float* %20
%63 = fadd float %61, %62
%64 = load float, float* %18
%65 = fmul float %63, %64
%66 = fdiv float %65, 4.000000e+00
store float %66, float* %22
%67 = load float, float* %15
%68 = load float, float* %16
%69 = load float, float* %21
%70 = call i32 @fabs(float %69)
%71 = sitofp i32 %70 to float
%72 = call float @llvm.fmuladd.f32(float %68, float %71, float %67)
store float %72, float* %23
%73 = load float, float* %21
%74 = load float, float* %22
%75 = fsub float %73, %74
%76 = call i32 @fabs(float %75)
%77 = sdiv i32 %76, 3
%78 = sitofp i32 %77 to float
%79 = load float*, float** %17
store float %78, float* %79
%80 = load float*, float** %17
%81 = load float, float* %80
%82 = load float, float* %23
%83 = fcmp olt float %81, %82
br i1 %83, label %84, label %86
84: ; preds = %8
%85 = load float, float* %21
store float %85, float* %9
br label %124
86: ; preds = %8
%87 = load float (float)*, float (float)** %10
%88 = load float, float* %11
%89 = load float, float* %11
%90 = load float, float* %12
%91 = fadd float %89, %90
%92 = fdiv float %91, 2.000000e+00
%93 = load float, float* %19
%94 = load float, float* %13
%95 = load float, float* %15
%96 = call float @sqrt(float 2.000000e+00)
%97 = fdiv float %95, %96
%98 = load float, float* %16
%99 = call float @adapt24(float (float)* %87, float %88, float %92, float %93, float %94, float %97, float %98, float* %26)
store float %99, float* %24
%100 = load float (float)*, float (float)** %10
%101 = load float, float* %11
%102 = load float, float* %12
%103 = fadd float %101, %102
%104 = fdiv float %103, 2.000000e+00
%105 = load float, float* %12
%106 = load float, float* %14
%107 = load float, float* %20
%108 = load float, float* %15
%109 = call float @sqrt(float 2.000000e+00)
%110 = fdiv float %108, %109
%111 = load float, float* %16
%112 = call float @adapt24(float (float)* %100, float %104, float %105, float %106, float %107, float %110, float %111, float* %27)
store float %112, float* %25
%113 = load float, float* %26
%114 = load float, float* %26
%115 = load float, float* %27
%116 = load float, float* %27
%117 = fmul float %115, %116
%118 = call float @llvm.fmuladd.f32(float %113, float %114, float %117)
%119 = call float @sqrt(float %118)
%120 = load float*, float** %17
store float %119, float* %120
%121 = load float, float* %24
%122 = load float, float* %25
%123 = fadd float %121, %122
store float %123, float* %9
br label %124
124: ; preds = %86, %84
%125 = load float, float* %9
ret float %125
}

LLVM IR (-O2):
define float @adapt24(float (float)* %0, float %1, float %2, float %3, float %4, float %5, float %6, float* nocapture writeonly %7) {
%9 = alloca float
%10 = alloca float
%11 = fsub float %2, %1
%12 = fdiv float %11, 6.000000e+00
%13 = fadd float %12, %1
%14 = tail call float %0(float %13)
%15 = fmul float %11, 5.000000e+00
%16 = fdiv float %15, 6.000000e+00
%17 = fadd float %16, %1
%18 = tail call float %0(float %17)
%19 = insertelement <2 x float> poison, float %3, i64 0
%20 = insertelement <2 x float> %19, float %14, i64 1
%21 = insertelement <2 x float> poison, float %4, i64 0
%22 = insertelement <2 x float> %21, float %18, i64 1
%23 = fadd <2 x float> %20, %22
%24 = insertelement <2 x float> poison, float %11, i64 0
%25 = shufflevector <2 x float> %24, <2 x float> poison, <2 x i32> zeroinitializer
%26 = fmul <2 x float> %25, %23
%27 = fdiv <2 x float> %26, <float 6.000000e+00, float 3.000000e+00>
%28 = shufflevector <2 x float> %27, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%29 = fadd <2 x float> %27, %28
%30 = extractelement <2 x float> %29, i64 0
%31 = fadd float %14, %3
%32 = fadd float %31, %4
%33 = fadd float %18, %32
%34 = fmul float %11, %33
%35 = fmul float %34, 2.500000e-01
%36 = tail call i32 @fabs(float %30)
%37 = sitofp i32 %36 to float
%38 = tail call float @llvm.fmuladd.f32(float %6, float %37, float %5)
%39 = fsub float %30, %35
%40 = tail call i32 @fabs(float %39)
%41 = sdiv i32 %40, 3
%42 = sitofp i32 %41 to float
store float %42, float* %7
%43 = fcmp ogt float %38, %42
br i1 %43, label %58, label %44
44: ; preds = %8
%45 = bitcast float* %9 to i8*
%46 = bitcast float* %10 to i8*
%47 = fadd float %1, %2
%48 = fmul float %47, 5.000000e-01
%49 = fdiv float %5, 0x3FF6A09E60000000
%50 = call float @adapt24(float (float)* %0, float %1, float %48, float %14, float %3, float %49, float %6, float* %9)
%51 = call float @adapt24(float (float)* %0, float %48, float %2, float %4, float %18, float %49, float %6, float* %10)
%52 = load float, float* %9
%53 = load float, float* %10
%54 = fmul float %53, %53
%55 = tail call float @llvm.fmuladd.f32(float %52, float %52, float %54)
%56 = tail call float @sqrt(float %55)
store float %56, float* %7
%57 = fadd float %50, %51
br label %58
58: ; preds = %8, %44
%59 = phi float [ %57, %44 ], [ %30, %8 ]
ret float %59
}