// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../source/thermodynamics.c
// Function: thermodynamics_at_z
int thermodynamics_at_z(
                        struct background * pba,
                        struct thermodynamics * pth,
                        double z,
                        enum interpolation_method inter_mode,
                        int * last_index,
                        double * pvecback, //should be filled for z>z_initial!
                        double * pvecthermo
                        ) {

  /** Summary: */

  /** - define local variables */
  double x0;
  /* Dark matter baryon scattering */
  double Vrms_idm_b2, T_diff_idm_b, m_b, FHe;
  /* Varying fundamental constants */
  double sigmaTrescale = 1., alpha = 1., me = 1.;

  /* The fact that z is in the pre-computed range 0 <= z <= z_initial will be checked in the interpolation routines below. Before
     trying to interpolate, allow the routine to deal with the case z > z_initial: then, all relevant quantities can be extrapolated
     using simple analytic approximations */

  if (z >= pth->z_table[pth->tt_size-1]) {

    /* ionization fraction assumed to remain constant at large z */
    x0= pth->thermodynamics_table[(pth->tt_size-1)*pth->th_size+pth->index_th_xe];
    pvecthermo[pth->index_th_xe] = x0;

    /* In the case of varying fundamental constants, compute correction factor (according to 1705.03925) */
    if (pth->has_varconst == _TRUE_) {
      class_call(background_varconst_of_z(pba, z, &alpha, &me),
                 pba->error_message,
                 pth->error_message);
      sigmaTrescale = alpha*alpha/me/me;
    }

    /* Calculate dkappa/dtau (dkappa/dtau = a n_e x_e sigma_T = a^{-2} n_e(today) x_e sigma_T in units of 1/Mpc) */
    pvecthermo[pth->index_th_dkappa] = (1.+z) * (1.+z) * pth->n_e * x0 * sigmaTrescale * _sigma_ * _Mpc_over_m_;

    /* tau_d scales like (1+z)**2 */
    pvecthermo[pth->index_th_tau_d] = pth->thermodynamics_table[(pth->tt_size-1)*pth->th_size+pth->index_th_tau_d]*pow((1+z)/(1.+pth->z_table[pth->tt_size-1]),2);

    if (pth->compute_damping_scale == _TRUE_) {

      /* r_d scales like (1+z)**-3/2 */
      pvecthermo[pth->index_th_r_d] = pth->thermodynamics_table[(pth->tt_size-1)*pth->th_size+pth->index_th_r_d]*pow((1+z)/(1.+pth->z_table[pth->tt_size-1]),-1.5);
    }

    /* Calculate d2kappa/dtau2 = dz/dtau d/dz[dkappa/dtau] given that [dkappa/dtau] proportional to (1+z)^2 and dz/dtau = -H */
    pvecthermo[pth->index_th_ddkappa] = -pvecback[pba->index_bg_H] * 2. / (1.+z) * pvecthermo[pth->index_th_dkappa];

    /* Calculate d3kappa/dtau3 given that [dkappa/dtau] proportional to (1+z)^2 */
    pvecthermo[pth->index_th_dddkappa] = (pvecback[pba->index_bg_H]*pvecback[pba->index_bg_H]/ (1.+z) - pvecback[pba->index_bg_H_prime]) * 2. / (1.+z) * pvecthermo[pth->index_th_dkappa];

    /* \f$ exp^{-\kappa}, g, g', g'' \f$ can be set to zero: they are used only for computing the source functions in the
       perturbation module; but source functions only need to be sampled below z_initial (the condition that
       z_start_sources<z_initial is checked in the perturbation module) */
    pvecthermo[pth->index_th_exp_m_kappa] = 0.;
    pvecthermo[pth->index_th_g]=0.;
    pvecthermo[pth->index_th_dg]=0.;
    pvecthermo[pth->index_th_ddg]=0.;

    /* Calculate Tb assuming Tb ~ T_g at early times */
    pvecthermo[pth->index_th_Tb] = pba->T_cmb*(1.+z);

    /* Tb derivative */
    pvecthermo[pth->index_th_dTb] = pba->T_cmb;

    /* Calculate baryon equation of state parameter wb = (k_B/mu) Tb */
    /* note that m_H / mu = 1 + (m_H/m_He-1) Y_p + x_e (1-Y_p) */
    pvecthermo[pth->index_th_wb] = _k_B_ / ( _c_ * _c_ * _m_H_ ) * (1. + (1./_not4_ - 1.) * pth->YHe + x0 * (1.-pth->YHe)) * pba->T_cmb * (1.+z);

    /* Calculate cb2 (cb2 = (k_B/mu) Tb (1-1/3 dlnTb/dlna) = (k_B/mu) Tb (1+1/3 (1+z) dlnTb/dz)) */
    /* note that m_H / mu = 1 + (m_H/m_He-1) Y_p + x_e (1-Y_p) */
    pvecthermo[pth->index_th_cb2] = pvecthermo[pth->index_th_wb] * 4. / 3.;

    /* derivatives of baryon sound speed (only computed if some non-minimal tight-coupling schemes is requested) */
    if (pth->compute_cb2_derivatives == _TRUE_) {

      /* since cb2 proportional to (1+z) or 1/a, its derivative wrt conformal time is given by dcb2 = - a H cb2 */
      pvecthermo[pth->index_th_dcb2] = - pvecback[pba->index_bg_H] * pvecback[pba->index_bg_a] * pvecthermo[pth->index_th_cb2];

      /* then its second derivative is given by ddcb2 = - a H' cb2 */
      pvecthermo[pth->index_th_ddcb2] = - pvecback[pba->index_bg_H_prime] * pvecback[pba->index_bg_a] * pvecthermo[pth->index_th_cb2];
    }

    /* in this regime, variation rate = dkappa/dtau */
    pvecthermo[pth->index_th_rate] = pvecthermo[pth->index_th_dkappa];

    /* Quantities related to idm */
    if (pba->has_idm == _TRUE_) {

      /* Temperature and sound speed of idm (assuming T_idm ~ T_g at early times) */
      pvecthermo[pth->index_th_T_idm] = pba->T_cmb* (1+z);
      pvecthermo[pth->index_th_c2_idm] = _k_B_ * pba->T_cmb*(1+z)/(pth->m_idm*_eV_)  * (1 - (1.+z)/3./pvecback[pba->index_bg_H]);

      /* For DM-g calculate at early times the optical depth parameters */
      if (pth->has_idm_g == _TRUE_) {
        /* calculate dmu_idm_g and its derivatives */
        pvecthermo[pth->index_th_dmu_idm_g] = 3./8./_PI_/_G_*pow(1.+z, 2+pth->n_index_idm_g)*pba->Omega0_idm*pba->H0*pba->H0*pth->u_idm_g*pow(_c_,4)*_sigma_/1.e11/_eV_/_Mpc_over_m_;
        pvecthermo[pth->index_th_ddmu_idm_g] = -(2.+pth->n_index_idm_g) * pvecback[pba->index_bg_H] * pvecback[pba->index_bg_a] * pvecthermo[pth->index_th_dmu_idm_g];
        pvecthermo[pth->index_th_dddmu_idm_g] = (2.+pth->n_index_idm_g)*pvecthermo[pth->index_th_dmu_idm_g]/(1.+z) *
          (pvecback[pba->index_bg_H]*pvecback[pba->index_bg_H]/(1.+z) * (1.+pth->n_index_idm_g) - pvecback[pba->index_bg_H_prime]);
        /* extrapolate optical depth of idm_g */
        if (pth->n_index_idm_g == -1){
          pvecthermo[pth->index_th_exp_mu_idm_g] = pth->thermodynamics_table[(pth->tt_size-1)*pth->th_size+pth->index_th_exp_mu_idm_g] * exp( - pvecthermo[pth->index_th_dmu_idm_g] *pow(1.+z, -2-pth->n_index_idm_g) * log((1.+z)/(1.+pth->z_table[pth->tt_size-1]))*(1.+z)*(1.+z)/pvecback[pba->index_bg_H]);
        }
        else{
          pvecthermo[pth->index_th_exp_mu_idm_g] = pth->thermodynamics_table[(pth->tt_size-1)*pth->th_size+pth->index_th_exp_mu_idm_g] * exp( - pvecthermo[pth->index_th_dmu_idm_g] *pow(1.+z, -2-pth->n_index_idm_g) /(1.+pth->n_index_idm_g) * (pow(1.+z,pth->n_index_idm_g+1)-pow(1.+pth->z_table[pth->tt_size-1],pth->n_index_idm_g+1))*(1.+z)*(1.+z)/pvecback[pba->index_bg_H] );
        }
      }

      /* For idm_b calculate at early times the interaction rate parameters */
      if (pth->has_idm_b == _TRUE_){

        /* some constants used in the scattering rate and temperatures */
        FHe = 1-pth->YHe;
        m_b = _m_p_*_c_*_c_/_eV_;
        Vrms_idm_b2 = 1.e-8; /* approximation for V_rms at early times */
        T_diff_idm_b = (pvecthermo[pth->index_th_Tb]*_k_B_/_eV_/m_b)+(pvecthermo[pth->index_th_T_idm]*_k_B_/_eV_/pth->m_idm)+(Vrms_idm_b2/3.0); /* T and m are all in eV */

        /* Now compute the coupling coefficients */
        pvecthermo[pth->index_th_R_idm_b] = (pvecback[pba->index_bg_a]*pvecback[pba->index_bg_rho_b]*pth->cross_idm_b*pth->n_coeff_idm_b/(m_b+pth->m_idm))
          *pow(T_diff_idm_b,(pth->n_index_idm_b+1.0)/2.0)*FHe
          *(3.e-4*pow(_c_,4.)/(8.*_PI_*_Mpc_over_m_*_G_*_eV_)); /* conversion coefficient for the units */
        pvecthermo[pth->index_th_dR_idm_b] = pvecthermo[pth->index_th_R_idm_b] * pvecback[pba->index_bg_a] * pvecback[pba->index_bg_H]
          * ( -2. - (1.+z) * (pth->n_index_idm_b+1.0)/2.0 * (pba->T_cmb*_k_B_/_eV_/m_b + pba->T_cmb*_k_B_/_eV_/pth->m_idm)/T_diff_idm_b);
      }

      /* For idm_dr calculate at early times the optical depth parameters */
      if (pth->has_idm_dr == _TRUE_){
        /* calculate dmu_idm_dr and its derivatives */
        pvecthermo[pth->index_th_dmu_idm_dr] = pth->a_idm_dr*pow((1.+z)/1.e7,pth->n_index_idm_dr)*pba->Omega0_idm*pow(pba->h,2);
        pvecthermo[pth->index_th_ddmu_idm_dr] =  -pvecback[pba->index_bg_H] * pth->n_index_idm_dr / (1+z) * pvecthermo[pth->index_th_dmu_idm_dr];
        pvecthermo[pth->index_th_dddmu_idm_dr] = (pvecback[pba->index_bg_H]*pvecback[pba->index_bg_H]/ (1.+z) * (pth->n_index_idm_dr - 1.) - pvecback[pba->index_bg_H_prime])
          * pth->n_index_idm_dr / (1.+z) * pvecthermo[pth->index_th_dmu_idm_dr];

        /* extrapolate optical depth of idm_dr and idr */
        if (pth->n_index_idm_dr == 1 ){
          pvecthermo[pth->index_th_tau_idr] = pth->thermodynamics_table[(pth->tt_size-1)*pth->th_size+pth->index_th_tau_idr]+pvecthermo[pth->index_th_dmu_idm_dr] * pow(1.+z, - pth->n_index_idm_dr) * log((1.+z)/(1.+pth->z_table[pth->tt_size-1]))/(pvecback[pba->index_bg_H]/(1.+z)/(1.+z));
        }
        else{
          pvecthermo[pth->index_th_tau_idr] = pth->thermodynamics_table[(pth->tt_size-1)*pth->th_size+pth->index_th_tau_idr]+pvecthermo[pth->index_th_dmu_idm_dr] * pow(1.+z, - pth->n_index_idm_dr)/(1.-pth->n_index_idm_dr) * (pow(1.+pth->z_table[pth->tt_size-1], pth->n_index_idm_dr -1) - pow(1.+z, pth->n_index_idm_dr -1))/(pvecback[pba->index_bg_H]/(1.+z)/(1.+z));
        }

        if (pth->n_index_idm_dr == 0 ){
          pvecthermo[pth->index_th_tau_idm_dr] = pth->thermodynamics_table[(pth->tt_size-1)*pth->th_size+pth->index_th_tau_idm_dr]+pvecthermo[pth->index_th_dmu_idm_dr] * pow(1.+z, - pth->n_index_idm_dr) * 4./3. * pba->Omega0_idr/pba->Omega0_idm * log((1.+z)/(1.+pth->z_table[pth->tt_size-1]))/(pvecback[pba->index_bg_H]/(1.+z)/(1.+z));
        }
        else{
          pvecthermo[pth->index_th_tau_idm_dr] = pth->thermodynamics_table[(pth->tt_size-1)*pth->th_size+pth->index_th_tau_idm_dr]+pvecthermo[pth->index_th_dmu_idm_dr] * pow(1.+z, - pth->n_index_idm_dr) * 4./3. * pba->Omega0_idr/pba->Omega0_idm /(-pth->n_index_idm_dr) * (pow(1.+pth->z_table[pth->tt_size-1], pth->n_index_idm_dr) - pow(1.+z, pth->n_index_idm_dr))/(pvecback[pba->index_bg_H]/(1.+z)/(1.+z));
        }

        /* extrapolate idm_dr visibility function */
        pvecthermo[pth->index_th_g_idm_dr] = pvecthermo[pth->index_th_dmu_idm_dr] * 4./3. * pba->Omega0_idr/pba->Omega0_idm * (1.+z) * exp(-pvecthermo[pth->index_th_tau_idm_dr]);
      }

    }

    /* Quantities related to idr */
    if (pba->has_idr == _TRUE_) {

      /* Use the temperature scaling assumed throughout */
      pvecthermo[pth->index_th_T_idr] = pba->T_idr* (1+z);

      /* calculate dmu_idr (self interaction) */
      pvecthermo[pth->index_th_dmu_idr] = pth->b_idr*pow((1.+z)/1.e7,pth->n_index_idm_dr)*pba->Omega0_idr*pow(pba->h,2);
    }
  }

  /** - interpolate in table with array_interpolate_spline (normal mode) or array_interpolate_spline_growing_closeby (closeby mode) */

  else {

    /* some very specific cases require linear interpolation because of a break in the derivative of the functions */
    if (((pth->reio_parametrization == reio_half_tanh) && (z < 2*pth->z_reio))
        || ((pth->reio_parametrization == reio_inter) && (z < 50.))) {

      class_call(array_interpolate_linear(pth->z_table,
                                          pth->tt_size,
                                          pth->thermodynamics_table,
                                          pth->th_size,
                                          z,
                                          last_index,
                                          pvecthermo,
                                          pth->th_size,
                                          pth->error_message),
                 pth->error_message,
                 pth->error_message);
    }

    /* in the "normal" case, use spline interpolation */
    else {

      if (inter_mode == inter_normal) {

        class_call(array_interpolate_spline(pth->z_table,
                                            pth->tt_size,
                                            pth->thermodynamics_table,
                                            pth->d2thermodynamics_dz2_table,
                                            pth->th_size,
                                            z,
                                            last_index,
                                            pvecthermo,
                                            pth->th_size,
                                            pth->error_message),
                   pth->error_message,
                   pth->error_message);
      }

      if (inter_mode == inter_closeby) {

        class_call(array_interpolate_spline_growing_closeby(pth->z_table,
                                                            pth->tt_size,
                                                            pth->thermodynamics_table,
                                                            pth->d2thermodynamics_dz2_table,
                                                            pth->th_size,
                                                            z,
                                                            last_index,
                                                            pvecthermo,
                                                            pth->th_size,
                                                            pth->error_message),
                   pth->error_message,
                   pth->error_message);

      }
    }
  }
  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x860, %rsp            # imm = 0x860
movq %r9, %r14
movapd %xmm0, %xmm4
movq %rsi, %rbx
movq %rdi, %r15
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x48(%rsp)
movq %rax, 0x40(%rsp)
movq 0xf10(%rsi), %rdi
movslq 0xf08(%rsi), %rsi
ucomisd -0x8(%rdi,%rsi,8), %xmm0
jae 0x620ed
movq %rcx, %r9
movl 0x18(%rbx), %eax
cmpl $0x3, %eax
jne 0x621ad
movsd 0x28(%rbx), %xmm0
addsd %xmm0, %xmm0
ucomisd %xmm4, %xmm0
ja 0x621ca
xorl %ebp, %ebp
cmpl $0x1, %edx
je 0x62749
testl %edx, %edx
jne 0x62e6d
movq 0xf20(%rbx), %rdx
movq 0xf28(%rbx), %rcx
movl 0xf04(%rbx), %r8d
addq $0x1064, %rbx           # imm = 0x1064
subq $0x8, %rsp
movapd %xmm4, %xmm0
pushq %rbx
pushq %r8
pushq %r14
callq 0x1604b
addq $0x20, %rsp
cmpl $0x1, %eax
jne 0x62e6d
leaq 0x83337(%rip), %rsi     # 0xe53f0
leaq 0xa272d(%rip), %rdx     # 0x1047ed
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x82f5b(%rip), %rsi     # 0xe5034
leaq 0xa265e(%rip), %rdx     # 0x10473e
movq %rbx, %rdi
movl $0x108, %ecx            # imm = 0x108
jmp 0x627ba
movq %r8, %r12
decq %rsi
movq 0xf20(%rbx), %rax
movslq 0xf04(%rbx), %rcx
movslq %esi, %rdx
imulq %rcx, %rdx
movslq 0xe7c(%rbx), %rcx
movq %rdx, %r8
addq %rcx, %r8
movsd (%rax,%r8,8), %xmm5
movsd %xmm5, (%r14,%rcx,8)
movsd 0x83137(%rip), %xmm2    # 0xe5260
cmpw $0x1, 0xe78(%rbx)
movapd %xmm2, %xmm0
jne 0x62284
movsd %xmm5, 0x10(%rsp)
leaq 0x48(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movq %r15, %rdi
movsd %xmm4, 0x8(%rsp)
movapd %xmm4, %xmm0
callq 0x5a991
cmpl $0x1, %eax
jne 0x62237
addq $0xd1c, %r15            # imm = 0xD1C
leaq 0x8327c(%rip), %rsi     # 0xe53f0
leaq 0xa2595(%rip), %rdx     # 0x104710
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x82e99(%rip), %rsi     # 0xe5034
leaq 0xa259c(%rip), %rdx     # 0x10473e
pushq $0x5a
popq %rcx
movq %rbx, %rdi
jmp 0x627ba
cmpl $0x5, %eax
setne %al
movsd 0x9f795(%rip), %xmm0    # 0x101950
ucomisd %xmm4, %xmm0
setbe %cl
orb %al, %cl
jne 0x62064
movq 0xf20(%rbx), %rdx
movl 0xf04(%rbx), %ecx
addq $0x1064, %rbx           # imm = 0x1064
movapd %xmm4, %xmm0
movq %r9, %r8
movq %r14, %r9
pushq %rbx
pushq %rcx
callq 0x16535
popq %rcx
popq %rdx
xorl %ebp, %ebp
cmpl $0x1, %eax
jne 0x62e6d
leaq 0x831ed(%rip), %rsi     # 0xe53f0
leaq 0xa2548(%rip), %rdx     # 0x104752
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x82e11(%rip), %rsi     # 0xe5034
leaq 0xa2514(%rip), %rdx     # 0x10473e
movq %rbx, %rdi
movl $0xf5, %ecx
jmp 0x627ba
movsd 0x48(%rsp), %xmm0
mulsd %xmm0, %xmm0
movsd 0x40(%rsp), %xmm1
divsd %xmm1, %xmm0
divsd %xmm1, %xmm0
movq 0xf10(%rbx), %rdi
movq 0xf20(%rbx), %rax
movslq 0xf08(%rbx), %rsi
decq %rsi
movl 0xf04(%rbx), %edx
imull %esi, %edx
movsd 0x8(%rsp), %xmm4
movsd 0x10(%rsp), %xmm5
movsd 0x82fdc(%rip), %xmm2    # 0xe5260
addsd %xmm2, %xmm4
movapd %xmm4, %xmm1
mulsd %xmm4, %xmm1
mulsd 0x1008(%rbx), %xmm1
mulsd %xmm5, %xmm1
mulsd %xmm0, %xmm1
mulsd 0x87880(%rip), %xmm1    # 0xe9b28
mulsd 0x876f8(%rip), %xmm1    # 0xe99a8
movslq 0xe80(%rbx), %rcx
movsd %xmm1, (%r14,%rcx,8)
movslq 0xe84(%rbx), %r8
movslq %edx, %rdx
leaq (%rdx,%r8), %r9
addsd (%rdi,%rsi,8), %xmm2
movapd %xmm4, %xmm0
divsd %xmm2, %xmm0
mulsd %xmm0, %xmm0
mulsd (%rax,%r9,8), %xmm0
movsd %xmm0, (%r14,%r8,8)
cmpw $0x1, 0x32(%rbx)
movsd %xmm4, 0x8(%rsp)
jne 0x62358
movslq 0xf00(%rbx), %rcx
addq %rdx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd (%rdi,%rsi,8), %xmm1
addsd 0x82f49(%rip), %xmm1    # 0xe5260
movapd %xmm4, %xmm0
divsd %xmm1, %xmm0
movsd 0x864a9(%rip), %xmm1    # 0xe87d0
movsd %xmm5, 0x10(%rsp)
callq 0x8650
movsd 0x10(%rsp), %xmm5
movsd 0x8(%rsp), %xmm4
mulsd 0x20(%rsp), %xmm0
movslq 0xf00(%rbx), %rax
movsd %xmm0, (%r14,%rax,8)
movslq 0xe80(%rbx), %rcx
movslq 0x384(%r15), %rax
movsd (%r12,%rax,8), %xmm0
mulsd 0x843cb(%rip), %xmm0    # 0xe6738
divsd %xmm4, %xmm0
mulsd (%r14,%rcx,8), %xmm0
movslq 0xe88(%rbx), %rdx
movsd %xmm0, (%r14,%rdx,8)
movsd (%r12,%rax,8), %xmm0
mulsd %xmm0, %xmm0
divsd %xmm4, %xmm0
movslq 0x388(%r15), %rdx
subsd (%r12,%rdx,8), %xmm0
addsd %xmm0, %xmm0
divsd %xmm4, %xmm0
mulsd (%r14,%rcx,8), %xmm0
movslq 0xe8c(%rbx), %rsi
movsd %xmm0, (%r14,%rsi,8)
movslq 0xe90(%rbx), %rsi
andq $0x0, (%r14,%rsi,8)
movslq 0xe94(%rbx), %rsi
andq $0x0, (%r14,%rsi,8)
movslq 0xe98(%rbx), %rsi
andq $0x0, (%r14,%rsi,8)
movslq 0xe9c(%rbx), %rsi
andq $0x0, (%r14,%rsi,8)
movsd 0x18(%r15), %xmm0
mulsd %xmm4, %xmm0
movslq 0xee4(%rbx), %rsi
movsd %xmm0, (%r14,%rsi,8)
movsd 0x18(%r15), %xmm0
movslq 0xee8(%rbx), %rsi
movsd %xmm0, (%r14,%rsi,8)
movsd (%rbx), %xmm1
movsd 0xa20f0(%rip), %xmm2    # 0x104510
mulsd %xmm1, %xmm2
movsd 0x82e34(%rip), %xmm3    # 0xe5260
addsd %xmm3, %xmm2
subsd %xmm1, %xmm3
mulsd %xmm3, %xmm5
addsd %xmm2, %xmm5
mulsd 0xa20d4(%rip), %xmm5    # 0x104518
mulsd %xmm0, %xmm5
mulsd %xmm4, %xmm5
movslq 0xeec(%rbx), %rsi
movsd %xmm5, (%r14,%rsi,8)
mulsd 0x85f97(%rip), %xmm5    # 0xe83f8
divsd 0x842df(%rip), %xmm5    # 0xe6748
movslq 0xef0(%rbx), %rsi
movsd %xmm5, (%r14,%rsi,8)
cmpw $0x1, 0x30(%rbx)
jne 0x624d0
movsd (%r12,%rax,8), %xmm0
movapd 0x82da5(%rip), %xmm1    # 0xe5230
xorpd %xmm1, %xmm0
movslq 0x380(%r15), %rdi
mulsd (%r12,%rdi,8), %xmm0
mulsd %xmm0, %xmm5
movslq 0xef4(%rbx), %r8
movsd %xmm5, (%r14,%r8,8)
movsd (%r12,%rdx,8), %xmm0
xorpd %xmm1, %xmm0
mulsd (%r12,%rdi,8), %xmm0
mulsd (%r14,%rsi,8), %xmm0
movslq 0xef8(%rbx), %rdx
movsd %xmm0, (%r14,%rdx,8)
movsd (%r14,%rcx,8), %xmm0
movslq 0xefc(%rbx), %rcx
movsd %xmm0, (%r14,%rcx,8)
cmpw $0x1, 0x4b6(%r15)
jne 0x62df5
movsd 0x18(%r15), %xmm0
mulsd %xmm4, %xmm0
movslq 0xea0(%rbx), %rcx
movsd %xmm0, (%r14,%rcx,8)
movsd 0x18(%r15), %xmm0
mulsd 0x875e9(%rip), %xmm0    # 0xe9b00
mulsd %xmm4, %xmm0
movsd 0x1010(%rbx), %xmm1
mulsd 0x875dd(%rip), %xmm1    # 0xe9b08
movapd %xmm4, %xmm2
divsd 0x85f09(%rip), %xmm2    # 0xe8440
divsd (%r12,%rax,8), %xmm2
divsd %xmm1, %xmm0
addsd 0x82d17(%rip), %xmm2    # 0xe5260
mulsd %xmm0, %xmm2
movslq 0xea4(%rbx), %rax
movsd %xmm2, (%r14,%rax,8)
cmpw $0x1, 0x36(%rbx)
jne 0x62847
movl 0x1058(%rbx), %eax
addl $0x2, %eax
cvtsi2sd %eax, %xmm1
movapd %xmm4, %xmm0
callq 0x8650
mulsd 0xa1f9d(%rip), %xmm0    # 0x104520
mulsd 0xf0(%r15), %xmm0
movsd (%r15), %xmm1
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
mulsd 0x1050(%rbx), %xmm0
mulsd 0xa1f7f(%rip), %xmm0    # 0x104528
mulsd 0x87577(%rip), %xmm0    # 0xe9b28
divsd 0x87577(%rip), %xmm0    # 0xe9b30
divsd 0x87547(%rip), %xmm0    # 0xe9b08
divsd 0x873df(%rip), %xmm0    # 0xe99a8
movslq 0xec8(%rbx), %rcx
movsd %xmm0, (%r14,%rcx,8)
movl 0x1058(%rbx), %eax
cvtsi2sd %eax, %xmm2
movsd 0x836f8(%rip), %xmm3    # 0xe5ce0
addsd %xmm2, %xmm3
movapd 0x82c3c(%rip), %xmm1    # 0xe5230
movapd %xmm3, %xmm4
xorpd %xmm1, %xmm4
movslq 0x384(%r15), %rdx
mulsd (%r12,%rdx,8), %xmm4
movslq 0x380(%r15), %rsi
mulsd (%r12,%rsi,8), %xmm4
mulsd %xmm0, %xmm4
movslq 0xecc(%rbx), %rsi
movsd %xmm4, (%r14,%rsi,8)
movsd 0x8(%rsp), %xmm4
mulsd (%r14,%rcx,8), %xmm3
divsd %xmm4, %xmm3
movsd (%r12,%rdx,8), %xmm0
mulsd %xmm0, %xmm0
divsd %xmm4, %xmm0
addsd 0x82c13(%rip), %xmm2    # 0xe5260
mulsd %xmm0, %xmm2
movslq 0x388(%r15), %rdx
subsd (%r12,%rdx,8), %xmm2
mulsd %xmm3, %xmm2
movslq 0xed0(%rbx), %rdx
movsd %xmm2, (%r14,%rdx,8)
movslq 0xf08(%rbx), %rdx
leaq -0x1(%rdx), %rsi
movslq 0xf04(%rbx), %rdi
imulq %rsi, %rdi
movslq 0xed4(%rbx), %rsi
addq %rdi, %rsi
movq 0xf20(%rbx), %rdi
movsd (%rdi,%rsi,8), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd (%r14,%rcx,8), %xmm2
xorpd %xmm1, %xmm2
cmpl $-0x1, %eax
je 0x627cc
pushq $-0x2
popq %rcx
subl %eax, %ecx
cvtsi2sd %ecx, %xmm1
movapd %xmm4, %xmm0
movapd %xmm2, 0x20(%rsp)
callq 0x8650
mulsd 0x20(%rsp), %xmm0
movl 0x1058(%rbx), %eax
cvtsi2sd %eax, %xmm2
movsd 0x82b7c(%rip), %xmm1    # 0xe5260
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movsd %xmm0, 0x20(%rsp)
incl %eax
cvtsi2sd %eax, %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x8650
movsd %xmm0, 0x30(%rsp)
movq 0xf10(%rbx), %rax
movslq 0xf08(%rbx), %rcx
movsd -0x8(%rax,%rcx,8), %xmm0
addsd 0x82b3b(%rip), %xmm0    # 0xe5260
movl 0x1058(%rbx), %eax
incl %eax
cvtsi2sd %eax, %xmm1
callq 0x8650
movsd 0x30(%rsp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
jmp 0x62804
movq 0xf20(%rbx), %rdx
movq 0xf28(%rbx), %rcx
movl 0xf04(%rbx), %r8d
addq $0x1064, %rbx           # imm = 0x1064
subq $0x8, %rsp
movapd %xmm4, %xmm0
pushq %rbx
pushq %r8
pushq %r14
callq 0x177dd
addq $0x20, %rsp
cmpl $0x1, %eax
jne 0x62e6d
leaq 0x82c65(%rip), %rsi     # 0xe53f0
leaq 0xa2117(%rip), %rdx     # 0x1048a9
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x82889(%rip), %rsi     # 0xe5034
leaq 0xa1f8c(%rip), %rdx     # 0x10473e
movq %rbx, %rdi
movl $0x118, %ecx            # imm = 0x118
movq %r14, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rbp
jmp 0x62e6d
movsd 0x82a8c(%rip), %xmm0    # 0xe5260
movapd %xmm0, %xmm1
divsd %xmm4, %xmm1
mulsd %xmm2, %xmm1
movsd %xmm1, 0x20(%rsp)
movq 0xf10(%rbx), %rax
movsd -0x8(%rax,%rdx,8), %xmm1
addsd %xmm0, %xmm1
movapd %xmm4, %xmm0
divsd %xmm1, %xmm0
callq 0x82e0
mulsd 0x20(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
movslq 0x384(%r15), %rax
divsd (%r12,%rax,8), %xmm0
callq 0x86a0
movsd 0x10(%rsp), %xmm1
mulsd %xmm0, %xmm1
movslq 0xed4(%rbx), %rax
movsd %xmm1, (%r14,%rax,8)
movsd 0x8(%rsp), %xmm4
cmpw $0x1, 0x34(%rbx)
jne 0x629db
movsd 0x82a06(%rip), %xmm0    # 0xe5260
movapd %xmm0, %xmm1
movapd %xmm0, %xmm5
subsd (%rbx), %xmm1
movsd %xmm1, 0x10(%rsp)
movslq 0xee4(%rbx), %rax
movsd 0x87285(%rip), %xmm2    # 0xe9b00
movsd (%r14,%rax,8), %xmm0
mulsd %xmm2, %xmm0
movsd 0x8727b(%rip), %xmm3    # 0xe9b08
divsd %xmm3, %xmm0
movsd 0xa1c97(%rip), %xmm1    # 0x104530
divsd %xmm1, %xmm0
movapd %xmm1, %xmm6
movslq 0xea0(%rbx), %rax
movsd (%r14,%rax,8), %xmm1
mulsd %xmm2, %xmm1
divsd %xmm3, %xmm1
movsd 0x1010(%rbx), %xmm2
divsd %xmm2, %xmm1
addsd %xmm0, %xmm1
addsd 0xa1c6a(%rip), %xmm1    # 0x104538
movapd %xmm1, %xmm0
movsd %xmm1, 0x20(%rsp)
movslq 0x380(%r15), %rax
movsd (%r12,%rax,8), %xmm3
movslq 0x390(%r15), %rax
mulsd (%r12,%rax,8), %xmm3
mulsd 0x1030(%rbx), %xmm3
mulsd 0x1040(%rbx), %xmm3
addsd %xmm6, %xmm2
cvtsi2sdl 0x1038(%rbx), %xmm1
divsd %xmm2, %xmm3
movsd %xmm3, 0x30(%rsp)
addsd %xmm5, %xmm1
mulsd 0x8338c(%rip), %xmm1    # 0xe5cb0
callq 0x8650
movsd 0x8(%rsp), %xmm4
mulsd 0x30(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
mulsd 0xa1bfd(%rip), %xmm0    # 0x104540
movslq 0xed8(%rbx), %rax
movsd %xmm0, (%r14,%rax,8)
movslq 0x380(%r15), %rax
mulsd (%r12,%rax,8), %xmm0
movslq 0x384(%r15), %rax
mulsd (%r12,%rax,8), %xmm0
cvtsi2sdl 0x1038(%rbx), %xmm1
addsd 0x828e6(%rip), %xmm1    # 0xe5260
mulsd %xmm4, %xmm1
mulsd 0x8332a(%rip), %xmm1    # 0xe5cb0
movsd 0x87172(%rip), %xmm3    # 0xe9b00
mulsd 0x18(%r15), %xmm3
divsd 0x8716c(%rip), %xmm3    # 0xe9b08
movapd %xmm3, %xmm2
divsd 0xa1b88(%rip), %xmm2    # 0x104530
divsd 0x1010(%rbx), %xmm3
addsd %xmm2, %xmm3
mulsd %xmm1, %xmm3
divsd 0x20(%rsp), %xmm3
movsd 0x83d72(%rip), %xmm1    # 0xe6738
subsd %xmm3, %xmm1
mulsd %xmm0, %xmm1
movslq 0xedc(%rbx), %rax
movsd %xmm1, (%r14,%rax,8)
cmpw $0x1, 0x38(%rbx)
jne 0x62df5
movapd %xmm4, %xmm0
divsd 0xa1b56(%rip), %xmm0    # 0x104548
movsd 0x1018(%rbx), %xmm1
movsd %xmm1, 0x10(%rsp)
movsd 0x1028(%rbx), %xmm1
callq 0x8650
movsd 0x8(%rsp), %xmm3
mulsd 0x10(%rsp), %xmm0
mulsd 0xf0(%r15), %xmm0
movsd 0x8(%r15), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm1
movslq 0xeac(%rbx), %rax
movsd %xmm1, (%r14,%rax,8)
movslq 0x384(%r15), %rcx
movsd (%r12,%rcx,8), %xmm0
xorpd 0x827de(%rip), %xmm0    # 0xe5230
mulsd 0x1028(%rbx), %xmm0
divsd %xmm3, %xmm0
mulsd %xmm1, %xmm0
movslq 0xeb0(%rbx), %rdx
movsd %xmm0, (%r14,%rdx,8)
movsd (%r12,%rcx,8), %xmm0
mulsd %xmm0, %xmm0
divsd %xmm3, %xmm0
movsd 0x1028(%rbx), %xmm1
movsd 0x82d5b(%rip), %xmm2    # 0xe57e8
addsd %xmm1, %xmm2
mulsd %xmm0, %xmm2
movslq 0x388(%r15), %rcx
subsd (%r12,%rcx,8), %xmm2
mulsd %xmm1, %xmm2
divsd %xmm3, %xmm2
mulsd (%r14,%rax,8), %xmm2
movslq 0xeb4(%rbx), %rcx
movsd %xmm2, (%r14,%rcx,8)
movsd 0x1028(%rbx), %xmm1
movslq 0xf08(%rbx), %rcx
decq %rcx
movslq 0xf04(%rbx), %rdx
imulq %rcx, %rdx
movslq 0xec0(%rbx), %rcx
addq %rdx, %rcx
ucomisd 0x82774(%rip), %xmm1    # 0xe5260
movq 0xf20(%rbx), %rdx
movsd (%rdx,%rcx,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd (%r14,%rax,8), %xmm2
jne 0x62b4c
jp 0x62b4c
movsd 0x82750(%rip), %xmm1    # 0xe5260
movapd %xmm1, %xmm0
divsd %xmm3, %xmm0
mulsd %xmm0, %xmm2
movsd %xmm2, 0x10(%rsp)
movq 0xf10(%rbx), %rax
movslq 0xf08(%rbx), %rcx
addsd -0x8(%rax,%rcx,8), %xmm1
movapd %xmm3, %xmm0
divsd %xmm1, %xmm0
callq 0x82e0
movapd %xmm0, %xmm2
jmp 0x62bdb
xorpd 0x826dc(%rip), %xmm1    # 0xe5230
movapd %xmm3, %xmm0
movsd %xmm2, 0x10(%rsp)
callq 0x8650
movsd 0x10(%rsp), %xmm3
mulsd %xmm0, %xmm3
movsd 0x1028(%rbx), %xmm1
movsd 0x826e3(%rip), %xmm0    # 0xe5260
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
divsd %xmm2, %xmm3
movsd %xmm3, 0x10(%rsp)
movq 0xf10(%rbx), %rax
movslq 0xf08(%rbx), %rcx
addsd -0x8(%rax,%rcx,8), %xmm0
addsd 0x82c3d(%rip), %xmm1    # 0xe57e8
callq 0x8650
movsd %xmm0, 0x30(%rsp)
movsd 0x82c2a(%rip), %xmm1    # 0xe57e8
addsd 0x1028(%rbx), %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x8650
movsd 0x30(%rsp), %xmm2
subsd %xmm0, %xmm2
mulsd 0x10(%rsp), %xmm2
movslq 0x384(%r15), %rax
movsd (%r12,%rax,8), %xmm1
movsd 0x8(%rsp), %xmm0
divsd %xmm0, %xmm1
divsd %xmm0, %xmm1
divsd %xmm1, %xmm2
movsd 0x20(%rsp), %xmm1
addsd %xmm2, %xmm1
movslq 0xec0(%rbx), %rax
movsd %xmm1, (%r14,%rax,8)
movsd 0x1028(%rbx), %xmm2
movaps %xmm2, 0x30(%rsp)
movq 0xf20(%rbx), %rax
movslq 0xf08(%rbx), %rcx
decq %rcx
movslq 0xf04(%rbx), %rdx
imulq %rcx, %rdx
movslq 0xebc(%rbx), %rcx
addq %rdx, %rcx
movsd (%rax,%rcx,8), %xmm1
movaps %xmm1, 0x10(%rsp)
movslq 0xeac(%rbx), %rax
movsd (%r14,%rax,8), %xmm1
movsd %xmm1, 0x20(%rsp)
movaps 0x825c2(%rip), %xmm1    # 0xe5230
xorps %xmm2, %xmm1
movaps %xmm1, 0x50(%rsp)
callq 0x8650
movapd %xmm0, %xmm2
movapd 0x30(%rsp), %xmm0
ucomisd 0x50(%rsp), %xmm0
mulsd 0x20(%rsp), %xmm2
mulsd 0x8575f(%rip), %xmm2    # 0xe83f8
divsd 0x83aa7(%rip), %xmm2    # 0xe6748
mulsd 0xf8(%r15), %xmm2
divsd 0xf0(%r15), %xmm2
jne 0x62cf4
jp 0x62cf4
movq 0xf10(%rbx), %rax
movslq 0xf08(%rbx), %rcx
movsd -0x8(%rax,%rcx,8), %xmm1
addsd 0x8258d(%rip), %xmm1    # 0xe5260
movsd 0x8(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm2, 0x20(%rsp)
callq 0x82e0
movsd 0x20(%rsp), %xmm1
mulsd %xmm0, %xmm1
jmp 0x62d60
movsd 0x1028(%rbx), %xmm1
movapd 0x8252c(%rip), %xmm0    # 0xe5230
xorpd %xmm1, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x20(%rsp)
movq 0xf10(%rbx), %rax
movslq 0xf08(%rbx), %rcx
movsd -0x8(%rax,%rcx,8), %xmm0
addsd 0x82532(%rip), %xmm0    # 0xe5260
callq 0x8650
movsd %xmm0, 0x30(%rsp)
movsd 0x1028(%rbx), %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x8650
movsd 0x20(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
subsd %xmm0, %xmm2
mulsd %xmm2, %xmm1
movslq 0x384(%r15), %rax
movsd (%r12,%rax,8), %xmm0
movsd 0x8(%rsp), %xmm2
divsd %xmm2, %xmm0
divsd %xmm2, %xmm0
divsd %xmm0, %xmm1
movapd 0x10(%rsp), %xmm0
addsd %xmm1, %xmm0
movslq 0xebc(%rbx), %rax
movsd %xmm0, (%r14,%rax,8)
movslq 0xeac(%rbx), %rax
movsd (%r14,%rax,8), %xmm1
mulsd 0x8564d(%rip), %xmm1    # 0xe83f8
divsd 0x83995(%rip), %xmm1    # 0xe6748
mulsd 0xf8(%r15), %xmm1
divsd 0xf0(%r15), %xmm1
mulsd %xmm2, %xmm1
movsd %xmm1, 0x10(%rsp)
xorpd 0x82459(%rip), %xmm0    # 0xe5230
callq 0x86a0
mulsd 0x10(%rsp), %xmm0
movslq 0xec4(%rbx), %rax
movsd %xmm0, (%r14,%rax,8)
movsd 0x8(%rsp), %xmm4
xorl %ebp, %ebp
cmpw $0x1, 0x4c6(%r15)
jne 0x62e6d
movsd 0x100(%r15), %xmm0
mulsd %xmm4, %xmm0
movslq 0xea8(%rbx), %rax
movsd %xmm0, (%r14,%rax,8)
divsd 0xa1724(%rip), %xmm4    # 0x104548
movsd 0x1020(%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x1028(%rbx), %xmm1
movapd %xmm4, %xmm0
callq 0x8650
mulsd 0x8(%rsp), %xmm0
mulsd 0xf8(%r15), %xmm0
movsd 0x8(%r15), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm1
movslq 0xeb8(%rbx), %rax
movsd %xmm1, (%r14,%rax,8)
movl %ebp, %eax
addq $0x860, %rsp            # imm = 0x860
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq