#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(double);
double stub1(double);
double integration(double a, double fa, double b, double fb, double eps,
                   double (*F)(double x)) {
  static int depth = 0;
  double fc, v0, v, h, xc;
  ++depth;
  v = 0.0;
  if (a != b) {
    xc = (a + b) * 0.5;
    h = b - a;
    v = v0 = h * (fa + fb) * 0.5;
    if (xc != a && xc != b) {
      double err;
      fc = (*F)(xc);
      v = (v0 + fc * h) * 0.5;
      err = fabs(v - v0);
      if (err >= 12.0 * h * eps && fabs(h) >= (1.0 + fabs(xc)) * 1e-15) {
        v = integration(a, fa, xc, fc, eps, F) +
            integration(xc, fc, b, fb, eps, F);
      }
    }
  }
  --depth;
  return v;
}


x86 assembly (clang, -O0):
<integration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
mov    %rdi,-0x30(%rbp)
mov    0x2ef1(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ee8(%rip)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1167 <integration+0x57>
jp     1167 <integration+0x57>
jmp    1309 <integration+0x1f9>
movsd  -0x8(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe87(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe54(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jne    11d5 <integration+0xc5>
jp     11d5 <integration+0xc5>
jmp    1304 <integration+0x1f4>
movsd  -0x58(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    11f0 <integration+0xe0>
jp     11f0 <integration+0xe0>
jmp    1304 <integration+0x1f4>
mov    -0x30(%rbp),%rax
movsd  -0x58(%rbp),%xmm0
call   *%rax
movsd  %xmm0,-0x38(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xde1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movaps 0xde7(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0xdb9(%rip),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jb     12ff <integration+0x1ef>
movsd  -0x50(%rbp),%xmm0
movaps 0xdb1(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x58(%rbp),%xmm2
movaps 0xda1(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  0xd8d(%rip),%xmm1
addsd  %xmm2,%xmm1
movsd  0xd79(%rip),%xmm2
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     12ff <integration+0x1ef>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
mov    -0x30(%rbp),%rdi
call   1030 <integration@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
mov    -0x30(%rbp),%rdi
call   1030 <integration@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1304 <integration+0x1f4>
jmp    1309 <integration+0x1f9>
mov    0x2d1d(%rip),%eax
add    $0xffffffff,%eax
mov    %eax,0x2d14(%rip)
movsd  -0x48(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integration>:
push   %rbx
sub    $0x50,%rsp
addl   $0x1,0x2f10(%rip)
ucomisd %xmm2,%xmm0
jne    1128 <integration+0x18>
jnp    126e <integration+0x15e>
movapd %xmm0,%xmm6
addsd  %xmm2,%xmm0
movsd  0xec7(%rip),%xmm8
mulsd  %xmm8,%xmm0
movapd %xmm2,%xmm7
subsd  %xmm6,%xmm7
movapd %xmm1,%xmm5
addsd  %xmm3,%xmm5
mulsd  %xmm7,%xmm5
mulsd  %xmm8,%xmm5
ucomisd %xmm6,%xmm0
jne    1163 <integration+0x53>
jnp    1274 <integration+0x164>
ucomisd %xmm2,%xmm0
jne    116f <integration+0x5f>
jnp    1274 <integration+0x164>
mov    %rdi,%rbx
movsd  %xmm6,0x20(%rsp)
movsd  %xmm1,0x28(%rsp)
movsd  %xmm2,0x30(%rsp)
movsd  %xmm3,0x38(%rsp)
movapd %xmm0,0x40(%rsp)
movsd  %xmm4,0x8(%rsp)
movapd %xmm7,0x10(%rsp)
movsd  %xmm5,(%rsp)
call   *%rdi
movapd 0x10(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
movapd %xmm0,%xmm5
mulsd  %xmm3,%xmm0
movsd  (%rsp),%xmm2
addsd  %xmm2,%xmm0
mulsd  0xe38(%rip),%xmm0
movapd %xmm0,%xmm1
subsd  %xmm2,%xmm1
andpd  0xe48(%rip),%xmm1
movsd  0xe28(%rip),%xmm2
mulsd  %xmm3,%xmm2
mulsd  %xmm4,%xmm2
ucomisd %xmm2,%xmm1
jb     1278 <integration+0x168>
movapd 0xe26(%rip),%xmm1
andpd  %xmm1,%xmm3
movapd 0x40(%rsp),%xmm2
andpd  %xmm2,%xmm1
addsd  0xe00(%rip),%xmm1
mulsd  0xe00(%rip),%xmm1
ucomisd %xmm1,%xmm3
jb     1278 <integration+0x168>
movsd  0x20(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movapd %xmm5,%xmm3
mov    %rbx,%rdi
movsd  %xmm5,(%rsp)
call   1030 <integration@plt>
movsd  %xmm0,0x10(%rsp)
movapd 0x40(%rsp),%xmm0
movsd  (%rsp),%xmm1
movsd  0x30(%rsp),%xmm2
movsd  0x38(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
mov    %rbx,%rdi
call   1030 <integration@plt>
addsd  0x10(%rsp),%xmm0
jmp    1278 <integration+0x168>
xorpd  %xmm0,%xmm0
jmp    1278 <integration+0x168>
movapd %xmm5,%xmm0
addl   $0xffffffff,0x2dad(%rip)
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@integration.depth = internal global i32 0
define double @integration(double %0, double %1, double %2, double %3, double %4, double (double)* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double (double)*
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double (double)* %5, double (double)** %12
%19 = load i32, i32* @integration.depth
%20 = add nsw i32 %19, 1
store i32 %20, i32* @integration.depth
store double 0.000000e+00, double* %15
%21 = load double, double* %7
%22 = load double, double* %9
%23 = fcmp une double %21, %22
br i1 %23, label %24, label %90
24: ; preds = %6
%25 = load double, double* %7
%26 = load double, double* %9
%27 = fadd double %25, %26
%28 = fmul double %27, 5.000000e-01
store double %28, double* %17
%29 = load double, double* %9
%30 = load double, double* %7
%31 = fsub double %29, %30
store double %31, double* %16
%32 = load double, double* %16
%33 = load double, double* %8
%34 = load double, double* %10
%35 = fadd double %33, %34
%36 = fmul double %32, %35
%37 = fmul double %36, 5.000000e-01
store double %37, double* %14
store double %37, double* %15
%38 = load double, double* %17
%39 = load double, double* %7
%40 = fcmp une double %38, %39
br i1 %40, label %41, label %89
41: ; preds = %24
%42 = load double, double* %17
%43 = load double, double* %9
%44 = fcmp une double %42, %43
br i1 %44, label %45, label %89
45: ; preds = %41
%46 = load double (double)*, double (double)** %12
%47 = load double, double* %17
%48 = call double %46(double %47)
store double %48, double* %13
%49 = load double, double* %14
%50 = load double, double* %13
%51 = load double, double* %16
%52 = call double @llvm.fmuladd.f64(double %50, double %51, double %49)
%53 = fmul double %52, 5.000000e-01
store double %53, double* %15
%54 = load double, double* %15
%55 = load double, double* %14
%56 = fsub double %54, %55
%57 = call double @llvm.fabs.f64(double %56)
store double %57, double* %18
%58 = load double, double* %18
%59 = load double, double* %16
%60 = fmul double 1.200000e+01, %59
%61 = load double, double* %11
%62 = fmul double %60, %61
%63 = fcmp oge double %58, %62
br i1 %63, label %64, label %88
64: ; preds = %45
%65 = load double, double* %16
%66 = call double @llvm.fabs.f64(double %65)
%67 = load double, double* %17
%68 = call double @llvm.fabs.f64(double %67)
%69 = fadd double 1.000000e+00, %68
%70 = fmul double %69, 1.000000e-15
%71 = fcmp oge double %66, %70
br i1 %71, label %72, label %88
72: ; preds = %64
%73 = load double, double* %7
%74 = load double, double* %8
%75 = load double, double* %17
%76 = load double, double* %13
%77 = load double, double* %11
%78 = load double (double)*, double (double)** %12
%79 = call double @integration(double %73, double %74, double %75, double %76, double %77, double (double)* %78)
%80 = load double, double* %17
%81 = load double, double* %13
%82 = load double, double* %9
%83 = load double, double* %10
%84 = load double, double* %11
%85 = load double (double)*, double (double)** %12
%86 = call double @integration(double %80, double %81, double %82, double %83, double %84, double (double)* %85)
%87 = fadd double %79, %86
store double %87, double* %15
br label %88
88: ; preds = %72, %64, %45
br label %89
89: ; preds = %88, %41, %24
br label %90
90: ; preds = %89, %6
%91 = load i32, i32* @integration.depth
%92 = add nsw i32 %91, -1
store i32 %92, i32* @integration.depth
%93 = load double, double* %15
ret double %93
}

LLVM IR (-O2):
@integration.depth = internal unnamed_addr global i32 0
define double @integration(double %0, double %1, double %2, double %3, double %4, double (double)* %5) {
%7 = load i32, i32* @integration.depth
%8 = add nsw i32 %7, 1
store i32 %8, i32* @integration.depth
%9 = fcmp une double %0, %2
br i1 %9, label %10, label %39
10: ; preds = %6
%11 = fadd double %0, %2
%12 = fmul double %11, 5.000000e-01
%13 = fsub double %2, %0
%14 = fadd double %1, %3
%15 = fmul double %13, %14
%16 = fmul double %15, 5.000000e-01
%17 = fcmp une double %12, %0
%18 = fcmp une double %12, %2
%19 = and i1 %17, %18
br i1 %19, label %20, label %39
20: ; preds = %10
%21 = tail call double %5(double %12)
%22 = tail call double @llvm.fmuladd.f64(double %21, double %13, double %16)
%23 = fmul double %22, 5.000000e-01
%24 = fsub double %23, %16
%25 = tail call double @llvm.fabs.f64(double %24)
%26 = fmul double %13, 1.200000e+01
%27 = fmul double %26, %4
%28 = fcmp ult double %25, %27
br i1 %28, label %39, label %29
29: ; preds = %20
%30 = tail call double @llvm.fabs.f64(double %13)
%31 = tail call double @llvm.fabs.f64(double %12)
%32 = fadd double %31, 1.000000e+00
%33 = fmul double %32, 1.000000e-15
%34 = fcmp ult double %30, %33
br i1 %34, label %39, label %35
35: ; preds = %29
%36 = tail call double @integration(double %0, double %1, double %12, double %21, double %4, double (double)* %5)
%37 = tail call double @integration(double %12, double %21, double %2, double %3, double %4, double (double)* %5)
%38 = fadd double %36, %37
br label %39
39: ; preds = %20, %29, %35, %10, %6
%40 = phi double [ %16, %10 ], [ 0.000000e+00, %6 ], [ %38, %35 ], [ %23, %29 ], [ %23, %20 ]
%41 = load i32, i32* @integration.depth
%42 = add nsw i32 %41, -1
store i32 %42, i32* @integration.depth
ret double %40
}