// File: /workspace/github_c_makefile_star2_O1/PoulinV[P]AxiCLASS/build/../external/HyRec2020/hydrogen.c
// Function: rec_TLA_dxHIIdlna
double rec_TLA_dxHIIdlna(REC_COSMOPARAMS *cosmo, double xe, double xHII, double nH, double H, double TM, double TR, double Fudge) {

  double RLya, alphaB_TM, alphaB_TR, four_betaB, C, s, Dxe2, DalphaB;
  double fsR = cosmo->fsR, meR = cosmo->meR;

  rescale_T(&TM, fsR, meR);
  rescale_T(&TR, fsR, meR);

  RLya       = LYA_FACT(fsR, meR) * H / nH / (1.-xHII);
  alphaB_TM  = Fudge * alphaB_PPB(TM, fsR, meR);
  alphaB_TR  = Fudge * alphaB_PPB(TR, fsR, meR);

  four_betaB = SAHA_FACT(fsR, meR) *TR*sqrt(TR) *exp(-0.25*EI/TR) * alphaB_TR;
  C          = (3.*RLya + L2s_rescaled(fsR, meR))/(3.*RLya + L2s_rescaled(fsR, meR) + four_betaB);    /* Peebles' C-factor */

  s          = SAHA_FACT(fsR, meR) *TR*sqrt(TR) *exp(-EI/TR)/nH;
  Dxe2       = xe*xHII - s*(1.-xHII);    /* xe xp - xe xp[Saha eq with 1s] -- gives more compact expressions */
  DalphaB    = alphaB_TM - alphaB_TR;

  return -nH*(s*(1.-xHII)*DalphaB + Dxe2*alphaB_TM)*C/H + (cosmo->inj_params->ion + (1.-C)*cosmo->inj_params->exclya)/H;

}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movaps %xmm6, 0x50(%rsp)
movaps %xmm3, 0xb0(%rsp)
movaps %xmm2, 0xa0(%rsp)
movsd %xmm1, 0x48(%rsp)
movsd %xmm0, 0x98(%rsp)
movq %rdi, %rbx
movsd 0x98(%rdi), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0xa0(%rdi), %xmm1
movsd %xmm1, 0x18(%rsp)
mulsd %xmm0, %xmm0
movsd %xmm0, 0x40(%rsp)
mulsd %xmm1, %xmm0
divsd %xmm0, %xmm4
movsd %xmm4, (%rsp)
divsd %xmm0, %xmm5
movsd %xmm5, 0x10(%rsp)
callq 0xd6f51
movapd %xmm0, %xmm1
mulsd 0x54eb6(%rip), %xmm1    # 0x12d328
mulsd 0xb0(%rsp), %xmm1
divsd 0xa0(%rsp), %xmm1
movsd 0x18dd4(%rip), %xmm0    # 0xf1260
subsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x90(%rsp)
divsd %xmm0, %xmm1
movsd %xmm1, 0x38(%rsp)
movsd (%rsp), %xmm0
divsd 0x54e86(%rip), %xmm0    # 0x12d338
divsd 0x381ee(%rip), %xmm0    # 0x1106a8
movsd %xmm0, (%rsp)
movsd 0x8(%rsp), %xmm0
divsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
callq 0xd6f4c
movapd %xmm0, 0x20(%rsp)
movsd 0x3cfa4(%rip), %xmm1    # 0x115488
movsd (%rsp), %xmm0
callq 0x8620
movaps %xmm0, 0x80(%rsp)
movsd 0x3cf9a(%rip), %xmm1    # 0x115498
movsd (%rsp), %xmm0
callq 0x8620
movaps %xmm0, 0x70(%rsp)
movsd 0x10(%rsp), %xmm0
divsd 0x54e1d(%rip), %xmm0    # 0x12d338
divsd 0x38185(%rip), %xmm0    # 0x1106a8
movsd %xmm0, (%rsp)
movsd 0x60(%rsp), %xmm0
callq 0xd6f4c
movaps %xmm0, 0x60(%rsp)
movsd (%rsp), %xmm0
movsd 0x3cf43(%rip), %xmm1    # 0x115488
callq 0x8620
movaps %xmm0, 0xc0(%rsp)
movsd (%rsp), %xmm0
movsd 0x3cf39(%rip), %xmm1    # 0x115498
callq 0x8620
movapd 0x20(%rsp), %xmm1
unpcklpd 0x60(%rsp), %xmm1       # xmm1 = xmm1[0],mem[0]
mulpd 0x54ea8(%rip), %xmm1    # 0x12d420
movapd %xmm1, %xmm2
movapd 0x80(%rsp), %xmm1
unpcklpd 0xc0(%rsp), %xmm1       # xmm1 = xmm1[0],mem[0]
movapd 0x70(%rsp), %xmm3
unpcklpd %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0]
mulpd 0x54e90(%rip), %xmm3    # 0x12d430
mulpd %xmm2, %xmm1
addpd 0x1c374(%rip), %xmm3    # 0xf4920
divpd %xmm3, %xmm1
movapd 0x50(%rsp), %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd %xmm1, %xmm0
movapd %xmm0, 0x50(%rsp)
movsd 0x8(%rsp), %xmm0
mulsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
callq 0xd6f51
movapd %xmm0, %xmm3
mulsd 0x54d36(%rip), %xmm3    # 0x12d320
movsd 0x10(%rsp), %xmm0
mulsd %xmm0, %xmm3
xorps %xmm1, %xmm1
sqrtsd %xmm0, %xmm1
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
movsd %xmm1, (%rsp)
movapd %xmm1, %xmm0
jae 0xd8625
movsd 0x10(%rsp), %xmm0
movsd %xmm3, 0x20(%rsp)
callq 0x82b0
movsd 0x20(%rsp), %xmm3
mulsd %xmm3, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x54d11(%rip), %xmm0    # 0x12d348
divsd 0x10(%rsp), %xmm0
callq 0x8670
mulsd 0x20(%rsp), %xmm0
movapd 0x50(%rsp), %xmm1
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
movapd %xmm1, 0x20(%rsp)
mulsd %xmm0, %xmm1
movapd %xmm1, 0x70(%rsp)
movsd 0x40(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rsp)
callq 0xd6f4c
mulsd 0x54ca7(%rip), %xmm0    # 0x12d330
mulsd 0x18(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
mulsd 0x19fe3(%rip), %xmm1    # 0xf2680
movsd %xmm1, 0x38(%rsp)
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x40(%rsp), %xmm0
callq 0xd6f4c
mulsd 0x54c70(%rip), %xmm0    # 0x12d330
mulsd 0x18(%rsp), %xmm0
addsd 0x38(%rsp), %xmm0
addsd 0x70(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x80(%rsp), %xmm0
callq 0xd6f51
movapd %xmm0, %xmm1
mulsd 0x54c24(%rip), %xmm1    # 0x12d320
movsd 0x10(%rsp), %xmm0
mulsd %xmm0, %xmm1
ucomisd 0x18b4a(%rip), %xmm0    # 0xf1258
jae 0xd872c
movsd 0x10(%rsp), %xmm0
movsd %xmm1, 0x18(%rsp)
callq 0x82b0
movsd 0x18(%rsp), %xmm1
movsd %xmm0, (%rsp)
movsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, (%rsp)
movsd 0x54c0e(%rip), %xmm0    # 0x12d350
divsd 0x10(%rsp), %xmm0
callq 0x8670
mulsd (%rsp), %xmm0
movapd 0xa0(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd 0x90(%rsp), %xmm4
mulsd %xmm0, %xmm4
movsd 0x98(%rsp), %xmm3
mulsd 0x48(%rsp), %xmm3
subsd %xmm4, %xmm3
movapd 0x50(%rsp), %xmm2
movapd %xmm2, %xmm0
subsd 0x20(%rsp), %xmm0
xorpd 0x18a99(%rip), %xmm1    # 0xf1230
mulsd %xmm2, %xmm3
mulsd %xmm4, %xmm0
addsd %xmm3, %xmm0
mulsd %xmm1, %xmm0
movq 0xb8(%rbx), %rax
movsd 0x18aaa(%rip), %xmm1    # 0xf1260
movsd 0x8(%rsp), %xmm2
subsd %xmm2, %xmm1
mulsd 0x68(%rax), %xmm1
addsd 0x60(%rax), %xmm1
mulsd %xmm2, %xmm0
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
movapd 0xb0(%rsp), %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
divpd %xmm0, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
addq $0xd0, %rsp
popq %rbx
retq