// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../external/HyRec2020/wrap_hyrec.c
// Function: thermodynamics_hyrec_init
int thermodynamics_hyrec_init(struct precision* ppr, struct background * pba, struct thermodynamics * pth, double Nnow, double T_cmb, double fHe, double zstart_hyrec, struct thermohyrec* phy){

  /** Summary: */

  if(phy->thermohyrec_verbose > 0){
    printf(" -> Using the hyrec wrapper programmed by Nils Sch. (Oct2020)\n");
    printf("    implements HyRec2 version Oct 2020 by Yacine Ali-Haimoud, Chris Hirata, and Nanoom Lee\n");
  }

  /** - allocate necessary data structures */
  class_alloc(phy->data,
              sizeof(HYREC_DATA),
              phy->error_message);

  phy->zend = 0.;
  phy->zstart = zstart_hyrec;

  if(phy->thermohyrec_verbose > 1){
    printf("    Starting HyRec at z = %.10e until z = %.10e\n",phy->zstart, phy->zend);
  }

  /** - allocate hyrec internally */
  phy->data->path_to_hyrec = ppr->hyrec_path;
  hyrec_allocate(phy->data, phy->zstart, phy->zend);
  /* Error during allocation */
  if(phy->data->error != 0){
    class_call_message(phy->error_message,"hyrec_allocate",phy->data->error_message);
    return _FAILURE_;
  }

  /** - set cosmological parameters for hyrec */
  phy->data->cosmo->T0 = T_cmb;
  phy->data->cosmo->obh2 = pba->Omega0_b*pba->h*pba->h;
  phy->data->cosmo->ocbh2 = pba->Omega0_nfsm*pba->h*pba->h;

  phy->data->cosmo->YHe = pth->YHe;
  phy->data->cosmo->Neff = pba->Neff;
  phy->data->cosmo->fHe = fHe; /* abundance of helium relative to hydrogen by number */
  phy->data->cosmo->fsR = 1.;
  phy->data->cosmo->meR = 1.;
  phy->data->cosmo->nH0 = Nnow*1e-6;

  /** - set other parameters for hyrec */
  /* XEII_MIN = 1e-6 defined in history.h
     HYREC-2 calculates Helium recombinations only until xHeII ~ XEII_MIN */
  phy->xHeII_limit = XHEII_MIN;

  return _SUCCESS_;
}

// Assembly:
subq $0x1058, %rsp           # imm = 0x1058
movq %rdi, 0x1048(%rsp)
movq %rsi, 0x1040(%rsp)
movq %rdx, 0x1038(%rsp)
movsd %xmm0, 0x1030(%rsp)
movsd %xmm1, 0x1028(%rsp)
movsd %xmm2, 0x1020(%rsp)
movsd %xmm3, 0x1018(%rsp)
movq %rcx, 0x1010(%rsp)
movq 0x1010(%rsp), %rax
cmpl $0x0, 0x820(%rax)
jle 0x1b3758
leaq 0x5c0eb(%rip), %rdi     # 0x20f82e
movb $0x0, %al
callq 0x8030
leaq 0x5c11c(%rip), %rdi     # 0x20f86d
movb $0x0, %al
callq 0x8030
movl $0x68, %edi
callq 0x8460
movq %rax, %rcx
movq 0x1010(%rsp), %rax
movq %rcx, (%rax)
movq 0x1010(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x1b37eb
movl $0x68, 0x100c(%rsp)
leaq 0x800(%rsp), %rdi
movl 0x100c(%rsp), %ecx
leaq 0x1e865(%rip), %rsi     # 0x1d2004
leaq 0x5c123(%rip), %rdx     # 0x20f8c9
movb $0x0, %al
callq 0x5b9c0
movq 0x1010(%rsp), %rdi
addq $0x20, %rdi
leaq 0x800(%rsp), %r8
leaq 0x1e86c(%rip), %rsi     # 0x1d2034
leaq 0x5c104(%rip), %rdx     # 0x20f8d3
movl $0x20, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x1054(%rsp)
jmp 0x1b3a86
movq 0x1010(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rax)
movsd 0x1018(%rsp), %xmm0
movq 0x1010(%rsp), %rax
movsd %xmm0, 0x8(%rax)
movq 0x1010(%rsp), %rax
cmpl $0x1, 0x820(%rax)
jle 0x1b384a
movq 0x1010(%rsp), %rax
movsd 0x8(%rax), %xmm0
movq 0x1010(%rsp), %rax
movsd 0x10(%rax), %xmm1
leaq 0x5c0aa(%rip), %rdi     # 0x20f8ed
movb $0x2, %al
callq 0x8030
movq 0x1048(%rsp), %rcx
addq $0x2e8, %rcx            # imm = 0x2E8
movq 0x1010(%rsp), %rax
movq (%rax), %rax
movq %rcx, 0x50(%rax)
movq 0x1010(%rsp), %rax
movq (%rax), %rdi
movq 0x1010(%rsp), %rax
movsd 0x8(%rax), %xmm0
movq 0x1010(%rsp), %rax
movsd 0x10(%rax), %xmm1
callq 0x1b3120
movq 0x1010(%rsp), %rax
movq (%rax), %rax
cmpl $0x0, 0x38(%rax)
je 0x1b3903
movq %rsp, %rdi
movq 0x1010(%rsp), %rax
movq (%rax), %rax
movq 0x48(%rax), %rcx
leaq 0x1eb1c(%rip), %rsi     # 0x1d23d8
leaq 0x5c05b(%rip), %rdx     # 0x20f91e
movb $0x0, %al
callq 0x5b9c0
movq 0x1010(%rsp), %rdi
addq $0x20, %rdi
movq %rsp, %r8
leaq 0x1e754(%rip), %rsi     # 0x1d2034
leaq 0x5bfec(%rip), %rdx     # 0x20f8d3
movl $0x2e, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x1054(%rsp)
jmp 0x1b3a86
movsd 0x1028(%rsp), %xmm0
movq 0x1010(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movsd %xmm0, 0x8(%rax)
movq 0x1040(%rsp), %rax
movsd 0x20(%rax), %xmm0
movq 0x1040(%rsp), %rax
mulsd 0x8(%rax), %xmm0
movq 0x1040(%rsp), %rax
mulsd 0x8(%rax), %xmm0
movq 0x1010(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movsd %xmm0, 0x10(%rax)
movq 0x1040(%rsp), %rax
movsd 0x358(%rax), %xmm0
movq 0x1040(%rsp), %rax
mulsd 0x8(%rax), %xmm0
movq 0x1040(%rsp), %rax
mulsd 0x8(%rax), %xmm0
movq 0x1010(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movsd %xmm0, 0x18(%rax)
movq 0x1038(%rsp), %rax
movsd (%rax), %xmm0
movq 0x1010(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movsd %xmm0, 0x90(%rax)
movq 0x1040(%rsp), %rax
movsd 0x328(%rax), %xmm0
movq 0x1010(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movsd %xmm0, 0x50(%rax)
movsd 0x1020(%rsp), %xmm0
movq 0x1010(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movsd %xmm0, 0x80(%rax)
movq 0x1010(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movsd 0x1e831(%rip), %xmm0    # 0x1d2248
movsd %xmm0, 0x98(%rax)
movq 0x1010(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movsd 0x1e812(%rip), %xmm0    # 0x1d2248
movsd %xmm0, 0xa0(%rax)
movsd 0x1f222(%rip), %xmm0    # 0x1d2c68
mulsd 0x1030(%rsp), %xmm0
movq 0x1010(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movsd %xmm0, 0x88(%rax)
movq 0x1010(%rsp), %rax
movsd 0x1f1f2(%rip), %xmm0    # 0x1d2c68
movsd %xmm0, 0x18(%rax)
movl $0x0, 0x1054(%rsp)
movl 0x1054(%rsp), %eax
addq $0x1058, %rsp           # imm = 0x1058
retq
nopw %cs:(%rax,%rax)