#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 EcontourExpAlt(double const, double const, double const, double const);
double EtrivAlt(double const, double const, double const);
double const cos(double);
double cosh(double const);
double sinh(double const);
double EnergyDifferenceExp(const double k1, const double k3, const double k4,
                           const double eta) {
  const double coshe = cosh(eta);
  const double denom = (coshe - cos(6.283185307179586476925 * k1)) *
                       (coshe - cos(6.283185307179586476925 * (k3 + k4 - k1))) *
                       (coshe - cos(6.283185307179586476925 * k3)) *
                       (coshe - cos(6.283185307179586476925 * k4));
  return 0.5 * sinh(eta) / denom * EtrivAlt(k1, k3, k4) *
         EcontourExpAlt(k1, k3, k4, eta);
}


x86 assembly (clang, -O0):
<EnergyDifferenceExp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <cosh@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xe78(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0xe3c(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1070 <cos@plt>
movsd  -0x70(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x68(%rbp),%xmm0
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe07(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1070 <cos@plt>
movsd  -0x60(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x58(%rbp),%xmm0
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xdd1(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1070 <cos@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <sinh@plt>
movaps %xmm0,%xmm1
movsd  0xd90(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <EtrivAlt@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1060 <EcontourExpAlt@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EnergyDifferenceExp>:
sub    $0x38,%rsp
movsd  %xmm3,0x30(%rsp)
movsd  %xmm2,0x28(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x18(%rsp)
movaps %xmm3,%xmm0
call   1050 <cosh@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  0xe78(%rip),%xmm0
call   1070 <cos@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
addsd  0x28(%rsp),%xmm0
subsd  0x18(%rsp),%xmm0
mulsd  0xe49(%rip),%xmm0
call   1070 <cos@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x10(%rsp),%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
mulsd  0xe20(%rip),%xmm0
call   1070 <cos@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x10(%rsp),%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xdfd(%rip),%xmm0
mulsd  0x28(%rsp),%xmm0
call   1070 <cos@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x10(%rsp),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x30(%rsp),%xmm0
call   1040 <sinh@plt>
mulsd  0xdd1(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
call   1030 <EtrivAlt@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
movsd  0x30(%rsp),%xmm3
call   1060 <EcontourExpAlt@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @EnergyDifferenceExp(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%11 = load double, double* %8
%12 = call double @cosh(double %11)
store double %12, double* %9
%13 = load double, double* %9
%14 = load double, double* %5
%15 = fmul double 0x401921FB54442D18, %14
%16 = call double @cos(double %15)
%17 = fsub double %13, %16
%18 = load double, double* %9
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fadd double %19, %20
%22 = load double, double* %5
%23 = fsub double %21, %22
%24 = fmul double 0x401921FB54442D18, %23
%25 = call double @cos(double %24)
%26 = fsub double %18, %25
%27 = fmul double %17, %26
%28 = load double, double* %9
%29 = load double, double* %6
%30 = fmul double 0x401921FB54442D18, %29
%31 = call double @cos(double %30)
%32 = fsub double %28, %31
%33 = fmul double %27, %32
%34 = load double, double* %9
%35 = load double, double* %7
%36 = fmul double 0x401921FB54442D18, %35
%37 = call double @cos(double %36)
%38 = fsub double %34, %37
%39 = fmul double %33, %38
store double %39, double* %10
%40 = load double, double* %8
%41 = call double @sinh(double %40)
%42 = fmul double 5.000000e-01, %41
%43 = load double, double* %10
%44 = fdiv double %42, %43
%45 = load double, double* %5
%46 = load double, double* %6
%47 = load double, double* %7
%48 = call double @EtrivAlt(double %45, double %46, double %47)
%49 = fmul double %44, %48
%50 = load double, double* %5
%51 = load double, double* %6
%52 = load double, double* %7
%53 = load double, double* %8
%54 = call double @EcontourExpAlt(double %50, double %51, double %52, double %53)
%55 = fmul double %49, %54
ret double %55
}

LLVM IR (-O2):
define double @EnergyDifferenceExp(double %0, double %1, double %2, double %3) {
%5 = tail call double @cosh(double %3)
%6 = fmul double %0, 0x401921FB54442D18
%7 = tail call double @cos(double %6)
%8 = fsub double %5, %7
%9 = fadd double %1, %2
%10 = fsub double %9, %0
%11 = fmul double %10, 0x401921FB54442D18
%12 = tail call double @cos(double %11)
%13 = fsub double %5, %12
%14 = fmul double %8, %13
%15 = fmul double %1, 0x401921FB54442D18
%16 = tail call double @cos(double %15)
%17 = fsub double %5, %16
%18 = fmul double %14, %17
%19 = fmul double %2, 0x401921FB54442D18
%20 = tail call double @cos(double %19)
%21 = fsub double %5, %20
%22 = fmul double %18, %21
%23 = tail call double @sinh(double %3)
%24 = fmul double %23, 5.000000e-01
%25 = fdiv double %24, %22
%26 = tail call double @EtrivAlt(double %0, double %1, double %2)
%27 = fmul double %26, %25
%28 = tail call double @EcontourExpAlt(double %0, double %1, double %2, double %3)
%29 = fmul double %28, %27
ret double %29
}