#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 pow(double, int);
double simpson_error(double (*f)(double), double a, double b) {
  double result = 0;
  double n = 100;
  double h = (b - a) / n;
  result = -(pow(h, 4) * (b - a) * pow(f(0.00001), 4)) / 180;
  return result;
}


x86 assembly (clang, -O0):
<simpson_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe8f(%rip),%xmm0
call   *-0x8(%rbp)
mov    $0x4,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe4f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simpson_error>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
divsd  0xed2(%rip),%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
movsd  %xmm0,(%rsp)
movsd  0xec3(%rip),%xmm0
call   *%rbx
mov    $0x4,%edi
call   1030 <pow@plt>
movsd  (%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
divsd  0xea8(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @simpson_error(double (double)* %0, double %1, double %2) {
%4 = alloca double (double)*
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double (double)* %0, double (double)** %4
store double %1, double* %5
store double %2, double* %6
store double 0.000000e+00, double* %7
store double 1.000000e+02, double* %8
%10 = load double, double* %6
%11 = load double, double* %5
%12 = fsub double %10, %11
%13 = load double, double* %8
%14 = fdiv double %12, %13
store double %14, double* %9
%15 = load double, double* %9
%16 = call double @pow(double %15, i32 4)
%17 = load double, double* %6
%18 = load double, double* %5
%19 = fsub double %17, %18
%20 = fmul double %16, %19
%21 = load double (double)*, double (double)** %4
%22 = call double %21(double 1.000000e-05)
%23 = call double @pow(double %22, i32 4)
%24 = fmul double %20, %23
%25 = fneg double %24
%26 = fdiv double %25, 1.800000e+02
store double %26, double* %7
%27 = load double, double* %7
ret double %27
}

LLVM IR (-O2):
define double @simpson_error(double (double)* nocapture %0, double %1, double %2) {
%4 = fsub double %2, %1
%5 = fdiv double %4, 1.000000e+02
%6 = tail call double @pow(double %5, i32 4)
%7 = tail call double %0(double 1.000000e-05)
%8 = tail call double @pow(double %7, i32 4)
%9 = fneg double %6
%10 = fmul double %4, %9
%11 = fmul double %10, %8
%12 = fdiv double %11, 1.800000e+02
ret double %12
}