// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../external/HyRec2020/wrap_hyrec.c
// Function: hyrec_dx_He_dz
int hyrec_dx_He_dz(struct thermodynamics* pth, struct thermohyrec* phy, double x_H, double x_He, double xe, double nH, double z, double Hz, double Tmat, double Trad, double alpha, double me, double *dx_He_dz) {

  /** Summary: */

  /** - define local variables */
  struct injection* pin = &(pth->in);
  double xHeII = x_He*phy->data->cosmo->fHe;    // Different definitions between CLASS and HYREC-2

  /** - do tests */
  class_test(MODEL == FULL, phy->error_message, "FULL mode is currently not allowed for HyRec-2");

  /** - assign variables */
  if (pth->has_exotic_injection == _TRUE_) {
    phy->data->cosmo->inj_params->ion = pin->pvecdeposition[pin->index_dep_ionHe]/nH/(_E_H_ion_*_eV_);
    phy->data->cosmo->inj_params->exclya = pin->pvecdeposition[pin->index_dep_lya]/nH/(_E_H_lya_*_eV_);
  }
  else{
    phy->data->cosmo->inj_params->ion = 0.;
    phy->data->cosmo->inj_params->exclya = 0.;
  }
  if (pth->has_varconst == _TRUE_) {
    phy->data->cosmo->fsR = alpha;
    phy->data->cosmo->meR = me;
  }

  if (xHeII<phy->xHeII_limit) {
    /** - don't evolve He below the limit */
    *dx_He_dz=0;
  }
  else {

    /** - convert to correct units, and retrieve derivative */
    *dx_He_dz = -1./(1.+z)* rec_helium_dxHeIIdlna(phy->data, z, 1.-x_H, xHeII, Hz) / phy->data->cosmo->fHe;

    /** - do error management */
    if(phy->data->error != 0){
      class_call_message(phy->error_message,"rec_helium_dxHeIIdlna",phy->data->error_message);
      return _FAILURE_;
    }
  }

  return _SUCCESS_;
}

// Assembly:
subq $0x888, %rsp            # imm = 0x888
movsd 0x898(%rsp), %xmm8
movsd 0x890(%rsp), %xmm8
movq %rdi, 0x878(%rsp)
movq %rsi, 0x870(%rsp)
movsd %xmm0, 0x868(%rsp)
movsd %xmm1, 0x860(%rsp)
movsd %xmm2, 0x858(%rsp)
movsd %xmm3, 0x850(%rsp)
movsd %xmm4, 0x848(%rsp)
movsd %xmm5, 0x840(%rsp)
movsd %xmm6, 0x838(%rsp)
movsd %xmm7, 0x830(%rsp)
movq %rdx, 0x828(%rsp)
movq 0x878(%rsp), %rax
addq $0xc0, %rax
movq %rax, 0x820(%rsp)
movsd 0x860(%rsp), %xmm0
movq 0x870(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
mulsd 0x80(%rax), %xmm0
movsd %xmm0, 0x818(%rsp)
movq 0x878(%rsp), %rax
movswl 0xb8(%rax), %eax
cmpl $0x1, %eax
jne 0x1b405a
movq 0x820(%rsp), %rax
movq 0x550(%rax), %rax
movq 0x820(%rsp), %rcx
movslq 0x540(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
divsd 0x850(%rsp), %xmm0
movsd 0x58952(%rip), %xmm1    # 0x20c938
divsd %xmm1, %xmm0
movq 0x870(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0xb8(%rax), %rax
movsd %xmm0, 0x60(%rax)
movq 0x820(%rsp), %rax
movq 0x550(%rax), %rax
movq 0x820(%rsp), %rcx
movslq 0x544(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
divsd 0x850(%rsp), %xmm0
movsd 0x588f7(%rip), %xmm1    # 0x20c930
divsd %xmm1, %xmm0
movq 0x870(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0xb8(%rax), %rax
movsd %xmm0, 0x68(%rax)
jmp 0x1b4096
movq 0x870(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0xb8(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x60(%rax)
movq 0x870(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0xb8(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x68(%rax)
movq 0x878(%rsp), %rax
movswl 0xe78(%rax), %eax
cmpl $0x1, %eax
jne 0x1b40ea
movsd 0x890(%rsp), %xmm0
movq 0x870(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movsd %xmm0, 0x98(%rax)
movsd 0x898(%rsp), %xmm0
movq 0x870(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movsd %xmm0, 0xa0(%rax)
movsd 0x818(%rsp), %xmm1
movq 0x870(%rsp), %rax
movsd 0x18(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1b411a
movq 0x828(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
jmp 0x1b421d
movsd 0x1e126(%rip), %xmm1    # 0x1d2248
addsd 0x848(%rsp), %xmm1
movsd 0x1e69d(%rip), %xmm0    # 0x1d27d0
divsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x870(%rsp), %rax
movq (%rax), %rdi
movsd 0x848(%rsp), %xmm0
movsd 0x1e0ef(%rip), %xmm1    # 0x1d2248
subsd 0x868(%rsp), %xmm1
movsd 0x818(%rsp), %xmm2
movsd 0x840(%rsp), %xmm3
callq 0x1a6e90
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
movq 0x870(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
divsd 0x80(%rax), %xmm0
movq 0x828(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x870(%rsp), %rax
movq (%rax), %rax
cmpl $0x0, 0x38(%rax)
je 0x1b421b
leaq 0x10(%rsp), %rdi
movq 0x870(%rsp), %rax
movq (%rax), %rax
movq 0x48(%rax), %rcx
leaq 0x1e203(%rip), %rsi     # 0x1d23d8
leaq 0x5b76d(%rip), %rdx     # 0x20f949
movb $0x0, %al
callq 0x5b9c0
movq 0x870(%rsp), %rdi
addq $0x20, %rdi
leaq 0x10(%rsp), %r8
leaq 0x1de39(%rip), %rsi     # 0x1d2034
leaq 0x5b75d(%rip), %rdx     # 0x20f95f
movl $0xcc, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x884(%rsp)
jmp 0x1b4228
jmp 0x1b421d
movl $0x0, 0x884(%rsp)
movl 0x884(%rsp), %eax
addq $0x888, %rsp            # imm = 0x888
retq
nopw (%rax,%rax)