#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 _f(double);
double difm2(double x, double h) {
  double f1, f2;
  f1 = _f(x + h) - _f(x - h);
  f2 = _f(x + 2. * h) - _f(x - 2. * h);
  return (2. * f1 / 3. - f2 / 12.) / h;
}


x86 assembly (clang, -O0):
<difm2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <_f@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <_f@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
call   1030 <_f@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
call   1030 <_f@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe6e(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe59(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xe40(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
divsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<difm2>:
sub    $0x48,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
addsd  %xmm1,%xmm0
call   1030 <_f@plt>
movapd %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
call   1030 <_f@plt>
movapd 0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x28(%rsp)
addsd  (%rsp),%xmm0
call   1030 <_f@plt>
movapd %xmm0,0x30(%rsp)
movsd  (%rsp),%xmm0
subsd  0x28(%rsp),%xmm0
call   1030 <_f@plt>
unpcklpd 0x30(%rsp),%xmm1
unpcklpd %xmm0,%xmm0
subpd  %xmm0,%xmm1
movapd 0x10(%rsp),%xmm0
addsd  %xmm0,%xmm0
shufpd $0x2,%xmm1,%xmm0
divpd  0xe5d(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
subsd  %xmm1,%xmm0
divsd  0x8(%rsp),%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define double @difm2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fadd double %7, %8
%10 = call double @_f(double %9)
%11 = load double, double* %3
%12 = load double, double* %4
%13 = fsub double %11, %12
%14 = call double @_f(double %13)
%15 = fsub double %10, %14
store double %15, double* %5
%16 = load double, double* %3
%17 = load double, double* %4
%18 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %17, double %16)
%19 = call double @_f(double %18)
%20 = load double, double* %3
%21 = load double, double* %4
%22 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %21, double %20)
%23 = call double @_f(double %22)
%24 = fsub double %19, %23
store double %24, double* %6
%25 = load double, double* %5
%26 = fmul double 2.000000e+00, %25
%27 = fdiv double %26, 3.000000e+00
%28 = load double, double* %6
%29 = fdiv double %28, 1.200000e+01
%30 = fsub double %27, %29
%31 = load double, double* %4
%32 = fdiv double %30, %31
ret double %32
}

LLVM IR (-O2):
define double @difm2(double %0, double %1) {
%3 = fadd double %0, %1
%4 = tail call double @_f(double %3)
%5 = fsub double %0, %1
%6 = tail call double @_f(double %5)
%7 = fsub double %4, %6
%8 = tail call double @llvm.fmuladd.f64(double %1, double 2.000000e+00, double %0)
%9 = tail call double @_f(double %8)
%10 = tail call double @llvm.fmuladd.f64(double %1, double -2.000000e+00, double %0)
%11 = tail call double @_f(double %10)
%12 = insertelement <2 x double> poison, double %7, i64 0
%13 = insertelement <2 x double> %12, double %9, i64 1
%14 = insertelement <2 x double> <double 2.000000e+00, double poison>, double %11, i64 1
%15 = fmul <2 x double> %13, %14
%16 = fsub <2 x double> %13, %14
%17 = shufflevector <2 x double> %15, <2 x double> %16, <2 x i32> <i32 0, i32 3>
%18 = fdiv <2 x double> %17, <double 3.000000e+00, double 1.200000e+01>
%19 = shufflevector <2 x double> %18, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%20 = fsub <2 x double> %18, %19
%21 = extractelement <2 x double> %20, i64 0
%22 = fdiv double %21, %1
ret double %22
}