// File: /workspace/github_c_makefile_star2_O3/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 0x663a1
movq %rcx, %r9
movl 0x18(%rbx), %eax
cmpl $0x3, %eax
jne 0x66463
movsd 0x28(%rbx), %xmm0
addsd %xmm0, %xmm0
ucomisd %xmm4, %xmm0
ja 0x66480
xorl %ebp, %ebp
cmpl $0x1, %edx
je 0x66a13
testl %edx, %edx
jne 0x6713f
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 0x18071
addq $0x20, %rsp
cmpl $0x1, %eax
jne 0x6713f
leaq 0x88083(%rip), %rsi     # 0xee3f0
leaq 0xa75d9(%rip), %rdx     # 0x10d94d
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x87ca7(%rip), %rsi     # 0xee034
leaq 0xa750a(%rip), %rdx     # 0x10d89e
movq %rbx, %rdi
movl $0x108, %ecx            # imm = 0x108
jmp 0x66a84
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 0x87e83(%rip), %xmm2    # 0xee260
cmpw $0x1, 0xe78(%rbx)
movapd %xmm2, %xmm0
jne 0x6653c
movsd %xmm5, 0x10(%rsp)
leaq 0x48(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movq %r15, %rdi
movsd %xmm4, 0x8(%rsp)
movapd %xmm4, %xmm0
callq 0x5e941
cmpl $0x1, %eax
jne 0x664ef
addq $0xd1c, %r15            # imm = 0xD1C
leaq 0x87fc8(%rip), %rsi     # 0xee3f0
leaq 0xa7441(%rip), %rdx     # 0x10d870
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x87be5(%rip), %rsi     # 0xee034
leaq 0xa7448(%rip), %rdx     # 0x10d89e
movq %rbx, %rdi
movl $0x5a, %ecx
jmp 0x66a84
cmpl $0x5, %eax
setne %al
movsd 0xa4617(%rip), %xmm0    # 0x10aa88
ucomisd %xmm4, %xmm0
setbe %cl
orb %al, %cl
jne 0x66318
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 0x185a0
addq $0x10, %rsp
xorl %ebp, %ebp
cmpl $0x1, %eax
jne 0x6713f
leaq 0x87f35(%rip), %rsi     # 0xee3f0
leaq 0xa73f0(%rip), %rdx     # 0x10d8b2
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x87b59(%rip), %rsi     # 0xee034
leaq 0xa73bc(%rip), %rdx     # 0x10d89e
movq %rbx, %rdi
movl $0xf5, %ecx
jmp 0x66a84
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 0x87d24(%rip), %xmm2    # 0xee260
addsd %xmm2, %xmm4
movapd %xmm4, %xmm1
mulsd %xmm4, %xmm1
mulsd 0x1008(%rbx), %xmm1
mulsd %xmm5, %xmm1
mulsd %xmm0, %xmm1
mulsd 0x8c708(%rip), %xmm1    # 0xf2c68
mulsd 0x8c580(%rip), %xmm1    # 0xf2ae8
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 0x66610
movslq 0xf00(%rbx), %rcx
addq %rdx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd (%rdi,%rsi,8), %xmm1
addsd 0x87c91(%rip), %xmm1    # 0xee260
movapd %xmm4, %xmm0
divsd %xmm1, %xmm0
movsd 0x8b271(%rip), %xmm1    # 0xf1850
movsd %xmm5, 0x10(%rsp)
callq 0x8620
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 0x8913b(%rip), %xmm0    # 0xef760
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
xorl %edi, %edi
movq %rdi, (%r14,%rsi,8)
movslq 0xe94(%rbx), %rsi
movq %rdi, (%r14,%rsi,8)
movslq 0xe98(%rbx), %rsi
movq %rdi, (%r14,%rsi,8)
movslq 0xe9c(%rbx), %rsi
movq %rdi, (%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 0xa6f7a(%rip), %xmm2    # 0x10d650
mulsd %xmm1, %xmm2
movsd 0x87b7e(%rip), %xmm3    # 0xee260
addsd %xmm3, %xmm2
subsd %xmm1, %xmm3
mulsd %xmm3, %xmm5
addsd %xmm2, %xmm5
mulsd 0xa6f5e(%rip), %xmm5    # 0x10d658
mulsd %xmm0, %xmm5
mulsd %xmm4, %xmm5
movslq 0xeec(%rbx), %rsi
movsd %xmm5, (%r14,%rsi,8)
mulsd 0x8ad21(%rip), %xmm5    # 0xf1438
divsd 0x88f61(%rip), %xmm5    # 0xef680
movslq 0xef0(%rbx), %rsi
movsd %xmm5, (%r14,%rsi,8)
cmpw $0x1, 0x30(%rbx)
jne 0x66786
movsd (%r12,%rax,8), %xmm0
movapd 0x87aef(%rip), %xmm1    # 0xee230
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 0x670c7
movsd 0x18(%r15), %xmm0
mulsd %xmm4, %xmm0
movslq 0xea0(%rbx), %rcx
movsd %xmm0, (%r14,%rcx,8)
movsd 0x18(%r15), %xmm0
mulsd 0x8c473(%rip), %xmm0    # 0xf2c40
mulsd %xmm4, %xmm0
movsd 0x1010(%rbx), %xmm1
mulsd 0x8c467(%rip), %xmm1    # 0xf2c48
movapd %xmm4, %xmm2
divsd 0x8ac93(%rip), %xmm2    # 0xf1480
divsd (%r12,%rax,8), %xmm2
divsd %xmm1, %xmm0
addsd 0x87a61(%rip), %xmm2    # 0xee260
mulsd %xmm0, %xmm2
movslq 0xea4(%rbx), %rax
movsd %xmm2, (%r14,%rax,8)
cmpw $0x1, 0x36(%rbx)
jne 0x66b13
movl 0x1058(%rbx), %eax
addl $0x2, %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movapd %xmm4, %xmm0
callq 0x8620
mulsd 0xa6e24(%rip), %xmm0    # 0x10d660
mulsd 0xf0(%r15), %xmm0
movsd (%r15), %xmm1
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
mulsd 0x1050(%rbx), %xmm0
mulsd 0xa6e06(%rip), %xmm0    # 0x10d668
mulsd 0x8c3fe(%rip), %xmm0    # 0xf2c68
divsd 0x8c3fe(%rip), %xmm0    # 0xf2c70
divsd 0x8c3ce(%rip), %xmm0    # 0xf2c48
divsd 0x8c266(%rip), %xmm0    # 0xf2ae8
movslq 0xec8(%rbx), %rcx
movsd %xmm0, (%r14,%rcx,8)
movl 0x1058(%rbx), %eax
xorps %xmm2, %xmm2
cvtsi2sd %eax, %xmm2
movsd 0x8845c(%rip), %xmm3    # 0xeed00
addsd %xmm2, %xmm3
movapd 0x87980(%rip), %xmm1    # 0xee230
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 0x87957(%rip), %xmm2    # 0xee260
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 0x66a98
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
subl %eax, %ecx
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
movapd %xmm4, %xmm0
movapd %xmm2, 0x20(%rsp)
callq 0x8620
mulsd 0x20(%rsp), %xmm0
movl 0x1058(%rbx), %eax
xorps %xmm2, %xmm2
cvtsi2sd %eax, %xmm2
movsd 0x878b8(%rip), %xmm1    # 0xee260
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movsd %xmm0, 0x20(%rsp)
incl %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x8620
movsd %xmm0, 0x30(%rsp)
movq 0xf10(%rbx), %rax
movslq 0xf08(%rbx), %rcx
movsd -0x8(%rax,%rcx,8), %xmm0
addsd 0x87874(%rip), %xmm0    # 0xee260
movl 0x1058(%rbx), %eax
incl %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
callq 0x8620
movsd 0x30(%rsp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
jmp 0x66ad0
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 0x198fb
addq $0x20, %rsp
cmpl $0x1, %eax
jne 0x6713f
leaq 0x8799b(%rip), %rsi     # 0xee3f0
leaq 0xa6fad(%rip), %rdx     # 0x10da09
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x875bf(%rip), %rsi     # 0xee034
leaq 0xa6e22(%rip), %rdx     # 0x10d89e
movq %rbx, %rdi
movl $0x118, %ecx            # imm = 0x118
movq %r14, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %ebp
jmp 0x6713f
movsd 0x877c0(%rip), %xmm0    # 0xee260
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 0x82c0
mulsd 0x20(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
movslq 0x384(%r15), %rax
divsd (%r12,%rax,8), %xmm0
callq 0x8670
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 0x66cad
movsd 0x8773a(%rip), %xmm0    # 0xee260
movapd %xmm0, %xmm1
movapd %xmm0, %xmm5
subsd (%rbx), %xmm1
movsd %xmm1, 0x10(%rsp)
movslq 0xee4(%rbx), %rax
movsd 0x8c0f9(%rip), %xmm2    # 0xf2c40
movsd (%r14,%rax,8), %xmm0
mulsd %xmm2, %xmm0
movsd 0x8c0ef(%rip), %xmm3    # 0xf2c48
divsd %xmm3, %xmm0
movsd 0xa6b0b(%rip), %xmm1    # 0x10d670
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 0xa6ade(%rip), %xmm1    # 0x10d678
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
xorps %xmm1, %xmm1
cvtsi2sdl 0x1038(%rbx), %xmm1
divsd %xmm2, %xmm3
movsd %xmm3, 0x30(%rsp)
addsd %xmm5, %xmm1
mulsd 0x880dd(%rip), %xmm1    # 0xeecd0
callq 0x8620
movsd 0x8(%rsp), %xmm4
mulsd 0x30(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
mulsd 0xa6a6e(%rip), %xmm0    # 0x10d680
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
xorps %xmm1, %xmm1
cvtsi2sdl 0x1038(%rbx), %xmm1
addsd 0x87614(%rip), %xmm1    # 0xee260
mulsd %xmm4, %xmm1
mulsd 0x88078(%rip), %xmm1    # 0xeecd0
movsd 0x8bfe0(%rip), %xmm3    # 0xf2c40
mulsd 0x18(%r15), %xmm3
divsd 0x8bfda(%rip), %xmm3    # 0xf2c48
movapd %xmm3, %xmm2
divsd 0xa69f6(%rip), %xmm2    # 0x10d670
divsd 0x1010(%rbx), %xmm3
addsd %xmm2, %xmm3
mulsd %xmm1, %xmm3
divsd 0x20(%rsp), %xmm3
movsd 0x88ac8(%rip), %xmm1    # 0xef760
subsd %xmm3, %xmm1
mulsd %xmm0, %xmm1
movslq 0xedc(%rbx), %rax
movsd %xmm1, (%r14,%rax,8)
cmpw $0x1, 0x38(%rbx)
jne 0x670c7
movapd %xmm4, %xmm0
divsd 0xa69c4(%rip), %xmm0    # 0x10d688
movsd 0x1018(%rbx), %xmm1
movsd %xmm1, 0x10(%rsp)
movsd 0x1028(%rbx), %xmm1
callq 0x8620
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 0x8750c(%rip), %xmm0    # 0xee230
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 0x87a89(%rip), %xmm2    # 0xee7e8
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 0x874a2(%rip), %xmm1    # 0xee260
movq 0xf20(%rbx), %rdx
movsd (%rdx,%rcx,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd (%r14,%rax,8), %xmm2
jne 0x66e1e
jp 0x66e1e
movsd 0x8747e(%rip), %xmm1    # 0xee260
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 0x82c0
movapd %xmm0, %xmm2
jmp 0x66ead
xorpd 0x8740a(%rip), %xmm1    # 0xee230
movapd %xmm3, %xmm0
movsd %xmm2, 0x10(%rsp)
callq 0x8620
movsd 0x10(%rsp), %xmm3
mulsd %xmm0, %xmm3
movsd 0x1028(%rbx), %xmm1
movsd 0x87411(%rip), %xmm0    # 0xee260
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 0x8796b(%rip), %xmm1    # 0xee7e8
callq 0x8620
movsd %xmm0, 0x30(%rsp)
movsd 0x87958(%rip), %xmm1    # 0xee7e8
addsd 0x1028(%rbx), %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x8620
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 0x872f0(%rip), %xmm1    # 0xee230
xorps %xmm2, %xmm1
movaps %xmm1, 0x50(%rsp)
callq 0x8620
movapd %xmm0, %xmm2
movapd 0x30(%rsp), %xmm0
ucomisd 0x50(%rsp), %xmm0
mulsd 0x20(%rsp), %xmm2
mulsd 0x8a4cd(%rip), %xmm2    # 0xf1438
divsd 0x8870d(%rip), %xmm2    # 0xef680
mulsd 0xf8(%r15), %xmm2
divsd 0xf0(%r15), %xmm2
jne 0x66fc6
jp 0x66fc6
movq 0xf10(%rbx), %rax
movslq 0xf08(%rbx), %rcx
movsd -0x8(%rax,%rcx,8), %xmm1
addsd 0x872bb(%rip), %xmm1    # 0xee260
movsd 0x8(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm2, 0x20(%rsp)
callq 0x82c0
movsd 0x20(%rsp), %xmm1
mulsd %xmm0, %xmm1
jmp 0x67032
movsd 0x1028(%rbx), %xmm1
movapd 0x8725a(%rip), %xmm0    # 0xee230
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 0x87260(%rip), %xmm0    # 0xee260
callq 0x8620
movsd %xmm0, 0x30(%rsp)
movsd 0x1028(%rbx), %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x8620
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 0x8a3bb(%rip), %xmm1    # 0xf1438
divsd 0x885fb(%rip), %xmm1    # 0xef680
mulsd 0xf8(%r15), %xmm1
divsd 0xf0(%r15), %xmm1
mulsd %xmm2, %xmm1
movsd %xmm1, 0x10(%rsp)
xorpd 0x87187(%rip), %xmm0    # 0xee230
callq 0x8670
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 0x6713f
movsd 0x100(%r15), %xmm0
mulsd %xmm4, %xmm0
movslq 0xea8(%rbx), %rax
movsd %xmm0, (%r14,%rax,8)
divsd 0xa6592(%rip), %xmm4    # 0x10d688
movsd 0x1020(%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x1028(%rbx), %xmm1
movapd %xmm4, %xmm0
callq 0x8620
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