#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 */
long double f(long double, long double);
long double runge_kutta_3(long double x, long double y, double h) {
  long double k1, k2, k3;
  k1 = f(x, y);
  k2 = f(x + 0.5 * h, y + 0.5 * h * k1);
  k3 = f(x + h, y + 2.0 * h * k2 - h * k1);
  y = y + h * (k1 + 4.0 * k2 + k3) / 6.0;
  return y;
}


x86 assembly (clang, -O0):
<runge_kutta_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <f@plt>
fstpt  -0x40(%rbp)
fldt   -0x10(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
fldl   -0x68(%rbp)
fadd   %st,%st(1)
fldt   -0x20(%rbp)
fldt   -0x40(%rbp)
fmulp  %st,%st(2)
faddp  %st,%st(1)
mov    %rsp,%rax
fxch   %st(1)
fstpt  (%rax)
fstpt  0x10(%rax)
call   1030 <f@plt>
fstpt  -0x50(%rbp)
fldt   -0x10(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
fldl   -0x70(%rbp)
fadd   %st,%st(1)
fldt   -0x20(%rbp)
addsd  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
fldl   -0x78(%rbp)
fldt   -0x50(%rbp)
fmulp  %st,%st(1)
faddp  %st,%st(1)
fldt   -0x40(%rbp)
fmulp  %st,%st(2)
fsubp  %st,%st(1)
mov    %rsp,%rax
fxch   %st(1)
fstpt  (%rax)
fstpt  0x10(%rax)
call   1030 <f@plt>
fstpt  -0x60(%rbp)
fldt   -0x20(%rbp)
fldl   -0x28(%rbp)
fldt   -0x40(%rbp)
fldt   -0x50(%rbp)
flds   0xe39(%rip)
fmulp  %st,%st(1)
faddp  %st,%st(1)
fldt   -0x60(%rbp)
faddp  %st,%st(1)
fmulp  %st,%st(1)
flds   0xe2c(%rip)
fdivrp %st,%st(1)
faddp  %st,%st(1)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runge_kutta_3>:
sub    $0x88,%rsp
movsd  %xmm0,0x38(%rsp)
fldt   0x90(%rsp)
fld    %st(0)
fstpt  0x40(%rsp)
fldt   0xa0(%rsp)
fld    %st(0)
fstpt  0x2c(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <f@plt>
fld    %st(0)
fstpt  0x4c(%rsp)
movsd  0xeaf(%rip),%xmm0
mulsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x58(%rsp)
fldl   0x58(%rsp)
fldt   0x40(%rsp)
fadd   %st(1),%st
fxch   %st(1)
fmulp  %st,%st(2)
fldt   0x2c(%rsp)
faddp  %st,%st(2)
fxch   %st(1)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <f@plt>
fld    %st(0)
fstpt  0x70(%rsp)
movsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x68(%rsp)
fldl   0x68(%rsp)
fld    %st(0)
fstpt  0x7c(%rsp)
addsd  %xmm0,%xmm0
movsd  %xmm0,0x60(%rsp)
fxch   %st(1)
fmull  0x60(%rsp)
fldt   0x40(%rsp)
fadd   %st(2),%st
fldt   0x2c(%rsp)
faddp  %st,%st(2)
fldt   0x4c(%rsp)
fmulp  %st,%st(3)
fxch   %st(1)
fsubp  %st,%st(2)
fstpt  (%rsp)
fstpt  0x10(%rsp)
call   1030 <f@plt>
fldt   0x70(%rsp)
fmuls  0xe31(%rip)
fldt   0x4c(%rsp)
faddp  %st,%st(1)
faddp  %st,%st(1)
fldt   0x7c(%rsp)
fmulp  %st,%st(1)
fdivs  0xe21(%rip)
fldt   0x2c(%rsp)
faddp  %st,%st(1)
add    $0x88,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @runge_kutta_3(x86_fp80 %0, x86_fp80 %1, double %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca double
%7 = alloca x86_fp80
%8 = alloca x86_fp80
%9 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
store double %2, double* %6
%10 = load x86_fp80, x86_fp80* %4
%11 = load x86_fp80, x86_fp80* %5
%12 = call x86_fp80 @f(x86_fp80 %10, x86_fp80 %11)
store x86_fp80 %12, x86_fp80* %7
%13 = load x86_fp80, x86_fp80* %4
%14 = load double, double* %6
%15 = fmul double 5.000000e-01, %14
%16 = fpext double %15 to x86_fp80
%17 = fadd x86_fp80 %13, %16
%18 = load x86_fp80, x86_fp80* %5
%19 = load double, double* %6
%20 = fmul double 5.000000e-01, %19
%21 = fpext double %20 to x86_fp80
%22 = load x86_fp80, x86_fp80* %7
%23 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %21, x86_fp80 %22, x86_fp80 %18)
%24 = call x86_fp80 @f(x86_fp80 %17, x86_fp80 %23)
store x86_fp80 %24, x86_fp80* %8
%25 = load x86_fp80, x86_fp80* %4
%26 = load double, double* %6
%27 = fpext double %26 to x86_fp80
%28 = fadd x86_fp80 %25, %27
%29 = load x86_fp80, x86_fp80* %5
%30 = load double, double* %6
%31 = fmul double 2.000000e+00, %30
%32 = fpext double %31 to x86_fp80
%33 = load x86_fp80, x86_fp80* %8
%34 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %32, x86_fp80 %33, x86_fp80 %29)
%35 = load double, double* %6
%36 = fpext double %35 to x86_fp80
%37 = load x86_fp80, x86_fp80* %7
%38 = fneg x86_fp80 %36
%39 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %38, x86_fp80 %37, x86_fp80 %34)
%40 = call x86_fp80 @f(x86_fp80 %28, x86_fp80 %39)
store x86_fp80 %40, x86_fp80* %9
%41 = load x86_fp80, x86_fp80* %5
%42 = load double, double* %6
%43 = fpext double %42 to x86_fp80
%44 = load x86_fp80, x86_fp80* %7
%45 = load x86_fp80, x86_fp80* %8
%46 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 0xK40018000000000000000, x86_fp80 %45, x86_fp80 %44)
%47 = load x86_fp80, x86_fp80* %9
%48 = fadd x86_fp80 %46, %47
%49 = fmul x86_fp80 %43, %48
%50 = fdiv x86_fp80 %49, 0xK4001C000000000000000
%51 = fadd x86_fp80 %41, %50
store x86_fp80 %51, x86_fp80* %5
%52 = load x86_fp80, x86_fp80* %5
ret x86_fp80 %52
}

