// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../external/HyRec2020/hydrogen.c
// Function: rec_HMLA_dxHIIdlna
double rec_HMLA_dxHIIdlna(HYREC_DATA *data, double xe, double xHII, double nH, double H, double TM, double TR) {

  REC_COSMOPARAMS *cosmo = data->cosmo;
  HYREC_ATOMIC *atomic = data->atomic;
  int *error = &data->error;
  double fsR = cosmo->fsR, meR = cosmo->meR;

  double Alpha[2], DAlpha[2], Beta[2], R2p2s, RLya;
  double Gamma_2s, Gamma_2p, C2s, C2p, s, Dxe2;
  double ratio;
  char sub_message[128];
  if (*error == 1) return 0.;
  ratio = TM/TR;
  rescale_T(&TR, fsR, meR);
  TM = ratio * TR;   /* This way ensure that TM<=TR is preserved */
  interpolate_rates(Alpha, DAlpha, Beta, &R2p2s, TR, TM/TR, atomic, fsR, meR, error, data->error_message);
  if (*error == 1) {
    sprintf(sub_message, "  called from rec_HMLA_dxHIIdlna\n");
    strcat(data->error_message, sub_message);
    return 0.;
  }

  RLya = LYA_FACT(fsR, meR) *H/nH/(1.-xHII);   /* 8 PI H/(3 nH x1s lambda_Lya^3) */

  /* Effective inverse lifetimes of 2s and 2p states */
  Gamma_2s = Beta[0] + 3.*R2p2s + L2s_rescaled(fsR, meR);
  Gamma_2p = Beta[1] + R2p2s + RLya;

  /* Generalization of Peebles' C factor */
  C2s = (L2s_rescaled(fsR, meR) + 3.*R2p2s * RLya/Gamma_2p)/(Gamma_2s - 3.*R2p2s*R2p2s/Gamma_2p);
  C2p = (RLya  +   R2p2s * L2s_rescaled(fsR, meR)/Gamma_2s)/(Gamma_2p - 3.*R2p2s*R2p2s/Gamma_2s);

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

  return -nH/H *( (s*(1.-xHII)*DAlpha[0] + Alpha[0]*Dxe2)*C2s + (s*(1.-xHII)*DAlpha[1] + Alpha[1]*Dxe2)*C2p )
         + (cosmo->inj_params->ion + (0.25*(1.-C2s) + 0.75*(1.-C2p))*cosmo->inj_params->exclya)/H ;

}

