#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 exp(int);
int rec_helium_dxedt(double, double, double, double, double, double);
double rec_sahaHeI(double, double, double, double);
double sqrt(double);
double xe_PostSahaHe(double nH0, double Tr0, double fHe, double H, double z,
                     double *Delta_xe) {
  double Tr, nH, s, xeSaha, dxeSahadt, Dxe, DxedotDxe, ainv;
  Tr = Tr0 * (ainv = 1. + z);
  nH = nH0 * ainv * ainv * ainv;
  s = 2.414194e21 * Tr * sqrt(Tr) * exp(-285325. / Tr) / nH * 4.;
  xeSaha = rec_sahaHeI(nH0, Tr0, fHe, z);
  dxeSahadt = -xeSaha * (xeSaha - 1.) / (2. * xeSaha + s - 1.) *
              (285325. / Tr - 1.5) * H;
  Dxe = 0.01 * (1. + fHe - xeSaha);
  DxedotDxe = (rec_helium_dxedt(xeSaha + Dxe, nH0, Tr0, fHe, H, z) -
               rec_helium_dxedt(xeSaha - Dxe, nH0, Tr0, fHe, H, z)) /
              2. / Dxe;
  *Delta_xe = dxeSahadt / DxedotDxe;
  return xeSaha + *Delta_xe;
}


