// File: /workspace/github_c_makefile_star2_O3/lesgourg[P]class_public/build/../source/background.c
// Function: background_functions
int background_functions(
                         struct background * pba,
                         double a,
                         double * pvecback_B, /* vector with argument pvecback[index_bi] */
                         enum vecback_format return_format,
                         double * pvecback /* vector with argument pvecback[index_bg] (must be already allocated with a size compatible with return_format) */
                         ) {

  /** Summary: */

  /** - define local variables */

  /* total density */
  double rho_tot;
  /* critical density */
  double rho_crit;
  /* total pressure */
  double p_tot;
  /* total relativistic density */
  double rho_r;
  /* total non-relativistic density */
  double rho_m;
  /* background ncdm quantities */
  double rho_ncdm,p_ncdm,pseudo_p_ncdm;
  /* index for n_ncdm species */
  int n_ncdm;
  /* fluid's time-dependent equation of state parameter */
  double w_fld, dw_over_da, integral_fld;
  /* scalar field quantities */
  double phi, phi_prime;
  /* Since we only know a_prime_over_a after we have rho_tot,
     it is not possible to simply sum up p_tot_prime directly.
     Instead we sum up dp_dloga = p_prime/a_prime_over_a. The formula is
     p_prime = a_prime_over_a * dp_dloga = a_prime_over_a * Sum [ (w_prime/a_prime_over_a -3(1+w)w)rho].
     Note: The scalar field contribution must be added in the end, as an exception!*/
  double dp_dloga;

  /** - initialize local variables */
  rho_tot = 0.;
  p_tot = 0.;
  dp_dloga = 0.;
  rho_r=0.;
  rho_m=0.;

  class_test(a <= 0.,
             pba->error_message,
             "a = %e instead of strictly positive",a);

  /** - pass value of \f$ a\f$ to output */
  pvecback[pba->index_bg_a] = a;

  /** - compute each component's density and pressure */

  /* photons */
  pvecback[pba->index_bg_rho_g] = pba->Omega0_g * pow(pba->H0,2) / pow(a,4);
  rho_tot += pvecback[pba->index_bg_rho_g];
  p_tot += (1./3.) * pvecback[pba->index_bg_rho_g];
  dp_dloga += -(4./3.) * pvecback[pba->index_bg_rho_g];
  rho_r += pvecback[pba->index_bg_rho_g];

  /* baryons */
  pvecback[pba->index_bg_rho_b] = pba->Omega0_b * pow(pba->H0,2) / pow(a,3);
  rho_tot += pvecback[pba->index_bg_rho_b];
  p_tot += 0;
  rho_m += pvecback[pba->index_bg_rho_b];

  /* cdm */
  if (pba->has_cdm == _TRUE_) {
    pvecback[pba->index_bg_rho_cdm] = pba->Omega0_cdm * pow(pba->H0,2) / pow(a,3);
    rho_tot += pvecback[pba->index_bg_rho_cdm];
    p_tot += 0.;
    rho_m += pvecback[pba->index_bg_rho_cdm];
  }

  /* idm */
  if (pba->has_idm == _TRUE_) {
    pvecback[pba->index_bg_rho_idm] = pba->Omega0_idm * pow(pba->H0,2) / pow(a,3);
    rho_tot += pvecback[pba->index_bg_rho_idm];
    p_tot += 0.;
    rho_m += pvecback[pba->index_bg_rho_idm];
  }

  /* dcdm */
  if (pba->has_dcdm == _TRUE_) {
    /* Pass value of rho_dcdm to output */
    pvecback[pba->index_bg_rho_dcdm] = pvecback_B[pba->index_bi_rho_dcdm];
    rho_tot += pvecback[pba->index_bg_rho_dcdm];
    p_tot += 0.;
    rho_m += pvecback[pba->index_bg_rho_dcdm];
  }

  /* dr */
  if (pba->has_dr == _TRUE_) {
    /* Pass value of rho_dr to output */
    pvecback[pba->index_bg_rho_dr] = pvecback_B[pba->index_bi_rho_dr];
    rho_tot += pvecback[pba->index_bg_rho_dr];
    p_tot += (1./3.)*pvecback[pba->index_bg_rho_dr];
    dp_dloga += -(4./3.) * pvecback[pba->index_bg_rho_dr];
    rho_r += pvecback[pba->index_bg_rho_dr];
  }

  /* Scalar field */
  if (pba->has_scf == _TRUE_) {
    phi = pvecback_B[pba->index_bi_phi_scf];
    phi_prime = pvecback_B[pba->index_bi_phi_prime_scf];
    pvecback[pba->index_bg_phi_scf] = phi; // value of the scalar field phi
    pvecback[pba->index_bg_phi_prime_scf] = phi_prime; // value of the scalar field phi derivative wrt conformal time
    pvecback[pba->index_bg_V_scf] = V_scf(pba,phi); //V_scf(pba,phi); //write here potential as function of phi
    pvecback[pba->index_bg_dV_scf] = dV_scf(pba,phi); // dV_scf(pba,phi); //potential' as function of phi
    pvecback[pba->index_bg_ddV_scf] = ddV_scf(pba,phi); // ddV_scf(pba,phi); //potential'' as function of phi
    pvecback[pba->index_bg_rho_scf] = (phi_prime*phi_prime/(2*a*a) + V_scf(pba,phi))/3.; // energy of the scalar field. The field units are set automatically by setting the initial conditions
    pvecback[pba->index_bg_p_scf] =(phi_prime*phi_prime/(2*a*a) - V_scf(pba,phi))/3.; // pressure of the scalar field
    rho_tot += pvecback[pba->index_bg_rho_scf];
    p_tot += pvecback[pba->index_bg_p_scf];
    dp_dloga += 0.0; /** <-- This depends on a_prime_over_a, so we cannot add it now! */
    //divide relativistic & nonrelativistic (not very meaningful for oscillatory models)
    rho_r += 3.*pvecback[pba->index_bg_p_scf]; //field pressure contributes radiation
    rho_m += pvecback[pba->index_bg_rho_scf] - 3.* pvecback[pba->index_bg_p_scf]; //the rest contributes matter
    //printf(" a= %e, Omega_scf = %f, \n ",a, pvecback[pba->index_bg_rho_scf]/rho_tot );
  }

  /* ncdm */
  if (pba->has_ncdm == _TRUE_) {

    /* Loop over species: */
    for (n_ncdm=0; n_ncdm<pba->N_ncdm; n_ncdm++) {

      /* function returning background ncdm[n_ncdm] quantities (only
         those for which non-NULL pointers are passed) */
      class_call(background_ncdm_momenta(
                                         pba->q_ncdm_bg[n_ncdm],
                                         pba->w_ncdm_bg[n_ncdm],
                                         pba->q_size_ncdm_bg[n_ncdm],
                                         pba->M_ncdm[n_ncdm],
                                         pba->factor_ncdm[n_ncdm],
                                         1./a-1.,
                                         NULL,
                                         &rho_ncdm,
                                         &p_ncdm,
                                         NULL,
                                         &pseudo_p_ncdm),
                 pba->error_message,
                 pba->error_message);

      pvecback[pba->index_bg_rho_ncdm1+n_ncdm] = rho_ncdm;
      rho_tot += rho_ncdm;
      pvecback[pba->index_bg_p_ncdm1+n_ncdm] = p_ncdm;
      p_tot += p_ncdm;
      pvecback[pba->index_bg_pseudo_p_ncdm1+n_ncdm] = pseudo_p_ncdm;
      /** See e.g. Eq. A6 in 1811.00904. */
      dp_dloga += (pseudo_p_ncdm - 5*p_ncdm);

      /* (3 p_ncdm1) is the "relativistic" contribution to rho_ncdm1 */
      rho_r += 3.* p_ncdm;

      /* (rho_ncdm1 - 3 p_ncdm1) is the "non-relativistic" contribution
         to rho_ncdm1 */
      rho_m += rho_ncdm - 3.* p_ncdm;
    }
  }

  /* Lambda */
  if (pba->has_lambda == _TRUE_) {
    pvecback[pba->index_bg_rho_lambda] = pba->Omega0_lambda * pow(pba->H0,2);
    rho_tot += pvecback[pba->index_bg_rho_lambda];
    p_tot -= pvecback[pba->index_bg_rho_lambda];
  }

  /* fluid with w(a) and constant cs2 */
  if (pba->has_fld == _TRUE_) {

    /* get rho_fld from vector of integrated variables */
    pvecback[pba->index_bg_rho_fld] = pvecback_B[pba->index_bi_rho_fld];

    /* get w_fld from dedicated function */
    class_call(background_w_fld(pba,a,&w_fld,&dw_over_da,&integral_fld), pba->error_message, pba->error_message);
    pvecback[pba->index_bg_w_fld] = w_fld;

    // Obsolete: at the beginning, we had here the analytic integral solution corresponding to the case w=w0+w1(1-a/a0):
    // pvecback[pba->index_bg_rho_fld] = pba->Omega0_fld * pow(pba->H0,2) / pow(a,3.*(1.+pba->w0_fld+pba->wa_fld)) * exp(3.*pba->wa_fld*(a-1.));
    // But now everthing is integrated numerically for a given w_fld(a) defined in the function background_w_fld.

    rho_tot += pvecback[pba->index_bg_rho_fld];
    p_tot += w_fld * pvecback[pba->index_bg_rho_fld];
    dp_dloga += (a*dw_over_da-3*(1+w_fld)*w_fld)*pvecback[pba->index_bg_rho_fld];
  }

  /* relativistic neutrinos (and all relativistic relics) */
  if (pba->has_ur == _TRUE_) {
    pvecback[pba->index_bg_rho_ur] = pba->Omega0_ur * pow(pba->H0,2) / pow(a,4);
    rho_tot += pvecback[pba->index_bg_rho_ur];
    p_tot += (1./3.) * pvecback[pba->index_bg_rho_ur];
    dp_dloga += -(4./3.) * pvecback[pba->index_bg_rho_ur];
    rho_r += pvecback[pba->index_bg_rho_ur];
  }

  /* interacting dark radiation */
  if (pba->has_idr == _TRUE_) {
    pvecback[pba->index_bg_rho_idr] = pba->Omega0_idr * pow(pba->H0,2) / pow(a,4);
    rho_tot += pvecback[pba->index_bg_rho_idr];
    p_tot += (1./3.) * pvecback[pba->index_bg_rho_idr];
    rho_r += pvecback[pba->index_bg_rho_idr];
  }

  /** - compute expansion rate H from Friedmann equation: this is the
      only place where the Friedmann equation is assumed. Remember
      that densities are all expressed in units of \f$ [3c^2/8\pi G] \f$, ie
      \f$ \rho_{class} = [8 \pi G \rho_{physical} / 3 c^2]\f$ */
  pvecback[pba->index_bg_H] = sqrt(rho_tot-pba->K/a/a);

  /** - compute derivative of H with respect to conformal time */
  pvecback[pba->index_bg_H_prime] = - (3./2.) * (rho_tot + p_tot) * a + pba->K/a;

  /* Total energy density*/
  pvecback[pba->index_bg_rho_tot] = rho_tot;

  /* Total pressure */
  pvecback[pba->index_bg_p_tot] = p_tot;

  /* Derivative of total pressure w.r.t. conformal time */
  pvecback[pba->index_bg_p_tot_prime] = a*pvecback[pba->index_bg_H]*dp_dloga;
  if (pba->has_scf == _TRUE_) {
    /** The contribution of scf was not added to dp_dloga, add p_scf_prime here: */
    pvecback[pba->index_bg_p_prime_scf] = pvecback[pba->index_bg_phi_prime_scf]*
      (-pvecback[pba->index_bg_phi_prime_scf]*pvecback[pba->index_bg_H]/a-2./3.*pvecback[pba->index_bg_dV_scf]);
    pvecback[pba->index_bg_p_tot_prime] += pvecback[pba->index_bg_p_prime_scf];
  }

  /** - compute critical density */
  rho_crit = rho_tot-pba->K/a/a;
  class_test(rho_crit <= 0.,
             pba->error_message,
             "rho_crit = %e instead of strictly positive",rho_crit);

  /** - compute relativistic density to total density ratio */
  pvecback[pba->index_bg_Omega_r] = rho_r / rho_crit;

  /** - compute other quantities in the exhaustive, redundant format */
  if (return_format == long_info) {

    /** - store critical density */
    pvecback[pba->index_bg_rho_crit] = rho_crit;

    /** - compute Omega_m */
    pvecback[pba->index_bg_Omega_m] = rho_m / rho_crit;

    /** - cosmological time */
    pvecback[pba->index_bg_time] = pvecback_B[pba->index_bi_time];

    /** - comoving sound horizon */
    pvecback[pba->index_bg_rs] = pvecback_B[pba->index_bi_rs];

    /** - growth factor */
    pvecback[pba->index_bg_D] = pvecback_B[pba->index_bi_D];

    /** - velocity growth factor */
    pvecback[pba->index_bg_f] = pvecback_B[pba->index_bi_D_prime]/( pvecback_B[pba->index_bi_D]*a*pvecback[pba->index_bg_H]);

    /**- Varying fundamental constants */
    if (pba->has_varconst == _TRUE_) {
      class_call(background_varconst_of_z(pba,
                                          1./a-1.,
                                          &(pvecback[pba->index_bg_varc_alpha]),
                                          &(pvecback[pba->index_bg_varc_me])
                                          ),
                 pba->error_message,
                 pba->error_message);
    }

    /* one can put other variables here */
    /*  */
    /*  */

  }

  return _SUCCESS_;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10d8, %rsp           # imm = 0x10D8
movq %rdi, %rbx
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x55751
movq %rcx, %r14
movq %rsi, %r15
movl %edx, 0x7c(%rsp)
movslq 0x208(%rbx), %rax
movsd %xmm0, (%rcx,%rax,8)
movsd (%rbx), %xmm1
mulsd %xmm1, %xmm1
mulsd 0x10(%rbx), %xmm1
movapd %xmm1, 0x30(%rsp)
movsd 0x8d2fb(%rip), %xmm1    # 0xe2438
movsd %xmm0, 0x8(%rsp)
callq 0x8620
movapd 0x30(%rsp), %xmm1
divsd %xmm0, %xmm1
movslq 0x214(%rbx), %rax
movsd %xmm1, (%r14,%rax,8)
movapd %xmm1, %xmm0
addsd 0x8a0ed(%rip), %xmm0    # 0xdf258
movapd %xmm0, 0x20(%rsp)
movsd 0x8d2cf(%rip), %xmm0    # 0xe2448
movapd %xmm1, 0x30(%rsp)
mulsd %xmm1, %xmm0
movapd %xmm0, 0x40(%rsp)
movsd (%rbx), %xmm0
mulsd %xmm0, %xmm0
mulsd 0x20(%rbx), %xmm0
movapd %xmm0, 0x50(%rsp)
movsd 0x8b4dc(%rip), %xmm1    # 0xe0680
movsd 0x8(%rsp), %xmm0
callq 0x8620
movsd 0x8(%rsp), %xmm2
movapd 0x50(%rsp), %xmm1
divsd %xmm0, %xmm1
movapd 0x20(%rsp), %xmm0
movslq 0x218(%rbx), %rax
movsd %xmm1, (%r14,%rax,8)
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
xorpd %xmm3, %xmm3
unpcklpd %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0]
addpd %xmm1, %xmm3
cmpw $0x1, 0x320(%rbx)
jne 0x5523b
movsd (%rbx), %xmm0
mulsd %xmm0, %xmm0
mulsd 0x30(%rbx), %xmm0
movapd %xmm0, 0x10(%rsp)
movsd 0x8b479(%rip), %xmm1    # 0xe0680
movapd %xmm2, %xmm0
movapd %xmm3, 0x50(%rsp)
callq 0x8620
movapd 0x50(%rsp), %xmm3
movapd 0x10(%rsp), %xmm1
divsd %xmm0, %xmm1
movslq 0x21c(%rbx), %rax
movsd %xmm1, (%r14,%rax,8)
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
addpd %xmm1, %xmm3
xorpd %xmm1, %xmm1
movapd 0x40(%rsp), %xmm2
addsd %xmm1, %xmm2
movapd 0x30(%rsp), %xmm4
mulsd 0xa3179(%rip), %xmm4    # 0xf83d0
cmpw $0x1, 0x322(%rbx)
jne 0x552ce
movsd (%rbx), %xmm0
mulsd %xmm0, %xmm0
mulsd 0x38(%rbx), %xmm0
movapd %xmm0, 0x10(%rsp)
movsd 0x8b404(%rip), %xmm1    # 0xe0680
movsd 0x8(%rsp), %xmm0
movapd %xmm3, 0x50(%rsp)
movapd %xmm4, 0x30(%rsp)
movapd %xmm2, 0x40(%rsp)
callq 0x8620
movapd 0x40(%rsp), %xmm2
xorpd %xmm1, %xmm1
movapd 0x30(%rsp), %xmm4
movapd 0x50(%rsp), %xmm3
movapd 0x10(%rsp), %xmm5
divsd %xmm0, %xmm5
movslq 0x220(%rbx), %rax
movsd %xmm5, (%r14,%rax,8)
unpcklpd %xmm5, %xmm5            # xmm5 = xmm5[0,0]
addpd %xmm5, %xmm3
addsd %xmm1, %xmm4
addsd %xmm1, %xmm2
cmpw $0x1, 0x324(%rbx)
jne 0x55302
movslq 0x2f0(%rbx), %rax
movsd (%r15,%rax,8), %xmm0
movslq 0x238(%rbx), %rax
movsd %xmm0, (%r14,%rax,8)
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
addpd %xmm0, %xmm3
cmpw $0x1, 0x326(%rbx)
unpcklpd %xmm2, %xmm4            # xmm4 = xmm4[0],xmm2[0]
movapd %xmm3, %xmm5
unpckhpd %xmm3, %xmm5            # xmm5 = xmm5[1],xmm3[1]
jne 0x55356
movslq 0x2f4(%rbx), %rax
movsd (%r15,%rax,8), %xmm0
movslq 0x23c(%rbx), %rax
movsd %xmm0, (%r14,%rax,8)
addsd %xmm0, %xmm5
movapd 0x20(%rsp), %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, 0x20(%rsp)
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd 0xa310e(%rip), %xmm0    # 0xf8460
addpd %xmm0, %xmm4
cmpw $0x1, 0x328(%rbx)
jne 0x555c9
movslq 0x2fc(%rbx), %rax
movsd (%r15,%rax,8), %xmm1
movsd %xmm1, 0x10(%rsp)
movslq 0x300(%rbx), %rax
movsd (%r15,%rax,8), %xmm0
movaps %xmm0, 0x80(%rsp)
movslq 0x240(%rbx), %rax
movsd %xmm1, (%r14,%rax,8)
movslq 0x244(%rbx), %rax
movsd %xmm0, (%r14,%rax,8)
movq 0x148(%rbx), %rax
movsd (%rax), %xmm0
xorpd 0x89e77(%rip), %xmm0    # 0xdf230
mulsd %xmm1, %xmm0
movapd %xmm3, 0x50(%rsp)
movapd %xmm4, 0x30(%rsp)
movapd %xmm5, 0x40(%rsp)
callq 0x8670
movsd %xmm0, 0x70(%rsp)
movq 0x148(%rbx), %rax
movsd 0x8(%rax), %xmm1
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x68(%rsp)
movsd 0x10(%rsp), %xmm0
subsd 0x18(%rax), %xmm0
callq 0x8620
addsd 0x68(%rsp), %xmm0
mulsd 0x70(%rsp), %xmm0
movslq 0x248(%rbx), %rax
movsd %xmm0, (%r14,%rax,8)
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x55dc8
movslq 0x24c(%rbx), %rax
movsd %xmm0, (%r14,%rax,8)
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x55ea7
movslq 0x250(%rbx), %rax
movsd %xmm0, (%r14,%rax,8)
movapd 0x80(%rsp), %xmm2
mulsd %xmm2, %xmm2
movsd 0x8(%rsp), %xmm1
movapd %xmm1, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
divsd %xmm0, %xmm2
movapd %xmm2, 0x80(%rsp)
movq 0x148(%rbx), %rax
movsd (%rax), %xmm0
xorpd 0x89da1(%rip), %xmm0    # 0xdf230
mulsd 0x10(%rsp), %xmm0
callq 0x8670
movsd %xmm0, 0x70(%rsp)
movq 0x148(%rbx), %rax
movsd 0x8(%rax), %xmm1
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x68(%rsp)
movsd 0x10(%rsp), %xmm0
subsd 0x18(%rax), %xmm0
callq 0x8620
addsd 0x68(%rsp), %xmm0
mulsd 0x70(%rsp), %xmm0
addsd 0x80(%rsp), %xmm0
movsd 0x8b19c(%rip), %xmm1    # 0xe0680
divsd %xmm1, %xmm0
movslq 0x254(%rbx), %rax
movsd %xmm0, (%r14,%rax,8)
movq 0x148(%rbx), %rax
movsd (%rax), %xmm0
xorpd 0x89d28(%rip), %xmm0    # 0xdf230
mulsd 0x10(%rsp), %xmm0
callq 0x8670
movsd %xmm0, 0x70(%rsp)
movq 0x148(%rbx), %rax
movsd 0x8(%rax), %xmm1
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x68(%rsp)
movsd 0x10(%rsp), %xmm0
subsd 0x18(%rax), %xmm0
callq 0x8620
movsd 0x8b138(%rip), %xmm2    # 0xe0680
movapd 0x40(%rsp), %xmm5
movapd 0x30(%rsp), %xmm4
movapd 0x50(%rsp), %xmm3
addsd 0x68(%rsp), %xmm0
mulsd 0x70(%rsp), %xmm0
movapd 0x80(%rsp), %xmm6
subsd %xmm0, %xmm6
divsd %xmm2, %xmm6
movslq 0x258(%rbx), %rax
movsd %xmm6, (%r14,%rax,8)
movslq 0x254(%rbx), %rax
movsd (%r14,%rax,8), %xmm0
addsd %xmm0, %xmm5
xorpd %xmm1, %xmm1
unpcklpd %xmm6, %xmm1            # xmm1 = xmm1[0],xmm6[0]
addpd %xmm1, %xmm4
movapd %xmm6, %xmm1
mulsd %xmm2, %xmm1
movapd 0x20(%rsp), %xmm2
addsd %xmm1, %xmm2
movapd %xmm2, 0x20(%rsp)
mulsd 0x8cebf(%rip), %xmm6    # 0xe2480
addsd %xmm0, %xmm6
addsd %xmm6, %xmm3
cmpw $0x1, 0x32a(%rbx)
movq %r15, 0x98(%rsp)
jne 0x557af
cmpl $0x0, 0x70(%rbx)
movsd 0x8(%rsp), %xmm0
jle 0x557af
movsd 0x89c69(%rip), %xmm1    # 0xdf260
divsd %xmm0, %xmm1
addsd 0x8a1e5(%rip), %xmm1    # 0xdf7e8
movsd %xmm1, 0x10(%rsp)
xorl %ebp, %ebp
leaq 0xb0(%rsp), %r15
leaq 0xc0(%rsp), %r12
leaq 0xb8(%rsp), %r13
movapd 0x20(%rsp), %xmm2
movapd %xmm2, 0x20(%rsp)
movapd %xmm5, 0x40(%rsp)
movapd %xmm4, 0x30(%rsp)
movapd %xmm3, 0x50(%rsp)
movq 0x340(%rbx), %rax
movq (%rax,%rbp,8), %rdi
movq 0x348(%rbx), %rax
movq (%rax,%rbp,8), %rsi
movq 0x368(%rbx), %rax
movl (%rax,%rbp,4), %edx
movq 0x90(%rbx), %rax
movsd (%rax,%rbp,8), %xmm0
movq 0x378(%rbx), %rax
movsd (%rax,%rbp,8), %xmm1
movsd 0x10(%rsp), %xmm2
xorl %ecx, %ecx
movq %r12, %r8
movq %r13, %r9
pushq %r15
pushq $0x0
callq 0x56018
movapd 0x50(%rsp), %xmm5
movapd 0x40(%rsp), %xmm4
addq $0x10, %rsp
movsd 0xc0(%rsp), %xmm0
movslq 0x260(%rbx), %rax
addq %rbp, %rax
movsd %xmm0, (%r14,%rax,8)
addsd %xmm0, %xmm5
movsd 0xb8(%rsp), %xmm1
movslq 0x264(%rbx), %rax
addq %rbp, %rax
movsd %xmm1, (%r14,%rax,8)
movsd 0xb0(%rsp), %xmm2
movslq 0x268(%rbx), %rax
addq %rbp, %rax
movsd %xmm2, (%r14,%rax,8)
movapd %xmm1, %xmm3
mulsd 0xa2cdd(%rip), %xmm3    # 0xf83d8
addsd %xmm2, %xmm3
unpcklpd %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0]
addpd %xmm3, %xmm4
movapd 0x50(%rsp), %xmm3
movapd %xmm1, %xmm2
mulsd 0x8af67(%rip), %xmm2    # 0xe0680
movapd 0x20(%rsp), %xmm6
addsd %xmm2, %xmm6
movapd %xmm6, 0x20(%rsp)
movapd 0x20(%rsp), %xmm2
mulsd 0x8cd49(%rip), %xmm1    # 0xe2480
addsd %xmm0, %xmm1
addsd %xmm1, %xmm3
incq %rbp
movslq 0x70(%rbx), %rax
cmpq %rax, %rbp
jl 0x55629
jmp 0x557b5
leaq 0xa328b(%rip), %rsi     # 0xf89e3
leaq 0xd0(%rsp), %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x30af0
leaq 0x89911(%rip), %rsi     # 0xdf082
leaq 0xa328f(%rip), %rdx     # 0xf8a07
leaq 0x8d0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0xb84, %rbx            # imm = 0xB84
leaq 0x89899(%rip), %rsi     # 0xdf034
leaq 0xa326d(%rip), %rdx     # 0xf8a0f
movq %rbx, %rdi
movl $0x1a1, %ecx            # imm = 0x1A1
jmp 0x55cea
movapd 0x20(%rsp), %xmm2
movapd %xmm2, 0x20(%rsp)
cmpw $0x1, 0x32c(%rbx)
movapd %xmm4, %xmm0
unpckhpd %xmm4, %xmm0            # xmm0 = xmm0[1],xmm4[1]
jne 0x557f2
movsd (%rbx), %xmm1
mulsd %xmm1, %xmm1
mulsd 0xf8(%rbx), %xmm1
movslq 0x224(%rbx), %rax
movsd %xmm1, (%r14,%rax,8)
addsd %xmm1, %xmm5
subsd %xmm1, %xmm0
movq 0x98(%rsp), %r15
cmpw $0x1, 0x32e(%rbx)
unpcklpd %xmm0, %xmm4            # xmm4 = xmm4[0],xmm0[0]
movapd %xmm3, 0x50(%rsp)
jne 0x55918
movapd %xmm5, 0x40(%rsp)
movapd %xmm4, 0x30(%rsp)
movslq 0x2f8(%rbx), %rax
movsd (%r15,%rax,8), %xmm0
movslq 0x228(%rbx), %rax
movsd %xmm0, (%r14,%rax,8)
leaq 0xa8(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
leaq 0xc8(%rsp), %rcx
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x56265
testl %eax, %eax
je 0x558aa
addq $0xb84, %rbx            # imm = 0xB84
leaq 0x89b80(%rip), %rsi     # 0xdf3f0
leaq 0xa31ad(%rip), %rdx     # 0xf8a24
leaq 0xd0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x897a1(%rip), %rsi     # 0xdf034
leaq 0xa3175(%rip), %rdx     # 0xf8a0f
movq %rbx, %rdi
movl $0x222, %ecx            # imm = 0x222
movq %r14, %r8
jmp 0x55ced
movsd 0xa8(%rsp), %xmm0
movslq 0x22c(%rbx), %rax
movsd %xmm0, (%r14,%rax,8)
movslq 0x228(%rbx), %rax
movsd (%r14,%rax,8), %xmm1
movapd 0x40(%rsp), %xmm5
addsd %xmm1, %xmm5
movsd 0x89981(%rip), %xmm2    # 0xdf260
addsd %xmm0, %xmm2
mulsd 0x8cb95(%rip), %xmm2    # 0xe2480
mulsd %xmm0, %xmm2
movsd 0xa0(%rsp), %xmm3
mulsd 0x8(%rsp), %xmm3
addsd %xmm2, %xmm3
unpcklpd %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0]
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm3, %xmm1
movapd 0x30(%rsp), %xmm4
addpd %xmm1, %xmm4
cmpw $0x1, 0x330(%rbx)
jne 0x5599b
movsd (%rbx), %xmm0
mulsd %xmm0, %xmm0
mulsd 0x28(%rbx), %xmm0
movapd %xmm0, 0x10(%rsp)
movsd 0x8cafb(%rip), %xmm1    # 0xe2438
movsd 0x8(%rsp), %xmm0
movapd %xmm4, 0x30(%rsp)
movapd %xmm5, 0x40(%rsp)
callq 0x8620
movapd 0x40(%rsp), %xmm5
movapd 0x30(%rsp), %xmm4
movapd 0x10(%rsp), %xmm1
divsd %xmm0, %xmm1
movslq 0x234(%rbx), %rax
movsd %xmm1, (%r14,%rax,8)
addsd %xmm1, %xmm5
movapd 0x20(%rsp), %xmm0
addsd %xmm1, %xmm0
movapd %xmm0, 0x20(%rsp)
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd 0xa2ac9(%rip), %xmm1    # 0xf8460
addpd %xmm1, %xmm4
cmpw $0x1, 0x332(%rbx)
movapd %xmm4, %xmm6
unpckhpd %xmm4, %xmm6            # xmm6 = xmm6[1],xmm4[1]
movapd %xmm4, 0x30(%rsp)
jne 0x55a3a
movsd (%rbx), %xmm0
mulsd %xmm0, %xmm0
mulsd 0x40(%rbx), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0x8ca63(%rip), %xmm1    # 0xe2438
movsd 0x8(%rsp), %xmm0
movapd %xmm5, 0x40(%rsp)
movapd %xmm6, 0x10(%rsp)
callq 0x8620
movapd 0x10(%rsp), %xmm6
movapd 0x40(%rsp), %xmm5
movsd 0x8(%rsp), %xmm3
movsd 0x80(%rsp), %xmm1
divsd %xmm0, %xmm1
movslq 0x230(%rbx), %rax
movsd %xmm1, (%r14,%rax,8)
addsd %xmm1, %xmm5
movapd 0x20(%rsp), %xmm0
addsd %xmm1, %xmm0
movapd %xmm0, 0x20(%rsp)
mulsd 0x8ca14(%rip), %xmm1    # 0xe2448
addsd %xmm1, %xmm6
jmp 0x55a40
movsd 0x8(%rsp), %xmm3
movsd 0x1a0(%rbx), %xmm1
divsd %xmm3, %xmm1
divsd %xmm3, %xmm1
movapd %xmm5, %xmm0
subsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x55a68
sqrtsd %xmm0, %xmm0
jmp 0x55a8b
movapd %xmm5, 0x40(%rsp)
movapd %xmm6, 0x10(%rsp)
callq 0x82b0
movapd 0x10(%rsp), %xmm6
movapd 0x40(%rsp), %xmm5
movsd 0x8(%rsp), %xmm3
movapd 0x30(%rsp), %xmm2
movslq 0x20c(%rbx), %rcx
movsd %xmm0, (%r14,%rcx,8)
movapd %xmm6, %xmm0
addsd %xmm5, %xmm0
mulsd 0x8cda2(%rip), %xmm0    # 0xe2850
movsd 0x1a0(%rbx), %xmm1
divsd %xmm3, %xmm1
mulsd %xmm3, %xmm0
addsd %xmm1, %xmm0
movslq 0x210(%rbx), %rax
movsd %xmm0, (%r14,%rax,8)
movslq 0x26c(%rbx), %rax
movsd %xmm5, (%r14,%rax,8)
movslq 0x270(%rbx), %rax
movsd %xmm6, (%r14,%rax,8)
movsd (%r14,%rcx,8), %xmm0
mulsd %xmm3, %xmm0
mulsd %xmm0, %xmm2
movslq 0x274(%rbx), %rax
movsd %xmm2, (%r14,%rax,8)
cmpw $0x1, 0x328(%rbx)
jne 0x55b5f
movslq 0x244(%rbx), %rdx
movsd (%r14,%rdx,8), %xmm0
movsd (%r14,%rcx,8), %xmm1
mulsd %xmm0, %xmm1
movslq 0x24c(%rbx), %rdx
movsd (%r14,%rdx,8), %xmm2
mulsd 0x8c9c6(%rip), %xmm2    # 0xe2500
divsd %xmm3, %xmm1
subsd %xmm1, %xmm2
mulsd %xmm0, %xmm2
movslq 0x25c(%rbx), %rdx
movsd %xmm2, (%r14,%rdx,8)
addsd (%r14,%rax,8), %xmm2
movsd %xmm2, (%r14,%rax,8)
movsd 0x1a0(%rbx), %xmm0
divsd %xmm3, %xmm0
divsd %xmm3, %xmm0
subsd %xmm0, %xmm5
xorpd %xmm0, %xmm0
ucomisd %xmm5, %xmm0
jae 0x55c8d
movapd 0x20(%rsp), %xmm0
divsd %xmm5, %xmm0
movslq 0x278(%rbx), %rax
movsd %xmm0, (%r14,%rax,8)
xorl %eax, %eax
cmpl $0x2, 0x7c(%rsp)
jne 0x55cf9
movslq 0x27c(%rbx), %rdx
movsd %xmm5, (%r14,%rdx,8)
movapd 0x50(%rsp), %xmm0
divsd %xmm5, %xmm0
movslq 0x280(%rbx), %rdx
movsd %xmm0, (%r14,%rdx,8)
movslq 0x304(%rbx), %rdx
movsd (%r15,%rdx,8), %xmm0
movslq 0x290(%rbx), %rdx
movsd %xmm0, (%r14,%rdx,8)
movslq 0x308(%rbx), %rdx
movsd (%r15,%rdx,8), %xmm0
movslq 0x294(%rbx), %rdx
movsd %xmm0, (%r14,%rdx,8)
movslq 0x310(%rbx), %rdx
movsd (%r15,%rdx,8), %xmm0
movslq 0x298(%rbx), %rdx
movsd %xmm0, (%r14,%rdx,8)
movslq 0x314(%rbx), %rdx
movsd (%r15,%rdx,8), %xmm1
mulsd %xmm3, %xmm0
mulsd (%r14,%rcx,8), %xmm0
divsd %xmm0, %xmm1
movslq 0x29c(%rbx), %rcx
movsd %xmm1, (%r14,%rcx,8)
cmpw $0x1, 0x336(%rbx)
jne 0x55cf9
movslq 0x2a0(%rbx), %rdx
movslq 0x2a4(%rbx), %rcx
movl 0x180(%rbx), %esi
cmpl $0x1, %esi
je 0x55d0b
testl %esi, %esi
jne 0x55cf9
movabsq $0x3ff0000000000000, %rsi # imm = 0x3FF0000000000000
movq %rsi, (%r14,%rdx,8)
movsd 0x895d8(%rip), %xmm0    # 0xdf260
jmp 0x55d53
leaq 0xa2dc9(%rip), %rsi     # 0xf8a5d
leaq 0xd0(%rsp), %r14
movq %r14, %rdi
movapd %xmm5, %xmm0
movb $0x1, %al
callq 0x30af0
leaq 0x893d1(%rip), %rsi     # 0xdf082
leaq 0xa2dd0(%rip), %rdx     # 0xf8a88
leaq 0x8d0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0xb84, %rbx            # imm = 0xB84
leaq 0x89359(%rip), %rsi     # 0xdf034
leaq 0xa2d2d(%rip), %rdx     # 0xf8a0f
movq %rbx, %rdi
movl $0x25b, %ecx            # imm = 0x25B
movq %r15, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x10d8, %rsp           # imm = 0x10D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd 0x8954d(%rip), %xmm0    # 0xdf260
movapd %xmm0, %xmm1
divsd %xmm3, %xmm1
addsd 0x89ac5(%rip), %xmm1    # 0xdf7e8
ucomisd 0x188(%rbx), %xmm1
jbe 0x55d45
movsd 0x170(%rbx), %xmm0
movsd %xmm0, (%r14,%rdx,8)
movsd 0x178(%rbx), %xmm0
jmp 0x55d53
movabsq $0x3ff0000000000000, %rsi # imm = 0x3FF0000000000000
movq %rsi, (%r14,%rdx,8)
movsd %xmm0, (%r14,%rcx,8)
jmp 0x55cf9