// File: /workspace/github_c_makefile_star2_O2/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 $0x80, %rsp
movsd %xmm6, 0x28(%rsp)
movaps %xmm3, 0x70(%rsp)
movaps %xmm2, 0x60(%rsp)
movsd %xmm1, 0x40(%rsp)
movsd %xmm0, 0x58(%rsp)
movq %rdi, %rbx
movsd 0x98(%rdi), %xmm0
movsd %xmm0, (%rsp)
movsd 0xa0(%rdi), %xmm1
movsd %xmm1, 0x18(%rsp)
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
mulsd %xmm1, %xmm2
divsd %xmm2, %xmm4
movsd %xmm4, 0x20(%rsp)
divsd %xmm2, %xmm5
movsd %xmm5, 0x10(%rsp)
callq 0xcd110
movapd %xmm0, %xmm1
mulsd 0x70(%rsp), %xmm1
divsd 0x60(%rsp), %xmm1
movsd 0x17fec(%rip), %xmm0    # 0xe5260
subsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
divsd %xmm0, %xmm1
movsd %xmm1, 0x30(%rsp)
movsd 0x20(%rsp), %xmm0
movsd (%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
callq 0xcd167
movsd %xmm0, 0x20(%rsp)
movsd 0x10(%rsp), %xmm0
movsd (%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
callq 0xcd167
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd (%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0xcd0fc
movsd 0x10(%rsp), %xmm2
mulsd %xmm2, %xmm0
movsd %xmm0, 0x8(%rsp)
sqrtsd %xmm2, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm2
movsd %xmm0, 0x48(%rsp)
jae 0xcd307
movsd 0x10(%rsp), %xmm0
callq 0x82d0
movsd 0x8(%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x20(%rsp), %xmm0
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x53ee7(%rip), %xmm0    # 0x121218
divsd 0x10(%rsp), %xmm0
callq 0x86a0
mulsd 0x8(%rsp), %xmm0
mulsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd (%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0xcd128
movsd 0x30(%rsp), %xmm1
mulsd 0x193dc(%rip), %xmm1    # 0xe6748
movsd %xmm1, 0x30(%rsp)
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd (%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0xcd128
addsd 0x30(%rsp), %xmm0
addsd 0x28(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd (%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0xcd0fc
movsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, (%rsp)
ucomisd 0x17e89(%rip), %xmm1    # 0xe5258
movsd 0x48(%rsp), %xmm0
jae 0xcd3e2
movsd 0x10(%rsp), %xmm0
callq 0x82d0
movsd (%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd 0x53e28(%rip), %xmm0    # 0x121220
divsd 0x10(%rsp), %xmm0
callq 0x86a0
mulsd (%rsp), %xmm0
movapd 0x60(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd 0x50(%rsp), %xmm3
mulsd %xmm0, %xmm3
movsd 0x58(%rsp), %xmm2
mulsd 0x40(%rsp), %xmm2
subsd %xmm3, %xmm2
movsd 0x20(%rsp), %xmm4
movapd %xmm4, %xmm0
subsd 0x38(%rsp), %xmm0
xorpd 0x17dec(%rip), %xmm1    # 0xe5230
mulsd %xmm4, %xmm2
mulsd %xmm3, %xmm0
addsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
movq 0xb8(%rbx), %rax
movsd 0x17dfd(%rip), %xmm1    # 0xe5260
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 0x70(%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 $0x80, %rsp
popq %rbx
retq