// File: /workspace/github_c_makefile_star2_O1/PoulinV[P]AxiCLASS/build/../source/thermodynamics.c
// Function: thermodynamics_derivs
int thermodynamics_derivs(
                          double mz,
                          double * y,
                          double * dy,
                          void * parameters_and_workspace,
                          ErrorMsg error_message
                          ) {
  /** Summary: */

  /** Define local variables */
  /* Index for iterating over derivatives */
  int index_ti;

  /* Shorthand notations */
  double z,x,nH,Trad,Tmat,x_H,x_He,Hz,eps,depsdlna,dHdlna,heat_capacity,rate_gamma_b;

  /* Baryon molecular weight */
  double mu_bar;

  /* Shorthand notations for all of the structs */
  struct thermodynamics_parameters_and_workspace * ptpaw;
  struct precision * ppr;
  struct background * pba;
  struct thermodynamics * pth;
  double * pvecback;
  struct thermo_workspace * ptw;
  struct thermo_diffeq_workspace * ptdw;
  struct thermo_vector * ptv;
  struct thermorecfast * precfast;
  struct injection * pin;
  int ap_current;

  /* varying fundamental constants */
  double alpha = 1., me = 1., rescale_rate = 1.;

  /* Redshift */
  z = -mz;

  /** - Rename structure fields (just to avoid heavy notations) */

  /* structures */
  ptpaw = parameters_and_workspace;
  ppr = ptpaw->ppr;
  pba = ptpaw->pba;
  pth = ptpaw->pth;
  pin = &(pth->in);
  /* vector of background quantities */
  pvecback = ptpaw->pvecback;
  /* thermodynamics workspace & vector */
  ptw = ptpaw->ptw;
  ptdw = ptw->ptdw;
  ptv = ptdw->ptv;
  /* pointer to Recfast/HyRec wrappers */
  precfast = ptdw->precfast;
  /* Approximation flag */
  ap_current = ptdw->ap_current;

  /** - Get background/thermo quantities in this point */

  class_call(background_at_z(pba,
                             z,
                             long_info,
                             inter_closeby,
                             &(ptw->last_index_back),
                             pvecback),
             pba->error_message,
             error_message);

  /* Hz is H in inverse seconds (while pvecback returns [H0/c] in inverse Mpcs) */
  Hz = pvecback[pba->index_bg_H] * _c_ / _Mpc_over_m_;

  /* Total number density of Hydrogen nuclei in SI units */
  nH = ptw->SIunit_nH0 * (1.+z) * (1.+z) * (1.+z);

  /* Photon temperature in Kelvins. Modify this for some non-trivial photon temperature changes */
  Trad = ptw->Tcmb * (1.+z);

  /** Set Tmat from the evolver (it is always evolved) and store it in the workspace. */
  Tmat = y[ptv->index_ti_D_Tmat] + ptw->Tcmb*(1.+z);

  /* For varying fundamental constants (according to 1705.03925) */
  if (pth->has_varconst == _TRUE_) {
    alpha = pvecback[pba->index_bg_varc_alpha];
    me = pvecback[pba->index_bg_varc_me];
    rescale_rate = alpha*alpha/me/me/me;
  }

  /** - The input vector y contains thermodynamic variables like
      (Tmat, x_H,x_He).  The goal of this function is: 1) Depending on
      the chosen code and current approximation, to use either
      analytical approximations or the vector y to calculate x_e; 2) To
      compute re-ionization effects on x_e; The output of this function
      is stored in the workspace ptdw */

  class_call(thermodynamics_ionization_fractions(z,y,pba,pth,ptw,ap_current),
             pth->error_message,
             error_message);

  /* Save the output in local variables */
  x = ptdw->x_reio;

  /** - If needed, calculate heating effects (i.e. any possible energy deposition rates
      affecting the evolution equations for x and Tmat) */

  if (pth->has_exotic_injection == _TRUE_) {
    /* In case of energy injection, we currently neglect the contribution to helium ionization for RecFast ! */
    /* Note that we calculate here the energy injection INCLUDING reionization ! */
    class_call(injection_calculate_at_z(pba,pth,x,z,Tmat,pvecback),
               pin->error_message,
               error_message);
  }

  /** - Derivative of the ionization fractions */
  x_H = ptdw->x_H;
  x_He = ptdw->x_He;
  x = ptdw->x_noreio;
  switch (pth->recombination) {

    /** --> use Recfast or HyRec to get the derivatives d(x_H)/dz and
        d(x_He)/dz, and store the result directly in the vector
        dy. This gives the derivative of the ionization fractions from
        recombination only (not from reionization). Of course, the
        full treatment would involve the actual evolution equations
        for x_H and x_He during reionization, but these are not yet
        fully implemented. */
  case recfast:
    precfast->fsR = alpha; /**< Pass value of fsR = relative alpha (fine-structure) */
    precfast->meR = me;    /**< Pass value of meR = relative m_e (effective eletron mass) */
    /* Hydrogen equations */
    if (ptdw->require_H == _TRUE_) {
      class_call(recfast_dx_H_dz(pth,precfast,x_H,x,nH,z,Hz,Tmat,Trad,&(dy[ptv->index_ti_x_H])),
                 precfast->error_message,
                 error_message);
    }

    /* Helium equations */
    if (ptdw->require_He == _TRUE_) {
      class_call(recfast_dx_He_dz(pth,precfast,x_He,x,x_H,nH,z,Hz,Tmat,Trad,&(dy[ptv->index_ti_x_He])),
                 precfast->error_message,
                 error_message);
    }

    break;
  case hyrec:
    /* Hydrogen equations */
    if (ptdw->require_H == _TRUE_) {
      class_call(hyrec_dx_H_dz(pth,ptw->ptdw->phyrec,x_H,x_He,x,nH,z,Hz,Tmat,Trad,alpha,me,&(dy[ptv->index_ti_x_H])),
                 ptw->ptdw->phyrec->error_message,
                 error_message);
    }

    /* Helium equations */
    if (ptdw->require_He == _TRUE_) {
      class_call(hyrec_dx_He_dz(pth,ptw->ptdw->phyrec,x_H,x_He,x,nH,z,Hz,Tmat,Trad,alpha,me,&(dy[ptv->index_ti_x_He])),
                 ptw->ptdw->phyrec->error_message,
                 error_message);
    }
    break;
  }

  /** - Derivative of the matter temperature (relevant for both Recfast and HyRec cases) */

  /* Restore the real x for the temperature equations. */
  x = ptdw->x_reio;

  /** - Calculate quantities for interacting dark matter */
  if (pba->has_idm == _TRUE_ || pba->has_idr == _TRUE_) {
    class_call(thermodynamics_idm_quantities(pba, z, y, dy, pth, ptw, pvecback),
               pth->error_message,
               pth->error_message);
  }

  /* Using the following definitions and equations, we derive a few important quantities
     Using n_e = x * n_H, n_He = f * n_H, rho_He ~ YHe * rho_b, rho_H ~ (1-YHe)*rho_b)
     - Heat capacity of the IGM
     heat_capacity = (3/2)*k_B*(n_H+n_He+n_e) = (3/2)*k_B*(1+f+x)*n_H
     - Mean baryonic molecular mass
     mu_bar = (rho_H + rho_He + rho_e)/(n_H + n_He + n_e) ~ ( (1. + YHe/(1+YHe) + 0.) * rho_H )/( (1. + f + x) * n_H) = m_H / (1+x+f) /(1-YHe)
     - Photon-baryon momentum transfer rate
     R_g = (4/3 * rho_g/rho_b) * (sigma_T * n_e) = (4/3 * rho_g * sigma_T ) * x * (1-YHe)/m_H
     - Photon-Baryon interaction rate:
     rate_gamma_b = 2 * mu_bar / m_e * R_g =  2 * (sigma_T/m_e) * (4/3 * rho_g) * x / (1. + f + x)
  */
  /* Photon-Baryon temperature change rate  */
  rate_gamma_b = ( 2. * _sigma_/_m_e_/_c_ ) * ( 4./3. * pvecback[pba->index_bg_rho_g] * _Jm3_over_Mpc2_ ) * x / (1.+x+ptw->fHe);
  if (pth->has_varconst == _TRUE_) {
    rate_gamma_b *= rescale_rate;
  }

  /* Heat capacity of the IGM */
  heat_capacity = (3./2.)*_k_B_*nH*(1.+ptw->fHe+x);

  /*
   * A note on the temperature definition:
   *
   * All equations work with D_Tmat = Tmat - Trad
   *
   * Thus all derivatives are calculated as dD_Tmat/dz = dTmat/dz - Tcmb
   **/

  /*
   * A note on the 'early' time steady state expansion (activated here before HeIII recombination):
   *
   * Note: dTr/dz = Tr/(1+z) = Tcmb
   *
   * The early system of CMB and matter is very tightly coupled anyway, so we can expand in the following way:
   * The full equation is dTm/dz = (Tm-Tr)/e /(1+z) + 2 Tm/(1+z). Here e = H*(1+x+f)/(cT*Tr^4*x) << 1 at early times
   *
   * Find the first order solution in e, by multiplying in (1+z)*e, and approximate
   *  e*(dTm/dz)*(1+z) ~ e*(dTr/dz)*(1+z) + O(e^2) ~ e * Tr
   *
   * You find e*Tr = (Tm-Tr) + 2 Tm * e
   * Thus Tm = (1+e)/(1+2*e) * Tr = Tr * (1-e) + O(e^2)
   *
   * This is the steady state solution, which is the SAME as e.g. in HyRec
   * In our notation, eps = e*Tr, so we get Tm = Tr - eps
   *
   * So, taking the derivative of the right hand side, we obtain dTm/dz = Tcmb - eps*(dln(eps)/dz)
   *
   * Now use the form of eps = Tr*e = H*(1+x+f)/(cT*Tr^3*x) to derive the remaining terms in the below formula
   * => dln(eps)/dlna = dln(H)/dlna  - (1+f)/(1+x+f)*dln(x)/dlna + 3*dln(Tr)/dlna
   *
   * We also approximate dln(x)/dlna << 1, since we are before HeIII recombination, thus finding
   * => dln(eps)/dlna ~ dln(H)/dlna + 3
   *
   * dD_Tmat/dz = d(-eps)/dz = - eps * dln(eps)/dz = eps *dln(eps)/dlna /(1.+z)
   **/

  if ( ap_current == ptdw->index_ap_brec || (ptw->has_ap_idmtca == _TRUE_ && ap_current == ptdw->index_ap_idmtca)) {
    /* Early time steady state equation */
    dHdlna = (1.+z)*pvecback[pba->index_bg_H_prime]/pvecback[pba->index_bg_H] * _c_ / _Mpc_over_m_;
    eps =  Trad * Hz / rate_gamma_b;
    depsdlna = dHdlna/Hz + 3.;
    /* Recfast v 1.5: add here a smoothing term as suggested by Adam Moss */
    dy[ptdw->ptv->index_ti_D_Tmat] = eps * depsdlna / (1.+z);
  }

  else {
    /* Full equations at later times */
    dy[ptv->index_ti_D_Tmat] =
      + 2.*Tmat/(1.+z)                                                          /* Adiabatic expansion */
      + rate_gamma_b * (Tmat-Trad) / (Hz*(1.+z))                                /* Coupling to photons*/
      - ptw->Tcmb;                                                              /* dTrad/dz */

    /* Add heating from energy injection */
    if (pth->has_exotic_injection == _TRUE_) {
      dy[ptv->index_ti_D_Tmat] -= pin->pvecdeposition[pin->index_dep_heat] / heat_capacity / (Hz*(1.+z));
    }
    /* Add term coming from idm_b */
    if (pth->has_idm_b == _TRUE_){
      mu_bar = _m_H_ / (1. + x + ptw->fHe) / (1. - pth->YHe); //In units of kg
      dy[ptv->index_ti_D_Tmat] += 2.* pvecback[pba->index_bg_rho_idm]/pvecback[pba->index_bg_rho_b]
        * mu_bar/(pth->m_idm*_eV_/_c_/_c_ + _m_p_)
        * ptdw->R_idm_b*(Tmat-ptdw->T_idm) / (pvecback[pba->index_bg_a]*pvecback[pba->index_bg_H]*(1.+z));
    }
  }

  /** - Derivative of the Dark Matter temperature */
  if (pba->has_idm == _TRUE_ && !(ptw->has_ap_idmtca == _TRUE_ && ap_current == ptdw->index_ap_idmtca)) {
    dy[ptv->index_ti_T_idm] = - ptdw->T_idm_prime; // the negative sign will be negated at the end
  }

  /** - If we have extreme heatings, recombination does not fully happen
   * and/or re-ionization happens before a redshift of
   * reionization_z_start_max (default = 50).  We want to catch this
   * unphysical regime, because it would lead to further errors
   * (and/or unphysical calculations) within our recombination codes
   */

  class_test((x>1.0) && (z < ppr->z_end_reco_test) && (z > ppr->reionization_z_start_max),
             error_message,
             "At redshift %.5g : Recombination did not complete by redshift %.5g, or re-ionization happened before %.5g.\nIf this is a desired behavior, please adjust z_end_reco_test and/or reionization_z_start_max.",
             z,ppr->z_end_reco_test,ppr->reionization_z_start_max);

  /** - invert all derivatives (because the evolver evolves with -z, not with +z) */

  for (index_ti=0;index_ti<ptdw->ptv->ti_size;index_ti++) {
    dy[index_ti]=-dy[index_ti];
  }

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10d8, %rsp           # imm = 0x10D8
movq %rcx, %rbp
movq %rsi, 0x20(%rsp)
movq %rdi, 0x68(%rsp)
movapd %xmm0, %xmm1
movapd 0x81f33(%rip), %xmm0    # 0xf1230
movapd %xmm1, 0x40(%rsp)
xorpd %xmm1, %xmm0
movq (%rdx), %rbx
movq 0x8(%rdx), %rax
movq %rax, 0xa0(%rsp)
movq 0x10(%rdx), %r13
movq 0x20(%rdx), %r8
movq 0x18(%rdx), %r12
movq 0x80(%r12), %rax
movq 0xb8(%rax), %r14
movq 0xc8(%rax), %rcx
movq %rcx, 0x60(%rsp)
movq %rax, 0xc8(%rsp)
movl 0x90(%rax), %eax
movl %eax, 0xac(%rsp)
leaq 0x78(%r12), %rcx
movq %rbx, %rdi
movapd %xmm0, 0x70(%rsp)
movl $0x2, %esi
movl $0x1, %edx
movq %r8, %r15
callq 0x5ea8c
cmpl $0x1, %eax
jne 0x6f3bc
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8206b(%rip), %rsi     # 0xf13f0
leaq 0xa3b83(%rip), %rdx     # 0x112f0f
leaq 0xd0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x81c8c(%rip), %rsi     # 0xf1034
leaq 0xa3bb5(%rip), %rdx     # 0x112f64
movq %rbp, %rdi
movl $0xa1f, %ecx            # imm = 0xA1F
jmp 0x6f4f0
movq %rbp, 0x18(%rsp)
movslq 0x384(%rbx), %rax
movsd 0x81e90(%rip), %xmm3    # 0xf1260
movapd %xmm3, %xmm1
subsd 0x40(%rsp), %xmm1
movsd 0x38(%r12), %xmm2
mulsd %xmm1, %xmm2
movslq 0xc(%r14), %rsi
cmpw $0x1, 0xe78(%r13)
movapd %xmm3, %xmm4
movapd %xmm3, %xmm0
movq %r12, %rbp
movq %r15, %r12
movq %r13, %r15
jne 0x6f433
movslq 0x42c(%rbx), %rdi
movsd (%r12,%rdi,8), %xmm3
movslq 0x430(%rbx), %rdi
movsd (%r12,%rdi,8), %xmm4
movapd %xmm3, %xmm0
mulsd %xmm3, %xmm0
divsd %xmm4, %xmm0
divsd %xmm4, %xmm0
divsd %xmm4, %xmm0
movsd %xmm4, 0x90(%rsp)
movsd %xmm3, 0x98(%rsp)
movsd %xmm0, 0xc0(%rsp)
movsd (%r12,%rax,8), %xmm0
movaps %xmm0, 0x40(%rsp)
movsd 0x30(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rsp)
movq 0x68(%rsp), %rdi
movsd (%rdi,%rsi,8), %xmm0
addsd %xmm2, %xmm0
movsd %xmm0, 0x10(%rsp)
movapd 0x70(%rsp), %xmm0
movq %rbx, %rsi
movq %r15, %rdx
movq %rbp, %rcx
movl 0xac(%rsp), %r13d
movl %r13d, %r8d
movsd %xmm1, 0x30(%rsp)
movapd %xmm2, 0xb0(%rsp)
callq 0x72949
testl %eax, %eax
je 0x6f511
addq $0x1064, %r15           # imm = 0x1064
leaq 0x81f34(%rip), %rsi     # 0xf13f0
leaq 0xa3ab7(%rip), %rdx     # 0x112f7a
leaq 0xd0(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x81b55(%rip), %rsi     # 0xf1034
leaq 0xa3a7e(%rip), %rdx     # 0x112f64
movq 0x18(%rsp), %rdi
movl $0xa3d, %ecx            # imm = 0xA3D
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
addq $0x10d8, %rsp           # imm = 0x10D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, 0x28(%rsp)
movq %rbx, %r14
cmpw $0x1, 0xb8(%r15)
movq 0xc8(%rsp), %rbx
jne 0x6f597
movsd 0x18(%rbx), %xmm0
movq %r14, %rdi
movq %r15, %rsi
movapd 0x70(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movq %r12, %rdx
callq 0xd4125
cmpl $0x1, %eax
jne 0x6f597
addq $0x630, %r15            # imm = 0x630
leaq 0x81e92(%rip), %rsi     # 0xf13f0
leaq 0xa3a55(%rip), %rdx     # 0x112fba
leaq 0xd0(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x81ab3(%rip), %rsi     # 0xf1034
leaq 0xa39dc(%rip), %rdx     # 0x112f64
movq 0x18(%rsp), %rdi
movl $0xa4a, %ecx            # imm = 0xA4A
jmp 0x6f4f0
movapd 0x40(%rsp), %xmm7
mulsd 0x8661b(%rip), %xmm7    # 0xf5bc0
movsd 0x30(%rsp), %xmm6
movsd 0x38(%rsp), %xmm2
mulsd %xmm6, %xmm2
divsd 0x864fb(%rip), %xmm7    # 0xf5ab8
mulsd %xmm6, %xmm2
movsd (%rbx), %xmm3
movsd 0x8(%rbx), %xmm1
movsd 0x10(%rbx), %xmm4
movl 0x10(%r15), %eax
cmpl $0x1, %eax
movsd %xmm2, 0x38(%rsp)
movapd %xmm7, 0x40(%rsp)
je 0x6f6f9
testl %eax, %eax
movq 0x20(%rsp), %r8
movq %rbp, %r11
jne 0x6f9aa
movq 0x60(%rsp), %rsi
movsd 0x98(%rsp), %xmm0
movsd %xmm0, 0x120(%rsi)
movsd 0x90(%rsp), %xmm0
movsd %xmm0, 0x128(%rsi)
cmpl $0x1, 0xb0(%rbx)
jne 0x6f815
movq 0x28(%rsp), %rax
movslq 0x4(%rax), %rax
leaq (%r8,%rax,8), %rdx
movq %r15, %rdi
movapd %xmm3, %xmm0
movsd %xmm1, 0x58(%rsp)
movapd %xmm4, %xmm1
movsd %xmm3, 0x88(%rsp)
movaps 0x70(%rsp), %xmm3
movsd %xmm4, 0x80(%rsp)
movapd %xmm7, %xmm4
movsd 0x10(%rsp), %xmm5
movaps 0xb0(%rsp), %xmm6
callq 0xd1449
movsd 0x58(%rsp), %xmm1
movsd 0x80(%rsp), %xmm4
movsd 0x88(%rsp), %xmm3
movq 0x60(%rsp), %r9
movapd 0x40(%rsp), %xmm7
movsd 0x30(%rsp), %xmm6
movq %rbp, %r11
movq 0x20(%rsp), %r8
cmpl $0x1, %eax
jne 0x6f815
addq $0x134, %r9             # imm = 0x134
leaq 0x81d30(%rip), %rsi     # 0xf13f0
leaq 0xa3927(%rip), %rdx     # 0x112fee
leaq 0xd0(%rsp), %rbx
movq %rbx, %rdi
movq %r9, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x81951(%rip), %rsi     # 0xf1034
leaq 0xa387a(%rip), %rdx     # 0x112f64
movq 0x18(%rsp), %rdi
movl $0xa61, %ecx            # imm = 0xA61
jmp 0x6f9a2
cmpl $0x1, 0xb0(%rbx)
movq 0x20(%rsp), %r8
movq %rbp, %r11
jne 0x6f8cc
movq 0x80(%r11), %rax
movq 0xc0(%rax), %rsi
movq 0x28(%rsp), %rax
movslq 0x4(%rax), %rax
leaq (%r8,%rax,8), %rdx
movsd 0x90(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x98(%rsp), %xmm0
movsd %xmm0, (%rsp)
movq %r15, %rdi
movapd %xmm3, %xmm0
movsd %xmm1, 0x58(%rsp)
movsd 0x58(%rsp), %xmm1
movapd %xmm4, %xmm2
movsd %xmm3, 0x88(%rsp)
movsd 0x38(%rsp), %xmm3
movsd %xmm4, 0x80(%rsp)
movaps 0x70(%rsp), %xmm4
movapd %xmm7, %xmm5
movsd 0x10(%rsp), %xmm6
movaps 0xb0(%rsp), %xmm7
callq 0xdfbad
movsd 0x58(%rsp), %xmm1
movsd 0x80(%rsp), %xmm4
movsd 0x88(%rsp), %xmm3
movapd 0x40(%rsp), %xmm7
movsd 0x30(%rsp), %xmm6
movq %rbp, %r11
movq 0x20(%rsp), %r8
cmpl $0x1, %eax
jne 0x6f8cc
movq 0x80(%r11), %rax
movq 0xc0(%rax), %rcx
addq $0x20, %rcx
leaq 0x81c11(%rip), %rsi     # 0xf13f0
leaq 0xa38ad(%rip), %rdx     # 0x113093
leaq 0xd0(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x81835(%rip), %rsi     # 0xf1034
leaq 0xa375e(%rip), %rdx     # 0x112f64
movq 0x18(%rsp), %rdi
movl $0xa71, %ecx            # imm = 0xA71
jmp 0x6f9a2
cmpl $0x1, 0xb4(%rbx)
jne 0x6f9aa
movq 0x28(%rsp), %rax
movslq 0x8(%rax), %rax
leaq (%r8,%rax,8), %rdx
movq %r15, %rdi
movq 0x60(%rsp), %rsi
movapd %xmm1, %xmm0
movapd %xmm4, %xmm1
movapd %xmm3, %xmm2
movsd 0x38(%rsp), %xmm3
movapd 0x70(%rsp), %xmm4
movapd %xmm7, %xmm5
movsd 0x10(%rsp), %xmm6
movaps 0xb0(%rsp), %xmm7
callq 0xd1982
movapd 0x40(%rsp), %xmm7
movsd 0x30(%rsp), %xmm6
movq %rbp, %r11
movq 0x20(%rsp), %r8
cmpl $0x1, %eax
jne 0x6f9aa
movq 0x60(%rsp), %rcx
addq $0x134, %rcx            # imm = 0x134
leaq 0x81b5a(%rip), %rsi     # 0xf13f0
leaq 0xa37a0(%rip), %rdx     # 0x11303d
leaq 0xd0(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x8177e(%rip), %rsi     # 0xf1034
leaq 0xa36a7(%rip), %rdx     # 0x112f64
movq 0x18(%rsp), %rdi
movl $0xa68, %ecx            # imm = 0xA68
jmp 0x6f9a2
cmpl $0x1, 0xb4(%rbx)
jne 0x6f9aa
movq 0x80(%r11), %rax
movq 0xc0(%rax), %rsi
movq 0x28(%rsp), %rax
movslq 0x8(%rax), %rax
leaq (%r8,%rax,8), %rdx
movsd 0x90(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x98(%rsp), %xmm0
movsd %xmm0, (%rsp)
movq %r15, %rdi
movapd %xmm3, %xmm0
movapd %xmm4, %xmm2
movsd 0x38(%rsp), %xmm3
movapd 0x70(%rsp), %xmm4
movapd %xmm7, %xmm5
movsd 0x10(%rsp), %xmm6
movaps 0xb0(%rsp), %xmm7
callq 0xdfd99
movapd 0x40(%rsp), %xmm7
movsd 0x30(%rsp), %xmm6
movq %rbp, %r11
movq 0x20(%rsp), %r8
cmpl $0x1, %eax
jne 0x6f9aa
movq 0x80(%r11), %rax
movq 0xc0(%rax), %rcx
addq $0x20, %rcx
leaq 0x81a7f(%rip), %rsi     # 0xf13f0
leaq 0xa377f(%rip), %rdx     # 0x1130f7
leaq 0xd0(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x816a3(%rip), %rsi     # 0xf1034
leaq 0xa35cc(%rip), %rdx     # 0x112f64
movq 0x18(%rsp), %rdi
movl $0xa78, %ecx            # imm = 0xA78
movq %rbx, %r8
jmp 0x6f4f3
movsd 0x18(%rbx), %xmm8
movq %r14, %rdi
cmpw $0x1, 0x4b6(%r14)
je 0x6f9c8
cmpw $0x1, 0x4c6(%rdi)
jne 0x6fa06
movapd 0x70(%rsp), %xmm0
movq 0x68(%rsp), %rsi
movq %r15, %rcx
movq %rbp, %r8
movq %r12, %r9
movsd %xmm8, 0x68(%rsp)
callq 0x730ca
movsd 0x68(%rsp), %xmm8
movapd 0x40(%rsp), %xmm7
movsd 0x30(%rsp), %xmm6
movq %r14, %rdi
movq %rbp, %r11
movq 0x20(%rsp), %r8
movslq 0x38c(%rdi), %rax
movsd (%r12,%rax,8), %xmm2
mulsd 0x84a95(%rip), %xmm2    # 0xf44b0
mulsd 0xa0cbd(%rip), %xmm2    # 0x1106e0
mulsd 0xa0cbd(%rip), %xmm2    # 0x1106e8
mulsd %xmm8, %xmm2
movsd 0x81828(%rip), %xmm0    # 0xf1260
movapd %xmm8, %xmm1
addsd %xmm0, %xmm1
movsd 0x20(%r11), %xmm3
movapd %xmm1, %xmm4
addsd %xmm3, %xmm4
divsd %xmm4, %xmm2
cmpw $0x1, 0xe78(%r15)
jne 0x6fa67
mulsd 0xc0(%rsp), %xmm2
movq 0x28(%rsp), %r10
movsd 0x10(%rsp), %xmm4
cmpl 0x74(%rbx), %r13d
jne 0x6faed
movslq 0x388(%rdi), %rax
movsd (%r12,%rax,8), %xmm0
mulsd %xmm6, %xmm0
movslq 0x384(%rdi), %rax
divsd (%r12,%rax,8), %xmm0
mulsd 0x86122(%rip), %xmm0    # 0xf5bc0
divsd 0x86012(%rip), %xmm0    # 0xf5ab8
movapd 0xb0(%rsp), %xmm1
mulsd %xmm7, %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
unpcklpd %xmm7, %xmm2            # xmm2 = xmm2[0],xmm7[0]
divpd %xmm2, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd 0x82bb1(%rip), %xmm0    # 0xf2680
mulsd %xmm1, %xmm0
divsd %xmm6, %xmm0
movq 0xb8(%rbx), %rax
movslq 0xc(%rax), %rax
movsd %xmm0, (%r8,%rax,8)
jmp 0x6fc44
cmpw $0x1, 0x60(%r11)
jne 0x6faff
cmpl 0x70(%rbx), %r13d
je 0x6fa78
movapd %xmm4, %xmm5
addsd %xmm4, %xmm5
divsd %xmm6, %xmm5
subsd 0xb0(%rsp), %xmm4
mulsd %xmm2, %xmm4
mulsd %xmm6, %xmm7
divsd %xmm7, %xmm4
addsd %xmm5, %xmm4
subsd 0x38(%r11), %xmm4
movslq 0xc(%r10), %rax
movsd %xmm4, (%r8,%rax,8)
cmpw $0x1, 0xb8(%r15)
jne 0x6fb80
movsd 0x38(%rsp), %xmm2
mulsd 0xa0ba3(%rip), %xmm2    # 0x1106f0
addsd %xmm0, %xmm3
addsd %xmm8, %xmm3
mulsd %xmm2, %xmm3
movq 0x610(%r15), %r9
movslq 0x5f8(%r15), %rdx
movsd (%r9,%rdx,8), %xmm2
divsd %xmm3, %xmm2
divsd %xmm7, %xmm2
subsd %xmm2, %xmm4
movsd %xmm4, (%r8,%rax,8)
cmpw $0x1, 0x34(%r15)
jne 0x6fc44
addsd 0x20(%r11), %xmm1
movsd 0xa0b5e(%rip), %xmm2    # 0x1106f8
divsd %xmm1, %xmm2
subsd (%r15), %xmm0
movslq 0x398(%rdi), %rdx
movsd (%r12,%rdx,8), %xmm1
addsd %xmm1, %xmm1
unpcklpd %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0]
movslq 0x390(%rdi), %rdx
movhpd (%r12,%rdx,8), %xmm0    # xmm0 = xmm0[0],mem[0]
divpd %xmm0, %xmm2
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
mulsd %xmm2, %xmm0
movsd 0x1010(%r15), %xmm1
mulsd 0x86032(%rip), %xmm1    # 0xf5c18
movsd 0x85fd2(%rip), %xmm2    # 0xf5bc0
divsd %xmm2, %xmm1
divsd %xmm2, %xmm1
addsd 0xa0b02(%rip), %xmm1    # 0x110700
divsd %xmm1, %xmm0
mulsd 0x30(%rbx), %xmm0
movsd 0x10(%rsp), %xmm1
subsd 0x38(%rbx), %xmm1
mulsd %xmm0, %xmm1
movslq 0x380(%rdi), %rcx
movsd (%r12,%rcx,8), %xmm0
movslq 0x384(%rdi), %rcx
mulsd (%r12,%rcx,8), %xmm0
mulsd %xmm0, %xmm6
divsd %xmm6, %xmm1
addsd (%r8,%rax,8), %xmm1
movsd %xmm1, (%r8,%rax,8)
cmpw $0x1, 0x4b6(%rdi)
movapd 0x70(%rsp), %xmm0
jne 0x6fc79
cmpw $0x1, 0x60(%r11)
jne 0x6fc62
cmpl 0x70(%rbx), %r13d
je 0x6fc79
movsd 0x40(%rbx), %xmm1
xorpd 0x815c1(%rip), %xmm1    # 0xf1230
movslq 0x10(%r10), %rax
movlpd %xmm1, (%r8,%rax,8)
ucomisd 0x815de(%rip), %xmm8    # 0xf1260
movq 0x18(%rsp), %rbp
jbe 0x6fd28
movq 0xa0(%rsp), %rax
movsd 0x1d0(%rax), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x6fd28
movq 0xa0(%rsp), %rax
ucomisd 0x3e8(%rax), %xmm0
jbe 0x6fd28
movq 0xa0(%rsp), %rax
movsd 0x1d0(%rax), %xmm1
movsd 0x3e8(%rax), %xmm2
leaq 0xa3485(%rip), %rsi     # 0x11315d
leaq 0xd0(%rsp), %rbx
movq %rbx, %rdi
movb $0x3, %al
callq 0x30c2c
leaq 0x81391(%rip), %rsi     # 0xf1082
leaq 0xa352e(%rip), %rdx     # 0x113226
leaq 0x8d0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x81320(%rip), %rsi     # 0xf1034
leaq 0xa3249(%rip), %rdx     # 0x112f64
movq %rbp, %rdi
movl $0xaed, %ecx            # imm = 0xAED
jmp 0x6f4f0
movq 0xb8(%rbx), %rax
movslq (%rax), %rdx
xorl %eax, %eax
testq %rdx, %rdx
jle 0x6f4ff
movapd 0x814eb(%rip), %xmm0    # 0xf1230
xorl %ecx, %ecx
movsd (%r8,%rcx,8), %xmm1
xorpd %xmm0, %xmm1
movlpd %xmm1, (%r8,%rcx,8)
incq %rcx
cmpq %rcx, %rdx
jne 0x6fd47
jmp 0x6f4ff