#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 adaptiveSimpsonsAux(double (*)(double, void *), void *, double, double,
                           double, double, double, double, double, int);
double adaptiveSimpsons(double (*f)(double, void *), void *extra_data, double a,
                        double b, double epsilon, int maxRecursionDepth) {
  double c = (a + b) / 2, h = b - a;
  double fa = f(a, extra_data), fb = f(b, extra_data), fc = f(c, extra_data);
  double S = (h / 6) * (fa + 4 * fc + fb);
  return adaptiveSimpsonsAux(f, extra_data, a, b, epsilon, S, fa, fb, fc,
                             maxRecursionDepth);
}


x86 assembly (clang, -O0):
<adaptiveSimpsons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
mov    %edx,-0x2c(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   *%rax
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   *%rax
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   *%rax
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xe63(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
movsd  0xe45(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
addsd  -0x50(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movsd  -0x48(%rbp),%xmm4
movsd  -0x50(%rbp),%xmm5
movsd  -0x58(%rbp),%xmm6
mov    -0x2c(%rbp),%edx
call   1030 <adaptiveSimpsonsAux@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adaptiveSimpsons>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %edx,%r14d
movsd  %xmm2,0x38(%rsp)
movsd  %xmm0,0x30(%rsp)
mov    %rsi,%rbx
mov    %rdi,%rbp
movapd %xmm0,%xmm2
movsd  %xmm1,0x8(%rsp)
addsd  %xmm1,%xmm2
mulsd  0xebd(%rip),%xmm2
movsd  %xmm2,0x18(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x28(%rsp)
mov    %rsi,%rdi
call   *%rbp
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
call   *%rbp
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
mov    %rbx,%rdi
call   *%rbp
movapd %xmm0,%xmm6
movsd  0x28(%rsp),%xmm0
divsd  0xe7c(%rip),%xmm0
movsd  0xe7c(%rip),%xmm3
mulsd  %xmm6,%xmm3
movsd  0x20(%rsp),%xmm4
addsd  %xmm4,%xmm3
movsd  0x10(%rsp),%xmm5
addsd  %xmm5,%xmm3
mulsd  %xmm0,%xmm3
mov    %rbp,%rdi
mov    %rbx,%rsi
movsd  0x30(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x38(%rsp),%xmm2
mov    %r14d,%edx
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <adaptiveSimpsonsAux@plt>

LLVM IR (-O0):
define double @adaptiveSimpsons(double (double, i8*)* %0, i8* %1, double %2, double %3, double %4, i32 %5) {
%7 = alloca double (double, i8*)*
%8 = alloca i8*
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca i32
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
store double (double, i8*)* %0, double (double, i8*)** %7
store i8* %1, i8** %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store i32 %5, i32* %12
%19 = load double, double* %9
%20 = load double, double* %10
%21 = fadd double %19, %20
%22 = fdiv double %21, 2.000000e+00
store double %22, double* %13
%23 = load double, double* %10
%24 = load double, double* %9
%25 = fsub double %23, %24
store double %25, double* %14
%26 = load double (double, i8*)*, double (double, i8*)** %7
%27 = load double, double* %9
%28 = load i8*, i8** %8
%29 = call double %26(double %27, i8* %28)
store double %29, double* %15
%30 = load double (double, i8*)*, double (double, i8*)** %7
%31 = load double, double* %10
%32 = load i8*, i8** %8
%33 = call double %30(double %31, i8* %32)
store double %33, double* %16
%34 = load double (double, i8*)*, double (double, i8*)** %7
%35 = load double, double* %13
%36 = load i8*, i8** %8
%37 = call double %34(double %35, i8* %36)
store double %37, double* %17
%38 = load double, double* %14
%39 = fdiv double %38, 6.000000e+00
%40 = load double, double* %15
%41 = load double, double* %17
%42 = call double @llvm.fmuladd.f64(double 4.000000e+00, double %41, double %40)
%43 = load double, double* %16
%44 = fadd double %42, %43
%45 = fmul double %39, %44
store double %45, double* %18
%46 = load double (double, i8*)*, double (double, i8*)** %7
%47 = load i8*, i8** %8
%48 = load double, double* %9
%49 = load double, double* %10
%50 = load double, double* %11
%51 = load double, double* %18
%52 = load double, double* %15
%53 = load double, double* %16
%54 = load double, double* %17
%55 = load i32, i32* %12
%56 = call double @adaptiveSimpsonsAux(double (double, i8*)* %46, i8* %47, double %48, double %49, double %50, double %51, double %52, double %53, double %54, i32 %55)
ret double %56
}

LLVM IR (-O2):
define double @adaptiveSimpsons(double (double, i8*)* %0, i8* %1, double %2, double %3, double %4, i32 %5) {
%7 = fadd double %2, %3
%8 = fmul double %7, 5.000000e-01
%9 = fsub double %3, %2
%10 = tail call double %0(double %2, i8* %1)
%11 = tail call double %0(double %3, i8* %1)
%12 = tail call double %0(double %8, i8* %1)
%13 = fdiv double %9, 6.000000e+00
%14 = tail call double @llvm.fmuladd.f64(double %12, double 4.000000e+00, double %10)
%15 = fadd double %11, %14
%16 = fmul double %13, %15
%17 = tail call double @adaptiveSimpsonsAux(double (double, i8*)* %0, i8* %1, double %2, double %3, double %4, double %16, double %10, double %11, double %12, i32 %5)
ret double %17
}