#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;
int cos(double const);
double EcontourNNN(const double s12, const double d12, const double d34,
                   const double eta) {
  return cos(M_PI * s12) + 2 * eta * cos(6.283185307179586476925 * s12) *
                               (cos(6.283185307179586476925 * d12) +
                                cos(6.283185307179586476925 * d34));
}


x86 assembly (clang, -O0):
<EcontourNNN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    0x2eb5(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb6(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe9c(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
movsd  -0x40(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe78(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <cos@plt>
mov    %eax,-0x24(%rbp)
movsd  0xe63(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1030 <cos@plt>
movsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EcontourNNN>:
push   %rbx
sub    $0x30,%rsp
movsd  %xmm3,0x8(%rsp)
movsd  %xmm2,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
movapd %xmm0,%xmm1
movsd  %xmm0,0x10(%rsp)
xorpd  %xmm0,%xmm0
mulsd  %xmm1,%xmm0
call   1030 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0xe97(%rip),%xmm0
call   1030 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  0xe71(%rip),%xmm0
call   1030 <cos@plt>
mov    %eax,%ebx
movsd  0x20(%rsp),%xmm0
mulsd  0xe5c(%rip),%xmm0
call   1030 <cos@plt>
add    %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x28(%rsp),%xmm0
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = constant double 0.000000e+00
define double @EcontourNNN(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* @M_PI
%10 = load double, double* %5
%11 = fmul double %9, %10
%12 = call i32 @cos(double %11)
%13 = sitofp i32 %12 to double
%14 = load double, double* %8
%15 = fmul double 2.000000e+00, %14
%16 = load double, double* %5
%17 = fmul double 0x401921FB54442D18, %16
%18 = call i32 @cos(double %17)
%19 = sitofp i32 %18 to double
%20 = fmul double %15, %19
%21 = load double, double* %6
%22 = fmul double 0x401921FB54442D18, %21
%23 = call i32 @cos(double %22)
%24 = load double, double* %7
%25 = fmul double 0x401921FB54442D18, %24
%26 = call i32 @cos(double %25)
%27 = add nsw i32 %23, %26
%28 = sitofp i32 %27 to double
%29 = call double @llvm.fmuladd.f64(double %20, double %28, double %13)
ret double %29
}

LLVM IR (-O2):
@M_PI = constant double 0.000000e+00
define double @EcontourNNN(double %0, double %1, double %2, double %3) {
%5 = fmul double %0, 0.000000e+00
%6 = tail call i32 @cos(double %5)
%7 = sitofp i32 %6 to double
%8 = fmul double %3, 2.000000e+00
%9 = fmul double %0, 0x401921FB54442D18
%10 = tail call i32 @cos(double %9)
%11 = sitofp i32 %10 to double
%12 = fmul double %8, %11
%13 = fmul double %1, 0x401921FB54442D18
%14 = tail call i32 @cos(double %13)
%15 = fmul double %2, 0x401921FB54442D18
%16 = tail call i32 @cos(double %15)
%17 = add nsw i32 %16, %14
%18 = sitofp i32 %17 to double
%19 = tail call double @llvm.fmuladd.f64(double %12, double %18, double %7)
ret double %19
}