#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(double);
double adaptiveSimpsonsAux(double (*f)(double, void *), void *extra_data,
                           double a, double b, double epsilon, double S,
                           double fa, double fb, double fc, int bottom) {
  double c = (a + b) / 2, h = b - a;
  double d = (a + c) / 2, e = (c + b) / 2;
  double fd = f(d, extra_data), fe = f(e, extra_data);
  double Sleft = (h / 12) * (fa + 4 * fd + fc);
  double Sright = (h / 12) * (fc + 4 * fe + fb);
  double S2 = Sleft + Sright;
  if (bottom <= 0 || fabs(S2 - S) <= 15 * epsilon)
    return S2 + (S2 - S) / 15;
  return adaptiveSimpsonsAux(f, extra_data, a, c, epsilon / 2, Sleft, fa, fc,
                             fd, bottom - 1) +
         adaptiveSimpsonsAux(f, extra_data, c, b, epsilon / 2, Sright, fc, fb,
                             fe, bottom - 1);
}


x86 assembly (clang, -O0):
<adaptiveSimpsonsAux>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
movsd  %xmm3,-0x38(%rbp)
movsd  %xmm4,-0x40(%rbp)
movsd  %xmm5,-0x48(%rbp)
movsd  %xmm6,-0x50(%rbp)
mov    %edx,-0x54(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  0xea5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  0xe7b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x60(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  0xe60(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x10(%rbp),%rax
movsd  -0x70(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
call   *%rax
movsd  %xmm0,-0x80(%rbp)
mov    -0x10(%rbp),%rax
movsd  -0x78(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
call   *%rax
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  0xe17(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
movsd  0xdf9(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
addsd  -0x50(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  0xddb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm1
ff
movsd  0xdba(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
addsd  -0x48(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
addsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
cmpl   $0x0,-0x54(%rbp)
jle    12ae <adaptiveSimpsonsAux+0x18e>
movsd  -0xa0(%rbp),%xmm0
ff
subsd  -0x38(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xd79(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     12dd <adaptiveSimpsonsAux+0x1bd>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm1
ff
subsd  -0x38(%rbp),%xmm1
movsd  0xd4d(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1386 <adaptiveSimpsonsAux+0x266>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movsd  -0x20(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  0xd14(%rip),%xmm3
divsd  %xmm3,%xmm2
movsd  -0x90(%rbp),%xmm3
ff
movsd  -0x40(%rbp),%xmm4
movsd  -0x50(%rbp),%xmm5
movsd  -0x80(%rbp),%xmm6
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
call   1030 <adaptiveSimpsonsAux@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movsd  -0x60(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  0xcc7(%rip),%xmm3
divsd  %xmm3,%xmm2
movsd  -0x98(%rbp),%xmm3
ff
movsd  -0x50(%rbp),%xmm4
movsd  -0x48(%rbp),%xmm5
movsd  -0x88(%rbp),%xmm6
ff
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
call   1030 <adaptiveSimpsonsAux@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adaptiveSimpsonsAux>:
push   %rbp
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %edx,%r14d
movsd  %xmm6,0x30(%rsp)
movsd  %xmm5,0x48(%rsp)
movsd  %xmm4,0x8(%rsp)
movsd  %xmm3,0x28(%rsp)
movsd  %xmm2,0x10(%rsp)
movapd %xmm0,%xmm4
mov    %rsi,%rbx
mov    %rdi,%rbp
movapd %xmm0,%xmm3
addsd  %xmm1,%xmm3
movsd  0xe9d(%rip),%xmm2
mulsd  %xmm2,%xmm3
movapd %xmm1,%xmm0
subsd  %xmm4,%xmm0
movsd  %xmm0,0x20(%rsp)
movapd %xmm3,%xmm0
movsd  %xmm4,0x60(%rsp)
addsd  %xmm4,%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm3,0x38(%rsp)
movsd  %xmm1,0x68(%rsp)
addsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm3,0x18(%rsp)
mov    %rsi,%rdi
call   *%rbp
movsd  %xmm0,0x40(%rsp)
movsd  0x18(%rsp),%xmm0
mov    %rbx,%rdi
call   *%rbp
movsd  0x20(%rsp),%xmm4
divsd  0xe43(%rip),%xmm4
movsd  0xe43(%rip),%xmm1
movsd  0x40(%rsp),%xmm3
mulsd  %xmm1,%xmm3
addsd  0x8(%rsp),%xmm3
movsd  0x30(%rsp),%xmm2
addsd  %xmm2,%xmm3
mulsd  %xmm4,%xmm3
movsd  %xmm0,0x20(%rsp)
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
addsd  0x48(%rsp),%xmm1
mulsd  %xmm4,%xmm1
movapd %xmm3,%xmm0
movsd  %xmm1,0x18(%rsp)
addsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
subsd  0x28(%rsp),%xmm1
test   %r14d,%r14d
jle    12fa <adaptiveSimpsonsAux+0x1da>
movsd  %xmm0,0x58(%rsp)
movapd %xmm1,%xmm0
movsd  %xmm3,0x28(%rsp)
movsd  %xmm1,0x50(%rsp)
call   1040 <fabs@plt>
movsd  0x28(%rsp),%xmm3
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xdc4(%rip),%xmm1
mulsd  0x10(%rsp),%xmm1
ucomisd %xmm0,%xmm1
movsd  0x50(%rsp),%xmm1
movsd  0x58(%rsp),%xmm0
jae    12fa <adaptiveSimpsonsAux+0x1da>
movsd  0x10(%rsp),%xmm2
mulsd  0xd82(%rip),%xmm2
movsd  %xmm2,0x10(%rsp)
add    $0xffffffff,%r14d
mov    %rbp,%rdi
mov    %rbx,%rsi
movsd  0x60(%rsp),%xmm0
movsd  0x38(%rsp),%xmm1
movsd  0x8(%rsp),%xmm4
movsd  0x30(%rsp),%xmm5
movsd  0x40(%rsp),%xmm6
mov    %r14d,%edx
call   1030 <adaptiveSimpsonsAux@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
movsd  0x38(%rsp),%xmm0
movsd  0x68(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x18(%rsp),%xmm3
movsd  0x30(%rsp),%xmm4
movsd  0x48(%rsp),%xmm5
movsd  0x20(%rsp),%xmm6
mov    %r14d,%edx
call   1030 <adaptiveSimpsonsAux@plt>
addsd  0x8(%rsp),%xmm0
jmp    1306 <adaptiveSimpsonsAux+0x1e6>
divsd  0xd16(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define double @adaptiveSimpsonsAux(double (double, i8*)* %0, i8* %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, i32 %9) {
%11 = fadd double %2, %3
%12 = fmul double %11, 5.000000e-01
%13 = fsub double %3, %2
%14 = fadd double %12, %2
%15 = fmul double %14, 5.000000e-01
%16 = fadd double %12, %3
%17 = fmul double %16, 5.000000e-01
%18 = tail call double %0(double %15, i8* %1)
%19 = tail call double %0(double %17, i8* %1)
%20 = fdiv double %13, 1.200000e+01
%21 = tail call double @llvm.fmuladd.f64(double %18, double 4.000000e+00, double %6)
%22 = fadd double %21, %8
%23 = fmul double %20, %22
%24 = tail call double @llvm.fmuladd.f64(double %19, double 4.000000e+00, double %8)
%25 = fadd double %24, %7
%26 = fmul double %20, %25
%27 = fadd double %23, %26
%28 = icmp slt i32 %9, 1
%29 = fsub double %27, %5
br i1 %28, label %35, label %30
30: ; preds = %10
%31 = tail call i32 @fabs(double %29)
%32 = sitofp i32 %31 to double
%33 = fmul double %4, 1.500000e+01
%34 = fcmp ult double %33, %32
br i1 %34, label %40, label %35
35: ; preds = %10, %30
%36 = fdiv double %29, 1.500000e+01
%37 = fadd double %27, %36
br label %38
38: ; preds = %35, %40
%39 = phi double [ %45, %40 ], [ %37, %35 ]
ret double %39
40: ; preds = %30
%41 = fmul double %4, 5.000000e-01
%42 = add nsw i32 %9, -1
%43 = tail call double @adaptiveSimpsonsAux(double (double, i8*)* %0, i8* %1, double %2, double %12, double %41, double %23, double %6, double %8, double %18, i32 %42)
%44 = tail call double @adaptiveSimpsonsAux(double (double, i8*)* %0, i8* %1, double %12, double %3, double %41, double %26, double %8, double %7, double %19, i32 %42)
%45 = fadd double %43, %44
br label %38
}