// Assembly:
subq $0x198, %rsp            # imm = 0x198
movq %rdi, 0x188(%rsp)
movsd %xmm0, 0x180(%rsp)
movsd %xmm1, 0x178(%rsp)
movsd %xmm2, 0x170(%rsp)
movsd %xmm3, 0x168(%rsp)
movsd %xmm4, 0x160(%rsp)
movsd %xmm5, 0x158(%rsp)
movq 0x188(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x150(%rsp)
movq 0x188(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x148(%rsp)
movq 0x188(%rsp), %rax
addq $0x38, %rax
movq %rax, 0x140(%rsp)
movq 0x150(%rsp), %rax
movsd 0x98(%rax), %xmm0
movsd %xmm0, 0x138(%rsp)
movq 0x150(%rsp), %rax
movsd 0xa0(%rax), %xmm0
movsd %xmm0, 0x130(%rsp)
movq 0x140(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x1a9c70
xorps %xmm0, %xmm0
movsd %xmm0, 0x190(%rsp)
jmp 0x1aa16c
movsd 0x160(%rsp), %xmm0
divsd 0x158(%rsp), %xmm0
movsd %xmm0, 0xb8(%rsp)
movsd 0x138(%rsp), %xmm0
movsd 0x130(%rsp), %xmm1
leaq 0x158(%rsp), %rdi
callq 0x1a7840
movsd 0xb8(%rsp), %xmm0
mulsd 0x158(%rsp), %xmm0
movsd %xmm0, 0x160(%rsp)
leaq 0x120(%rsp), %rdi
leaq 0x110(%rsp), %rsi
leaq 0x100(%rsp), %rdx
movsd 0x158(%rsp), %xmm0
movsd 0x160(%rsp), %xmm1
divsd 0x158(%rsp), %xmm1
movq 0x148(%rsp), %r8
movsd 0x138(%rsp), %xmm2
movsd 0x130(%rsp), %xmm3
movq 0x140(%rsp), %r9
movq 0x188(%rsp), %rax
movq 0x48(%rax), %rax
leaq 0xf8(%rsp), %rcx
movq %rax, (%rsp)
callq 0x1a8830
movq 0x140(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x1a9d7e
leaq 0x30(%rsp), %rdi
leaq 0x64dc8(%rip), %rsi     # 0x20eb18
movb $0x0, %al
callq 0x8090
movq 0x188(%rsp), %rax
movq 0x48(%rax), %rdi
leaq 0x30(%rsp), %rsi
callq 0x8660
xorps %xmm0, %xmm0
movsd %xmm0, 0x190(%rsp)
jmp 0x1aa16c
movsd 0x138(%rsp), %xmm0
movsd 0x130(%rsp), %xmm1
callq 0x1a77b0
mulsd 0x168(%rsp), %xmm0
divsd 0x170(%rsp), %xmm0
movsd 0x28499(%rip), %xmm1    # 0x1d2248
subsd 0x178(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0xf0(%rsp)
movsd 0x100(%rsp), %xmm1
movsd 0xf8(%rsp), %xmm0
movsd 0x298b9(%rip), %xmm2    # 0x1d3698
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x138(%rsp), %xmm0
movsd 0x130(%rsp), %xmm1
callq 0x1a77f0
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xe8(%rsp)
movsd 0x108(%rsp), %xmm0
addsd 0xf8(%rsp), %xmm0
addsd 0xf0(%rsp), %xmm0
movsd %xmm0, 0xe0(%rsp)
movsd 0x138(%rsp), %xmm0
movsd 0x130(%rsp), %xmm1
callq 0x1a77f0
movsd 0x2983b(%rip), %xmm1    # 0x1d3698
mulsd 0xf8(%rsp), %xmm1
mulsd 0xf0(%rsp), %xmm1
divsd 0xe0(%rsp), %xmm1
addsd %xmm1, %xmm0
movsd 0xe8(%rsp), %xmm1
movsd 0x2980b(%rip), %xmm2    # 0x1d3698
mulsd 0xf8(%rsp), %xmm2
mulsd 0xf8(%rsp), %xmm2
divsd 0xe0(%rsp), %xmm2
subsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0xd8(%rsp)
movsd 0xf0(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0xf8(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x138(%rsp), %xmm0
movsd 0x130(%rsp), %xmm1
callq 0x1a77f0
movsd 0x10(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x18(%rsp), %xmm0
mulsd %xmm2, %xmm1
divsd 0xe8(%rsp), %xmm1
addsd %xmm1, %xmm0
movsd 0xe0(%rsp), %xmm1
movsd 0x29779(%rip), %xmm2    # 0x1d3698
mulsd 0xf8(%rsp), %xmm2
mulsd 0xf8(%rsp), %xmm2
divsd 0xe8(%rsp), %xmm2
subsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0x138(%rsp), %xmm0
movsd 0x130(%rsp), %xmm1
callq 0x1a7770
mulsd 0x158(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x158(%rsp), %xmm0
callq 0x82e0
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x64966(%rip), %xmm0    # 0x20e900
divsd 0x158(%rsp), %xmm0
callq 0x8670
movaps %xmm0, %xmm1
movsd 0x28(%rsp), %xmm0
mulsd %xmm1, %xmm0
divsd 0x170(%rsp), %xmm0
movsd %xmm0, 0xc8(%rsp)
movsd 0x180(%rsp), %xmm0
movsd 0x178(%rsp), %xmm2
movsd 0xc8(%rsp), %xmm1
movsd 0x2825e(%rip), %xmm3    # 0x1d2248
subsd 0x178(%rsp), %xmm3
mulsd %xmm3, %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xc0(%rsp)
movsd 0x170(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
divsd 0x168(%rsp), %xmm0
movsd 0xc8(%rsp), %xmm2
movsd 0x281ef(%rip), %xmm1    # 0x1d2248
subsd 0x178(%rsp), %xmm1
mulsd %xmm1, %xmm2
movsd 0x110(%rsp), %xmm3
movsd 0x120(%rsp), %xmm1
mulsd 0xc0(%rsp), %xmm1
mulsd %xmm3, %xmm2
addsd %xmm1, %xmm2
movsd 0xd8(%rsp), %xmm3
movsd 0xc8(%rsp), %xmm1
movsd 0x281a5(%rip), %xmm4    # 0x1d2248
subsd 0x178(%rsp), %xmm4
mulsd %xmm4, %xmm1
movsd 0x118(%rsp), %xmm5
movsd 0x128(%rsp), %xmm4
mulsd 0xc0(%rsp), %xmm4
mulsd %xmm5, %xmm1
addsd %xmm4, %xmm1
mulsd 0xd0(%rsp), %xmm1
mulsd %xmm3, %xmm2
addsd %xmm1, %xmm2
movq 0x150(%rsp), %rax
movq 0xb8(%rax), %rax
movsd 0x60(%rax), %xmm3
movsd 0x28148(%rip), %xmm1    # 0x1d2248
subsd 0xd8(%rsp), %xmm1
movsd 0x28137(%rip), %xmm5    # 0x1d2248
subsd 0xd0(%rsp), %xmm5
movsd 0x28ba6(%rip), %xmm4    # 0x1d2cc8
mulsd %xmm5, %xmm4
movsd 0x28b92(%rip), %xmm5    # 0x1d2cc0
mulsd %xmm5, %xmm1
addsd %xmm4, %xmm1
movq 0x150(%rsp), %rax
movq 0xb8(%rax), %rax
movsd 0x68(%rax), %xmm4
mulsd %xmm4, %xmm1
addsd %xmm3, %xmm1
divsd 0x168(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x190(%rsp)
movsd 0x190(%rsp), %xmm0
addq $0x198, %rsp            # imm = 0x198
retq
nopl (%rax)