// File: /workspace/github_c_makefile_star2_O1/PoulinV[P]AxiCLASS/build/../source/perturbations.c
// Function: perturbations_einstein
int perturbations_einstein(
                           struct precision * ppr,
                           struct background * pba,
                           struct thermodynamics * pth,
                           struct perturbations * ppt,
                           int index_md,
                           double k,
                           double tau,
                           double * y,
                           struct perturbations_workspace * ppw
                           ) {
  /** Summary: */

  /** - define local variables */

  double k2,a,a2,a_prime_over_a;
  double s2_squared;
  double shear_g = 0.;
  double shear_idr = 0.;

  /** - define wavenumber and scale factor related quantities */

  k2 = k*k;
  a = ppw->pvecback[pba->index_bg_a];
  a2 = a * a;
  a_prime_over_a = ppw->pvecback[pba->index_bg_H]*a;
  s2_squared = 1.-3.*pba->K/k2;

  /** - sum up perturbations from all species */
  class_call(perturbations_total_stress_energy(ppr,pba,pth,ppt,index_md,k,y,ppw),
             ppt->error_message,
             ppt->error_message);

  /** - for scalar modes: */

  if (_scalars_) {

    /** - --> infer metric perturbations from Einstein equations */

    /* newtonian gauge */
    if (ppt->gauge == newtonian) {

      /* in principle we could get phi from the constrain equation:

         ppw->pvecmetric[ppw->index_mt_phi] = -1.5 * (a2/k2/k2/s2/s2) * (k2 * delta_rho + 3.*a_prime_over_a * rho_plus_p_theta);

         with s2_squared = sqrt(1-3K/k2) = ppw->s_l[2]*ppw->s_l[2]

         This was the case in class v1.3. However the integration is
         more stable is we treat phi as a dynamical variable
         y[ppw->pv->index_pt_phi], which derivative is given by the
         second equation below (credits to Guido Walter Pettinari). */

      /* equation for psi */
      ppw->pvecmetric[ppw->index_mt_psi] = y[ppw->pv->index_pt_phi] - 4.5 * (a2/k2) * ppw->rho_plus_p_shear;

      /* equation for phi' */
      ppw->pvecmetric[ppw->index_mt_phi_prime] = -a_prime_over_a * ppw->pvecmetric[ppw->index_mt_psi] + 1.5 * (a2/k2) * ppw->rho_plus_p_theta;

      /* eventually, infer radiation streaming approximation for
         gamma and ur (this is exactly the right place to do it
         because the result depends on h_prime) */

      if (ppw->approx[ppw->index_ap_rsa] == (int)rsa_on) {

        class_call(perturbations_rsa_delta_and_theta(ppr,pba,pth,ppt,k,y,a_prime_over_a,ppw->pvecthermo,ppw,ppt->error_message),
                   ppt->error_message,
                   ppt->error_message);
      }

      if ((pba->has_idr)&&(ppw->approx[ppw->index_ap_rsa_idr] == (int)rsa_idr_on)){

        class_call(perturbations_rsa_idr_delta_and_theta(ppr,pba,pth,ppt,k,y,a_prime_over_a,ppw->pvecthermo,ppw,ppt->error_message),
                   ppt->error_message,
                   ppt->error_message);
      }
    }

    /* synchronous gauge */
    if (ppt->gauge == synchronous) {

      /* first equation involving total density fluctuation */
      ppw->pvecmetric[ppw->index_mt_h_prime] =
        ( k2 * s2_squared * y[ppw->pv->index_pt_eta] + 1.5 * a2 * ppw->delta_rho)/(0.5*a_prime_over_a);  /* h' */

      /* eventually, infer radiation streaming approximation for
         gamma and ur (this is exactly the right place to do it
         because the result depends on h_prime) */

      if (ppw->approx[ppw->index_ap_rsa] == (int)rsa_on) {

        class_call(perturbations_rsa_delta_and_theta(ppr,pba,pth,ppt,k,y,a_prime_over_a,ppw->pvecthermo,ppw,ppt->error_message),
                   ppt->error_message,
                   ppt->error_message);
      }

      if ((pba->has_idr==_TRUE_)&&(ppw->approx[ppw->index_ap_rsa_idr] == (int)rsa_idr_on)) {

        class_call(perturbations_rsa_idr_delta_and_theta(ppr,pba,pth,ppt,k,y,a_prime_over_a,ppw->pvecthermo,ppw,ppt->error_message),
                   ppt->error_message,
                   ppt->error_message);

        ppw->rho_plus_p_theta += 4./3.*ppw->pvecback[pba->index_bg_rho_idr]*ppw->rsa_theta_idr;
      }

      /* second equation involving total velocity */
      ppw->pvecmetric[ppw->index_mt_eta_prime] = (1.5 * a2 * ppw->rho_plus_p_theta + 0.5 * pba->K * ppw->pvecmetric[ppw->index_mt_h_prime])/k2/s2_squared;  /* eta' */

      /* third equation involving total pressure */
      ppw->pvecmetric[ppw->index_mt_h_prime_prime] =
        - 2. * a_prime_over_a * ppw->pvecmetric[ppw->index_mt_h_prime]
        + 2. * k2 * s2_squared * y[ppw->pv->index_pt_eta]
        - 9. * a2 * ppw->delta_p;

      /* alpha = (h'+6eta')/2k^2 */
      ppw->pvecmetric[ppw->index_mt_alpha] = (ppw->pvecmetric[ppw->index_mt_h_prime] + 6.*ppw->pvecmetric[ppw->index_mt_eta_prime])/2./k2;

      /* eventually, infer first-order tight-coupling approximation for photon
         shear, then correct the total shear */
      if (ppw->approx[ppw->index_ap_tca] == (int)tca_on) {

        if (pth->has_idm_g == _TRUE_) {
          shear_g = 16./45./(ppw->pvecthermo[pth->index_th_dkappa] + ppw->pvecthermo[pth->index_th_dmu_idm_g])*(y[ppw->pv->index_pt_theta_g]+k2*ppw->pvecmetric[ppw->index_mt_alpha]);
        }
        else {
          shear_g = 16./45./ppw->pvecthermo[pth->index_th_dkappa]*(y[ppw->pv->index_pt_theta_g]+k2*ppw->pvecmetric[ppw->index_mt_alpha]);
        }

        ppw->rho_plus_p_shear += 4./3.*ppw->pvecback[pba->index_bg_rho_g]*shear_g;

      }

      if (pth->has_idm_dr == _TRUE_) {
        if (ppw->approx[ppw->index_ap_tca_idm_dr] == (int)tca_idm_dr_on){

          shear_idr = 0.5*8./15./ppw->pvecthermo[pth->index_th_dmu_idm_dr]/ppt->alpha_idm_dr[0]*(y[ppw->pv->index_pt_theta_idr]+k2*ppw->pvecmetric[ppw->index_mt_alpha]);

          ppw->rho_plus_p_shear += 4./3.*ppw->pvecback[pba->index_bg_rho_idr]*shear_idr;
        }
      }

      /* fourth equation involving total shear */
      ppw->pvecmetric[ppw->index_mt_alpha_prime] =  //TBC
        - 2. * a_prime_over_a * ppw->pvecmetric[ppw->index_mt_alpha]
        + y[ppw->pv->index_pt_eta]
        - 4.5 * (a2/k2) * ppw->rho_plus_p_shear;

    }

    /* transform (delta_m, theta_m) of the current gauge into
       gauge-independent variables (you could comment this out if you
       really want gauge-dependent results) */

    if (ppt->has_matter_source_in_current_gauge == _FALSE_) {
      if (ppt->has_source_delta_m == _TRUE_) {
        ppw->delta_m += 3. *ppw->pvecback[pba->index_bg_a]*ppw->pvecback[pba->index_bg_H] * ppw->theta_m/k2;
        // note: until 2.4.3 there was a typo, the factor was (-2 H'/H) instead
        // of (3 aH). There is the same typo in the CLASSgal paper
        // 1307.1459v1,v2,v3. It came from a confusion between (1+w_total)
        // and (1+w_matter)=1 [the latter is the relevant one here].
        //
        // note2: at this point this gauge-invariant variable is only
        // valid if all matter components are pressureless and
        // stable. This relation will be generalized soon to the case
        // of decaying dark matter.
      }

      if (ppt->has_source_delta_cb == _TRUE_) {
        ppw->delta_cb += 3. *ppw->pvecback[pba->index_bg_a]*ppw->pvecback[pba->index_bg_H] * ppw->theta_cb/k2;//check gauge transformation
      }

      if (ppt->has_source_theta_m == _TRUE_) {
        if  (ppt->gauge == synchronous) {
          ppw->theta_m += ppw->pvecmetric[ppw->index_mt_alpha]*k2;
        }
      }
      if (ppt->has_source_theta_cb == _TRUE_){
        if  (ppt->gauge == synchronous) {
          ppw->theta_cb += ppw->pvecmetric[ppw->index_mt_alpha]*k2; //check gauge transformation
        }
      }
    }
  }
  /** - for vector modes */

  if (_vectors_) {

    if (ppt->gauge == newtonian) {

      ppw->pvecmetric[ppw->index_mt_V_prime] = -2.*a_prime_over_a*y[ppw->pv->index_pt_V] - 3.*ppw->vector_source_pi/k;

    }

    if (ppt->gauge == synchronous) {

      // assuming    vector_source_pi = p_class a^2 pi_T^{(1)} and  vector_source_v = (rho_class+p_class)a^2 v^{(1)}

      // from Hu and White:
      ppw->pvecmetric[ppw->index_mt_hv_prime_prime] = -2.*a_prime_over_a*y[ppw->pv->index_pt_hv_prime] - 3.*ppw->vector_source_pi/k2;

      // what we suspect:
      //ppw->pvecmetric[ppw->index_mt_hv_prime_prime] = -2.*a_prime_over_a*y[ppw->pv->index_pt_hv_prime] - 3.*ppw->vector_source_pi;

      // if we use the other equation:
      //ppw->pvecmetric[ppw->index_mt_hv_prime] = -2./k/ (1.-2.*pba->K/k2) * 3. * ppw->vector_source_v;

    }

  }

  /** - for tensor modes */

  if (_tensors_) {

    /* single einstein equation for tensor perturbations */
    ppw->pvecmetric[ppw->index_mt_gw_prime_prime] = -2.*a_prime_over_a*y[ppw->pv->index_pt_gwdot]-(k2+2.*pba->K)*y[ppw->pv->index_pt_gw]+ppw->gw_source;

  }

  return _SUCCESS_;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x858, %rsp            # imm = 0x858
movq %r9, %rbp
movl %r8d, %r12d
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %rbx
movq 0x890(%rsp), %rdx
movq 0x30(%rdx), %rax
movslq 0x380(%rsi), %rcx
movsd (%rax,%rcx,8), %xmm2
movslq 0x384(%rsi), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd %xmm2, 0x18(%rsp)
mulsd %xmm2, %xmm1
movsd %xmm1, 0x38(%rsp)
movsd 0x318(%rsi), %xmm1
movsd %xmm1, 0x28(%rsp)
movq %rdx, (%rsp)
movq %r15, %rdx
movq %r14, %rcx
movsd %xmm0, 0x30(%rsp)
callq 0x91778
testl %eax, %eax
je 0x90f5f
addq $0x6c8a, %r14           # imm = 0x6C8A
leaq 0x604d4(%rip), %rsi     # 0xf13f0
leaq 0x89909(%rip), %rdx     # 0x11a82c
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x600f8(%rip), %rsi     # 0xf1034
leaq 0x8992d(%rip), %rdx     # 0x11a870
movq %r14, %rdi
movl $0x1adb, %ecx           # imm = 0x1ADB
movq %rbx, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
jmp 0x916ef
movq %r13, 0x10(%rsp)
movq %r15, 0x48(%rsp)
movsd 0x18(%rsp), %xmm7
movsd 0x30(%rsp), %xmm6
movapd %xmm6, %xmm5
mulsd %xmm6, %xmm5
cmpw $0x1, 0xe(%r14)
movq 0x890(%rsp), %r10
movsd 0x38(%rsp), %xmm4
movq %r14, %r13
jne 0x915db
cmpl %r12d, 0x848(%r13)
jne 0x915db
mulsd %xmm7, %xmm7
cmpl $0x0, 0x83c(%r13)
movsd 0x28(%rsp), %xmm3
je 0x910f9
cmpl $0x1, 0x83c(%r13)
jne 0x914b6
mulsd 0x6349b(%rip), %xmm3    # 0xf4470
divsd %xmm5, %xmm3
addsd 0x6027f(%rip), %xmm3    # 0xf1260
movapd %xmm5, %xmm0
mulsd %xmm3, %xmm0
movq 0x40(%r10), %rax
movq 0x48(%r10), %rcx
movslq 0xd0(%rcx), %rcx
movsd 0x62fb8(%rip), %xmm2    # 0xf3fb8
mulsd %xmm7, %xmm2
movsd 0x50(%r10), %xmm1
mulsd %xmm2, %xmm1
mulsd (%rbp,%rcx,8), %xmm0
addsd %xmm1, %xmm0
movsd 0x60cb0(%rip), %xmm1    # 0xf1cd0
mulsd %xmm4, %xmm1
divsd %xmm1, %xmm0
movslq 0x8(%r10), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x180(%r10), %rax
movslq 0x164(%r10), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x91208
movq %r10, (%rsp)
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq %r13, %rcx
movapd %xmm6, %xmm0
movq %rbp, %r8
movapd %xmm4, %xmm1
movq %r10, %r14
movsd %xmm5, 0x20(%rsp)
movsd %xmm7, 0x18(%rsp)
movsd %xmm3, 0x28(%rsp)
movsd %xmm2, 0x40(%rsp)
callq 0x940ff
movsd 0x40(%rsp), %xmm2
movsd 0x28(%rsp), %xmm3
movsd 0x18(%rsp), %xmm7
movsd 0x30(%rsp), %xmm6
movsd 0x20(%rsp), %xmm5
movsd 0x38(%rsp), %xmm4
movq %r14, %r10
testl %eax, %eax
je 0x91208
addq $0x6c8a, %r13           # imm = 0x6C8A
leaq 0x6032b(%rip), %rsi     # 0xf13f0
leaq 0x897bb(%rip), %rdx     # 0x11a887
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x5ff4f(%rip), %rsi     # 0xf1034
leaq 0x89784(%rip), %rdx     # 0x11a870
movq %r13, %rdi
movl $0x1b19, %ecx           # imm = 0x1B19
jmp 0x91200
movq 0x40(%r10), %rax
movq 0x48(%r10), %rcx
movslq 0xd4(%rcx), %rcx
movapd %xmm7, %xmm0
divsd %xmm5, %xmm0
movsd 0x844c8(%rip), %xmm1    # 0x1155e0
mulsd %xmm0, %xmm1
mulsd 0x60(%r10), %xmm1
addsd (%rbp,%rcx,8), %xmm1
movslq (%r10), %rcx
movsd %xmm1, (%rax,%rcx,8)
mulsd 0x62e80(%rip), %xmm0    # 0xf3fb8
mulsd 0x58(%r10), %xmm0
mulsd %xmm4, %xmm1
subsd %xmm1, %xmm0
movslq 0x4(%r10), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x180(%r10), %rax
movslq 0x164(%r10), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x91701
movq %r10, (%rsp)
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq %r13, %rcx
movapd %xmm6, %xmm0
movq %rbp, %r8
movapd %xmm4, %xmm1
movq %r10, %r14
movsd %xmm5, 0x20(%rsp)
movsd %xmm7, 0x18(%rsp)
callq 0x940ff
movsd 0x28(%rsp), %xmm3
movsd 0x18(%rsp), %xmm7
movsd 0x30(%rsp), %xmm6
movsd 0x20(%rsp), %xmm5
movsd 0x38(%rsp), %xmm4
movq %r14, %r10
testl %eax, %eax
je 0x91701
addq $0x6c8a, %r13           # imm = 0x6C8A
leaq 0x6021f(%rip), %rsi     # 0xf13f0
leaq 0x896af(%rip), %rdx     # 0x11a887
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x5fe43(%rip), %rsi     # 0xf1034
leaq 0x89678(%rip), %rdx     # 0x11a870
movq %r13, %rdi
movl $0x1aff, %ecx           # imm = 0x1AFF
movq %r14, %r8
jmp 0x90f4e
movq 0x10(%rsp), %rax
cmpw $0x1, 0x4c6(%rax)
jne 0x912c8
movq 0x180(%r10), %rax
movslq 0x16c(%r10), %rcx
cmpl $0x1, (%rax,%rcx,4)
movq 0x10(%rsp), %rax
jne 0x912c8
movq %r10, (%rsp)
movq %r13, %rcx
movapd %xmm6, %xmm0
movq %rbp, %r8
movapd %xmm4, %xmm1
movq %r10, %r14
movsd %xmm5, 0x20(%rsp)
movsd %xmm7, 0x18(%rsp)
movsd %xmm3, 0x28(%rsp)
movsd %xmm2, 0x40(%rsp)
callq 0x945dd
movsd 0x40(%rsp), %xmm2
movsd 0x28(%rsp), %xmm3
movsd 0x18(%rsp), %xmm7
movsd 0x30(%rsp), %xmm6
movsd 0x20(%rsp), %xmm5
movsd 0x38(%rsp), %xmm4
movq %r14, %r10
movq 0x30(%r14), %rax
movq 0x10(%rsp), %rcx
movslq 0x3b0(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x10(%rsp), %rax
mulsd 0x631fd(%rip), %xmm0    # 0xf44b0
mulsd 0xd0(%r14), %xmm0
addsd 0x58(%r14), %xmm0
movsd %xmm0, 0x58(%r14)
movsd 0x60a00(%rip), %xmm1    # 0xf1cd0
movsd 0x318(%rax), %xmm0
mulsd %xmm1, %xmm0
movq 0x40(%r10), %rax
movslq 0x8(%r10), %rsi
mulsd (%rax,%rsi,8), %xmm0
mulsd 0x58(%r10), %xmm2
addsd %xmm0, %xmm2
divsd %xmm5, %xmm2
divsd %xmm3, %xmm2
movslq 0x10(%r10), %rdi
movsd %xmm2, (%rax,%rdi,8)
movsd 0x6144c(%rip), %xmm0    # 0xf2758
movapd %xmm5, %xmm2
addsd %xmm5, %xmm2
mulsd %xmm3, %xmm2
movq 0x48(%r10), %rdx
movslq 0xd0(%rdx), %rcx
mulsd (%rbp,%rcx,8), %xmm2
mulsd %xmm4, %xmm0
movsd (%rax,%rsi,8), %xmm3
mulsd %xmm0, %xmm3
addsd %xmm2, %xmm3
movsd 0x8419e(%rip), %xmm2    # 0x1154e0
mulsd %xmm7, %xmm2
mulsd 0x68(%r10), %xmm2
addsd %xmm3, %xmm2
movslq 0xc(%r10), %r9
movsd %xmm2, (%rax,%r9,8)
movsd (%rax,%rdi,8), %xmm2
mulsd 0x61309(%rip), %xmm2    # 0xf2670
addsd (%rax,%rsi,8), %xmm2
mulsd %xmm1, %xmm2
divsd %xmm5, %xmm2
movslq 0x14(%r10), %rsi
movsd %xmm2, (%rax,%rsi,8)
movq 0x180(%r10), %rdi
movslq 0x160(%r10), %r9
cmpl $0x0, (%rdi,%r9,4)
movq 0x48(%rsp), %r14
jne 0x9140a
cmpw $0x1, 0x36(%r14)
movq 0x38(%r10), %r11
movslq 0xe80(%r14), %r9
movsd (%r11,%r9,8), %xmm1
jne 0x913bd
movslq 0xec8(%r14), %r9
addsd (%r11,%r9,8), %xmm1
movsd 0x84223(%rip), %xmm3    # 0x1155e8
divsd %xmm1, %xmm3
movslq 0x4(%rdx), %r9
mulsd %xmm5, %xmm2
addsd (%rbp,%r9,8), %xmm2
mulsd %xmm3, %xmm2
movq 0x30(%r10), %r11
movq 0x10(%rsp), %r9
movslq 0x38c(%r9), %r9
movsd (%r11,%r9,8), %xmm1
mulsd 0x630b6(%rip), %xmm1    # 0xf44b0
mulsd %xmm2, %xmm1
addsd 0x60(%r10), %xmm1
movsd %xmm1, 0x60(%r10)
cmpw $0x1, 0x38(%r14)
jne 0x9148c
movslq 0x168(%r10), %r9
cmpl $0x0, (%rdi,%r9,4)
jne 0x9148c
movq 0x30(%r10), %rdi
movq 0x38(%r10), %r11
movslq 0xeac(%r14), %r9
movsd 0x84079(%rip), %xmm1    # 0x1154b0
divsd (%r11,%r9,8), %xmm1
movq 0x820(%r13), %r9
divsd (%r9), %xmm1
movslq 0x94(%rdx), %rdx
movsd (%rax,%rsi,8), %xmm2
mulsd %xmm5, %xmm2
addsd (%rbp,%rdx,8), %xmm2
mulsd %xmm1, %xmm2
movq 0x10(%rsp), %rdx
movslq 0x3b0(%rdx), %rdx
movsd (%rdi,%rdx,8), %xmm1
mulsd 0x63034(%rip), %xmm1    # 0xf44b0
mulsd %xmm2, %xmm1
addsd 0x60(%r10), %xmm1
movsd %xmm1, 0x60(%r10)
mulsd (%rax,%rsi,8), %xmm0
addsd (%rbp,%rcx,8), %xmm0
divsd %xmm5, %xmm7
mulsd 0x8413d(%rip), %xmm7    # 0x1155e0
mulsd 0x60(%r10), %xmm7
addsd %xmm0, %xmm7
movslq 0x18(%r10), %rcx
movsd %xmm7, (%rax,%rcx,8)
cmpw $0x0, 0x844(%r13)
jne 0x915db
cmpw $0x1, 0x87c(%r13)
jne 0x91518
movq 0x30(%r10), %rax
movq 0x10(%rsp), %rdx
movslq 0x380(%rdx), %rcx
movsd (%rax,%rcx,8), %xmm0
mulsd 0x61193(%rip), %xmm0    # 0xf2680
movslq 0x384(%rdx), %rcx
mulsd (%rax,%rcx,8), %xmm0
mulsd 0x108(%r10), %xmm0
divsd %xmm5, %xmm0
addsd 0x100(%r10), %xmm0
movsd %xmm0, 0x100(%r10)
cmpw $0x1, 0x87e(%r13)
jne 0x9156b
movq 0x30(%r10), %rax
movq 0x10(%rsp), %rdx
movslq 0x380(%rdx), %rcx
movsd (%rax,%rcx,8), %xmm0
mulsd 0x61140(%rip), %xmm0    # 0xf2680
movslq 0x384(%rdx), %rcx
mulsd (%rax,%rcx,8), %xmm0
mulsd 0x118(%r10), %xmm0
divsd %xmm5, %xmm0
addsd 0x110(%r10), %xmm0
movsd %xmm0, 0x110(%r10)
cmpw $0x1, 0x898(%r13)
jne 0x915a3
cmpl $0x1, 0x83c(%r13)
jne 0x915a3
movq 0x40(%r10), %rax
movslq 0x14(%r10), %rcx
movsd (%rax,%rcx,8), %xmm0
mulsd %xmm5, %xmm0
addsd 0x108(%r10), %xmm0
movsd %xmm0, 0x108(%r10)
cmpw $0x1, 0x89a(%r13)
jne 0x915db
cmpl $0x1, 0x83c(%r13)
jne 0x915db
movq 0x40(%r10), %rax
movslq 0x14(%r10), %rcx
movsd (%rax,%rcx,8), %xmm0
mulsd %xmm5, %xmm0
addsd 0x118(%r10), %xmm0
movsd %xmm0, 0x118(%r10)
cmpw $0x1, 0x10(%r13)
jne 0x9168a
cmpl %r12d, 0x850(%r13)
jne 0x9168a
movl 0x83c(%r13), %eax
cmpl $0x1, %eax
je 0x91644
testl %eax, %eax
jne 0x9168a
movsd 0x61148(%rip), %xmm0    # 0xf2758
mulsd %xmm4, %xmm0
movq 0x48(%r10), %rax
movslq 0xdc(%rax), %rax
movsd 0x80(%r10), %xmm1
mulsd 0x62e40(%rip), %xmm1    # 0xf4470
divsd %xmm6, %xmm1
mulsd (%rbp,%rax,8), %xmm0
addsd %xmm1, %xmm0
leaq 0x20(%r10), %rax
jmp 0x9167e
movsd 0x6110c(%rip), %xmm0    # 0xf2758
mulsd %xmm4, %xmm0
movq 0x48(%r10), %rax
movslq 0xd8(%rax), %rax
movsd 0x80(%r10), %xmm1
mulsd 0x62e04(%rip), %xmm1    # 0xf4470
divsd %xmm5, %xmm1
mulsd (%rbp,%rax,8), %xmm0
addsd %xmm1, %xmm0
leaq 0x24(%r10), %rax
movq 0x40(%r10), %rcx
movslq (%rax), %rax
movsd %xmm0, (%rcx,%rax,8)
xorl %eax, %eax
cmpw $0x1, 0x12(%r13)
jne 0x916ef
cmpl %r12d, 0x84c(%r13)
jne 0x916ef
mulsd 0x610b3(%rip), %xmm4    # 0xf2758
movq 0x40(%r10), %rcx
movq 0x48(%r10), %rdx
movq 0x10(%rsp), %rsi
movsd 0x318(%rsi), %xmm0
addsd %xmm0, %xmm0
addsd %xmm5, %xmm0
movslq 0xe0(%rdx), %rsi
mulsd (%rbp,%rsi,8), %xmm0
movslq 0xe4(%rdx), %rdx
mulsd (%rbp,%rdx,8), %xmm4
subsd %xmm0, %xmm4
addsd 0x78(%r10), %xmm4
movslq 0x1c(%r10), %rdx
movsd %xmm4, (%rcx,%rdx,8)
addq $0x858, %rsp            # imm = 0x858
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rax
cmpw $0x0, 0x4c6(%rax)
je 0x90fbf
movq 0x180(%r10), %rax
movslq 0x16c(%r10), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x90fbf
movq %r10, (%rsp)
movq %r13, %rcx
movapd %xmm6, %xmm0
movq %rbp, %r8
movapd %xmm4, %xmm1
movq %r10, %r14
movsd %xmm5, 0x20(%rsp)
movsd %xmm7, 0x18(%rsp)
callq 0x945dd
movsd 0x28(%rsp), %xmm3
movsd 0x18(%rsp), %xmm7
movsd 0x30(%rsp), %xmm6
movsd 0x20(%rsp), %xmm5
movsd 0x38(%rsp), %xmm4
movq %r14, %r10
jmp 0x90fbf