// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x5138, %rsp           # imm = 0x5138
movsd %xmm0, 0x5128(%rsp)
movq %rdi, 0x5120(%rsp)
movq %rsi, 0x5118(%rsp)
movq %rdx, 0x5110(%rsp)
movq %rcx, 0x5108(%rsp)
movsd 0x114770(%rip), %xmm0   # 0x1d2248
movsd %xmm0, 0x5030(%rsp)
movsd 0x11475f(%rip), %xmm0   # 0x1d2248
movsd %xmm0, 0x5028(%rsp)
movsd 0x11474e(%rip), %xmm0   # 0x1d2248
movsd %xmm0, 0x5020(%rsp)
movsd 0x5128(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x50f8(%rsp)
movq 0x5110(%rsp), %rax
movq %rax, 0x5088(%rsp)
movq 0x5088(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x5080(%rsp)
movq 0x5088(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x5078(%rsp)
movq 0x5088(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x5070(%rsp)
movq 0x5070(%rsp), %rax
addq $0xc0, %rax
movq %rax, 0x5040(%rsp)
movq 0x5088(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x5068(%rsp)
movq 0x5088(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x5060(%rsp)
movq 0x5060(%rsp), %rax
movq 0x80(%rax), %rax
movq %rax, 0x5058(%rsp)
movq 0x5058(%rsp), %rax
movq 0xb8(%rax), %rax
movq %rax, 0x5050(%rsp)
movq 0x5058(%rsp), %rax
movq 0xc8(%rax), %rax
movq %rax, 0x5048(%rsp)
movq 0x5058(%rsp), %rax
movl 0x90(%rax), %eax
movl %eax, 0x503c(%rsp)
movq 0x5078(%rsp), %rdi
movsd 0x50f8(%rsp), %xmm0
movq 0x5060(%rsp), %rcx
addq $0x78, %rcx
movq 0x5068(%rsp), %r8
movl $0x2, %esi
movl $0x1, %edx
callq 0x9e4b0
cmpl $0x1, %eax
jne 0xbdcae
leaq 0x4820(%rsp), %rdi
movq 0x5078(%rsp), %rcx
addq $0xd1c, %rcx            # imm = 0xD1C
leaq 0x114772(%rip), %rsi    # 0x1d23d8
leaq 0x1361aa(%rip), %rdx    # 0x1f3e17
movb $0x0, %al
callq 0x5b9c0
movq 0x5108(%rsp), %rdi
leaq 0x4820(%rsp), %r8
leaq 0x1143a9(%rip), %rsi    # 0x1d2034
leaq 0x1361da(%rip), %rdx    # 0x1f3e6c
movl $0xa1f, %ecx            # imm = 0xA1F
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5134(%rsp)
jmp 0xbec45
movq 0x5068(%rsp), %rax
movq 0x5078(%rsp), %rcx
movslq 0x384(%rcx), %rcx
movsd 0x118963(%rip), %xmm0   # 0x1d6630
mulsd (%rax,%rcx,8), %xmm0
movsd 0x118986(%rip), %xmm1   # 0x1d6660
divsd %xmm1, %xmm0
movsd %xmm0, 0x50c0(%rsp)
movq 0x5060(%rsp), %rax
movsd 0x30(%rax), %xmm0
movsd 0x11454c(%rip), %xmm1   # 0x1d2248
addsd 0x50f8(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x114537(%rip), %xmm1   # 0x1d2248
addsd 0x50f8(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x114522(%rip), %xmm1   # 0x1d2248
addsd 0x50f8(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x50e8(%rsp)
movq 0x5060(%rsp), %rax
movsd 0x38(%rax), %xmm0
movsd 0x1144f7(%rip), %xmm1   # 0x1d2248
addsd 0x50f8(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x50e0(%rsp)
movq 0x5120(%rsp), %rax
movq 0x5050(%rsp), %rcx
movslq 0xc(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm1
movq 0x5060(%rsp), %rax
movsd 0x38(%rax), %xmm0
movsd 0x1144b3(%rip), %xmm2   # 0x1d2248
addsd 0x50f8(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x50d8(%rsp)
movq 0x5070(%rsp), %rax
movswl 0xe78(%rax), %eax
cmpl $0x1, %eax
jne 0xbde47
movq 0x5068(%rsp), %rax
movq 0x5078(%rsp), %rcx
movslq 0x42c(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x5030(%rsp)
movq 0x5068(%rsp), %rax
movq 0x5078(%rsp), %rcx
movslq 0x430(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x5028(%rsp)
movsd 0x5030(%rsp), %xmm0
mulsd 0x5030(%rsp), %xmm0
divsd 0x5028(%rsp), %xmm0
divsd 0x5028(%rsp), %xmm0
divsd 0x5028(%rsp), %xmm0
movsd %xmm0, 0x5020(%rsp)
movsd 0x50f8(%rsp), %xmm0
movq 0x5120(%rsp), %rdi
movq 0x5078(%rsp), %rsi
movq 0x5070(%rsp), %rdx
movq 0x5060(%rsp), %rcx
movl 0x503c(%rsp), %r8d
callq 0xc4340
cmpl $0x1, %eax
jne 0xbdee8
leaq 0x4020(%rsp), %rdi
movq 0x5070(%rsp), %rcx
addq $0x1064, %rcx           # imm = 0x1064
leaq 0x114538(%rip), %rsi    # 0x1d23d8
leaq 0x135fdb(%rip), %rdx    # 0x1f3e82
movb $0x0, %al
callq 0x5b9c0
movq 0x5108(%rsp), %rdi
leaq 0x4020(%rsp), %r8
leaq 0x11416f(%rip), %rsi    # 0x1d2034
leaq 0x135fa0(%rip), %rdx    # 0x1f3e6c
movl $0xa3d, %ecx            # imm = 0xA3D
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5134(%rsp)
jmp 0xbec45
movq 0x5058(%rsp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x50f0(%rsp)
movq 0x5070(%rsp), %rax
movswl 0xb8(%rax), %eax
cmpl $0x1, %eax
jne 0xbdfbb
movq 0x5078(%rsp), %rdi
movq 0x5070(%rsp), %rsi
movsd 0x50f0(%rsp), %xmm0
movsd 0x50f8(%rsp), %xmm1
movsd 0x50d8(%rsp), %xmm2
movq 0x5068(%rsp), %rdx
callq 0x19fa60
cmpl $0x1, %eax
jne 0xbdfb9
leaq 0x3820(%rsp), %rdi
movq 0x5040(%rsp), %rcx
addq $0x570, %rcx            # imm = 0x570
leaq 0x114467(%rip), %rsi    # 0x1d23d8
leaq 0x135f4a(%rip), %rdx    # 0x1f3ec2
movb $0x0, %al
callq 0x5b9c0
movq 0x5108(%rsp), %rdi
leaq 0x3820(%rsp), %r8
leaq 0x11409e(%rip), %rsi    # 0x1d2034
leaq 0x135ecf(%rip), %rdx    # 0x1f3e6c
movl $0xa4a, %ecx            # imm = 0xA4A
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5134(%rsp)
jmp 0xbec45
jmp 0xbdfbb
movq 0x5058(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x50d0(%rsp)
movq 0x5058(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x50c8(%rsp)
movq 0x5058(%rsp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x50f0(%rsp)
movq 0x5070(%rsp), %rax
movl 0x10(%rax), %eax
movl %eax, 0x1c(%rsp)
testl %eax, %eax
je 0xbe023
jmp 0xbe011
movl 0x1c(%rsp), %eax
subl $0x1, %eax
je 0xbe245
jmp 0xbe4af
movsd 0x5030(%rsp), %xmm0
movq 0x5048(%rsp), %rax
movsd %xmm0, 0x120(%rax)
movsd 0x5028(%rsp), %xmm0
movq 0x5048(%rsp), %rax
movsd %xmm0, 0x128(%rax)
movq 0x5058(%rsp), %rax
cmpl $0x1, 0xb0(%rax)
jne 0xbe146
movq 0x5070(%rsp), %rdi
movq 0x5048(%rsp), %rsi
movsd 0x50d0(%rsp), %xmm0
movsd 0x50f0(%rsp), %xmm1
movsd 0x50e8(%rsp), %xmm2
movsd 0x50f8(%rsp), %xmm3
movsd 0x50c0(%rsp), %xmm4
movsd 0x50d8(%rsp), %xmm5
movsd 0x50e0(%rsp), %xmm6
movq 0x5118(%rsp), %rdx
movq 0x5050(%rsp), %rax
movslq 0x4(%rax), %rax
shlq $0x3, %rax
addq %rax, %rdx
callq 0x19a5e0
cmpl $0x1, %eax
jne 0xbe144
leaq 0x3020(%rsp), %rdi
movq 0x5048(%rsp), %rcx
addq $0x134, %rcx            # imm = 0x134
leaq 0x1142dc(%rip), %rsi    # 0x1d23d8
leaq 0x135df3(%rip), %rdx    # 0x1f3ef6
movb $0x0, %al
callq 0x5b9c0
movq 0x5108(%rsp), %rdi
leaq 0x3020(%rsp), %r8
leaq 0x113f13(%rip), %rsi    # 0x1d2034
leaq 0x135d44(%rip), %rdx    # 0x1f3e6c
movl $0xa61, %ecx            # imm = 0xA61
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5134(%rsp)
jmp 0xbec45
jmp 0xbe146
movq 0x5058(%rsp), %rax
cmpl $0x1, 0xb4(%rax)
jne 0xbe240
movq 0x5070(%rsp), %rdi
movq 0x5048(%rsp), %rsi
movsd 0x50c8(%rsp), %xmm0
movsd 0x50f0(%rsp), %xmm1
movsd 0x50d0(%rsp), %xmm2
movsd 0x50e8(%rsp), %xmm3
movsd 0x50f8(%rsp), %xmm4
movsd 0x50c0(%rsp), %xmm5
movsd 0x50d8(%rsp), %xmm6
movsd 0x50e0(%rsp), %xmm7
movq 0x5118(%rsp), %rdx
movq 0x5050(%rsp), %rax
movslq 0x8(%rax), %rax
shlq $0x3, %rax
addq %rax, %rdx
callq 0x19b040
cmpl $0x1, %eax
jne 0xbe23e
leaq 0x2820(%rsp), %rdi
movq 0x5048(%rsp), %rcx
addq $0x134, %rcx            # imm = 0x134
leaq 0x1141e2(%rip), %rsi    # 0x1d23d8
leaq 0x135d48(%rip), %rdx    # 0x1f3f45
movb $0x0, %al
callq 0x5b9c0
movq 0x5108(%rsp), %rdi
leaq 0x2820(%rsp), %r8
leaq 0x113e19(%rip), %rsi    # 0x1d2034
leaq 0x135c4a(%rip), %rdx    # 0x1f3e6c
movl $0xa68, %ecx            # imm = 0xA68
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5134(%rsp)
jmp 0xbec45
jmp 0xbe240
jmp 0xbe4af
movq 0x5058(%rsp), %rax
cmpl $0x1, 0xb0(%rax)
jne 0xbe379
movq 0x5070(%rsp), %rdi
movq 0x5060(%rsp), %rax
movq 0x80(%rax), %rax
movq 0xc0(%rax), %rsi
movsd 0x50d0(%rsp), %xmm0
movsd 0x50c8(%rsp), %xmm1
movsd 0x50f0(%rsp), %xmm2
movsd 0x50e8(%rsp), %xmm3
movsd 0x50f8(%rsp), %xmm4
movsd 0x50c0(%rsp), %xmm5
movsd 0x50d8(%rsp), %xmm6
movsd 0x50e0(%rsp), %xmm7
movsd 0x5030(%rsp), %xmm9
movsd 0x5028(%rsp), %xmm8
movq 0x5118(%rsp), %rdx
movq 0x5050(%rsp), %rax
movslq 0x4(%rax), %rax
shlq $0x3, %rax
addq %rax, %rdx
movsd %xmm9, (%rsp)
movsd %xmm8, 0x8(%rsp)
callq 0x1b3ad0
cmpl $0x1, %eax
jne 0xbe377
leaq 0x2020(%rsp), %rdi
movq 0x5060(%rsp), %rax
movq 0x80(%rax), %rax
movq 0xc0(%rax), %rcx
addq $0x20, %rcx
leaq 0x1140a9(%rip), %rsi    # 0x1d23d8
leaq 0x135c65(%rip), %rdx    # 0x1f3f9b
movb $0x0, %al
callq 0x5b9c0
movq 0x5108(%rsp), %rdi
leaq 0x2020(%rsp), %r8
leaq 0x113ce0(%rip), %rsi    # 0x1d2034
leaq 0x135b11(%rip), %rdx    # 0x1f3e6c
movl $0xa71, %ecx            # imm = 0xA71
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5134(%rsp)
jmp 0xbec45
jmp 0xbe379
movq 0x5058(%rsp), %rax
cmpl $0x1, 0xb4(%rax)
jne 0xbe4ad
movq 0x5070(%rsp), %rdi
movq 0x5060(%rsp), %rax
movq 0x80(%rax), %rax
movq 0xc0(%rax), %rsi
movsd 0x50d0(%rsp), %xmm0
movsd 0x50c8(%rsp), %xmm1
movsd 0x50f0(%rsp), %xmm2
movsd 0x50e8(%rsp), %xmm3
movsd 0x50f8(%rsp), %xmm4
movsd 0x50c0(%rsp), %xmm5
movsd 0x50d8(%rsp), %xmm6
movsd 0x50e0(%rsp), %xmm7
movsd 0x5030(%rsp), %xmm9
movsd 0x5028(%rsp), %xmm8
movq 0x5118(%rsp), %rdx
movq 0x5050(%rsp), %rax
movslq 0x8(%rax), %rax
shlq $0x3, %rax
addq %rax, %rdx
movsd %xmm9, (%rsp)
movsd %xmm8, 0x8(%rsp)
callq 0x1b3ee0
cmpl $0x1, %eax
jne 0xbe4ab
leaq 0x1820(%rsp), %rdi
movq 0x5060(%rsp), %rax
movq 0x80(%rax), %rax
movq 0xc0(%rax), %rcx
addq $0x20, %rcx
leaq 0x113f75(%rip), %rsi    # 0x1d23d8
leaq 0x135b95(%rip), %rdx    # 0x1f3fff
movb $0x0, %al
callq 0x5b9c0
movq 0x5108(%rsp), %rdi
leaq 0x1820(%rsp), %r8
leaq 0x113bac(%rip), %rsi    # 0x1d2034
leaq 0x1359dd(%rip), %rdx    # 0x1f3e6c
movl $0xa78, %ecx            # imm = 0xA78
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5134(%rsp)
jmp 0xbec45
jmp 0xbe4ad
jmp 0xbe4af
movq 0x5058(%rsp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x50f0(%rsp)
movq 0x5078(%rsp), %rax
movswl 0x4b6(%rax), %eax
cmpl $0x1, %eax
je 0xbe4f1
movq 0x5078(%rsp), %rax
movswl 0x4c6(%rax), %eax
cmpl $0x1, %eax
jne 0xbe5a3
movq 0x5078(%rsp), %rdi
movsd 0x50f8(%rsp), %xmm0
movq 0x5120(%rsp), %rsi
movq 0x5118(%rsp), %rdx
movq 0x5070(%rsp), %rcx
movq 0x5060(%rsp), %r8
movq 0x5068(%rsp), %r9
callq 0xc5260
cmpl $0x1, %eax
jne 0xbe5a1
leaq 0x1020(%rsp), %rdi
movq 0x5070(%rsp), %rcx
addq $0x1064, %rcx           # imm = 0x1064
leaq 0x113e86(%rip), %rsi    # 0x1d23d8
leaq 0x135b0c(%rip), %rdx    # 0x1f4065
movb $0x0, %al
callq 0x5b9c0
movq 0x5070(%rsp), %rdi
addq $0x1064, %rdi           # imm = 0x1064
leaq 0x1020(%rsp), %r8
leaq 0x113ab6(%rip), %rsi    # 0x1d2034
leaq 0x1358e7(%rip), %rdx    # 0x1f3e6c
movl $0xa86, %ecx            # imm = 0xA86
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5134(%rsp)
jmp 0xbec45
jmp 0xbe5a3
movq 0x5068(%rsp), %rax
movq 0x5078(%rsp), %rcx
movslq 0x38c(%rcx), %rcx
movsd 0x116f4e(%rip), %xmm1   # 0x1d5510
mulsd (%rax,%rcx,8), %xmm1
movsd 0x132f91(%rip), %xmm0   # 0x1f1560
mulsd %xmm0, %xmm1
movsd 0x132f7d(%rip), %xmm0   # 0x1f1558
mulsd %xmm1, %xmm0
mulsd 0x50f0(%rsp), %xmm0
movsd 0x113c58(%rip), %xmm1   # 0x1d2248
addsd 0x50f0(%rsp), %xmm1
movq 0x5060(%rsp), %rax
addsd 0x20(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x5098(%rsp)
movq 0x5070(%rsp), %rax
movswl 0xe78(%rax), %eax
cmpl $0x1, %eax
jne 0xbe642
movsd 0x5020(%rsp), %xmm0
mulsd 0x5098(%rsp), %xmm0
movsd %xmm0, 0x5098(%rsp)
movsd 0x132f1e(%rip), %xmm0   # 0x1f1568
mulsd 0x50e8(%rsp), %xmm0
movq 0x5060(%rsp), %rax
movsd 0x113be5(%rip), %xmm1   # 0x1d2248
addsd 0x20(%rax), %xmm1
addsd 0x50f0(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x50a0(%rsp)
movl 0x503c(%rsp), %eax
movq 0x5058(%rsp), %rcx
cmpl 0x74(%rcx), %eax
je 0xbe6bf
movq 0x5060(%rsp), %rax
movswl 0x60(%rax), %eax
cmpl $0x1, %eax
jne 0xbe7c0
movl 0x503c(%rsp), %eax
movq 0x5058(%rsp), %rcx
cmpl 0x70(%rcx), %eax
jne 0xbe7c0
movsd 0x113b81(%rip), %xmm0   # 0x1d2248
addsd 0x50f8(%rsp), %xmm0
movq 0x5068(%rsp), %rax
movq 0x5078(%rsp), %rcx
movslq 0x388(%rcx), %rcx
mulsd (%rax,%rcx,8), %xmm0
movq 0x5068(%rsp), %rax
movq 0x5078(%rsp), %rcx
movslq 0x384(%rcx), %rcx
divsd (%rax,%rcx,8), %xmm0
movsd 0x117f20(%rip), %xmm1   # 0x1d6630
mulsd %xmm1, %xmm0
movsd 0x117f44(%rip), %xmm1   # 0x1d6660
divsd %xmm1, %xmm0
movsd %xmm0, 0x50a8(%rsp)
movsd 0x50e0(%rsp), %xmm0
mulsd 0x50c0(%rsp), %xmm0
divsd 0x5098(%rsp), %xmm0
movsd %xmm0, 0x50b8(%rsp)
movsd 0x50a8(%rsp), %xmm0
divsd 0x50c0(%rsp), %xmm0
movsd 0x114f31(%rip), %xmm1   # 0x1d3698
addsd %xmm1, %xmm0
movsd %xmm0, 0x50b0(%rsp)
movsd 0x50b8(%rsp), %xmm0
mulsd 0x50b0(%rsp), %xmm0
movsd 0x113aba(%rip), %xmm1   # 0x1d2248
addsd 0x50f8(%rsp), %xmm1
divsd %xmm1, %xmm0
movq 0x5118(%rsp), %rax
movq 0x5058(%rsp), %rcx
movq 0xb8(%rcx), %rcx
movslq 0xc(%rcx), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xbea56
movsd 0x1144b8(%rip), %xmm0   # 0x1d2c80
mulsd 0x50d8(%rsp), %xmm0
movsd 0x113a6f(%rip), %xmm1   # 0x1d2248
addsd 0x50f8(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd 0x5098(%rsp), %xmm1
movsd 0x50d8(%rsp), %xmm2
subsd 0x50e0(%rsp), %xmm2
mulsd %xmm2, %xmm1
movsd 0x50c0(%rsp), %xmm2
movsd 0x113a32(%rip), %xmm3   # 0x1d2248
addsd 0x50f8(%rsp), %xmm3
mulsd %xmm3, %xmm2
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movq 0x5060(%rsp), %rax
subsd 0x38(%rax), %xmm0
movq 0x5118(%rsp), %rax
movq 0x5050(%rsp), %rcx
movslq 0xc(%rcx), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x5070(%rsp), %rax
movswl 0xb8(%rax), %eax
cmpl $0x1, %eax
jne 0xbe8d5
movq 0x5040(%rsp), %rax
movq 0x550(%rax), %rax
movq 0x5040(%rsp), %rcx
movslq 0x538(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm1
divsd 0x50a0(%rsp), %xmm1
movsd 0x50c0(%rsp), %xmm0
movsd 0x1139a6(%rip), %xmm2   # 0x1d2248
addsd 0x50f8(%rsp), %xmm2
mulsd %xmm2, %xmm0
divsd %xmm0, %xmm1
movq 0x5118(%rsp), %rax
movq 0x5050(%rsp), %rcx
movslq 0xc(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq 0x5070(%rsp), %rax
movswl 0x34(%rax), %eax
cmpl $0x1, %eax
jne 0xbea54
movsd 0x113956(%rip), %xmm1   # 0x1d2248
addsd 0x50f0(%rsp), %xmm1
movq 0x5060(%rsp), %rax
addsd 0x20(%rax), %xmm1
movsd 0x132c68(%rip), %xmm0   # 0x1f1578
divsd %xmm1, %xmm0
movq 0x5070(%rsp), %rax
movsd 0x113924(%rip), %xmm1   # 0x1d2248
subsd (%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x5090(%rsp)
movq 0x5068(%rsp), %rax
movq 0x5078(%rsp), %rcx
movslq 0x398(%rcx), %rcx
movsd 0x11432c(%rip), %xmm0   # 0x1d2c80
mulsd (%rax,%rcx,8), %xmm0
movq 0x5068(%rsp), %rax
movq 0x5078(%rsp), %rcx
movslq 0x390(%rcx), %rcx
divsd (%rax,%rcx,8), %xmm0
mulsd 0x5090(%rsp), %xmm0
movq 0x5070(%rsp), %rax
movsd 0x117e6a(%rip), %xmm1   # 0x1d67f8
mulsd 0x1010(%rax), %xmm1
movsd 0x117c92(%rip), %xmm2   # 0x1d6630
divsd %xmm2, %xmm1
movsd 0x117c86(%rip), %xmm2   # 0x1d6630
divsd %xmm2, %xmm1
movsd 0x132bba(%rip), %xmm2   # 0x1f1570
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movq 0x5058(%rsp), %rax
mulsd 0x30(%rax), %xmm0
movsd 0x50d8(%rsp), %xmm1
movq 0x5058(%rsp), %rax
subsd 0x38(%rax), %xmm1
mulsd %xmm1, %xmm0
movq 0x5068(%rsp), %rax
movq 0x5078(%rsp), %rcx
movslq 0x380(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm1
movq 0x5068(%rsp), %rax
movq 0x5078(%rsp), %rcx
movslq 0x384(%rcx), %rcx
mulsd (%rax,%rcx,8), %xmm1
movsd 0x113823(%rip), %xmm2   # 0x1d2248
addsd 0x50f8(%rsp), %xmm2
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movq 0x5118(%rsp), %rax
movq 0x5050(%rsp), %rcx
movslq 0xc(%rcx), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xbea56
movq 0x5078(%rsp), %rax
movswl 0x4b6(%rax), %eax
cmpl $0x1, %eax
jne 0xbeacc
movq 0x5060(%rsp), %rax
movswl 0x60(%rax), %eax
cmpl $0x1, %eax
jne 0xbea8f
movl 0x503c(%rsp), %eax
movq 0x5058(%rsp), %rcx
cmpl 0x70(%rcx), %eax
je 0xbeacc
movq 0x5058(%rsp), %rax
movsd 0x40(%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq 0x5118(%rsp), %rax
movq 0x5050(%rsp), %rcx
movslq 0x10(%rcx), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x50f0(%rsp), %xmm0
movsd 0x11376b(%rip), %xmm1   # 0x1d2248
ucomisd %xmm1, %xmm0
jbe 0xbebc1
movsd 0x50f8(%rsp), %xmm1
movq 0x5080(%rsp), %rax
movsd 0x1d0(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xbebc1
movsd 0x50f8(%rsp), %xmm0
movq 0x5080(%rsp), %rax
ucomisd 0x3e8(%rax), %xmm0
jbe 0xbebc1
leaq 0x820(%rsp), %rdi
movsd 0x50f8(%rsp), %xmm0
movq 0x5080(%rsp), %rax
movsd 0x1d0(%rax), %xmm1
movq 0x5080(%rsp), %rax
movsd 0x3e8(%rax), %xmm2
leaq 0x135545(%rip), %rsi    # 0x1f40a6
movb $0x3, %al
callq 0x5b9c0
leaq 0x20(%rsp), %rdi
leaq 0x820(%rsp), %rcx
leaq 0x113506(%rip), %rsi    # 0x1d2082
leaq 0x1355ec(%rip), %rdx    # 0x1f416f
movb $0x0, %al
callq 0x5b9c0
movq 0x5108(%rsp), %rdi
leaq 0x20(%rsp), %r8
leaq 0x113496(%rip), %rsi    # 0x1d2034
leaq 0x1352c7(%rip), %rdx    # 0x1f3e6c
movl $0xaed, %ecx            # imm = 0xAED
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5134(%rsp)
jmp 0xbec45
movl $0x0, 0x5104(%rsp)
movl 0x5104(%rsp), %eax
movq 0x5058(%rsp), %rcx
movq 0xb8(%rcx), %rcx
cmpl (%rcx), %eax
jge 0xbec3a
movq 0x5118(%rsp), %rax
movslq 0x5104(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq 0x5118(%rsp), %rax
movslq 0x5104(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x5104(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5104(%rsp)
jmp 0xbebcc
movl $0x0, 0x5134(%rsp)
movl 0x5134(%rsp), %eax
addq $0x5138, %rsp           # imm = 0x5138
retq
nopw %cs:(%rax,%rax)