#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 */
int pow(double, double);
double euler(double xt, double xtau, double a, double b, double dt) {
  double x1, x2;
  x1 = (a * xtau) / (1 + pow(xtau, 10.0)) - b * xt;
  x2 = (a * xtau) / (1 + pow(xtau, 10.0)) - b * (dt * x1 + xt);
  return (xt + 0.5 * dt * (x1 + x2));
}


x86 assembly (clang, -O0):
<euler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xebb(%rip),%xmm1
call   1030 <pow@plt>
movsd  -0x48(%rbp),%xmm1
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
divsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe5c(%rip),%xmm1
call   1030 <pow@plt>
movsd  -0x40(%rbp),%xmm1
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
divsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm4
movsd  -0x8(%rbp),%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xdf2(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
addsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euler>:
sub    $0x38,%rsp
movsd  %xmm4,0x30(%rsp)
movsd  %xmm3,0x18(%rsp)
movapd %xmm1,%xmm3
movsd  %xmm1,0x28(%rsp)
movsd  %xmm0,0x10(%rsp)
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
movsd  0xebe(%rip),%xmm1
movapd %xmm3,%xmm0
call   1030 <pow@plt>
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  0x18(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  0x28(%rsp),%xmm0
movsd  0xe7d(%rip),%xmm1
call   1030 <pow@plt>
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x8(%rsp),%xmm0
divsd  %xmm1,%xmm0
movsd  0x30(%rsp),%xmm2
movapd %xmm2,%xmm1
movsd  0x20(%rsp),%xmm4
mulsd  %xmm4,%xmm1
movsd  0x10(%rsp),%xmm3
addsd  %xmm3,%xmm1
mulsd  0x18(%rsp),%xmm1
mulsd  0xe40(%rip),%xmm2
subsd  %xmm1,%xmm0
addsd  %xmm4,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @euler(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%13 = load double, double* %8
%14 = load double, double* %7
%15 = fmul double %13, %14
%16 = load double, double* %7
%17 = call i32 @pow(double %16, double 1.000000e+01)
%18 = add nsw i32 1, %17
%19 = sitofp i32 %18 to double
%20 = fdiv double %15, %19
%21 = load double, double* %9
%22 = load double, double* %6
%23 = fneg double %21
%24 = call double @llvm.fmuladd.f64(double %23, double %22, double %20)
store double %24, double* %11
%25 = load double, double* %8
%26 = load double, double* %7
%27 = fmul double %25, %26
%28 = load double, double* %7
%29 = call i32 @pow(double %28, double 1.000000e+01)
%30 = add nsw i32 1, %29
%31 = sitofp i32 %30 to double
%32 = fdiv double %27, %31
%33 = load double, double* %9
%34 = load double, double* %10
%35 = load double, double* %11
%36 = load double, double* %6
%37 = call double @llvm.fmuladd.f64(double %34, double %35, double %36)
%38 = fneg double %33
%39 = call double @llvm.fmuladd.f64(double %38, double %37, double %32)
store double %39, double* %12
%40 = load double, double* %6
%41 = load double, double* %10
%42 = fmul double 5.000000e-01, %41
%43 = load double, double* %11
%44 = load double, double* %12
%45 = fadd double %43, %44
%46 = call double @llvm.fmuladd.f64(double %42, double %45, double %40)
ret double %46
}

LLVM IR (-O2):
define double @euler(double %0, double %1, double %2, double %3, double %4) {
%6 = fmul double %1, %2
%7 = tail call i32 @pow(double %1, double 1.000000e+01)
%8 = add nsw i32 %7, 1
%9 = sitofp i32 %8 to double
%10 = fdiv double %6, %9
%11 = fneg double %3
%12 = tail call double @llvm.fmuladd.f64(double %11, double %0, double %10)
%13 = tail call i32 @pow(double %1, double 1.000000e+01)
%14 = add nsw i32 %13, 1
%15 = sitofp i32 %14 to double
%16 = fdiv double %6, %15
%17 = tail call double @llvm.fmuladd.f64(double %4, double %12, double %0)
%18 = tail call double @llvm.fmuladd.f64(double %11, double %17, double %16)
%19 = fmul double %4, 5.000000e-01
%20 = fadd double %12, %18
%21 = tail call double @llvm.fmuladd.f64(double %19, double %20, double %0)
ret double %21
}