x86 assembly (clang, -O0):
<xe_PostSahaHe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
mov    %rdi,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe9b(%rip),%xmm1
addsd  -0x28(%rbp),%xmm1
movsd  %xmm1,-0x70(%rbp)
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe8f(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xe54(%rip),%xmm0
divsd  -0x38(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  0xe25(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
call   1060 <rec_sahaHeI@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  0xdbd(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
addsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0xd9b(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xd9b(%rip),%xmm1
divsd  -0x38(%rbp),%xmm1
movsd  0xd86(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xd64(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
subsd  -0x50(%rbp),%xmm1
movsd  0xd4a(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
call   1030 <rec_helium_dxedt@plt>
mov    %eax,-0x74(%rbp)
movsd  -0x50(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
call   1030 <rec_helium_dxedt@plt>
mov    %eax,%ecx
mov    -0x74(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  0xcd3(%rip),%xmm1
divsd  %xmm1,%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
divsd  -0x68(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
mov    -0x30(%rbp),%rax
addsd  (%rax),%xmm0
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xe_PostSahaHe>:
push   %rbp
push   %rbx
sub    $0x78,%rsp
mov    %rdi,%rbx
movsd  %xmm3,0x48(%rsp)
movsd  %xmm2,0x20(%rsp)
movsd  0xea3(%rip),%xmm3
movsd  %xmm4,0x28(%rsp)
addsd  %xmm4,%xmm3
movapd %xmm3,%xmm2
movsd  %xmm1,0x18(%rsp)
mulsd  %xmm1,%xmm2
movapd %xmm2,%xmm1
movapd %xmm3,(%rsp)
unpcklpd %xmm3,%xmm1
movapd 0xeb6(%rip),%xmm3
movapd %xmm0,0x60(%rsp)
unpcklpd %xmm0,%xmm3
mulpd  %xmm1,%xmm3
movapd %xmm3,0x30(%rsp)
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
movapd %xmm2,0x50(%rsp)
jb     11b7 <xe_PostSahaHe+0x77>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    11c6 <xe_PostSahaHe+0x86>
movapd %xmm2,%xmm0
call   1050 <sqrt@plt>
movapd 0x50(%rsp),%xmm2
unpcklpd (%rsp),%xmm0
movapd 0x30(%rsp),%xmm1
mulpd  %xmm0,%xmm1
movapd %xmm1,0x30(%rsp)
movsd  0xe25(%rip),%xmm0
divsd  %xmm2,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <exp@plt>
unpcklpd (%rsp),%xmm0
mulpd  0x30(%rsp),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
mulsd  0xe01(%rip),%xmm0
movapd %xmm0,(%rsp)
movapd 0x60(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
movsd  0x28(%rsp),%xmm3
call   1060 <rec_sahaHeI@plt>
movapd 0xe17(%rip),%xmm3
xorpd  %xmm0,%xmm3
movsd  0xdd3(%rip),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm3,%xmm2
movapd %xmm0,%xmm3
movapd %xmm0,%xmm5
addsd  %xmm0,%xmm3
addsd  (%rsp),%xmm3
addsd  %xmm1,%xmm3
movapd 0xdf2(%rip),%xmm1
unpcklpd %xmm2,%xmm1
movapd 0x50(%rsp),%xmm0
unpcklpd %xmm3,%xmm0
divpd  %xmm0,%xmm1
movsd  0xd98(%rip),%xmm0
addsd  %xmm1,%xmm0
unpckhpd %xmm1,%xmm1
mulsd  %xmm0,%xmm1
movsd  0x48(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movapd %xmm0,%xmm4
movapd %xmm1,0x50(%rsp)
movsd  0xd50(%rip),%xmm1
movsd  0x20(%rsp),%xmm3
addsd  %xmm3,%xmm1
movapd %xmm5,%xmm0
movapd %xmm5,0x30(%rsp)
subsd  %xmm5,%xmm1
mulsd  0xd58(%rip),%xmm1
movsd  %xmm1,(%rsp)
addsd  %xmm1,%xmm0
movaps 0x60(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x28(%rsp),%xmm5
call   1030 <rec_helium_dxedt@plt>
mov    %eax,%ebp
movapd 0x30(%rsp),%xmm0
subsd  (%rsp),%xmm0
movaps 0x60(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
movsd  0x48(%rsp),%xmm4
movsd  0x28(%rsp),%xmm5
call   1030 <rec_helium_dxedt@plt>
sub    %eax,%ebp
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
mulsd  0xd01(%rip),%xmm1
divsd  (%rsp),%xmm1
movapd 0x50(%rsp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx)
addsd  0x30(%rsp),%xmm0
add    $0x78,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @xe_PostSahaHe(double %0, double %1, double %2, double %3, double %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double*
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double* %5, double** %12
%21 = load double, double* %8
%22 = load double, double* %11
%23 = fadd double 1.000000e+00, %22
store double %23, double* %20
%24 = fmul double %21, %23
store double %24, double* %13
%25 = load double, double* %7
%26 = load double, double* %20
%27 = fmul double %25, %26
%28 = load double, double* %20
%29 = fmul double %27, %28
%30 = load double, double* %20
%31 = fmul double %29, %30
store double %31, double* %14
%32 = load double, double* %13
%33 = fmul double 0x44605BF58181A9ED, %32
%34 = load double, double* %13
%35 = call double @sqrt(double %34)
%36 = fmul double %33, %35
%37 = load double, double* %13
%38 = fdiv double -2.853250e+05, %37
%39 = fptosi double %38 to i32
%40 = call double @exp(i32 %39)
%41 = fmul double %36, %40
%42 = load double, double* %14
%43 = fdiv double %41, %42
%44 = fmul double %43, 4.000000e+00
store double %44, double* %15
%45 = load double, double* %7
%46 = load double, double* %8
%47 = load double, double* %9
%48 = load double, double* %11
%49 = call double @rec_sahaHeI(double %45, double %46, double %47, double %48)
store double %49, double* %16
%50 = load double, double* %16
%51 = fneg double %50
%52 = load double, double* %16
%53 = fsub double %52, 1.000000e+00
%54 = fmul double %51, %53
%55 = load double, double* %16
%56 = load double, double* %15
%57 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %55, double %56)
%58 = fsub double %57, 1.000000e+00
%59 = fdiv double %54, %58
%60 = load double, double* %13
%61 = fdiv double 2.853250e+05, %60
%62 = fsub double %61, 1.500000e+00
%63 = fmul double %59, %62
%64 = load double, double* %10
%65 = fmul double %63, %64
store double %65, double* %17
%66 = load double, double* %9
%67 = fadd double 1.000000e+00, %66
%68 = load double, double* %16
%69 = fsub double %67, %68
%70 = fmul double 1.000000e-02, %69
store double %70, double* %18
%71 = load double, double* %16
%72 = load double, double* %18
%73 = fadd double %71, %72
%74 = load double, double* %7
%75 = load double, double* %8
%76 = load double, double* %9
%77 = load double, double* %10
%78 = load double, double* %11
%79 = call i32 @rec_helium_dxedt(double %73, double %74, double %75, double %76, double %77, double %78)
%80 = load double, double* %16
%81 = load double, double* %18
%82 = fsub double %80, %81
%83 = load double, double* %7
%84 = load double, double* %8
%85 = load double, double* %9
%86 = load double, double* %10
%87 = load double, double* %11
%88 = call i32 @rec_helium_dxedt(double %82, double %83, double %84, double %85, double %86, double %87)
%89 = sub nsw i32 %79, %88
%90 = sitofp i32 %89 to double
%91 = fdiv double %90, 2.000000e+00
%92 = load double, double* %18
%93 = fdiv double %91, %92
store double %93, double* %19
%94 = load double, double* %17
%95 = load double, double* %19
%96 = fdiv double %94, %95
%97 = load double*, double** %12
store double %96, double* %97
%98 = load double, double* %16
%99 = load double*, double** %12
%100 = load double, double* %99
%101 = fadd double %98, %100
ret double %101
}

LLVM IR (-O2):
define double @xe_PostSahaHe(double %0, double %1, double %2, double %3, double %4, double* nocapture writeonly %5) {
%7 = fadd double %4, 1.000000e+00
%8 = fmul double %7, %1
%9 = insertelement <2 x double> poison, double %8, i64 0
%10 = insertelement <2 x double> %9, double %7, i64 1
%11 = insertelement <2 x double> <double 0x44605BF58181A9ED, double poison>, double %0, i64 1
%12 = fmul <2 x double> %10, %11
%13 = tail call double @sqrt(double %8)
%14 = insertelement <2 x double> poison, double %13, i64 0
%15 = insertelement <2 x double> %14, double %7, i64 1
%16 = fmul <2 x double> %12, %15
%17 = fdiv double -2.853250e+05, %8
%18 = fptosi double %17 to i32
%19 = tail call double @exp(i32 %18)
%20 = insertelement <2 x double> poison, double %19, i64 0
%21 = insertelement <2 x double> %20, double %7, i64 1
%22 = fmul <2 x double> %16, %21
%23 = extractelement <2 x double> %22, i64 0
%24 = extractelement <2 x double> %22, i64 1
%25 = fdiv double %23, %24
%26 = fmul double %25, 4.000000e+00
%27 = tail call double @rec_sahaHeI(double %0, double %1, double %2, double %4)
%28 = fneg double %27
%29 = fadd double %27, -1.000000e+00
%30 = fmul double %29, %28
%31 = tail call double @llvm.fmuladd.f64(double %27, double 2.000000e+00, double %26)
%32 = fadd double %31, -1.000000e+00
%33 = insertelement <2 x double> <double 2.853250e+05, double poison>, double %30, i64 1
%34 = insertelement <2 x double> %9, double %32, i64 1
%35 = fdiv <2 x double> %33, %34
%36 = extractelement <2 x double> %35, i64 0
%37 = fadd double %36, -1.500000e+00
%38 = extractelement <2 x double> %35, i64 1
%39 = fmul double %37, %38
%40 = fmul double %39, %3
%41 = fadd double %2, 1.000000e+00
%42 = fsub double %41, %27
%43 = fmul double %42, 1.000000e-02
%44 = fadd double %27, %43
%45 = tail call i32 @rec_helium_dxedt(double %44, double %0, double %1, double %2, double %3, double %4)
%46 = fsub double %27, %43
%47 = tail call i32 @rec_helium_dxedt(double %46, double %0, double %1, double %2, double %3, double %4)
%48 = sub nsw i32 %45, %47
%49 = sitofp i32 %48 to double
%50 = fmul double %49, 5.000000e-01
%51 = fdiv double %50, %43
%52 = fdiv double %40, %51
store double %52, double* %5
%53 = fadd double %27, %52
ret double %53
}