// File: /workspace/github_c_makefile_star2_O2/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 $0x868, %rsp            # imm = 0x868
movq %r9, %rbp
movl %r8d, %r12d
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %rbx
movq 0x8a0(%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, 0x20(%rsp)
mulsd %xmm2, %xmm1
movsd %xmm1, 0x50(%rsp)
movsd 0x318(%rsi), %xmm1
movsd %xmm1, 0x40(%rsp)
movq %rdx, (%rsp)
movq %r15, %rdx
movq %r14, %rcx
movsd %xmm0, 0x48(%rsp)
callq 0x89da8
testl %eax, %eax
je 0x895a6
addq $0x6c8a, %r14           # imm = 0x6C8A
leaq 0x5be8b(%rip), %rsi     # 0xe53f0
leaq 0x851a0(%rip), %rdx     # 0x10e70c
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x5baaf(%rip), %rsi     # 0xe5034
leaq 0x851c4(%rip), %rdx     # 0x10e750
movq %r14, %rdi
movl $0x1adb, %ecx           # imm = 0x1ADB
movq %rbx, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
jmp 0x89d96
movsd 0x20(%rsp), %xmm8
movq %r13, 0x18(%rsp)
movq %r15, 0x38(%rsp)
movsd 0x48(%rsp), %xmm5
movapd %xmm5, %xmm6
mulsd %xmm5, %xmm6
cmpw $0x1, 0xe(%r14)
movq 0x8a0(%rsp), %r10
movsd 0x50(%rsp), %xmm1
movq %r14, %r13
jne 0x89cb7
cmpl %r12d, 0x848(%r13)
jne 0x89cb7
mulsd %xmm8, %xmm8
movl 0x83c(%r13), %eax
movapd %xmm8, %xmm7
divsd %xmm6, %xmm7
testl %eax, %eax
jne 0x89789
movq 0x40(%r10), %rax
movq 0x48(%r10), %rcx
movslq 0xd4(%rcx), %rcx
movsd 0x7fe9d(%rip), %xmm0    # 0x1094c0
mulsd %xmm7, %xmm0
mulsd 0x60(%r10), %xmm0
addsd (%rbp,%rcx,8), %xmm0
movslq (%r10), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x5e945(%rip), %xmm2    # 0xe7f88
mulsd %xmm7, %xmm2
mulsd 0x58(%r10), %xmm2
mulsd %xmm1, %xmm0
subsd %xmm0, %xmm2
movslq 0x4(%r10), %rcx
movsd %xmm2, (%rax,%rcx,8)
movq 0x180(%r10), %rax
movslq 0x164(%r10), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x89714
movq %r10, (%rsp)
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r13, %rcx
movapd %xmm5, %xmm0
movq %rbp, %r8
movq %r10, %r14
movsd %xmm6, 0x30(%rsp)
movsd %xmm7, 0x28(%rsp)
movsd %xmm8, 0x20(%rsp)
callq 0x8cbf2
movsd 0x20(%rsp), %xmm8
movsd 0x28(%rsp), %xmm7
movsd 0x30(%rsp), %xmm6
movsd 0x48(%rsp), %xmm5
movsd 0x50(%rsp), %xmm1
movq %r14, %r10
testl %eax, %eax
je 0x89714
addq $0x6c8a, %r13           # imm = 0x6C8A
leaq 0x5bd10(%rip), %rsi     # 0xe53f0
leaq 0x85080(%rip), %rdx     # 0x10e767
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x5b934(%rip), %rsi     # 0xe5034
leaq 0x85049(%rip), %rdx     # 0x10e750
movq %r13, %rdi
movl $0x1aff, %ecx           # imm = 0x1AFF
jmp 0x89898
movq 0x18(%rsp), %rax
cmpw $0x0, 0x4c6(%rax)
je 0x89782
movq 0x180(%r10), %rax
movslq 0x16c(%r10), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x89782
movq %r10, (%rsp)
movq %r13, %rcx
movapd %xmm5, %xmm0
movq %rbp, %r8
movq %r10, %r14
movsd %xmm6, 0x30(%rsp)
movsd %xmm7, 0x28(%rsp)
movsd %xmm8, 0x20(%rsp)
callq 0x8d076
movsd 0x20(%rsp), %xmm8
movsd 0x28(%rsp), %xmm7
movsd 0x30(%rsp), %xmm6
movsd 0x48(%rsp), %xmm5
movsd 0x50(%rsp), %xmm1
movq %r14, %r10
movl 0x83c(%r13), %eax
cmpl $0x1, %eax
jne 0x89b92
movsd 0x40(%rsp), %xmm2
mulsd 0x5eca0(%rip), %xmm2    # 0xe8440
divsd %xmm6, %xmm2
addsd 0x5bab4(%rip), %xmm2    # 0xe5260
movapd %xmm6, %xmm0
movsd %xmm2, 0x40(%rsp)
mulsd %xmm2, %xmm0
movq 0x40(%r10), %rax
movq 0x48(%r10), %rcx
movslq 0xd0(%rcx), %rcx
movsd 0x5e7b7(%rip), %xmm3    # 0xe7f88
mulsd %xmm8, %xmm3
movsd 0x50(%r10), %xmm2
mulsd %xmm3, %xmm2
mulsd (%rbp,%rcx,8), %xmm0
addsd %xmm2, %xmm0
movsd 0x5c4be(%rip), %xmm2    # 0xe5cb0
mulsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movslq 0x8(%r10), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x180(%r10), %rcx
movslq 0x164(%r10), %rax
cmpl $0x1, (%rcx,%rax,4)
jne 0x898cf
movsd %xmm3, 0x58(%rsp)
movsd %xmm8, 0x20(%rsp)
movsd %xmm7, 0x28(%rsp)
movsd %xmm6, 0x30(%rsp)
movq %r10, (%rsp)
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r13, %rcx
movapd %xmm5, %xmm0
movq %rbp, %r8
movq %r10, %r14
callq 0x8cbf2
testl %eax, %eax
je 0x898a0
addq $0x6c8a, %r13           # imm = 0x6C8A
leaq 0x5bb87(%rip), %rsi     # 0xe53f0
leaq 0x84ef7(%rip), %rdx     # 0x10e767
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x5b7ab(%rip), %rsi     # 0xe5034
leaq 0x84ec0(%rip), %rdx     # 0x10e750
movq %r13, %rdi
movl $0x1b19, %ecx           # imm = 0x1B19
movq %r14, %r8
jmp 0x89597
movq 0x180(%r14), %rcx
movq %r14, %r10
movsd 0x50(%rsp), %xmm1
movsd 0x48(%rsp), %xmm5
movsd 0x30(%rsp), %xmm6
movsd 0x28(%rsp), %xmm7
movsd 0x20(%rsp), %xmm8
movsd 0x58(%rsp), %xmm3
movq 0x18(%rsp), %rax
cmpw $0x1, 0x4c6(%rax)
jne 0x899a5
movslq 0x16c(%r10), %rax
cmpl $0x1, (%rcx,%rax,4)
movq 0x18(%rsp), %rax
movq 0x38(%rsp), %r15
movsd 0x40(%rsp), %xmm2
jne 0x899b0
movq %r10, (%rsp)
movq %r13, %rcx
movapd %xmm5, %xmm0
movq %rbp, %r8
movq %r10, %r14
movsd %xmm6, 0x30(%rsp)
movsd %xmm7, 0x28(%rsp)
movsd %xmm8, 0x20(%rsp)
movsd %xmm3, 0x58(%rsp)
callq 0x8d076
movsd 0x58(%rsp), %xmm3
movsd 0x40(%rsp), %xmm2
movsd 0x20(%rsp), %xmm8
movsd 0x28(%rsp), %xmm7
movsd 0x30(%rsp), %xmm6
movsd 0x48(%rsp), %xmm5
movsd 0x50(%rsp), %xmm1
movq 0x38(%rsp), %r15
movq %r14, %r10
movq 0x18(%rsp), %rax
movslq 0x3b0(%rax), %rax
movq 0x30(%r14), %rcx
movsd (%rcx,%rax,8), %xmm0
movq 0x18(%rsp), %rax
mulsd 0x5eaf9(%rip), %xmm0    # 0xe8480
mulsd 0xd0(%r14), %xmm0
movq 0x180(%r14), %rcx
addsd 0x58(%r14), %xmm0
movsd %xmm0, 0x58(%r14)
jmp 0x899b0
movq 0x38(%rsp), %r15
movsd 0x40(%rsp), %xmm2
movsd 0x5c2f8(%rip), %xmm4    # 0xe5cb0
movsd 0x318(%rax), %xmm0
mulsd %xmm4, %xmm0
movq 0x40(%r10), %rax
movslq 0x8(%r10), %rdi
mulsd (%rax,%rdi,8), %xmm0
mulsd 0x58(%r10), %xmm3
addsd %xmm0, %xmm3
divsd %xmm6, %xmm3
divsd %xmm2, %xmm3
movslq 0x10(%r10), %r11
movsd %xmm3, (%rax,%r11,8)
movsd 0x5cd43(%rip), %xmm0    # 0xe6738
movapd %xmm2, %xmm3
movapd %xmm6, %xmm2
addsd %xmm6, %xmm2
mulsd %xmm3, %xmm2
movq 0x48(%r10), %rsi
movslq 0xd0(%rsi), %rdx
mulsd (%rbp,%rdx,8), %xmm2
mulsd %xmm1, %xmm0
movsd (%rax,%rdi,8), %xmm3
mulsd %xmm0, %xmm3
addsd %xmm2, %xmm3
mulsd 0x7f990(%rip), %xmm8    # 0x1093c0
mulsd 0x68(%r10), %xmm8
addsd %xmm3, %xmm8
movslq 0xc(%r10), %r9
movsd %xmm8, (%rax,%r9,8)
movsd (%rax,%r11,8), %xmm2
mulsd 0x5cbfd(%rip), %xmm2    # 0xe6650
addsd (%rax,%rdi,8), %xmm2
mulsd %xmm4, %xmm2
divsd %xmm6, %xmm2
movslq 0x14(%r10), %rdi
movsd %xmm2, (%rax,%rdi,8)
movslq 0x160(%r10), %r9
cmpl $0x0, (%rcx,%r9,4)
jne 0x89aea
cmpw $0x1, 0x36(%r15)
movq 0x38(%r10), %r11
movslq 0xe80(%r15), %r9
movsd (%r11,%r9,8), %xmm4
jne 0x89a9d
movslq 0xec8(%r15), %r9
addsd (%r11,%r9,8), %xmm4
movsd 0x7fa23(%rip), %xmm3    # 0x1094c8
divsd %xmm4, %xmm3
movslq 0x4(%rsi), %r9
mulsd %xmm6, %xmm2
addsd (%rbp,%r9,8), %xmm2
mulsd %xmm3, %xmm2
movq 0x30(%r10), %r11
movq 0x18(%rsp), %r9
movslq 0x38c(%r9), %r9
movsd (%r11,%r9,8), %xmm3
mulsd 0x5e9a6(%rip), %xmm3    # 0xe8480
mulsd %xmm2, %xmm3
addsd 0x60(%r10), %xmm3
movsd %xmm3, 0x60(%r10)
cmpw $0x1, 0x38(%r15)
jne 0x89b6c
movslq 0x168(%r10), %r9
cmpl $0x0, (%rcx,%r9,4)
jne 0x89b6c
movq 0x30(%r10), %rcx
movq 0x38(%r10), %r11
movslq 0xeac(%r15), %r9
movsd 0x7f879(%rip), %xmm3    # 0x109390
divsd (%r11,%r9,8), %xmm3
movq 0x820(%r13), %r9
divsd (%r9), %xmm3
movslq 0x94(%rsi), %rsi
movsd (%rax,%rdi,8), %xmm2
mulsd %xmm6, %xmm2
addsd (%rbp,%rsi,8), %xmm2
mulsd %xmm3, %xmm2
movq 0x18(%rsp), %rsi
movslq 0x3b0(%rsi), %rsi
movsd (%rcx,%rsi,8), %xmm3
mulsd 0x5e924(%rip), %xmm3    # 0xe8480
mulsd %xmm2, %xmm3
addsd 0x60(%r10), %xmm3
movsd %xmm3, 0x60(%r10)
mulsd (%rax,%rdi,8), %xmm0
addsd (%rbp,%rdx,8), %xmm0
mulsd 0x7f941(%rip), %xmm7    # 0x1094c0
mulsd 0x60(%r10), %xmm7
addsd %xmm0, %xmm7
movslq 0x18(%r10), %rcx
movsd %xmm7, (%rax,%rcx,8)
cmpw $0x0, 0x844(%r13)
jne 0x89cb7
cmpw $0x1, 0x87c(%r13)
jne 0x89bf4
movq 0x30(%r10), %rax
movq 0x18(%rsp), %rdx
movslq 0x380(%rdx), %rcx
movsd (%rax,%rcx,8), %xmm0
mulsd 0x5cb7f(%rip), %xmm0    # 0xe6748
movslq 0x384(%rdx), %rcx
mulsd (%rax,%rcx,8), %xmm0
mulsd 0x108(%r10), %xmm0
divsd %xmm6, %xmm0
addsd 0x100(%r10), %xmm0
movsd %xmm0, 0x100(%r10)
cmpw $0x1, 0x87e(%r13)
jne 0x89c47
movq 0x30(%r10), %rax
movq 0x18(%rsp), %rdx
movslq 0x380(%rdx), %rcx
movsd (%rax,%rcx,8), %xmm0
mulsd 0x5cb2c(%rip), %xmm0    # 0xe6748
movslq 0x384(%rdx), %rcx
mulsd (%rax,%rcx,8), %xmm0
mulsd 0x118(%r10), %xmm0
divsd %xmm6, %xmm0
addsd 0x110(%r10), %xmm0
movsd %xmm0, 0x110(%r10)
cmpw $0x1, 0x898(%r13)
jne 0x89c7f
cmpl $0x1, 0x83c(%r13)
jne 0x89c7f
movq 0x40(%r10), %rax
movslq 0x14(%r10), %rcx
movsd (%rax,%rcx,8), %xmm0
mulsd %xmm6, %xmm0
addsd 0x108(%r10), %xmm0
movsd %xmm0, 0x108(%r10)
cmpw $0x1, 0x89a(%r13)
jne 0x89cb7
cmpl $0x1, 0x83c(%r13)
jne 0x89cb7
movq 0x40(%r10), %rax
movslq 0x14(%r10), %rcx
movsd (%rax,%rcx,8), %xmm0
mulsd %xmm6, %xmm0
addsd 0x118(%r10), %xmm0
movsd %xmm0, 0x118(%r10)
cmpw $0x1, 0x10(%r13)
jne 0x89d31
cmpl %r12d, 0x850(%r13)
jne 0x89d31
movl 0x83c(%r13), %eax
cmpl $0x1, %eax
je 0x89ce6
testl %eax, %eax
jne 0x89d31
movl $0xdc, %ecx
addq 0x48(%r10), %rcx
pushq $0x20
popq %rax
jmp 0x89cf6
movl $0xd8, %ecx
addq 0x48(%r10), %rcx
pushq $0x24
popq %rax
movapd %xmm6, %xmm5
movsd 0x5ca3a(%rip), %xmm0    # 0xe6738
mulsd %xmm1, %xmm0
movsd 0x80(%r10), %xmm2
mulsd 0x5e72d(%rip), %xmm2    # 0xe8440
movslq (%rcx), %rcx
divsd %xmm5, %xmm2
mulsd (%rbp,%rcx,8), %xmm0
addsd %xmm2, %xmm0
movq 0x40(%r10), %rcx
movslq (%r10,%rax), %rax
movsd %xmm0, (%rcx,%rax,8)
xorl %eax, %eax
cmpw $0x1, 0x12(%r13)
jne 0x89d96
cmpl %r12d, 0x84c(%r13)
jne 0x89d96
mulsd 0x5c9ec(%rip), %xmm1    # 0xe6738
movq 0x40(%r10), %rcx
movq 0x48(%r10), %rdx
movq 0x18(%rsp), %rsi
movsd 0x318(%rsi), %xmm0
addsd %xmm0, %xmm0
addsd %xmm6, %xmm0
movslq 0xe0(%rdx), %rsi
mulsd (%rbp,%rsi,8), %xmm0
movslq 0xe4(%rdx), %rdx
mulsd (%rbp,%rdx,8), %xmm1
subsd %xmm0, %xmm1
addsd 0x78(%r10), %xmm1
movslq 0x1c(%r10), %rdx
movsd %xmm1, (%rcx,%rdx,8)
addq $0x868, %rsp            # imm = 0x868
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq