#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 charge_fraction(double);
double pow(double const, double);
double flux_gaisser(double cos_theta, double kinetic_energy, double charge) {
  const double Emu = kinetic_energy + 0.10566;
  const double ec = 1.1 * Emu * cos_theta;
  const double rpi = 1. + ec / 115.;
  const double rK = 1. + ec / 850.;
  return 1.4E+03 * pow(Emu, -2.7) * (1. / rpi + 0.054 / rK) *
         charge_fraction(charge);
}


x86 assembly (clang, -O0):
<flux_gaisser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xef9(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xedf(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  0xebb(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe8f(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  0xe91(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe6d(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe67(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe4f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe3b(%rip),%xmm1
divsd  -0x30(%rbp),%xmm1
movsd  0xe26(%rip),%xmm2
divsd  -0x38(%rbp),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <charge_fraction@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flux_gaisser>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
movapd %xmm1,%xmm2
addsd  0xeca(%rip),%xmm2
movsd  0xeca(%rip),%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
unpcklpd %xmm1,%xmm1
divpd  0xece(%rip),%xmm1
addpd  0xed6(%rip),%xmm1
movapd %xmm1,(%rsp)
movsd  0xea9(%rip),%xmm1
movapd %xmm2,%xmm0
call   1030 <pow@plt>
mulsd  0xea0(%rip),%xmm0
movapd 0xec0(%rip),%xmm2
divpd  (%rsp),%xmm2
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <charge_fraction@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @flux_gaisser(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%11 = load double, double* %5
%12 = fadd double %11, 1.056600e-01
store double %12, double* %7
%13 = load double, double* %7
%14 = fmul double 1.100000e+00, %13
%15 = load double, double* %4
%16 = fmul double %14, %15
store double %16, double* %8
%17 = load double, double* %8
%18 = fdiv double %17, 1.150000e+02
%19 = fadd double 1.000000e+00, %18
store double %19, double* %9
%20 = load double, double* %8
%21 = fdiv double %20, 8.500000e+02
%22 = fadd double 1.000000e+00, %21
store double %22, double* %10
%23 = load double, double* %7
%24 = call double @pow(double %23, double -2.700000e+00)
%25 = fmul double 1.400000e+03, %24
%26 = load double, double* %9
%27 = fdiv double 1.000000e+00, %26
%28 = load double, double* %10
%29 = fdiv double 5.400000e-02, %28
%30 = fadd double %27, %29
%31 = fmul double %25, %30
%32 = load double, double* %6
%33 = call double @charge_fraction(double %32)
%34 = fmul double %31, %33
ret double %34
}

LLVM IR (-O2):
define double @flux_gaisser(double %0, double %1, double %2) {
%4 = fadd double %1, 1.056600e-01
%5 = fmul double %4, 1.100000e+00
%6 = fmul double %5, %0
%7 = insertelement <2 x double> poison, double %6, i64 0
%8 = shufflevector <2 x double> %7, <2 x double> poison, <2 x i32> zeroinitializer
%9 = fdiv <2 x double> %8, <double 1.150000e+02, double 8.500000e+02>
%10 = fadd <2 x double> %9, <double 1.000000e+00, double 1.000000e+00>
%11 = tail call double @pow(double %4, double -2.700000e+00)
%12 = fmul double %11, 1.400000e+03
%13 = fdiv <2 x double> <double 1.000000e+00, double 5.400000e-02>, %10
%14 = shufflevector <2 x double> %13, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%15 = fadd <2 x double> %13, %14
%16 = extractelement <2 x double> %15, i64 0
%17 = fmul double %16, %12
%18 = tail call double @charge_fraction(double %2)
%19 = fmul double %18, %17
ret double %19
}