// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../external/RecfastCLASS/wrap_recfast.c
// Function: recfast_dx_H_dz
int recfast_dx_H_dz(struct thermodynamics* pth, struct thermorecfast * pre, double x_H, double x, double nH,
                    double z, double Hz, double Tmat, double Trad,
                    double* dxH_dz) {

  /** Define local variables */
  struct injection* pin = &(pth->in);
  /* new in recfast 1.4: */
  double Rup,Rdown,K,C,C_nofudge;
  double ion_H,ion_He,ion_lya;

  /* Einstein coefficient of 2s -> 1s transition in hydrogen */
  double A2s1sH = _Lambda_;

  /* Varying fundamental constants */
  if (pth->has_varconst == _TRUE_) {
    /** - Rescale temperatures by factor alpha^2 * m_e (see e.g. 1705.03925) */
    Tmat /= pre->fsR*pre->fsR*pre->meR;
    Trad /= pre->fsR*pre->fsR*pre->meR;
  }

  /** - Get necessary coefficients */
  Rdown = 1.e-19*_a_PPB_*pow((Tmat/1.e4),_b_PPB_)/(1.+_c_PPB_*pow((Tmat/1.e4),_d_PPB_));
  switch (pre->photoion_mode){
    case recfast_photoion_Tmat:
      Rup = Rdown * pow((pre->CR*Tmat),1.5)*exp(-pre->CDB/Tmat);
    break;
    default:
    case recfast_photoion_Trad:
      Rup = 1.e-19*_a_PPB_*pow((Trad/1.e4),_b_PPB_)/(1.+_c_PPB_*pow((Trad/1.e4),_d_PPB_)) * pow((pre->CR*Trad),1.5)*exp(-pre->CDB/Trad);
    break;
  }
  K = pre->CK/Hz;

  /* following is from recfast 1.5 */
  /** - Adjust the K constant with double gaussian fit */
  if (pre->Hswitch == _TRUE_ ){
    K *= 1.
      + pre->AGauss1*exp(-pow((log(1.+z)-pre->zGauss1)/pre->wGauss1,2))
      + pre->AGauss2*exp(-pow((log(1.+z)-pre->zGauss2)/pre->wGauss2,2));
  }
  /* end of new recfast 1.5 piece */

  /* Varying fundamental constants */
  if (pth->has_varconst == _TRUE_) {
    /** - Rescale by various powers of fsR = relative alpha and meR = relative m_e (see e.g. 1705.03925) */
    Rdown *= pre->fsR*pre->fsR/pre->meR/pre->meR;
    Rup *= pre->fsR*pre->fsR*pre->fsR*pre->fsR*pre->fsR*pre->meR;
    K *= 1./pow(pre->fsR*pre->fsR*pre->meR,3);
    A2s1sH *= pow(pre->fsR, 8)*pre->meR;
  }

  /** - Calculate Peebles' coefficient */
  /* Peebles' coefficient (approximated as one when the Hydrogen
   * ionization fraction is very close to one) */
  if (x_H < pre->x_H0_trigger2 || z < pre->z_switch_late) {
    C = (1. + K*A2s1sH*nH*(1.-x_H))/(1./pre->fudge_H+K*A2s1sH*nH*(1.-x_H)/pre->fudge_H +K*Rup*nH*(1.-x_H));
    C_nofudge = (1. + K*A2s1sH*nH*(1.-x_H))/(1.+K*A2s1sH*nH*(1.-x_H) + K*Rup*nH*(1.-x_H));
  }
  else {
    C = 1.;
    C_nofudge = 1.;
  }

  /** - Evolve system by fudged Peebles' equation, use fudged Peebles' coefficient C */
  *dxH_dz = (x*x_H*nH*Rdown - Rup*(1.-x_H)*exp(-pre->CL/Tmat)) * C / (Hz*(1.+z));

  /** - Energy injection */
  if (pth->has_exotic_injection == _TRUE_) {
    ion_H = pin->pvecdeposition[pin->index_dep_ionH];
    ion_He = pin->pvecdeposition[pin->index_dep_ionHe];
    ion_lya = pin->pvecdeposition[pin->index_dep_lya];

    *dxH_dz += -1./nH*((ion_H+ion_He)/(_E_H_ion_*_eV_)+ion_lya*(1.-C_nofudge)/(_E_H_lya_*_eV_))/(Hz*(1.+z));
  }

  return _SUCCESS_;
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movq %rdi, 0x110(%rsp)
movq %rsi, 0x108(%rsp)
movsd %xmm0, 0x100(%rsp)
movsd %xmm1, 0xf8(%rsp)
movsd %xmm2, 0xf0(%rsp)
movsd %xmm3, 0xe8(%rsp)
movsd %xmm4, 0xe0(%rsp)
movsd %xmm5, 0xd8(%rsp)
movsd %xmm6, 0xd0(%rsp)
movq %rdx, 0xc8(%rsp)
movq 0x110(%rsp), %rax
addq $0xc0, %rax
movq %rax, 0xc0(%rsp)
movsd 0x722c4(%rip), %xmm0    # 0x20c920
movsd %xmm0, 0x78(%rsp)
movq 0x110(%rsp), %rax
movswl 0xe78(%rax), %eax
cmpl $0x1, %eax
jne 0x19a706
movq 0x108(%rsp), %rax
movsd 0x120(%rax), %xmm1
movq 0x108(%rsp), %rax
mulsd 0x120(%rax), %xmm1
movq 0x108(%rsp), %rax
mulsd 0x128(%rax), %xmm1
movsd 0xd8(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0xd8(%rsp)
movq 0x108(%rsp), %rax
movsd 0x120(%rax), %xmm1
movq 0x108(%rsp), %rax
mulsd 0x120(%rax), %xmm1
movq 0x108(%rsp), %rax
mulsd 0x128(%rax), %xmm1
movsd 0xd0(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0xd8(%rsp), %xmm0
movsd 0x3bf09(%rip), %xmm1    # 0x1d6620
movsd %xmm1, 0x60(%rsp)
divsd %xmm1, %xmm0
movsd 0x5bb67(%rip), %xmm1    # 0x1f6290
callq 0x8610
movsd 0x60(%rsp), %xmm1
movsd 0x721ec(%rip), %xmm2    # 0x20c928
mulsd %xmm2, %xmm0
movsd %xmm0, 0x68(%rsp)
movsd 0xd8(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd 0x5bb25(%rip), %xmm1    # 0x1f6280
callq 0x8610
movaps %xmm0, %xmm1
movsd 0x68(%rsp), %xmm0
movsd 0x5bb07(%rip), %xmm2    # 0x1f6278
mulsd %xmm2, %xmm1
movsd 0x37acb(%rip), %xmm2    # 0x1d2248
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0xb0(%rsp)
movq 0x108(%rsp), %rax
movl 0x130(%rax), %eax
movl %eax, 0x74(%rsp)
testl %eax, %eax
je 0x19a7b8
jmp 0x19a7a6
movl 0x74(%rsp), %eax
subl $0x1, %eax
je 0x19a84b
jmp 0x19a849
movsd 0xb0(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movq 0x108(%rsp), %rax
movsd 0x8(%rax), %xmm0
mulsd 0xd8(%rsp), %xmm0
movsd 0x3846b(%rip), %xmm1    # 0x1d2c50
callq 0x8610
movaps %xmm0, %xmm1
movsd 0x50(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
movq 0x108(%rsp), %rax
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
divsd 0xd8(%rsp), %xmm0
callq 0x8670
movaps %xmm0, %xmm1
movsd 0x58(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0xb8(%rsp)
jmp 0x19a94c
jmp 0x19a84b
movsd 0xd0(%rsp), %xmm0
movsd 0x3bdc4(%rip), %xmm1    # 0x1d6620
divsd %xmm1, %xmm0
movsd 0x5ba28(%rip), %xmm1    # 0x1f6290
callq 0x8610
movaps %xmm0, %xmm1
movsd 0x720b0(%rip), %xmm0    # 0x20c928
mulsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd 0x3bd8d(%rip), %xmm1    # 0x1d6620
divsd %xmm1, %xmm0
movsd 0x5b9e1(%rip), %xmm1    # 0x1f6280
callq 0x8610
movaps %xmm0, %xmm1
movsd 0x38(%rsp), %xmm0
movsd 0x5b9c3(%rip), %xmm2    # 0x1f6278
mulsd %xmm2, %xmm1
movsd 0x37987(%rip), %xmm2    # 0x1d2248
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x108(%rsp), %rax
movsd 0x8(%rax), %xmm0
mulsd 0xd0(%rsp), %xmm0
movsd 0x38363(%rip), %xmm1    # 0x1d2c50
callq 0x8610
movaps %xmm0, %xmm1
movsd 0x40(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
movq 0x108(%rsp), %rax
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
divsd 0xd0(%rsp), %xmm0
callq 0x8670
movaps %xmm0, %xmm1
movsd 0x48(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0xb8(%rsp)
movq 0x108(%rsp), %rax
movsd 0x10(%rax), %xmm0
divsd 0xe0(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
movq 0x108(%rsp), %rax
cmpl $0x1, 0xc4(%rax)
jne 0x19aab2
movq 0x108(%rsp), %rax
movsd 0x90(%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x378aa(%rip), %xmm0    # 0x1d2248
addsd 0xe8(%rsp), %xmm0
callq 0x82f0
movq 0x108(%rsp), %rax
subsd 0xa0(%rax), %xmm0
movq 0x108(%rsp), %rax
divsd 0xb0(%rax), %xmm0
movsd 0x382ac(%rip), %xmm1    # 0x1d2c80
callq 0x8610
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
callq 0x8670
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd 0x3783e(%rip), %xmm1    # 0x1d2248
addsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0x108(%rsp), %rax
movsd 0x98(%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x37816(%rip), %xmm0    # 0x1d2248
addsd 0xe8(%rsp), %xmm0
callq 0x82f0
movq 0x108(%rsp), %rax
subsd 0xa8(%rax), %xmm0
movq 0x108(%rsp), %rax
divsd 0xb8(%rax), %xmm0
movsd 0x38218(%rip), %xmm1    # 0x1d2c80
callq 0x8610
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
callq 0x8670
movsd 0x28(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x30(%rsp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
mulsd 0xa8(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
movq 0x110(%rsp), %rax
movswl 0xe78(%rax), %eax
cmpl $0x1, %eax
jne 0x19ac25
movq 0x108(%rsp), %rax
movsd 0x120(%rax), %xmm0
movq 0x108(%rsp), %rax
mulsd 0x120(%rax), %xmm0
movq 0x108(%rsp), %rax
divsd 0x128(%rax), %xmm0
movq 0x108(%rsp), %rax
divsd 0x128(%rax), %xmm0
mulsd 0xb0(%rsp), %xmm0
movsd %xmm0, 0xb0(%rsp)
movq 0x108(%rsp), %rax
movsd 0x120(%rax), %xmm0
movq 0x108(%rsp), %rax
mulsd 0x120(%rax), %xmm0
movq 0x108(%rsp), %rax
mulsd 0x120(%rax), %xmm0
movq 0x108(%rsp), %rax
mulsd 0x120(%rax), %xmm0
movq 0x108(%rsp), %rax
mulsd 0x120(%rax), %xmm0
movq 0x108(%rsp), %rax
mulsd 0x128(%rax), %xmm0
mulsd 0xb8(%rsp), %xmm0
movsd %xmm0, 0xb8(%rsp)
movq 0x108(%rsp), %rax
movsd 0x120(%rax), %xmm0
movq 0x108(%rsp), %rax
mulsd 0x120(%rax), %xmm0
movq 0x108(%rsp), %rax
mulsd 0x128(%rax), %xmm0
movsd 0x38ad2(%rip), %xmm1    # 0x1d3698
callq 0x8610
movaps %xmm0, %xmm1
movsd 0x37672(%rip), %xmm0    # 0x1d2248
divsd %xmm1, %xmm0
mulsd 0xa8(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
movq 0x108(%rsp), %rax
movsd 0x120(%rax), %xmm0
movsd 0x3a8d4(%rip), %xmm1    # 0x1d54d8
callq 0x8610
movq 0x108(%rsp), %rax
mulsd 0x128(%rax), %xmm0
mulsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x78(%rsp)
movsd 0x100(%rsp), %xmm1
movq 0x108(%rsp), %rax
movsd 0xc8(%rax), %xmm0
ucomisd %xmm1, %xmm0
ja 0x19ac67
movsd 0xe8(%rsp), %xmm1
movq 0x108(%rsp), %rax
movsd 0xd8(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x19adef
movsd 0xa8(%rsp), %xmm0
mulsd 0x78(%rsp), %xmm0
mulsd 0xf0(%rsp), %xmm0
movsd 0x375c1(%rip), %xmm1    # 0x1d2248
subsd 0x100(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x375ac(%rip), %xmm1    # 0x1d2248
addsd %xmm1, %xmm0
movq 0x108(%rsp), %rax
movsd 0x37598(%rip), %xmm2    # 0x1d2248
divsd 0xf0(%rax), %xmm2
movsd 0xa8(%rsp), %xmm1
mulsd 0x78(%rsp), %xmm1
mulsd 0xf0(%rsp), %xmm1
movsd 0x37570(%rip), %xmm3    # 0x1d2248
subsd 0x100(%rsp), %xmm3
mulsd %xmm3, %xmm1
movq 0x108(%rsp), %rax
divsd 0xf0(%rax), %xmm1
addsd %xmm1, %xmm2
movsd 0xa8(%rsp), %xmm1
mulsd 0xb8(%rsp), %xmm1
mulsd 0xf0(%rsp), %xmm1
movsd 0x3752c(%rip), %xmm3    # 0x1d2248
subsd 0x100(%rsp), %xmm3
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0xa0(%rsp)
movsd 0xa8(%rsp), %xmm0
mulsd 0x78(%rsp), %xmm0
mulsd 0xf0(%rsp), %xmm0
movsd 0x374ee(%rip), %xmm1    # 0x1d2248
subsd 0x100(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x374d9(%rip), %xmm1    # 0x1d2248
addsd %xmm1, %xmm0
movsd 0xa8(%rsp), %xmm2
mulsd 0x78(%rsp), %xmm2
mulsd 0xf0(%rsp), %xmm2
movsd 0x374b5(%rip), %xmm1    # 0x1d2248
subsd 0x100(%rsp), %xmm1
mulsd %xmm1, %xmm2
movsd 0x374a0(%rip), %xmm1    # 0x1d2248
addsd %xmm1, %xmm2
movsd 0xa8(%rsp), %xmm1
mulsd 0xb8(%rsp), %xmm1
mulsd 0xf0(%rsp), %xmm1
movsd 0x37479(%rip), %xmm3    # 0x1d2248
subsd 0x100(%rsp), %xmm3
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x98(%rsp)
jmp 0x19ae11
movsd 0x37451(%rip), %xmm0    # 0x1d2248
movsd %xmm0, 0xa0(%rsp)
movsd 0x37440(%rip), %xmm0    # 0x1d2248
movsd %xmm0, 0x98(%rsp)
movsd 0xf8(%rsp), %xmm0
mulsd 0x100(%rsp), %xmm0
mulsd 0xf0(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0xb0(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0xb8(%rsp), %xmm0
movsd 0x373f6(%rip), %xmm1    # 0x1d2248
subsd 0x100(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x108(%rsp), %rax
movsd 0x18(%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
divsd 0xd8(%rsp), %xmm0
callq 0x8670
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movaps %xmm0, %xmm3
movsd 0x18(%rsp), %xmm0
mulsd %xmm3, %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
mulsd 0xa0(%rsp), %xmm0
movsd 0xe0(%rsp), %xmm1
movsd 0x3735f(%rip), %xmm2    # 0x1d2248
addsd 0xe8(%rsp), %xmm2
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movq 0xc8(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x110(%rsp), %rax
movswl 0xb8(%rax), %eax
cmpl $0x1, %eax
jne 0x19b035
movq 0xc0(%rsp), %rax
movq 0x550(%rax), %rax
movq 0xc0(%rsp), %rcx
movslq 0x53c(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x90(%rsp)
movq 0xc0(%rsp), %rax
movq 0x550(%rax), %rax
movq 0xc0(%rsp), %rcx
movslq 0x540(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x88(%rsp)
movq 0xc0(%rsp), %rax
movq 0x550(%rax), %rax
movq 0xc0(%rsp), %rcx
movslq 0x544(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0x37826(%rip), %xmm0    # 0x1d27d0
divsd 0xf0(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
addsd 0x88(%rsp), %xmm1
movsd 0x7196b(%rip), %xmm2    # 0x20c938
divsd %xmm2, %xmm1
movsd 0x80(%rsp), %xmm2
movsd 0x37266(%rip), %xmm3    # 0x1d2248
subsd 0x98(%rsp), %xmm3
mulsd %xmm3, %xmm2
movsd 0x71939(%rip), %xmm3    # 0x20c930
divsd %xmm3, %xmm2
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd 0xe0(%rsp), %xmm1
movsd 0x37234(%rip), %xmm2    # 0x1d2248
addsd 0xe8(%rsp), %xmm2
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movq 0xc8(%rsp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
retq
nop