// File: /workspace/github_c_makefile_star2_O1/PoulinV[P]AxiCLASS/build/../external/HyRec2020/history.c
// Function: rec_HubbleRate
double rec_HubbleRate(REC_COSMOPARAMS *cosmo, double z) {
  double a = 1./(1.+z), y, Tnu0;
  int i;
  cosmo->onuh2 = 0;
  Tnu0 = cosmo->T0 * pow(4./11.,1./3.) ;
  if (cosmo->Nmnu == 0) cosmo->onuh2 = 0;
  else{
    /* Massive neutrino energy density using fitting function */
    for (i=0;i<cosmo->Nmnu;i++) {
      y = cosmo->mnu[i]/kBoltz/(Tnu0/a);
      cosmo->onuh2 = cosmo->onuh2 + (1.+0.317322*0.0457584*pow(y,3.47446+1.)
          + 2.05298*0.0457584*pow(y,3.47446-1.))/(1.+0.0457584*pow(y,3.47446))*(3.45e-8*Tnu0*Tnu0*Tnu0*Tnu0)*5.6822*2;
    }
  }

  /* Total density parameter, including curvature */
  double rho = cosmo->ocbh2 /a/a/a     /* Matter (baryon + CDM) */
             + cosmo->okh2 /a/a       /* Curvature */
             + cosmo->odeh2 * pow(1./a, 3*(1+cosmo->w0)) * exp(3*cosmo->wa* (log(1./a)-1.+a))  /* Dark energy */
             + cosmo->orh2 /a/a/a/a   /* Radiation (photons + massless neutrinos) */
             + cosmo->onuh2 /a/a/a/a; /* Massive neutrinos */
  /* Conversion to Hubble rate in sec-1 */

  return( 3.2407792896393e-18 * sqrt(rho) );
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movsd 0x151ca(%rip), %xmm1    # 0xf1260
addsd %xmm1, %xmm0
divsd %xmm0, %xmm1
movapd %xmm1, 0x20(%rsp)
movq $0x0, 0x38(%rdi)
movsd 0x60(%rdi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0xdc0ca
jp 0xdc0ca
movq $0x0, 0x38(%rbx)
jmp 0xdc1f1
movsd 0x60(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0xdc1f1
movsd 0x8(%rbx), %xmm0
mulsd 0x5164a(%rip), %xmm0    # 0x12d730
movsd 0x5164a(%rip), %xmm1    # 0x12d738
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
divsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movl $0xd, %r14d
movsd (%rbx,%r14,8), %xmm1
divsd 0x51214(%rip), %xmm1    # 0x12d338
divsd 0x50(%rsp), %xmm1
movsd %xmm1, (%rsp)
movsd 0x38(%rbx), %xmm0
movsd %xmm0, 0x40(%rsp)
movapd %xmm1, %xmm0
movsd 0x515fa(%rip), %xmm1    # 0x12d740
callq 0x8620
mulsd 0x515f5(%rip), %xmm0    # 0x12d748
addsd 0x15105(%rip), %xmm0    # 0xf1260
shufpd $0x2, 0x5095c(%rip), %xmm0 # xmm0 = xmm0[0],mem[1]
movapd %xmm0, 0x30(%rsp)
movsd (%rsp), %xmm0
movsd 0x515d9(%rip), %xmm1    # 0x12d750
callq 0x8620
movaps %xmm0, 0x10(%rsp)
movsd (%rsp), %xmm0
movsd 0x515ca(%rip), %xmm1    # 0x12d758
callq 0x8620
movapd 0x10(%rsp), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
mulpd 0x5162b(%rip), %xmm1    # 0x12d7d0
addpd 0x30(%rsp), %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
divsd %xmm0, %xmm1
mulsd 0x8(%rsp), %xmm1
mulsd 0x5159b(%rip), %xmm1    # 0x12d760
addsd %xmm1, %xmm1
addsd 0x40(%rsp), %xmm1
movsd %xmm1, 0x38(%rbx)
leal -0xc(%r14), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x60(%rbx), %xmm1
incq %r14
ucomisd %xmm0, %xmm1
ja 0xdc116
movsd 0x18(%rbx), %xmm0
movsd 0x20(%rbx), %xmm1
movsd %xmm1, 0x10(%rsp)
movapd 0x20(%rsp), %xmm2
divsd %xmm2, %xmm0
movhpd 0x28(%rbx), %xmm0       # xmm0 = xmm0[0],mem[0]
movapd %xmm2, %xmm1
unpcklpd %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0]
movapd %xmm1, 0x40(%rsp)
divpd %xmm1, %xmm0
divpd %xmm1, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x30(%rsp)
movsd 0x15020(%rip), %xmm1    # 0xf1260
movapd %xmm1, %xmm0
divsd %xmm2, %xmm0
movsd %xmm0, 0x8(%rsp)
addsd 0x40(%rbx), %xmm1
movsd 0x16425(%rip), %xmm2    # 0xf2680
movsd %xmm2, (%rsp)
mulsd %xmm2, %xmm1
callq 0x8620
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd (%rsp), %xmm0
mulsd 0x48(%rbx), %xmm0
movsd %xmm0, (%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x82c0
addsd 0x15551(%rip), %xmm0    # 0xf17e8
addsd 0x20(%rsp), %xmm0
mulsd (%rsp), %xmm0
callq 0x8670
movapd %xmm0, %xmm1
mulsd 0x10(%rsp), %xmm1
addsd 0x30(%rsp), %xmm1
movupd 0x30(%rbx), %xmm0
movapd 0x40(%rsp), %xmm2
divpd %xmm2, %xmm0
divpd %xmm2, %xmm0
divpd %xmm2, %xmm0
divpd %xmm2, %xmm0
addsd %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0xdc2ee
sqrtsd %xmm0, %xmm0
jmp 0xdc2f3
callq 0x82b0
mulsd 0x5146d(%rip), %xmm0    # 0x12d768
addq $0x58, %rsp
popq %rbx
popq %r14
retq