// File: /workspace/github_c_makefile_star2_O1/PoulinV[P]AxiCLASS/build/../external/HyRec2020/hydrogen.c
// Function: fplus_from_fminus
void fplus_from_fminus(double Dfplus[NVIRT], double Dfplus_Ly[], double **Dfminus_hist, double **Dfminus_Ly_hist,
                       double TR, double zstart, unsigned iz, double z, double Eb_tab[NVIRT]) {
  unsigned b;
  double ainv, lna_start, zp1;

  zp1 = 1.+z;
  lna_start = -log(1.+zstart);

  /*** Bins below Lyman alpha ***/
  for (b = 0; b < NSUBLYA-1; b++) {
    ainv = zp1*Eb_tab[b+1]/Eb_tab[b];
    Dfplus[b] = interp_Dfnu(lna_start, DLNA_HYREC, Dfminus_hist[b+1], iz, -log(ainv));
  }

  /*** highest bin below Ly-alpha: feedback from optically thick Ly-alpha ***/
  b = NSUBLYA-1;
  ainv = zp1*E21/Eb_tab[b];
  Dfplus[b] = interp_Dfnu(lna_start, DLNA_HYREC, Dfminus_Ly_hist[0], iz, -log(ainv));

  /*** incoming photon occupation number at Lyman alpha ***/
  b = NSUBLYA;     /* next highest bin */
  ainv = zp1*Eb_tab[b]/E21;
  Dfplus_Ly[0] = interp_Dfnu(lna_start, DLNA_HYREC, Dfminus_hist[b], iz, -log(ainv));

  /*** Bins between Lyman alpha and beta ***/
  for (b = NSUBLYA; b < NSUBLYB-1; b++) {
    ainv = zp1*Eb_tab[b+1]/Eb_tab[b];
    Dfplus[b] = interp_Dfnu(lna_start, DLNA_HYREC, Dfminus_hist[b+1], iz, -log(ainv));
  }

  /*** highest bin below Ly-beta: feedback from Ly-beta ***/
  b = NSUBLYB-1;
  ainv = zp1*E31/Eb_tab[b];
  Dfplus[b] = interp_Dfnu(lna_start, DLNA_HYREC, Dfminus_Ly_hist[1], iz, -log(ainv));

  /*** incoming photon occupation number at Lyman beta ***/
  b = NSUBLYB;     /* next highest bin */
  ainv = zp1*Eb_tab[b]/E31;
  Dfplus_Ly[1] = interp_Dfnu(lna_start, DLNA_HYREC, Dfminus_hist[b], iz, -log(ainv));

  /*** Bins between Lyman beta and gamma ***/
  for (b = NSUBLYB; b < NVIRT-1; b++) {
    ainv = zp1*Eb_tab[b+1]/Eb_tab[b];
    Dfplus[b] = interp_Dfnu(lna_start, DLNA_HYREC, Dfminus_hist[b+1], iz, -log(ainv));
  }

  /*** highest energy bin: feedback from Ly-gamma ***/
  b = NVIRT-1;
  ainv = zp1*E41/Eb_tab[b];
  Dfplus[b] = interp_Dfnu(lna_start, DLNA_HYREC, Dfminus_Ly_hist[2], iz, -log(ainv));

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r14
movl %r8d, %ebp
movq %rcx, 0x20(%rsp)
movq %rdx, %r12
movq %rsi, 0x28(%rsp)
movq %rdi, 0x30(%rsp)
movsd 0x16071(%rip), %xmm0    # 0xf1260
addsd %xmm0, %xmm2
movsd %xmm2, 0x8(%rsp)
addsd %xmm1, %xmm0
callq 0x82c0
xorpd 0x16026(%rip), %xmm0    # 0xf1230
movapd %xmm0, 0x10(%rsp)
xorl %r15d, %r15d
leaq 0x1(%r15), %rbx
movsd 0x8(%r14,%r15,8), %xmm0
mulsd 0x8(%rsp), %xmm0
divsd (%r14,%r15,8), %xmm0
movq 0x8(%r12,%r15,8), %r13
callq 0x82c0
movapd %xmm0, %xmm2
xorpd 0x15ff0(%rip), %xmm2    # 0xf1230
movapd 0x10(%rsp), %xmm0
movsd 0x521a2(%rip), %xmm1    # 0x12d3f0
movq %r13, %rdi
movl %ebp, %esi
callq 0xdb13f
movq 0x30(%rsp), %rax
movsd %xmm0, (%rax,%r15,8)
movq %rbx, %r15
cmpq $0x8b, %rbx
jne 0xdb213
movsd 0x8(%rsp), %xmm0
mulsd 0x5212b(%rip), %xmm0    # 0x12d3a8
divsd 0x458(%r14), %xmm0
movq 0x20(%rsp), %rax
movq (%rax), %r13
callq 0x82c0
movapd %xmm0, %xmm2
xorpd 0x15f91(%rip), %xmm2    # 0xf1230
movsd 0x52149(%rip), %xmm1    # 0x12d3f0
movaps 0x10(%rsp), %xmm0
movq %r13, %rdi
movl %ebp, %esi
callq 0xdb13f
movq 0x30(%rsp), %rbx
movsd %xmm0, 0x458(%rbx)
movsd 0x460(%r14), %xmm0
mulsd 0x8(%rsp), %xmm0
divsd 0x520ce(%rip), %xmm0    # 0x12d3a8
movq 0x460(%r12), %r13
callq 0x82c0
movapd %xmm0, %xmm2
xorpd 0x15f3d(%rip), %xmm2    # 0xf1230
movaps 0x10(%rsp), %xmm0
movsd 0x520f0(%rip), %xmm1    # 0x12d3f0
movq %r13, %rdi
movl %ebp, %esi
callq 0xdb13f
movq 0x28(%rsp), %rax
movsd %xmm0, (%rax)
xorl %r15d, %r15d
movsd 0x468(%r14,%r15,8), %xmm0
mulsd 0x8(%rsp), %xmm0
divsd 0x460(%r14,%r15,8), %xmm0
movq 0x468(%r12,%r15,8), %r13
callq 0x82c0
movapd %xmm0, %xmm2
xorpd 0x15ee7(%rip), %xmm2    # 0xf1230
movaps 0x10(%rsp), %xmm0
movsd 0x5209a(%rip), %xmm1    # 0x12d3f0
movq %r13, %rdi
movl %ebp, %esi
callq 0xdb13f
movsd %xmm0, 0x460(%rbx,%r15,8)
incq %r15
cmpq $0x82, %r15
jne 0xdb316
movsd 0x8(%rsp), %xmm0
mulsd 0x52074(%rip), %xmm0    # 0x12d3f8
divsd 0x870(%r14), %xmm0
movq 0x20(%rsp), %rax
movq 0x8(%rax), %r13
callq 0x82c0
movapd %xmm0, %xmm2
movapd 0x15e89(%rip), %xmm0    # 0xf1230
xorpd %xmm0, %xmm2
movsd 0x5203d(%rip), %xmm1    # 0x12d3f0
movaps 0x10(%rsp), %xmm0
movq %r13, %rdi
movl %ebp, %esi
callq 0xdb13f
movsd %xmm0, 0x870(%rbx)
movsd 0x878(%r14), %xmm0
mulsd 0x8(%rsp), %xmm0
divsd 0x52017(%rip), %xmm0    # 0x12d3f8
movq 0x878(%r12), %r13
callq 0x82c0
movapd 0x15e3a(%rip), %xmm2    # 0xf1230
xorpd %xmm0, %xmm2
movaps 0x10(%rsp), %xmm0
movsd 0x51fe9(%rip), %xmm1    # 0x12d3f0
movq %r13, %rdi
movl %ebp, %esi
callq 0xdb13f
movq 0x28(%rsp), %rax
movsd %xmm0, 0x8(%rax)
xorl %r15d, %r15d
movsd 0x880(%r14,%r15,8), %xmm0
mulsd 0x8(%rsp), %xmm0
divsd 0x878(%r14,%r15,8), %xmm0
movq 0x880(%r12,%r15,8), %r13
callq 0x82c0
movapd %xmm0, %xmm2
xorpd 0x15ddf(%rip), %xmm2    # 0xf1230
movaps 0x10(%rsp), %xmm0
movsd 0x51f92(%rip), %xmm1    # 0x12d3f0
movq %r13, %rdi
movl %ebp, %esi
callq 0xdb13f
movsd %xmm0, 0x878(%rbx,%r15,8)
incq %r15
cmpq $0x27, %r15
jne 0xdb41e
movsd 0x8(%rsp), %xmm0
mulsd 0x51f77(%rip), %xmm0    # 0x12d400
divsd 0x9b0(%r14), %xmm0
movq 0x20(%rsp), %rax
movq 0x10(%rax), %r14
callq 0x82c0
movapd %xmm0, %xmm2
xorpd 0x15d84(%rip), %xmm2    # 0xf1230
movsd 0x51f3c(%rip), %xmm1    # 0x12d3f0
movaps 0x10(%rsp), %xmm0
movq %r14, %rdi
movl %ebp, %esi
callq 0xdb13f
movsd %xmm0, 0x9b0(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq