#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 const M_PI;
double cos(double const);
double cosh(double const);
double const square(double const);
double EcontourExp(const double s12, const double d12, const double d34,
                   const double eta) {
  const double coshe = cosh(eta);
  const double cos12 = cos(6.283185307179586476925 * d12);
  const double cos34 = cos(6.283185307179586476925 * d34);
  const double cossum = cos(M_PI * s12);
  return cossum * (1 + square(coshe) + cos12 * cos34 - square(cossum)) -
         coshe * (cos12 + cos34);
}


x86 assembly (clang, -O0):
<EcontourExp>:
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  -0x20(%rbp),%xmm0
call   1030 <cosh@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  0xea5(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xe8e(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x38(%rbp)
mov    0x2e58(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <square@plt>
movsd  0xe41(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1040 <square@plt>
movsd  -0x50(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
subsd  %xmm1,%xmm2
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm3
addsd  -0x38(%rbp),%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EcontourExp>:
sub    $0x28,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,(%rsp)
movaps %xmm3,%xmm0
call   1030 <cosh@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0xe9f(%rip),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xe86(%rip),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm0,%xmm0
mulsd  (%rsp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
call   1040 <square@plt>
addsd  0xe5d(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  (%rsp),%xmm0
call   1040 <square@plt>
movsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  0x18(%rsp),%xmm0
mulsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
@M_PI = constant double 0.000000e+00
define double @EcontourExp(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
%11 = alloca double
%12 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%13 = load double, double* %8
%14 = call double @cosh(double %13)
store double %14, double* %9
%15 = load double, double* %6
%16 = fmul double 0x401921FB54442D18, %15
%17 = call double @cos(double %16)
store double %17, double* %10
%18 = load double, double* %7
%19 = fmul double 0x401921FB54442D18, %18
%20 = call double @cos(double %19)
store double %20, double* %11
%21 = load double, double* @M_PI
%22 = load double, double* %5
%23 = fmul double %21, %22
%24 = call double @cos(double %23)
store double %24, double* %12
%25 = load double, double* %12
%26 = load double, double* %9
%27 = call double @square(double %26)
%28 = fadd double 1.000000e+00, %27
%29 = load double, double* %10
%30 = load double, double* %11
%31 = call double @llvm.fmuladd.f64(double %29, double %30, double %28)
%32 = load double, double* %12
%33 = call double @square(double %32)
%34 = fsub double %31, %33
%35 = load double, double* %9
%36 = load double, double* %10
%37 = load double, double* %11
%38 = fadd double %36, %37
%39 = fmul double %35, %38
%40 = fneg double %39
%41 = call double @llvm.fmuladd.f64(double %25, double %34, double %40)
ret double %41
}

LLVM IR (-O2):
@M_PI = constant double 0.000000e+00
define double @EcontourExp(double %0, double %1, double %2, double %3) {
%5 = tail call double @cosh(double %3)
%6 = fmul double %1, 0x401921FB54442D18
%7 = tail call double @cos(double %6)
%8 = fmul double %2, 0x401921FB54442D18
%9 = tail call double @cos(double %8)
%10 = fmul double %0, 0.000000e+00
%11 = tail call double @cos(double %10)
%12 = tail call double @square(double %5)
%13 = fadd double %12, 1.000000e+00
%14 = tail call double @llvm.fmuladd.f64(double %7, double %9, double %13)
%15 = tail call double @square(double %11)
%16 = fsub double %14, %15
%17 = fadd double %7, %9
%18 = fneg double %5
%19 = fmul double %17, %18
%20 = tail call double @llvm.fmuladd.f64(double %11, double %16, double %19)
ret double %20
}