// File: /workspace/github_c_makefile_star2_O2/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 0x154a8(%rip), %xmm0    # 0xe5260
addsd %xmm0, %xmm2
movsd %xmm2, 0x8(%rsp)
addsd %xmm1, %xmm0
callq 0x82e0
xorpd 0x1545d(%rip), %xmm0    # 0xe5230
movapd %xmm0, 0x10(%rsp)
xorl %r15d, %r15d
cmpq $0x8b, %r15
je 0xcfe3a
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 0x82e0
movapd %xmm0, %xmm2
xorpd 0x1541e(%rip), %xmm2    # 0xe5230
movapd 0x10(%rsp), %xmm0
movsd 0x514a0(%rip), %xmm1    # 0x1212c0
movq %r13, %rdi
movl %ebp, %esi
callq 0xcfcd5
movq 0x30(%rsp), %rax
movsd %xmm0, (%rax,%r15,8)
movq %rbx, %r15
jmp 0xcfddc
movsd 0x8(%rsp), %xmm0
mulsd 0x51430(%rip), %xmm0    # 0x121278
divsd 0x458(%r14), %xmm0
movq 0x20(%rsp), %rax
movq (%rax), %r13
callq 0x82e0
movapd %xmm0, %xmm2
xorpd 0x153c6(%rip), %xmm2    # 0xe5230
movsd 0x5144e(%rip), %xmm1    # 0x1212c0
movaps 0x10(%rsp), %xmm0
movq %r13, %rdi
movl %ebp, %esi
callq 0xcfcd5
movq 0x30(%rsp), %rbx
movsd %xmm0, 0x458(%rbx)
movsd 0x460(%r14), %xmm0
mulsd 0x8(%rsp), %xmm0
divsd 0x513d3(%rip), %xmm0    # 0x121278
movq 0x460(%r12), %r13
callq 0x82e0
movapd %xmm0, %xmm2
xorpd 0x15372(%rip), %xmm2    # 0xe5230
movaps 0x10(%rsp), %xmm0
movsd 0x513f5(%rip), %xmm1    # 0x1212c0
movq %r13, %rdi
movl %ebp, %esi
callq 0xcfcd5
movq 0x28(%rsp), %rax
movsd %xmm0, (%rax)
xorl %r15d, %r15d
cmpq $0x82, %r15
je 0xcff43
movsd 0x468(%r14,%r15,8), %xmm0
mulsd 0x8(%rsp), %xmm0
divsd 0x460(%r14,%r15,8), %xmm0
movq 0x468(%r12,%r15,8), %r13
callq 0x82e0
movapd %xmm0, %xmm2
xorpd 0x15313(%rip), %xmm2    # 0xe5230
movaps 0x10(%rsp), %xmm0
movsd 0x51396(%rip), %xmm1    # 0x1212c0
movq %r13, %rdi
movl %ebp, %esi
callq 0xcfcd5
movsd %xmm0, 0x460(%rbx,%r15,8)
incq %r15
jmp 0xcfee1
movsd 0x8(%rsp), %xmm0
mulsd 0x51377(%rip), %xmm0    # 0x1212c8
divsd 0x870(%r14), %xmm0
movq 0x20(%rsp), %rax
movq 0x8(%rax), %r13
callq 0x82e0
movapd %xmm0, %xmm2
movapd 0x152bc(%rip), %xmm0    # 0xe5230
xorpd %xmm0, %xmm2
movsd 0x51340(%rip), %xmm1    # 0x1212c0
movaps 0x10(%rsp), %xmm0
movq %r13, %rdi
movl %ebp, %esi
callq 0xcfcd5
movsd %xmm0, 0x870(%rbx)
movsd 0x878(%r14), %xmm0
mulsd 0x8(%rsp), %xmm0
divsd 0x5131a(%rip), %xmm0    # 0x1212c8
movq 0x878(%r12), %r13
callq 0x82e0
movapd 0x1526d(%rip), %xmm2    # 0xe5230
xorpd %xmm0, %xmm2
movaps 0x10(%rsp), %xmm0
movsd 0x512ec(%rip), %xmm1    # 0x1212c0
movq %r13, %rdi
movl %ebp, %esi
callq 0xcfcd5
movq 0x28(%rsp), %rax
movsd %xmm0, 0x8(%rax)
xorl %r15d, %r15d
cmpq $0x27, %r15
je 0xd004a
movsd 0x880(%r14,%r15,8), %xmm0
mulsd 0x8(%rsp), %xmm0
divsd 0x878(%r14,%r15,8), %xmm0
movq 0x880(%r12,%r15,8), %r13
callq 0x82e0
movapd %xmm0, %xmm2
xorpd 0x1520c(%rip), %xmm2    # 0xe5230
movaps 0x10(%rsp), %xmm0
movsd 0x5128f(%rip), %xmm1    # 0x1212c0
movq %r13, %rdi
movl %ebp, %esi
callq 0xcfcd5
movsd %xmm0, 0x878(%rbx,%r15,8)
incq %r15
jmp 0xcffeb
movsd 0x8(%rsp), %xmm0
mulsd 0x51278(%rip), %xmm0    # 0x1212d0
divsd 0x9b0(%r14), %xmm0
movq 0x20(%rsp), %rax
movq 0x10(%rax), %r14
callq 0x82e0
movapd %xmm0, %xmm2
xorpd 0x151b5(%rip), %xmm2    # 0xe5230
movsd 0x5123d(%rip), %xmm1    # 0x1212c0
movaps 0x10(%rsp), %xmm0
movq %r14, %rdi
movl %ebp, %esi
callq 0xcfcd5
movsd %xmm0, 0x9b0(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq