#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 M_PI;
scalar_t__ cos(double);
double cosh(double const);
double sin(double);
double sinh(double const);
double square(scalar_t__);
double dEnergyDifferenceExpGamma2(const double k1, const double k2,
                                  const double eta) {
  const double coshe = cosh(eta);
  return M_PI * sinh(eta) *
         (sin(6.283185307179586476925 * k2) /
              square(coshe - cos(6.283185307179586476925 * k2)) -
          sin(6.283185307179586476925 * k1) /
              square(coshe - cos(6.283185307179586476925 * k1)));
}


x86 assembly (clang, -O0):
<dEnergyDifferenceExpGamma2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <cosh@plt>
movsd  %xmm0,-0x20(%rbp)
mov    0x2e6b(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sinh@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe57(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1060 <sin@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe36(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1070 <cos@plt>
movsd  -0x50(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1050 <square@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xdfb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1060 <sin@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xdda(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1070 <cos@plt>
movsd  -0x40(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1050 <square@plt>
movsd  -0x38(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x28(%rbp),%xmm0
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dEnergyDifferenceExpGamma2>:
sub    $0x58,%rsp
movsd  %xmm2,0x30(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movaps %xmm2,%xmm0
call   1040 <cosh@plt>
movsd  %xmm0,0x28(%rsp)
mov    0x2e6d(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x30(%rsp),%xmm0
call   1030 <sinh@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0xe59(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1060 <sin@plt>
movapd %xmm0,0x30(%rsp)
movsd  0x10(%rsp),%xmm0
call   1070 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x28(%rsp),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
call   1050 <square@plt>
movapd %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xe0d(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1060 <sin@plt>
movapd %xmm0,0x40(%rsp)
movsd  0x8(%rsp),%xmm0
call   1070 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x28(%rsp),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
call   1050 <square@plt>
movapd 0x30(%rsp),%xmm1
unpcklpd 0x40(%rsp),%xmm1
movapd 0x10(%rsp),%xmm2
unpcklpd %xmm0,%xmm2
divpd  %xmm2,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
subsd  %xmm0,%xmm1
mulsd  (%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x58,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @dEnergyDifferenceExpGamma2(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %6
%9 = call double @cosh(double %8)
store double %9, double* %7
%10 = load double, double* @M_PI
%11 = load double, double* %6
%12 = call double @sinh(double %11)
%13 = fmul double %10, %12
%14 = load double, double* %5
%15 = fmul double 0x401921FB54442D18, %14
%16 = call double @sin(double %15)
%17 = load double, double* %7
%18 = load double, double* %5
%19 = fmul double 0x401921FB54442D18, %18
%20 = call i64 @cos(double %19)
%21 = sitofp i64 %20 to double
%22 = fsub double %17, %21
%23 = fptosi double %22 to i64
%24 = call double @square(i64 %23)
%25 = fdiv double %16, %24
%26 = load double, double* %4
%27 = fmul double 0x401921FB54442D18, %26
%28 = call double @sin(double %27)
%29 = load double, double* %7
%30 = load double, double* %4
%31 = fmul double 0x401921FB54442D18, %30
%32 = call i64 @cos(double %31)
%33 = sitofp i64 %32 to double
%34 = fsub double %29, %33
%35 = fptosi double %34 to i64
%36 = call double @square(i64 %35)
%37 = fdiv double %28, %36
%38 = fsub double %25, %37
%39 = fmul double %13, %38
ret double %39
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @dEnergyDifferenceExpGamma2(double %0, double %1, double %2) {
%4 = tail call double @cosh(double %2)
%5 = load double, double* @M_PI
%6 = tail call double @sinh(double %2)
%7 = fmul double %5, %6
%8 = fmul double %1, 0x401921FB54442D18
%9 = tail call double @sin(double %8)
%10 = tail call i64 @cos(double %8)
%11 = sitofp i64 %10 to double
%12 = fsub double %4, %11
%13 = fptosi double %12 to i64
%14 = tail call double @square(i64 %13)
%15 = fmul double %0, 0x401921FB54442D18
%16 = tail call double @sin(double %15)
%17 = tail call i64 @cos(double %15)
%18 = sitofp i64 %17 to double
%19 = fsub double %4, %18
%20 = fptosi double %19 to i64
%21 = tail call double @square(i64 %20)
%22 = insertelement <2 x double> poison, double %9, i64 0
%23 = insertelement <2 x double> %22, double %16, i64 1
%24 = insertelement <2 x double> poison, double %14, i64 0
%25 = insertelement <2 x double> %24, double %21, i64 1
%26 = fdiv <2 x double> %23, %25
%27 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%28 = fsub <2 x double> %26, %27
%29 = extractelement <2 x double> %28, i64 0
%30 = fmul double %7, %29
ret double %30
}