LLVM IR (-O2):
define x86_fp80 @runge_kutta_3(x86_fp80 %0, x86_fp80 %1, double %2) {
%4 = tail call x86_fp80 @f(x86_fp80 %0, x86_fp80 %1)
%5 = fmul double %2, 5.000000e-01
%6 = fpext double %5 to x86_fp80
%7 = fadd x86_fp80 %6, %0
%8 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %6, x86_fp80 %4, x86_fp80 %1)
%9 = tail call x86_fp80 @f(x86_fp80 %7, x86_fp80 %8)
%10 = fpext double %2 to x86_fp80
%11 = fadd x86_fp80 %10, %0
%12 = fmul double %2, 2.000000e+00
%13 = fpext double %12 to x86_fp80
%14 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %13, x86_fp80 %9, x86_fp80 %1)
%15 = fneg x86_fp80 %10
%16 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %15, x86_fp80 %4, x86_fp80 %14)
%17 = tail call x86_fp80 @f(x86_fp80 %11, x86_fp80 %16)
%18 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %9, x86_fp80 0xK40018000000000000000, x86_fp80 %4)
%19 = fadd x86_fp80 %18, %17
%20 = fmul x86_fp80 %19, %10
%21 = fdiv x86_fp80 %20, 0xK4001C000000000000000
%22 = fadd x86_fp80 %21, %1
ret x86_fp80 %22
}