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


x86 assembly (clang, -O0):
<dNontrivEnergyDifferenceNNN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    0x2ea5(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    0x2e7e(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe7f(%rip),%xmm0
mov    0x2e58(%rip),%rax
mulsd  (%rax),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe5a(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x48(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe36(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
mov    %eax,-0x24(%rbp)
movsd  0xe21(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x40(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%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):
<dNontrivEnergyDifferenceNNN>:
push   %rbx
sub    $0x30,%rsp
movsd  %xmm3,0x28(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm0,%xmm0
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xe97(%rip),%xmm0
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0xe77(%rip),%xmm0
call   1040 <cos@plt>
mov    %eax,%ebx
movsd  0x18(%rsp),%xmm0
mulsd  0xe62(%rip),%xmm0
call   1040 <cos@plt>
add    %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xe54(%rip),%xmm1
movsd  0x28(%rsp),%xmm2
mulsd  %xmm1,%xmm2
mulsd  0x8(%rsp),%xmm2
mulsd  %xmm0,%xmm2
movsd  0x20(%rsp),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = constant double 0.000000e+00
define double @dNontrivEnergyDifferenceNNN(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 = fneg double %9
%11 = load double, double* @M_PI
%12 = load double, double* %5
%13 = fmul double %11, %12
%14 = call i32 @sin(double %13)
%15 = sitofp i32 %14 to double
%16 = load double, double* @M_PI
%17 = fmul double 4.000000e+00, %16
%18 = load double, double* %8
%19 = fmul double %17, %18
%20 = load double, double* %5
%21 = fmul double 0x401921FB54442D18, %20
%22 = call i32 @sin(double %21)
%23 = sitofp i32 %22 to double
%24 = fmul double %19, %23
%25 = load double, double* %6
%26 = fmul double 0x401921FB54442D18, %25
%27 = call i32 @cos(double %26)
%28 = load double, double* %7
%29 = fmul double 0x401921FB54442D18, %28
%30 = call i32 @cos(double %29)
%31 = add nsw i32 %27, %30
%32 = sitofp i32 %31 to double
%33 = fmul double %24, %32
%34 = fneg double %33
%35 = call double @llvm.fmuladd.f64(double %10, double %15, double %34)
ret double %35
}

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