// File: /workspace/github_c_makefile_star2_O3/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 0x1681b(%rip), %xmm0    # 0xee260
addsd %xmm0, %xmm2
movsd %xmm2, 0x8(%rsp)
addsd %xmm1, %xmm0
callq 0x82c0
xorpd 0x167d0(%rip), %xmm0    # 0xee230
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 0x1679a(%rip), %xmm2    # 0xee230
movapd 0x10(%rsp), %xmm0
movsd 0x5297c(%rip), %xmm1    # 0x12a420
movq %r13, %rdi
movl %ebp, %esi
callq 0xd7995
movq 0x30(%rsp), %rax
movsd %xmm0, (%rax,%r15,8)
movq %rbx, %r15
cmpq $0x8b, %rbx
jne 0xd7a69
movsd 0x8(%rsp), %xmm0
mulsd 0x52905(%rip), %xmm0    # 0x12a3d8
divsd 0x458(%r14), %xmm0
movq 0x20(%rsp), %rax
movq (%rax), %r13
callq 0x82c0
movapd %xmm0, %xmm2
xorpd 0x1673b(%rip), %xmm2    # 0xee230
movsd 0x52923(%rip), %xmm1    # 0x12a420
movaps 0x10(%rsp), %xmm0
movq %r13, %rdi
movl %ebp, %esi
callq 0xd7995
movq 0x30(%rsp), %rbx
movsd %xmm0, 0x458(%rbx)
movsd 0x460(%r14), %xmm0
mulsd 0x8(%rsp), %xmm0
divsd 0x528a8(%rip), %xmm0    # 0x12a3d8
movq 0x460(%r12), %r13
callq 0x82c0
movapd %xmm0, %xmm2
xorpd 0x166e7(%rip), %xmm2    # 0xee230
movaps 0x10(%rsp), %xmm0
movsd 0x528ca(%rip), %xmm1    # 0x12a420
movq %r13, %rdi
movl %ebp, %esi
callq 0xd7995
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 0x16691(%rip), %xmm2    # 0xee230
movaps 0x10(%rsp), %xmm0
movsd 0x52874(%rip), %xmm1    # 0x12a420
movq %r13, %rdi
movl %ebp, %esi
callq 0xd7995
movsd %xmm0, 0x460(%rbx,%r15,8)
incq %r15
cmpq $0x82, %r15
jne 0xd7b6c
movsd 0x8(%rsp), %xmm0
mulsd 0x5284e(%rip), %xmm0    # 0x12a428
divsd 0x870(%r14), %xmm0
movq 0x20(%rsp), %rax
movq 0x8(%rax), %r13
callq 0x82c0
movapd %xmm0, %xmm2
movapd 0x16633(%rip), %xmm0    # 0xee230
xorpd %xmm0, %xmm2
movsd 0x52817(%rip), %xmm1    # 0x12a420
movaps 0x10(%rsp), %xmm0
movq %r13, %rdi
movl %ebp, %esi
callq 0xd7995
movsd %xmm0, 0x870(%rbx)
movsd 0x878(%r14), %xmm0
mulsd 0x8(%rsp), %xmm0
divsd 0x527f1(%rip), %xmm0    # 0x12a428
movq 0x878(%r12), %r13
callq 0x82c0
movapd 0x165e4(%rip), %xmm2    # 0xee230
xorpd %xmm0, %xmm2
movaps 0x10(%rsp), %xmm0
movsd 0x527c3(%rip), %xmm1    # 0x12a420
movq %r13, %rdi
movl %ebp, %esi
callq 0xd7995
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 0x16589(%rip), %xmm2    # 0xee230
movaps 0x10(%rsp), %xmm0
movsd 0x5276c(%rip), %xmm1    # 0x12a420
movq %r13, %rdi
movl %ebp, %esi
callq 0xd7995
movsd %xmm0, 0x878(%rbx,%r15,8)
incq %r15
cmpq $0x27, %r15
jne 0xd7c74
movsd 0x8(%rsp), %xmm0
mulsd 0x52751(%rip), %xmm0    # 0x12a430
divsd 0x9b0(%r14), %xmm0
movq 0x20(%rsp), %rax
movq 0x10(%rax), %r14
callq 0x82c0
movapd %xmm0, %xmm2
xorpd 0x1652e(%rip), %xmm2    # 0xee230
movsd 0x52716(%rip), %xmm1    # 0x12a420
movaps 0x10(%rsp), %xmm0
movq %r14, %rdi
movl %ebp, %esi
callq 0xd7995
movsd %xmm0, 0x9b0(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq