#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(double);
int sqrt(int);
double rec_sahaHeII(double nH0, double Tr0, double fHe, double z,
                    double *xHeIII) {
  double Tr, nH, ainv, s;
  Tr = Tr0 * (ainv = 1 + z);
  nH = nH0 * ainv * ainv * ainv;
  s = 2.414194e21 * Tr * sqrt(Tr) * exp(-631462.7 / Tr) / nH;
  *xHeIII = 2. * s * fHe / (1. + s + fHe) /
            (1. + sqrt(1. + 4. * s * fHe / (1. + s + fHe) / (1. + s + fHe)));
  return (1. + fHe + *xHeIII);
}


x86 assembly (clang, -O0):
<rec_sahaHeII>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb3(%rip),%xmm1
addsd  -0x20(%rbp),%xmm1
movsd  %xmm1,-0x40(%rbp)
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe9f(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
cvttsd2si -0x30(%rbp),%edi
call   1040 <sqrt@plt>
movsd  -0x60(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe69(%rip),%xmm0
divsd  -0x30(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe39(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe17(%rip),%xmm1
addsd  -0x48(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe04(%rip),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xdea(%rip),%xmm0
addsd  -0x48(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  0xdd4(%rip),%xmm0
addsd  -0x48(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  0xdbe(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
movsd  -0x50(%rbp),%xmm0
cvtsi2sd %eax,%xmm2
movsd  0xda0(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xd88(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
mov    -0x28(%rbp),%rax
addsd  (%rax),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec_sahaHeII>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rbx
movsd  %xmm2,0x8(%rsp)
addsd  0xeca(%rip),%xmm3
movapd %xmm3,0x10(%rsp)
mulsd  %xmm3,%xmm1
movapd %xmm1,0x30(%rsp)
movapd %xmm1,%xmm2
unpcklpd %xmm3,%xmm2
movapd 0xeca(%rip),%xmm3
unpcklpd %xmm0,%xmm3
mulpd  %xmm2,%xmm3
movapd %xmm3,0x20(%rsp)
cvttsd2si %xmm1,%edi
call   1040 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
unpcklpd 0x10(%rsp),%xmm0
mulpd  0x20(%rsp),%xmm0
movapd %xmm0,0x20(%rsp)
movsd  0xe7a(%rip),%xmm0
divsd  0x30(%rsp),%xmm0
call   1030 <exp@plt>
unpcklpd 0x10(%rsp),%xmm0
mulpd  0x20(%rsp),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm4
addsd  %xmm0,%xmm4
movsd  0x8(%rsp),%xmm2
mulsd  %xmm2,%xmm4
movapd %xmm0,%xmm1
movsd  0xe31(%rip),%xmm3
addsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm4
movapd %xmm4,0x10(%rsp)
mulsd  0xe27(%rip),%xmm0
mulsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
divsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xdef(%rip),%xmm1
addsd  %xmm1,%xmm0
movapd 0x10(%rsp),%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,(%rbx)
movsd  0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @rec_sahaHeII(double %0, double %1, double %2, double %3, double* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double*
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double* %4, double** %10
%15 = load double, double* %7
%16 = load double, double* %9
%17 = fadd double 1.000000e+00, %16
store double %17, double* %13
%18 = fmul double %15, %17
store double %18, double* %11
%19 = load double, double* %6
%20 = load double, double* %13
%21 = fmul double %19, %20
%22 = load double, double* %13
%23 = fmul double %21, %22
%24 = load double, double* %13
%25 = fmul double %23, %24
store double %25, double* %12
%26 = load double, double* %11
%27 = fmul double 0x44605BF58181A9ED, %26
%28 = load double, double* %11
%29 = fptosi double %28 to i32
%30 = call i32 @sqrt(i32 %29)
%31 = sitofp i32 %30 to double
%32 = fmul double %27, %31
%33 = load double, double* %11
%34 = fdiv double 0xC123454D66666666, %33
%35 = call double @exp(double %34)
%36 = fmul double %32, %35
%37 = load double, double* %12
%38 = fdiv double %36, %37
store double %38, double* %14
%39 = load double, double* %14
%40 = fmul double 2.000000e+00, %39
%41 = load double, double* %8
%42 = fmul double %40, %41
%43 = load double, double* %14
%44 = fadd double 1.000000e+00, %43
%45 = load double, double* %8
%46 = fadd double %44, %45
%47 = fdiv double %42, %46
%48 = load double, double* %14
%49 = fmul double 4.000000e+00, %48
%50 = load double, double* %8
%51 = fmul double %49, %50
%52 = load double, double* %14
%53 = fadd double 1.000000e+00, %52
%54 = load double, double* %8
%55 = fadd double %53, %54
%56 = fdiv double %51, %55
%57 = load double, double* %14
%58 = fadd double 1.000000e+00, %57
%59 = load double, double* %8
%60 = fadd double %58, %59
%61 = fdiv double %56, %60
%62 = fadd double 1.000000e+00, %61
%63 = fptosi double %62 to i32
%64 = call i32 @sqrt(i32 %63)
%65 = sitofp i32 %64 to double
%66 = fadd double 1.000000e+00, %65
%67 = fdiv double %47, %66
%68 = load double*, double** %10
store double %67, double* %68
%69 = load double, double* %8
%70 = fadd double 1.000000e+00, %69
%71 = load double*, double** %10
%72 = load double, double* %71
%73 = fadd double %70, %72
ret double %73
}

LLVM IR (-O2):
define double @rec_sahaHeII(double %0, double %1, double %2, double %3, double* nocapture writeonly %4) {
%6 = fadd double %3, 1.000000e+00
%7 = fmul double %6, %1
%8 = insertelement <2 x double> poison, double %7, i64 0
%9 = insertelement <2 x double> %8, double %6, i64 1
%10 = insertelement <2 x double> <double 0x44605BF58181A9ED, double poison>, double %0, i64 1
%11 = fmul <2 x double> %9, %10
%12 = fptosi double %7 to i32
%13 = tail call i32 @sqrt(i32 %12)
%14 = sitofp i32 %13 to double
%15 = insertelement <2 x double> poison, double %14, i64 0
%16 = insertelement <2 x double> %15, double %6, i64 1
%17 = fmul <2 x double> %11, %16
%18 = fdiv double 0xC123454D66666666, %7
%19 = tail call double @exp(double %18)
%20 = insertelement <2 x double> poison, double %19, i64 0
%21 = insertelement <2 x double> %20, double %6, i64 1
%22 = fmul <2 x double> %21, %17
%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, 2.000000e+00
%27 = fmul double %26, %2
%28 = fadd double %25, 1.000000e+00
%29 = fadd double %28, %2
%30 = fdiv double %27, %29
%31 = fmul double %25, 4.000000e+00
%32 = fmul double %31, %2
%33 = fdiv double %32, %29
%34 = fdiv double %33, %29
%35 = fadd double %34, 1.000000e+00
%36 = fptosi double %35 to i32
%37 = tail call i32 @sqrt(i32 %36)
%38 = sitofp i32 %37 to double
%39 = fadd double %38, 1.000000e+00
%40 = fdiv double %30, %39
store double %40, double* %4
%41 = fadd double %2, 1.000000e+00
%42 = fadd double %41, %40
ret double %42
}