// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../external/HyRec2020/wrap_hyrec.c
// Function: hyrec_dx_H_dz
int hyrec_dx_H_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_H_dz) {

  /** Summary: */

  /** - define local variables */
  struct injection* pin = &(pth->in);
  long iz = 0;
  int model;
  double Trad_phys;

  /** - 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_ionH]/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;
  }

  Trad_phys = Trad*kBoltz;
  if (pth->has_varconst == _TRUE_) {
    Trad_phys /= phy->data->cosmo->fsR*phy->data->cosmo->fsR*phy->data->cosmo->meR; //According to 1705.03925
  }

  if (Trad_phys <= TR_MIN || Tmat/Trad <= T_RATIO_MIN) { model = PEEBLES; }
  else { model = MODEL; }

  /** - convert to correct units, and retrieve derivative */
  *dx_H_dz = -1./(1.+z)* rec_dxHIIdlna(phy->data, model, xe, x_H, nH*1e-6, Hz, Tmat*kBoltz, Trad*kBoltz, iz, z);

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

  return _SUCCESS_;
}

// Assembly:
subq $0x898, %rsp            # imm = 0x898
movsd 0x8a8(%rsp), %xmm8
movsd 0x8a0(%rsp), %xmm8
movq %rdi, 0x888(%rsp)
movq %rsi, 0x880(%rsp)
movsd %xmm0, 0x878(%rsp)
movsd %xmm1, 0x870(%rsp)
movsd %xmm2, 0x868(%rsp)
movsd %xmm3, 0x860(%rsp)
movsd %xmm4, 0x858(%rsp)
movsd %xmm5, 0x850(%rsp)
movsd %xmm6, 0x848(%rsp)
movsd %xmm7, 0x840(%rsp)
movq %rdx, 0x838(%rsp)
movq 0x888(%rsp), %rax
addq $0xc0, %rax
movq %rax, 0x830(%rsp)
movq $0x0, 0x828(%rsp)
movq 0x888(%rsp), %rax
movswl 0xb8(%rax), %eax
cmpl $0x1, %eax
jne 0x1b3c2d
movq 0x830(%rsp), %rax
movq 0x550(%rax), %rax
movq 0x830(%rsp), %rcx
movslq 0x53c(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
divsd 0x860(%rsp), %xmm0
movsd 0x58d7f(%rip), %xmm1    # 0x20c938
divsd %xmm1, %xmm0
movq 0x880(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0xb8(%rax), %rax
movsd %xmm0, 0x60(%rax)
movq 0x830(%rsp), %rax
movq 0x550(%rax), %rax
movq 0x830(%rsp), %rcx
movslq 0x544(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
divsd 0x860(%rsp), %xmm0
movsd 0x58d24(%rip), %xmm1    # 0x20c930
divsd %xmm1, %xmm0
movq 0x880(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0xb8(%rax), %rax
movsd %xmm0, 0x68(%rax)
jmp 0x1b3c69
movq 0x880(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0xb8(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x60(%rax)
movq 0x880(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0xb8(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x68(%rax)
movq 0x888(%rsp), %rax
movswl 0xe78(%rax), %eax
cmpl $0x1, %eax
jne 0x1b3cbd
movsd 0x8a0(%rsp), %xmm0
movq 0x880(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movsd %xmm0, 0x98(%rax)
movsd 0x8a8(%rsp), %xmm0
movq 0x880(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movsd %xmm0, 0xa0(%rax)
movsd 0x5ac33(%rip), %xmm0    # 0x20e8f8
mulsd 0x840(%rsp), %xmm0
movsd %xmm0, 0x818(%rsp)
movq 0x888(%rsp), %rax
movswl 0xe78(%rax), %eax
cmpl $0x1, %eax
jne 0x1b3d46
movq 0x880(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movsd 0x98(%rax), %xmm1
movq 0x880(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
mulsd 0x98(%rax), %xmm1
movq 0x880(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
mulsd 0xa0(%rax), %xmm1
movsd 0x818(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x818(%rsp)
movsd 0x5abc2(%rip), %xmm0    # 0x20e910
ucomisd 0x818(%rsp), %xmm0
jae 0x1b3d79
movsd 0x848(%rsp), %xmm1
divsd 0x840(%rsp), %xmm1
movsd 0x1e4ed(%rip), %xmm0    # 0x1d2260
ucomisd %xmm1, %xmm0
jb 0x1b3d86
movl $0x0, 0x824(%rsp)
jmp 0x1b3d91
movl $0x4, 0x824(%rsp)
movsd 0x1e4af(%rip), %xmm1    # 0x1d2248
addsd 0x858(%rsp), %xmm1
movsd 0x1ea26(%rip), %xmm0    # 0x1d27d0
divsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x880(%rsp), %rax
movq (%rax), %rdi
movl 0x824(%rsp), %esi
movsd 0x868(%rsp), %xmm0
movsd 0x878(%rsp), %xmm1
movsd 0x1ee88(%rip), %xmm2    # 0x1d2c68
mulsd 0x860(%rsp), %xmm2
movsd 0x850(%rsp), %xmm3
movsd 0x5aafe(%rip), %xmm4    # 0x20e8f8
mulsd 0x848(%rsp), %xmm4
movsd 0x5aaed(%rip), %xmm5    # 0x20e8f8
mulsd 0x840(%rsp), %xmm5
movq 0x828(%rsp), %rax
movl %eax, %edx
movsd 0x858(%rsp), %xmm6
callq 0x1ad910
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
movq 0x838(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x880(%rsp), %rax
movq (%rax), %rax
cmpl $0x0, 0x38(%rax)
je 0x1b3eb7
leaq 0x10(%rsp), %rdi
movq 0x880(%rsp), %rax
movq (%rax), %rax
movq 0x48(%rax), %rcx
leaq 0x1e567(%rip), %rsi     # 0x1d23d8
leaq 0x5bab5(%rip), %rdx     # 0x20f92d
movb $0x0, %al
callq 0x5b9c0
movq 0x880(%rsp), %rdi
addq $0x20, %rdi
leaq 0x10(%rsp), %r8
leaq 0x1e19d(%rip), %rsi     # 0x1d2034
leaq 0x5ba9d(%rip), %rdx     # 0x20f93b
movl $0x8f, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x894(%rsp)
jmp 0x1b3ec2
movl $0x0, 0x894(%rsp)
movl 0x894(%rsp), %eax
addq $0x898, %rsp            # imm = 0x898
retq
nopw %cs:(%rax,%rax)