// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../source/background.c
// Function: background_init
int background_init(
                    struct precision * ppr,
                    struct background * pba
                    ) {

  /** Summary: */

  /** - define local variables */
  int n_ncdm;
  double rho_ncdm_rel,rho_nu_rel;
  double Neff, Omega_rad_neutrinos, Omega_tot_ac, N_dark;
  double w_fld, dw_over_da, integral_fld;
  double wn, f, p, Eac, xc,cos_initial,sin_initial, n, ac, Gac;
  double Omega_r, Omega_m,a_eq;
  int filenum=0;

  /** - in verbose mode, provide some information */
  if (pba->background_verbose > 0) {
    printf("Running CLASS version %s\n",_VERSION_);
    printf("Computing background\n");
  }

  // printf("pba->Omega0_ncdm_tot %e %e\n",pba->Omega0_ncdm_tot, pba->max_fraction_ncdm);

  /** - if shooting failed during input, catch the error here */
  class_test(pba->shooting_failed == _TRUE_,
             pba->error_message,
             "Shooting failed, try optimising input_get_guess(). Error message:\n\n%s",
             pba->shooting_error);

  /** - assign values to all indices in vectors of background quantities */
  class_call(background_indices(pba),
             pba->error_message,
             pba->error_message);

   /** - //VP: to test whether the fraction of ncdm over cdm is too large. default is never too large. */
   if(pba->has_ncdm == _TRUE_ && pba->has_cdm == _TRUE_){
     if (pba->background_verbose > 1)printf(" fraction of ncdm is %e \n", pba->Omega0_ncdm_tot/pba->Omega0_cdm);
     class_test(pba->Omega0_ncdm_tot>pba->max_fraction_ncdm*pba->Omega0_cdm,pba->error_message,"User defined max fraction of ncdm %e is exceeded: %e",pba->max_fraction_ncdm,pba->Omega0_ncdm_tot/pba->Omega0_cdm);
   }
  /* fluid equation of state */
  if (pba->has_fld == _TRUE_) {
    pba->f_ede_peak = 0.0;
    pba->a_peak = 0.0;

    class_call(background_w_fld(pba,0.,&w_fld,&dw_over_da,&integral_fld), pba->error_message, pba->error_message);

    // class_test(w_fld >= 1./3.,
    //            pba->error_message,
    //            "Your choice for w(a--->0)=%g is suspicious, since it is bigger than -1/3 there cannot be radiation domination at early times\n",
    //            w_fld);

      //if we have a pheno axion model, we need to extract the axion mass (in unit of H0) and decay constant (in unit of reduced planck mass) from the pheno parameters.
      //We also extract the characteristic angular frequency of oscillations
      //See 1806.10608, Eqs. 27, 28,30.
     if(pba->ede_parametrization == pheno_axion){
       Omega_r = pba->Omega0_g;
       if(pba->has_ur == _TRUE_) Omega_r += pba->Omega0_ur;
       Omega_m = pba->Omega0_b;
       if(pba->has_cdm == _TRUE_) Omega_m += pba->Omega0_cdm;
       if(pba->has_idm == _TRUE_) Omega_m += pba->Omega0_idm;
       if(pba->has_dcdm == _TRUE_) Omega_m += pba->Omega0_dcdm;
          a_eq = Omega_r /Omega_m;
         if(pba->a_c<a_eq){
           //switch depending on whether ac is smaller or larger than a_eq (approximate)
           p = 1./2;
         }
         else{
           p = 2./3;
         }

         cos_initial = cos(pba->Theta_initial_fld);
         sin_initial = sin(pba->Theta_initial_fld);
         // printf("%e %e %e \n",cos_initial,sin_initial,p);

         n = pba->n_pheno_axion;
         wn = (n-1)/(n+1);

         Eac = sqrt(Omega_r*pow(pba->a_c,-4)+Omega_m*pow(pba->a_c,-3)+pba->Omega0_lambda+pba->Omega_fld_ac);
         // Eac = sqrt((pba->Omega0_g+pba->Omega0_ur)*pow(pba->a_c,-4)+(pba->Omega0_b+pba->Omega0_cdm)*pow(pba->a_c,-3));

         xc = p/Eac;
         f = 7./8;


         if(n>50){
           pba->m_fld = 0;
           pba->alpha_fld = 0;
           Gac = 0;
           pba->omega_axion = 0;
         }
         else{
           pba->m_fld = pow(1-cos_initial,(1.-n)/2.)*sqrt((1-f)*(6*p+2)*pba->Theta_initial_fld/(n*sin_initial))/xc;
           pba->alpha_fld = sqrt(6 * pba->Omega_fld_ac)/pba->m_fld/pow(1-cos_initial,n/2);
           Gac =sqrt(_PI_)*gsl_sf_gamma((n+1.)/(2*n))/gsl_sf_gamma(1+1./(2*n))*pow(2,-(n*n+1)/(2*n))*pow(3,0.5*(1./n-1))
           *pow(pba->a_c,3-6./(1+n))*pow(pow(pba->a_c,6*n/(1+n))+1,0.5*(1./n-1));
           pba->omega_axion = pba->H0*pba->m_fld*pow(1-cos_initial,0.5*(n-1))*Gac;
         }
         if (pba->background_verbose > 1)printf("axion parameters: pba->m_fld  %e /H0, pba->alpha_fld %e/Mpl pba->omega_axion today %e \n", pba->m_fld,pba->alpha_fld,pba->omega_axion);

     }
  }

  /* in verbose mode, inform the user about the value of the ncdm
     masses in eV and about the ratio [m/omega_ncdm] in eV (the usual
     93 point something)*/
  if ((pba->background_verbose > 0) && (pba->has_ncdm == _TRUE_)) {
    for (n_ncdm=0; n_ncdm < pba->N_ncdm; n_ncdm++) {
      printf(" -> non-cold dark matter species with i=%d has m_i = %e eV (so m_i / omega_i =%e eV)\n",
             n_ncdm+1,
             pba->m_ncdm_in_eV[n_ncdm],
             pba->m_ncdm_in_eV[n_ncdm]*pba->deg_ncdm[n_ncdm]/pba->Omega0_ncdm[n_ncdm]/pba->h/pba->h);
    }
  }

  if(pba->has_scf == _TRUE_){
        if(pba->scf_potential == axionquad){
          pba->m_scf = pba->scf_parameters[0]*_eV_over_Mpc_/pba->H0; //from eV to Mpc^-1 to unit of H0
          pba->w_scf = 0;
        }
        else if(pba->scf_potential == axion){
            if(pba->f_axion > 0 && pba->m_scf > 0){
              cos_initial = cos(pba->phi_ini_scf);
              sin_initial = sin(pba->phi_ini_scf);
              // printf("%e %e %e \n",cos_initial,sin_initial,pba->f_axion);

              n = pba->n_axion;


              Gac =sqrt(_PI_)*gsl_sf_gamma((n+1.)/(2*n))/gsl_sf_gamma(1+1./(2*n))*pow(2,-(n*n+1)/(2*n))*pow(3,0.5*(1./n-1))
              *pow(pba->a_c,3-6./(1+n))*pow(pow(pba->a_c,6*n/(1+n))+1,0.5*(1./n-1));
              pba->omega_axion = pba->H0*pba->m_scf*pow(1-cos_initial,0.5*(n-1))*Gac;
            }
        else if(pba->log10_axion_ac > -30 && pba->log10_fraction_axion_ac > -30){
           /*-30 is the default value*/
//            pba->alpha_squared = fabs(pba->alpha_squared);
//            pba->power_of_mu = fabs(pba->power_of_mu);

        /*shoot for both*/
        // pba->power_of_mu= sqrt(pow(pba->power_of_mu,2));
        // pba->mu_squared_alpha_squared= sqrt(pow(pba->mu_squared_alpha_squared,2));
        // Omega_rad_neutrinos = Neff/(1/7.*8./pow(4./11.,4./3.)/pba->Omega0_g);

          Omega_r = pba->Omega0_g;
          if(pba->has_ur == _TRUE_) Omega_r += pba->Omega0_ur;
          Omega_m = pba->Omega0_b;
          if(pba->has_cdm == _TRUE_) Omega_m += pba->Omega0_cdm;
          if(pba->has_idm == _TRUE_) Omega_m += pba->Omega0_idm;
          if(pba->has_dcdm == _TRUE_) Omega_m += pba->Omega0_dcdm;

          a_eq = Omega_r /Omega_m;

          if(pow(10,pba->log10_axion_ac)<a_eq){
            p = 1./2;
            pba->m_scf = pow(pow(10,pba->power_of_mu),-2.);
          }
          else{
            p = 2./3;
            pba->m_scf = pow(pow(10,pba->power_of_mu),-3./2);
          }
          pba->f_axion = sqrt(pow(10,pba->alpha_squared));

          // printf("pba->f_axion %r\n", );
          pba->log10_f_axion = log10(pba->f_axion);
          pba->log10_m_axion = log10(pba->m_scf);

          pba->a_c=pow(10,pba->log10_axion_ac);

          cos_initial = cos(pba->phi_ini_scf);
          sin_initial = sin(pba->phi_ini_scf);
          // printf("%e %e %e \n",cos_initial,sin_initial,p);

          n = pba->n_axion;


          Gac =sqrt(_PI_)*gsl_sf_gamma((n+1.)/(2*n))/gsl_sf_gamma(1+1./(2*n))*pow(2,-(n*n+1)/(2*n))*pow(3,0.5*(1./n-1))
          *pow(pba->a_c,3-6./(1+n))*pow(pow(pba->a_c,6*n/(1+n))+1,0.5*(1./n-1));
          pba->omega_axion = pba->H0*pba->m_scf*pow(1-cos_initial,0.5*(n-1))*Gac;

          // printf("pba->axion_ac %e pba->log10_fraction_axion_ac %e pba->m_scf %e pba->f_axion %e\n",pba->log10_axion_ac,pba->log10_fraction_axion_ac,pba->m_scf,pba->f_axion);
          if(pba->background_verbose>10)printf("pba->m_scf %e pba->f_axion %e pba->omega_axion  %e\n",pba->m_scf,pba->f_axion,pba->omega_axion);
          }

          else if(pba->alpha_squared > -30 && pba->log10_fraction_axion_ac > -30){

            /*shoot for fac by varying alpha*/
            // pba->power_of_mu= sqrt(pow(pba->power_of_mu,2));
            // pba->mu_squared_alpha_squared= sqrt(pow(pba->mu_squared_alpha_squared,2));
            // Omega_rad_neutrinos = Neff/(1/7.*8./pow(4./11.,4./3.)/pba->Omega0_g);

              pba->f_axion = sqrt(pow(10,pba->alpha_squared));

              pba->log10_f_axion = log10(pba->f_axion);
              pba->log10_m_axion = log10(pba->m_scf);
              // printf("pba->axion_ac %e pba->fraction_axion_ac %e pba->m_scf %e pba->f_axion %e\n",pba->axion_ac,pba->fraction_axion_ac,pba->m_scf,pba->f_axion);
              // printf("pba->mu_squared_alpha_squared %e \n",pba->mu_squared_alpha_squared);
          }
          else if(pba->power_of_mu > -30 && pba->log10_axion_ac > -30){
            pba->power_of_mu = fabs(pba->power_of_mu);
            /*shoot for axion ac by varying mu*/
            // pba->power_of_mu= sqrt(pow(pba->power_of_mu,2));
            // pba->mu_squared_alpha_squared= sqrt(pow(pba->mu_squared_alpha_squared,2));
            // Omega_rad_neutrinos = Neff/(1/7.*8./pow(4./11.,4./3.)/pba->Omega0_g);
            Omega_r = pba->Omega0_g;
            if(pba->has_ur == _TRUE_) Omega_r += pba->Omega0_ur;
            Omega_m = pba->Omega0_b;
            if(pba->has_cdm == _TRUE_) Omega_m += pba->Omega0_cdm;
            if(pba->has_idm == _TRUE_) Omega_m += pba->Omega0_idm;
            if(pba->has_dcdm == _TRUE_) Omega_m += pba->Omega0_dcdm;

            a_eq = Omega_r /Omega_m;

            if(pow(10,pba->log10_axion_ac)<a_eq){
              p = 1./2;
              pba->m_scf = pow(pow(10,pba->power_of_mu),-2.);
            }
            else{
              p = 2./3;
              pba->m_scf = pow(pow(10,pba->power_of_mu),-3./2);
            }
              pba->log10_f_axion = log10(pba->f_axion);
              pba->log10_m_axion = log10(pba->m_scf);
              // printf("pba->axion_ac %e pba->log10_fraction_axion_ac %e pba->m_scf %e pba->f_axion %e\n",pba->axion_ac,pba->log10_fraction_axion_ac,pba->m_scf,pba->f_axion);
              // printf("pba->m_scf %e pba->power_of_mu %e \n",pba->m_scf,pba->power_of_mu);
          }

            pba->w_scf = (pba->n_axion-1.0)/(pba->n_axion+1.0);

            // pba->scf_parameters[0]*=pba->f_axion; //conversion from theta_i to phi_i; multiplying by fa
            // pba->scf_parameters[1]*=pba->f_axion; //conversion from theta_dot_i to phi_dot_i; multiplying by fa
            pba->phi_ini_scf*=pba->f_axion; //conversion from theta_i to phi_i; multiplying by fa
            pba->phi_prime_ini_scf*=pba->f_axion; //conversion from theta_dot_i to phi_dot_i; multiplying by fa
            // printf("%e %e\n", pba->scf_parameters[0],  pba->scf_parameters[0]/pba->f_axion);



        }
        else{
          pba->m_scf = 0;
          pba->w_scf = 0; //default to 0 but never used in that case
        }

        pba->f_ede=0.0;
        pba->log10_z_c=1;
        // printf("m_scf is %e pba->w_scf %e pba->f_axion %e\n", pba->m_scf,pba->w_scf,pba->f_axion);
     }

  /** - check that input parameters make sense and write additional information about them */
  class_call(background_checks(ppr,pba),
             pba->error_message,
             pba->error_message);

  /** - integrate the background over log(a), allocate and fill the background table */
  class_call(background_solve(ppr,pba),
             pba->error_message,
             pba->error_message);

  /** - find and store a few derived parameters at radiation-matter equality */
  class_call(background_find_equality(ppr,pba),
             pba->error_message,
             pba->error_message);

  /* - write a summary of the budget of the universe */
  class_call(background_output_budget(pba),
             pba->error_message,
             pba->error_message);

  pba->is_allocated = _TRUE_;

  return _SUCCESS_;

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1058, %rsp           # imm = 0x1058
movq %rsi, %rbx
movq %rdi, %r14
cmpw $0x0, 0xd1a(%rsi)
jle 0x5e9cd
leaq 0xac9f4(%rip), %rdi     # 0x10b3a7
leaq 0x93877(%rip), %rsi     # 0xf2231
xorl %eax, %eax
callq 0x8030
leaq 0xaea9f(%rip), %rdi     # 0x10d467
callq 0x8510
cmpw $0x1, 0x518(%rbx)
jne 0x5ea3c
leaq 0x51a(%rbx), %rdx
leaq 0xac9dc(%rip), %rsi     # 0x10b3c1
leaq 0x50(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x8f687(%rip), %rsi     # 0xee082
leaq 0xaca05(%rip), %rdx     # 0x10b407
leaq 0x850(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8f60f(%rip), %rsi     # 0xee034
leaq 0xac9fa(%rip), %rdx     # 0x10b426
movq %rbx, %rdi
movl $0x3bb, %ecx            # imm = 0x3BB
movq %r15, %r8
jmp 0x5f880
movq %rbx, %rdi
callq 0x5f8b0
cmpw $0x1, 0x4be(%rbx)
jne 0x5eb07
cmpw $0x1, 0x4b4(%rbx)
jne 0x5eb07
cmpw $0x2, 0xd1a(%rbx)
jl 0x5ea85
movsd 0x288(%rbx), %xmm0
divsd 0x28(%rbx), %xmm0
leaq 0xac9b8(%rip), %rdi     # 0x10b436
movb $0x1, %al
callq 0x8030
movsd 0x288(%rbx), %xmm1
movsd 0x268(%rbx), %xmm0
movsd 0x28(%rbx), %xmm2
movapd %xmm0, %xmm3
mulsd %xmm2, %xmm3
ucomisd %xmm3, %xmm1
jbe 0x5eb07
divsd %xmm2, %xmm1
leaq 0xac99d(%rip), %rsi     # 0x10b450
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x30af0
leaq 0x8f5b9(%rip), %rsi     # 0xee082
leaq 0xac9b5(%rip), %rdx     # 0x10b485
leaq 0x850(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8f541(%rip), %rsi     # 0xee034
leaq 0xac92c(%rip), %rdx     # 0x10b426
movq %rbx, %rdi
movl $0x3c5, %ecx            # imm = 0x3C5
jmp 0x5ea34
cmpw $0x1, 0x4c2(%rbx)
jne 0x5efc2
xorpd %xmm0, %xmm0
movupd %xmm0, 0xb8(%rbx)
leaq 0x850(%rsp), %rsi
leaq 0x48(%rsp), %rdx
leaq 0x40(%rsp), %rcx
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x5e095
testl %eax, %eax
je 0x5eb85
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8f89f(%rip), %rsi     # 0xee3f0
leaq 0xac969(%rip), %rdx     # 0x10b4c1
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x8f4c3(%rip), %rsi     # 0xee034
leaq 0xac8ae(%rip), %rdx     # 0x10b426
movq %rbx, %rdi
movl $0x3cc, %ecx            # imm = 0x3CC
jmp 0x5f87d
cmpl $0x1, 0x44(%rbx)
jne 0x5efc2
movsd 0x10(%rbx), %xmm0
cmpw $0x1, 0x4c4(%rbx)
jne 0x5eba6
addsd 0xe8(%rbx), %xmm0
movsd 0x20(%rbx), %xmm1
cmpw $0x1, 0x4b4(%rbx)
jne 0x5ebba
addsd 0x28(%rbx), %xmm1
cmpw $0x1, 0x4b6(%rbx)
jne 0x5ebcc
addsd 0xf0(%rbx), %xmm1
cmpw $0x1, 0x4b8(%rbx)
movsd %xmm0, 0x8(%rsp)
jne 0x5ebe4
addsd 0x330(%rbx), %xmm1
movsd %xmm1, 0x18(%rsp)
movsd 0x78(%rbx), %xmm0
movsd 0x1c8(%rbx), %xmm1
movsd %xmm1, 0x38(%rsp)
callq 0x86a0
movsd %xmm0, 0x30(%rsp)
movsd 0x78(%rbx), %xmm0
callq 0x80a0
movsd %xmm0, 0x28(%rsp)
movsd 0x68(%rbx), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x92835(%rip), %xmm1    # 0xf1468
callq 0x8620
movsd %xmm0, 0x20(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x92832(%rip), %xmm1    # 0xf1480
callq 0x8620
movsd 0x18(%rsp), %xmm2
mulsd %xmm2, %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x20(%rsp), %xmm3
mulsd %xmm1, %xmm3
addsd %xmm0, %xmm3
addsd 0x30(%rbx), %xmm3
addsd 0x90(%rbx), %xmm3
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm3
movapd %xmm3, %xmm0
jb 0x5ec96
movapd %xmm2, %xmm3
sqrtsd %xmm0, %xmm0
jmp 0x5eca7
callq 0x82b0
movsd 0x18(%rsp), %xmm3
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
ucomisd 0xabdd3(%rip), %xmm2    # 0x10aa88
jbe 0x5eccc
xorpd %xmm0, %xmm0
movupd %xmm0, 0x80(%rbx)
xorpd %xmm2, %xmm2
jmp 0x5ef92
divsd %xmm3, %xmm1
xorl %eax, %eax
ucomisd 0x38(%rsp), %xmm1
seta %al
leaq 0xabe5e(%rip), %rcx     # 0x10ab40
movsd (%rcx,%rax,8), %xmm1
movsd %xmm1, 0x8(%rsp)
divsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
movsd 0x8f561(%rip), %xmm1    # 0xee260
movapd %xmm1, %xmm0
subsd 0x30(%rsp), %xmm0
subsd %xmm2, %xmm1
mulsd 0x8ffbb(%rip), %xmm1    # 0xeecd0
movsd %xmm0, 0x20(%rsp)
callq 0x8620
movsd 0x10(%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
mulsd 0x9093c(%rip), %xmm1    # 0xef670
addsd 0x8ffc4(%rip), %xmm1    # 0xeed00
mulsd 0x93dac(%rip), %xmm1    # 0xf2af0
movapd %xmm0, %xmm3
mulsd 0x78(%rbx), %xmm1
movsd 0x28(%rsp), %xmm0
mulsd %xmm2, %xmm0
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
xorpd %xmm4, %xmm4
ucomisd %xmm4, %xmm1
jb 0x5ed6f
sqrtsd %xmm0, %xmm0
jmp 0x5ed8a
movsd %xmm3, 0x8(%rsp)
callq 0x82b0
xorpd %xmm4, %xmm4
movsd 0x8(%rsp), %xmm3
movsd 0x10(%rsp), %xmm2
movapd %xmm2, %xmm1
addsd 0x8f4ca(%rip), %xmm1    # 0xee260
movsd %xmm1, 0x8(%rsp)
movsd 0x8fa44(%rip), %xmm1    # 0xee7e8
addsd %xmm2, %xmm1
movsd %xmm1, 0x30(%rsp)
mulsd %xmm0, %xmm3
divsd 0x18(%rsp), %xmm3
movsd %xmm3, 0x80(%rbx)
movsd 0x90(%rbx), %xmm0
mulsd 0x908a0(%rip), %xmm0    # 0xef670
ucomisd %xmm4, %xmm0
jb 0x5eddc
sqrtsd %xmm0, %xmm0
jmp 0x5ede7
callq 0x82b0
movsd 0x10(%rsp), %xmm2
divsd 0x80(%rbx), %xmm0
movsd %xmm0, 0x18(%rsp)
movapd %xmm2, %xmm1
mulsd 0x8fecf(%rip), %xmm1    # 0xeecd0
movsd 0x20(%rsp), %xmm0
callq 0x8620
movsd 0x18(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x88(%rbx)
movsd 0x10(%rsp), %xmm1
addsd %xmm1, %xmm1
movsd %xmm1, 0x28(%rsp)
movsd 0x8(%rsp), %xmm0
divsd %xmm1, %xmm0
callq 0x5fc88
mulsd 0x926b3(%rip), %xmm0    # 0xf14f8
movsd %xmm0, 0x18(%rsp)
movsd 0x8f40d(%rip), %xmm1    # 0xee260
movapd %xmm1, %xmm0
divsd 0x28(%rsp), %xmm0
addsd %xmm1, %xmm0
callq 0x5fc88
movsd 0x18(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd %xmm0, %xmm0
addsd 0x8f3d8(%rip), %xmm0    # 0xee260
xorpd 0x8f3a0(%rip), %xmm0    # 0xee230
divsd 0x28(%rsp), %xmm0
callq 0x8310
mulsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x8f3b1(%rip), %xmm1    # 0xee260
divsd 0x10(%rsp), %xmm1
addsd 0x8f92b(%rip), %xmm1    # 0xee7e8
mulsd 0x8fe0b(%rip), %xmm1    # 0xeecd0
movsd %xmm1, 0x18(%rsp)
movsd 0x907ad(%rip), %xmm0    # 0xef680
callq 0x8620
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x9077c(%rip), %xmm3    # 0xef670
divsd 0x8(%rsp), %xmm3
movsd 0x9077e(%rip), %xmm1    # 0xef680
subsd %xmm3, %xmm1
callq 0x8620
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x10(%rsp), %xmm1
mulsd 0x90743(%rip), %xmm1    # 0xef670
divsd 0x8(%rsp), %xmm1
callq 0x8620
addsd 0x8f320(%rip), %xmm0    # 0xee260
movsd 0x18(%rsp), %xmm1
callq 0x8620
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd (%rbx), %xmm0
mulsd 0x80(%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x30(%rsp), %xmm1
mulsd 0x8fd59(%rip), %xmm1    # 0xeecd0
movsd 0x20(%rsp), %xmm0
callq 0x8620
movapd %xmm0, %xmm2
mulsd 0x8(%rsp), %xmm2
mulsd 0x10(%rsp), %xmm2
movsd %xmm2, 0x70(%rbx)
movzwl 0xd1a(%rbx), %eax
cmpw $0x2, %ax
jl 0x5efc9
movsd 0x80(%rbx), %xmm0
movsd 0x88(%rbx), %xmm1
leaq 0xac540(%rip), %rdi     # 0x10b4fb
movb $0x3, %al
callq 0x8030
movzwl 0xd1a(%rbx), %eax
testw %ax, %ax
jle 0x5f03f
cmpw $0x1, 0x4be(%rbx)
jne 0x5f03f
cmpl $0x0, 0x248(%rbx)
jle 0x5f03f
xorl %eax, %eax
leaq 0xac569(%rip), %r15     # 0x10b553
movq 0x278(%rbx), %rcx
movsd (%rcx,%rax,8), %xmm0
movq 0x2b0(%rbx), %rcx
movsd (%rcx,%rax,8), %xmm1
mulsd %xmm0, %xmm1
movq 0x280(%rbx), %rcx
divsd (%rcx,%rax,8), %xmm1
leaq 0x1(%rax), %r12
movsd 0x8(%rbx), %xmm2
divsd %xmm2, %xmm1
divsd %xmm2, %xmm1
movq %r15, %rdi
movl %r12d, %esi
movb $0x2, %al
callq 0x8030
movslq 0x248(%rbx), %rcx
movq %r12, %rax
cmpq %rcx, %r12
jl 0x5efea
cmpw $0x1, 0x4bc(%rbx)
jne 0x5f792
movl 0x160(%rbx), %eax
cmpl $0x2, %eax
je 0x5f090
cmpl $0x4, %eax
jne 0x5f27e
movq 0x168(%rbx), %rax
movsd (%rax), %xmm0
mulsd 0x93aec(%rip), %xmm0    # 0xf2b60
divsd (%rbx), %xmm0
movsd %xmm0, 0x188(%rbx)
movq $0x0, 0x218(%rbx)
jmp 0x5f776
movsd 0x190(%rbx), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jbe 0x5f293
movsd 0x188(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x5f293
movsd 0x150(%rbx), %xmm0
callq 0x86a0
movsd %xmm0, 0x28(%rsp)
movsd 0x150(%rbx), %xmm0
callq 0x80a0
movsd 0x210(%rbx), %xmm0
movsd %xmm0, 0x10(%rsp)
movapd %xmm0, %xmm1
addsd 0x8f16e(%rip), %xmm1    # 0xee260
movsd %xmm1, 0x18(%rsp)
movapd %xmm0, %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, 0x20(%rsp)
movapd %xmm1, %xmm0
divsd %xmm2, %xmm0
callq 0x5fc88
mulsd 0x923dd(%rip), %xmm0    # 0xf14f8
movsd %xmm0, 0x8(%rsp)
movsd 0x8f137(%rip), %xmm1    # 0xee260
movapd %xmm1, %xmm0
divsd 0x20(%rsp), %xmm0
addsd %xmm1, %xmm0
callq 0x5fc88
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd %xmm0, %xmm0
addsd 0x8f102(%rip), %xmm0    # 0xee260
xorpd 0x8f0ca(%rip), %xmm0    # 0xee230
divsd 0x20(%rsp), %xmm0
callq 0x8310
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x8f0db(%rip), %xmm1    # 0xee260
divsd 0x10(%rsp), %xmm1
addsd 0x8f655(%rip), %xmm1    # 0xee7e8
mulsd 0x8fb35(%rip), %xmm1    # 0xeecd0
movsd %xmm1, 0x8(%rsp)
movsd 0x904d7(%rip), %xmm0    # 0xef680
callq 0x8620
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x904a6(%rip), %xmm3    # 0xef670
divsd 0x18(%rsp), %xmm3
movsd 0x904a8(%rip), %xmm1    # 0xef680
subsd %xmm3, %xmm1
callq 0x8620
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x90473(%rip), %xmm1    # 0xef670
mulsd 0x10(%rsp), %xmm1
divsd 0x18(%rsp), %xmm1
callq 0x8620
addsd 0x8f04a(%rip), %xmm0    # 0xee260
movsd 0x8(%rsp), %xmm1
callq 0x8620
movsd (%rbx), %xmm1
mulsd 0x188(%rbx), %xmm1
movsd %xmm1, 0x18(%rsp)
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x8f019(%rip), %xmm0    # 0xee260
subsd 0x28(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
addsd 0x8f58d(%rip), %xmm1    # 0xee7e8
mulsd 0x8fa6d(%rip), %xmm1    # 0xeecd0
callq 0x8620
mulsd 0x18(%rsp), %xmm0
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x70(%rbx)
jmp 0x5f72e
xorl %eax, %eax
movq %rax, 0x188(%rbx)
movq %rax, 0x218(%rbx)
jmp 0x5f776
movsd 0x1b8(%rbx), %xmm1
ucomisd 0x938cd(%rip), %xmm1    # 0xf2b70
jbe 0x5f391
movsd 0x1d0(%rbx), %xmm0
ucomisd 0x938b7(%rip), %xmm0    # 0xf2b70
jbe 0x5f391
movsd 0x10(%rbx), %xmm2
cmpw $0x1, 0x4c4(%rbx)
jne 0x5f2d6
addsd 0xe8(%rbx), %xmm2
movsd 0x20(%rbx), %xmm0
cmpw $0x1, 0x4b4(%rbx)
jne 0x5f2ea
addsd 0x28(%rbx), %xmm0
cmpw $0x1, 0x4b6(%rbx)
jne 0x5f2fc
addsd 0xf0(%rbx), %xmm0
cmpw $0x1, 0x4b8(%rbx)
jne 0x5f30e
addsd 0x330(%rbx), %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x10(%rsp)
movsd 0x8f4d0(%rip), %xmm0    # 0xee7f0
callq 0x8620
xorl %r15d, %r15d
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
seta %r15b
movsd 0x1a0(%rbx), %xmm1
movsd 0x8f4aa(%rip), %xmm0    # 0xee7f0
callq 0x8620
leaq 0xab7fe(%rip), %rax     # 0x10ab50
movsd (%rax,%r15,8), %xmm1
callq 0x8620
movsd %xmm0, 0x188(%rbx)
movsd 0x198(%rbx), %xmm1
movsd 0x8f47b(%rip), %xmm0    # 0xee7f0
callq 0x8620
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x5f4c4
sqrtsd %xmm0, %xmm0
jmp 0x5f4c9
movsd 0x198(%rbx), %xmm2
ucomisd 0x937cf(%rip), %xmm2    # 0xf2b70
jbe 0x5f3dd
movsd 0x1d0(%rbx), %xmm0
ucomisd 0x937bd(%rip), %xmm0    # 0xf2b70
jbe 0x5f3dd
movsd 0x8f433(%rip), %xmm0    # 0xee7f0
movapd %xmm2, %xmm1
callq 0x8620
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x5f6ff
sqrtsd %xmm0, %xmm0
jmp 0x5f704
ucomisd 0x9378b(%rip), %xmm1    # 0xf2b70
jbe 0x5f72e
movsd 0x1a0(%rbx), %xmm0
ucomisd 0x93775(%rip), %xmm0    # 0xf2b70
jbe 0x5f72e
andpd 0x8ee37(%rip), %xmm0    # 0xee240
movlpd %xmm0, 0x1a0(%rbx)
movsd 0x10(%rbx), %xmm2
cmpw $0x1, 0x4c4(%rbx)
jne 0x5f428
addsd 0xe8(%rbx), %xmm2
movsd 0x20(%rbx), %xmm0
cmpw $0x1, 0x4b4(%rbx)
jne 0x5f43c
addsd 0x28(%rbx), %xmm0
cmpw $0x1, 0x4b6(%rbx)
jne 0x5f44e
addsd 0xf0(%rbx), %xmm0
cmpw $0x1, 0x4b8(%rbx)
jne 0x5f460
addsd 0x330(%rbx), %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x10(%rsp)
movsd 0x8f37e(%rip), %xmm0    # 0xee7f0
callq 0x8620
xorl %r15d, %r15d
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
seta %r15b
movsd 0x1a0(%rbx), %xmm1
movsd 0x8f358(%rip), %xmm0    # 0xee7f0
callq 0x8620
leaq 0xab6ac(%rip), %rax     # 0x10ab50
movsd (%rax,%r15,8), %xmm1
callq 0x8620
movsd %xmm0, 0x188(%rbx)
movsd 0x190(%rbx), %xmm0
jmp 0x5f70c
callq 0x82b0
movsd %xmm0, 0x190(%rbx)
callq 0x81d0
movsd %xmm0, 0x1a8(%rbx)
movsd 0x188(%rbx), %xmm0
callq 0x81d0
movsd %xmm0, 0x1b0(%rbx)
movsd 0x1b8(%rbx), %xmm1
movsd 0x8f2ed(%rip), %xmm0    # 0xee7f0
callq 0x8620
movsd %xmm0, 0x1c8(%rbx)
movsd 0x150(%rbx), %xmm0
callq 0x86a0
movsd %xmm0, 0x28(%rsp)
movsd 0x150(%rbx), %xmm0
callq 0x80a0
movsd 0x210(%rbx), %xmm0
movsd %xmm0, 0x10(%rsp)
movapd %xmm0, %xmm1
addsd 0x8ed16(%rip), %xmm1    # 0xee260
movsd %xmm1, 0x18(%rsp)
movapd %xmm0, %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, 0x20(%rsp)
movapd %xmm1, %xmm0
divsd %xmm2, %xmm0
callq 0x5fc88
mulsd 0x91f85(%rip), %xmm0    # 0xf14f8
movsd %xmm0, 0x8(%rsp)
movsd 0x8ecdf(%rip), %xmm1    # 0xee260
movapd %xmm1, %xmm0
divsd 0x20(%rsp), %xmm0
addsd %xmm1, %xmm0
callq 0x5fc88
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd %xmm0, %xmm0
addsd 0x8ecaa(%rip), %xmm0    # 0xee260
xorpd 0x8ec72(%rip), %xmm0    # 0xee230
divsd 0x20(%rsp), %xmm0
callq 0x8310
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x8ec83(%rip), %xmm1    # 0xee260
divsd 0x10(%rsp), %xmm1
addsd 0x8f1fd(%rip), %xmm1    # 0xee7e8
mulsd 0x8f6dd(%rip), %xmm1    # 0xeecd0
movsd %xmm1, 0x8(%rsp)
movsd 0x9007f(%rip), %xmm0    # 0xef680
callq 0x8620
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x9004e(%rip), %xmm3    # 0xef670
divsd 0x18(%rsp), %xmm3
movsd 0x90050(%rip), %xmm1    # 0xef680
subsd %xmm3, %xmm1
callq 0x8620
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x9001b(%rip), %xmm1    # 0xef670
mulsd 0x10(%rsp), %xmm1
divsd 0x18(%rsp), %xmm1
callq 0x8620
addsd 0x8ebf2(%rip), %xmm0    # 0xee260
movsd 0x8(%rsp), %xmm1
callq 0x8620
movsd (%rbx), %xmm1
mulsd 0x188(%rbx), %xmm1
movsd %xmm1, 0x18(%rsp)
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x8ebc1(%rip), %xmm0    # 0xee260
subsd 0x28(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
addsd 0x8f135(%rip), %xmm1    # 0xee7e8
mulsd 0x8f615(%rip), %xmm1    # 0xeecd0
callq 0x8620
movapd %xmm0, %xmm2
mulsd 0x18(%rsp), %xmm2
mulsd 0x8(%rsp), %xmm2
movsd %xmm2, 0x70(%rbx)
cmpw $0xb, 0xd1a(%rbx)
jl 0x5f72e
movsd 0x188(%rbx), %xmm0
movsd 0x190(%rbx), %xmm1
leaq 0xabeb3(%rip), %rdi     # 0x10b5a9
movb $0x3, %al
callq 0x8030
jmp 0x5f72e
callq 0x82b0
movsd %xmm0, 0x190(%rbx)
callq 0x81d0
movsd %xmm0, 0x1a8(%rbx)
movsd 0x188(%rbx), %xmm0
callq 0x81d0
movsd %xmm0, 0x1b0(%rbx)
movsd 0x210(%rbx), %xmm0
movsd 0x8f0aa(%rip), %xmm1    # 0xee7e8
addsd %xmm0, %xmm1
addsd 0x8eb16(%rip), %xmm0    # 0xee260
divsd %xmm0, %xmm1
movsd %xmm1, 0x218(%rbx)
movupd 0x150(%rbx), %xmm0
movsd 0x190(%rbx), %xmm1
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm0, %xmm1
movupd %xmm1, 0x150(%rbx)
movq $0x0, 0x200(%rbx)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x1f0(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5fd22
testl %eax, %eax
je 0x5f7e3
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8ec41(%rip), %rsi     # 0xee3f0
leaq 0xabe27(%rip), %rdx     # 0x10b5dd
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x8e865(%rip), %rsi     # 0xee034
leaq 0xabc50(%rip), %rdx     # 0x10b426
movq %rbx, %rdi
movl $0x499, %ecx            # imm = 0x499
jmp 0x5f87d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x601fa
testl %eax, %eax
je 0x5f831
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8ebf0(%rip), %rsi     # 0xee3f0
leaq 0xabdf1(%rip), %rdx     # 0x10b5f8
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x8e814(%rip), %rsi     # 0xee034
leaq 0xabbff(%rip), %rdx     # 0x10b426
movq %rbx, %rdi
movl $0x49e, %ecx            # imm = 0x49E
jmp 0x5f87d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6162b
testl %eax, %eax
je 0x5f89b
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8eba2(%rip), %rsi     # 0xee3f0
leaq 0xabdbd(%rip), %rdx     # 0x10b612
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x8e7c6(%rip), %rsi     # 0xee034
leaq 0xabbb1(%rip), %rdx     # 0x10b426
movq %rbx, %rdi
movl $0x4a3, %ecx            # imm = 0x4A3
movq %r14, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x1058, %rsp           # imm = 0x1058
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x61904
movw $0x1, 0x151c(%rbx)
xorl %eax, %eax
jmp 0x5f88c