#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 difm4(double x, double h) {
  double f1, f2, f3, f4;
  f1 = _f(x + h) - _f(x - h);
  f2 = _f(x + 2. * h) - _f(x - 2. * h);
  f3 = _f(x + 3. * h) - _f(x - 3. * h);
  f4 = _f(x + 4. * h) - _f(x - 4. * h);
  return (0.8 * f1 - 0.2 * f2 + 4. * f3 / 105. - f4 / 280.) / h;
}


x86 assembly (clang, -O0):
<difm4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <_f@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <_f@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%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,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
call   1030 <_f@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xe8c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <_f@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xe60(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <_f@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xe10(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <_f@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xe04(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <_f@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xdd1(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xda5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xd8d(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
movsd  0xd78(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  0xd5b(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
divsd  -0x10(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<difm4>:
sub    $0x48,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
addsd  %xmm1,%xmm0
call   1030 <_f@plt>
movsd  %xmm0,0x18(%rsp)
movsd  (%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
call   1030 <_f@plt>
movsd  0x18(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x20(%rsp)
addsd  (%rsp),%xmm0
call   1030 <_f@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
call   1030 <_f@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xe6a(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
call   1030 <_f@plt>
movapd %xmm0,0x20(%rsp)
movsd  0xe54(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
call   1030 <_f@plt>
movapd 0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xe2e(%rip),%xmm0
addsd  (%rsp),%xmm0
call   1030 <_f@plt>
movapd %xmm0,0x30(%rsp)
movsd  0xe1e(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
call   1030 <_f@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0xe08(%rip),%xmm1
movsd  0x18(%rsp),%xmm2
mulsd  0xe02(%rip),%xmm2
addsd  %xmm1,%xmm2
unpcklpd 0x30(%rsp),%xmm1
unpcklpd %xmm0,%xmm0
subpd  %xmm0,%xmm1
movapd 0x20(%rsp),%xmm0
mulsd  0xdca(%rip),%xmm0
shufpd $0x2,%xmm1,%xmm0
divpd  0xddd(%rip),%xmm0
addsd  %xmm0,%xmm2
unpckhpd %xmm0,%xmm0
subsd  %xmm0,%xmm2
divsd  0x8(%rsp),%xmm2
movapd %xmm2,%xmm0
add    $0x48,%rsp
ret

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

LLVM IR (-O2):
define double @difm4(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 = fsub double %9, %11
%13 = tail call double @llvm.fmuladd.f64(double %1, double 3.000000e+00, double %0)
%14 = tail call double @_f(double %13)
%15 = tail call double @llvm.fmuladd.f64(double %1, double -3.000000e+00, double %0)
%16 = tail call double @_f(double %15)
%17 = fsub double %14, %16
%18 = tail call double @llvm.fmuladd.f64(double %1, double 4.000000e+00, double %0)
%19 = tail call double @_f(double %18)
%20 = tail call double @llvm.fmuladd.f64(double %1, double -4.000000e+00, double %0)
%21 = tail call double @_f(double %20)
%22 = fmul double %12, -2.000000e-01
%23 = tail call double @llvm.fmuladd.f64(double %7, double 8.000000e-01, double %22)
%24 = insertelement <2 x double> poison, double %17, i64 0
%25 = insertelement <2 x double> %24, double %19, i64 1
%26 = insertelement <2 x double> <double 4.000000e+00, double poison>, double %21, i64 1
%27 = fmul <2 x double> %25, %26
%28 = fsub <2 x double> %25, %26
%29 = shufflevector <2 x double> %27, <2 x double> %28, <2 x i32> <i32 0, i32 3>
%30 = fdiv <2 x double> %29, <double 1.050000e+02, double 2.800000e+02>
%31 = extractelement <2 x double> %30, i64 0
%32 = fadd double %23, %31
%33 = extractelement <2 x double> %30, i64 1
%34 = fsub double %32, %33
%35 = fdiv double %34, %1
ret double %35
}