// File: /workspace/github_c_makefile_star2_O2/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 0x5aa1d
leaq 0xa7864(%rip), %rdi     # 0x102267
leaq 0x8e747(%rip), %rsi     # 0xe9151
xorl %eax, %eax
callq 0x8030
leaq 0xa990f(%rip), %rdi     # 0x104327
callq 0x8540
cmpw $0x1, 0x518(%rbx)
jne 0x5aa8c
leaq 0x51a(%rbx), %rdx
leaq 0xa784c(%rip), %rsi     # 0x102281
leaq 0x50(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x8a637(%rip), %rsi     # 0xe5082
leaq 0xa7875(%rip), %rdx     # 0x1022c7
leaq 0x850(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8a5bf(%rip), %rsi     # 0xe5034
leaq 0xa786a(%rip), %rdx     # 0x1022e6
movq %rbx, %rdi
movl $0x3bb, %ecx            # imm = 0x3BB
movq %r15, %r8
jmp 0x5b8bb
movq %rbx, %rdi
callq 0x5b8e9
cmpw $0x1, 0x4be(%rbx)
jne 0x5ab57
cmpw $0x1, 0x4b4(%rbx)
jne 0x5ab57
cmpw $0x2, 0xd1a(%rbx)
jl 0x5aad5
movsd 0x288(%rbx), %xmm0
divsd 0x28(%rbx), %xmm0
leaq 0xa7828(%rip), %rdi     # 0x1022f6
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 0x5ab57
divsd %xmm2, %xmm1
leaq 0xa780d(%rip), %rsi     # 0x102310
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x2e014
leaq 0x8a569(%rip), %rsi     # 0xe5082
leaq 0xa7825(%rip), %rdx     # 0x102345
leaq 0x850(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8a4f1(%rip), %rsi     # 0xe5034
leaq 0xa779c(%rip), %rdx     # 0x1022e6
movq %rbx, %rdi
movl $0x3c5, %ecx            # imm = 0x3C5
jmp 0x5aa84
cmpw $0x1, 0x4c2(%rbx)
jne 0x5b012
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 0x5a0e7
testl %eax, %eax
je 0x5abd5
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8a84f(%rip), %rsi     # 0xe53f0
leaq 0xa77d9(%rip), %rdx     # 0x102381
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x8a473(%rip), %rsi     # 0xe5034
leaq 0xa771e(%rip), %rdx     # 0x1022e6
movq %rbx, %rdi
movl $0x3cc, %ecx            # imm = 0x3CC
jmp 0x5b8b8
cmpl $0x1, 0x44(%rbx)
jne 0x5b012
movsd 0x10(%rbx), %xmm0
cmpw $0x1, 0x4c4(%rbx)
jne 0x5abf6
addsd 0xe8(%rbx), %xmm0
movsd 0x20(%rbx), %xmm1
cmpw $0x1, 0x4b4(%rbx)
jne 0x5ac0a
addsd 0x28(%rbx), %xmm1
cmpw $0x1, 0x4b6(%rbx)
jne 0x5ac1c
addsd 0xf0(%rbx), %xmm1
cmpw $0x1, 0x4b8(%rbx)
movsd %xmm0, 0x8(%rsp)
jne 0x5ac34
addsd 0x330(%rbx), %xmm1
movsd %xmm1, 0x18(%rsp)
movsd 0x78(%rbx), %xmm0
movsd 0x1c8(%rbx), %xmm1
movsd %xmm1, 0x38(%rsp)
callq 0x86d0
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 0x8d7a5(%rip), %xmm1    # 0xe8428
callq 0x8650
movsd %xmm0, 0x20(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x8d7a2(%rip), %xmm1    # 0xe8440
callq 0x8650
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 0x5ace6
movapd %xmm2, %xmm3
sqrtsd %xmm0, %xmm0
jmp 0x5acf7
callq 0x82d0
movsd 0x18(%rsp), %xmm3
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
ucomisd 0xa6c4b(%rip), %xmm2    # 0x101950
jbe 0x5ad1c
xorpd %xmm0, %xmm0
movupd %xmm0, 0x80(%rbx)
xorpd %xmm2, %xmm2
jmp 0x5afe2
divsd %xmm3, %xmm1
xorl %eax, %eax
ucomisd 0x38(%rsp), %xmm1
seta %al
leaq 0xa6cde(%rip), %rcx     # 0x101a10
movsd (%rcx,%rax,8), %xmm1
movsd %xmm1, 0x8(%rsp)
divsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
movsd 0x8a511(%rip), %xmm1    # 0xe5260
movapd %xmm1, %xmm0
subsd 0x30(%rsp), %xmm0
subsd %xmm2, %xmm1
mulsd 0x8af4b(%rip), %xmm1    # 0xe5cb0
movsd %xmm0, 0x20(%rsp)
callq 0x8650
movsd 0x10(%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
mulsd 0x8b8cc(%rip), %xmm1    # 0xe6650
addsd 0x8af54(%rip), %xmm1    # 0xe5ce0
mulsd 0x8ec1c(%rip), %xmm1    # 0xe99b0
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 0x5adbf
sqrtsd %xmm0, %xmm0
jmp 0x5adda
movsd %xmm3, 0x8(%rsp)
callq 0x82d0
xorpd %xmm4, %xmm4
movsd 0x8(%rsp), %xmm3
movsd 0x10(%rsp), %xmm2
movapd %xmm2, %xmm1
addsd 0x8a47a(%rip), %xmm1    # 0xe5260
movsd %xmm1, 0x8(%rsp)
movsd 0x8a9f4(%rip), %xmm1    # 0xe57e8
addsd %xmm2, %xmm1
movsd %xmm1, 0x30(%rsp)
mulsd %xmm0, %xmm3
divsd 0x18(%rsp), %xmm3
movsd %xmm3, 0x80(%rbx)
movsd 0x90(%rbx), %xmm0
mulsd 0x8b830(%rip), %xmm0    # 0xe6650
ucomisd %xmm4, %xmm0
jb 0x5ae2c
sqrtsd %xmm0, %xmm0
jmp 0x5ae37
callq 0x82d0
movsd 0x10(%rsp), %xmm2
divsd 0x80(%rbx), %xmm0
movsd %xmm0, 0x18(%rsp)
movapd %xmm2, %xmm1
mulsd 0x8ae5f(%rip), %xmm1    # 0xe5cb0
movsd 0x20(%rsp), %xmm0
callq 0x8650
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 0x5bcb4
mulsd 0x8d623(%rip), %xmm0    # 0xe84b8
movsd %xmm0, 0x18(%rsp)
movsd 0x8a3bd(%rip), %xmm1    # 0xe5260
movapd %xmm1, %xmm0
divsd 0x28(%rsp), %xmm0
addsd %xmm1, %xmm0
callq 0x5bcb4
movsd 0x18(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd %xmm0, %xmm0
addsd 0x8a388(%rip), %xmm0    # 0xe5260
xorpd 0x8a350(%rip), %xmm0    # 0xe5230
divsd 0x28(%rsp), %xmm0
callq 0x8330
mulsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x8a361(%rip), %xmm1    # 0xe5260
divsd 0x10(%rsp), %xmm1
addsd 0x8a8db(%rip), %xmm1    # 0xe57e8
mulsd 0x8ad9b(%rip), %xmm1    # 0xe5cb0
movsd %xmm1, 0x18(%rsp)
movsd 0x8b825(%rip), %xmm0    # 0xe6748
callq 0x8650
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x8b70c(%rip), %xmm3    # 0xe6650
divsd 0x8(%rsp), %xmm3
movsd 0x8b7f6(%rip), %xmm1    # 0xe6748
subsd %xmm3, %xmm1
callq 0x8650
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x10(%rsp), %xmm1
mulsd 0x8b6d3(%rip), %xmm1    # 0xe6650
divsd 0x8(%rsp), %xmm1
callq 0x8650
addsd 0x8a2d0(%rip), %xmm0    # 0xe5260
movsd 0x18(%rsp), %xmm1
callq 0x8650
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd (%rbx), %xmm0
mulsd 0x80(%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x30(%rsp), %xmm1
mulsd 0x8ace9(%rip), %xmm1    # 0xe5cb0
movsd 0x20(%rsp), %xmm0
callq 0x8650
movapd %xmm0, %xmm2
mulsd 0x8(%rsp), %xmm2
mulsd 0x10(%rsp), %xmm2
movsd %xmm2, 0x70(%rbx)
movzwl 0xd1a(%rbx), %eax
cmpw $0x2, %ax
jl 0x5b019
movsd 0x80(%rbx), %xmm0
movsd 0x88(%rbx), %xmm1
leaq 0xa73b0(%rip), %rdi     # 0x1023bb
movb $0x3, %al
callq 0x8030
movzwl 0xd1a(%rbx), %eax
testw %ax, %ax
jle 0x5b088
cmpw $0x1, 0x4be(%rbx)
jne 0x5b088
xorl %r12d, %r12d
leaq 0xa73e1(%rip), %r15     # 0x102413
movslq 0x248(%rbx), %rax
cmpq %rax, %r12
jge 0x5b088
movq 0x278(%rbx), %rax
movsd (%rax,%r12,8), %xmm0
movq 0x2b0(%rbx), %rax
movsd (%rax,%r12,8), %xmm1
mulsd %xmm0, %xmm1
movq 0x280(%rbx), %rax
divsd (%rax,%r12,8), %xmm1
incq %r12
movsd 0x8(%rbx), %xmm2
divsd %xmm2, %xmm1
divsd %xmm2, %xmm1
movq %r15, %rdi
movl %r12d, %esi
movb $0x2, %al
callq 0x8030
jmp 0x5b032
cmpw $0x1, 0x4bc(%rbx)
jne 0x5b7cd
movl 0x160(%rbx), %eax
cmpl $0x2, %eax
je 0x5b0ce
cmpl $0x4, %eax
jne 0x5b2bc
movq 0x168(%rbx), %rax
movsd (%rax), %xmm0
mulsd 0x8e963(%rip), %xmm0    # 0xe9a20
divsd (%rbx), %xmm0
movsd %xmm0, 0x188(%rbx)
jmp 0x5b2c4
movsd 0x190(%rbx), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jbe 0x5b2d1
movsd 0x188(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x5b2d1
movsd 0x150(%rbx), %xmm0
callq 0x86d0
movsd %xmm0, 0x28(%rsp)
movsd 0x150(%rbx), %xmm0
callq 0x80a0
movsd 0x210(%rbx), %xmm0
movsd %xmm0, 0x10(%rsp)
movapd %xmm0, %xmm1
addsd 0x8a130(%rip), %xmm1    # 0xe5260
movsd %xmm1, 0x18(%rsp)
movapd %xmm0, %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, 0x20(%rsp)
movapd %xmm1, %xmm0
divsd %xmm2, %xmm0
callq 0x5bcb4
mulsd 0x8d35f(%rip), %xmm0    # 0xe84b8
movsd %xmm0, 0x8(%rsp)
movsd 0x8a0f9(%rip), %xmm1    # 0xe5260
movapd %xmm1, %xmm0
divsd 0x20(%rsp), %xmm0
addsd %xmm1, %xmm0
callq 0x5bcb4
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd %xmm0, %xmm0
addsd 0x8a0c4(%rip), %xmm0    # 0xe5260
xorpd 0x8a08c(%rip), %xmm0    # 0xe5230
divsd 0x20(%rsp), %xmm0
callq 0x8330
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x8a09d(%rip), %xmm1    # 0xe5260
divsd 0x10(%rsp), %xmm1
addsd 0x8a617(%rip), %xmm1    # 0xe57e8
mulsd 0x8aad7(%rip), %xmm1    # 0xe5cb0
movsd %xmm1, 0x8(%rsp)
movsd 0x8b561(%rip), %xmm0    # 0xe6748
callq 0x8650
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x8b448(%rip), %xmm3    # 0xe6650
divsd 0x18(%rsp), %xmm3
movsd 0x8b532(%rip), %xmm1    # 0xe6748
subsd %xmm3, %xmm1
callq 0x8650
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x8b415(%rip), %xmm1    # 0xe6650
mulsd 0x10(%rsp), %xmm1
divsd 0x18(%rsp), %xmm1
callq 0x8650
addsd 0x8a00c(%rip), %xmm0    # 0xe5260
movsd 0x8(%rsp), %xmm1
callq 0x8650
movsd (%rbx), %xmm1
mulsd 0x188(%rbx), %xmm1
movsd %xmm1, 0x18(%rsp)
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x89fdb(%rip), %xmm0    # 0xe5260
subsd 0x28(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
addsd 0x8a54f(%rip), %xmm1    # 0xe57e8
mulsd 0x8aa0f(%rip), %xmm1    # 0xe5cb0
callq 0x8650
mulsd 0x18(%rsp), %xmm0
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x70(%rbx)
jmp 0x5b76c
andq $0x0, 0x188(%rbx)
andq $0x0, 0x218(%rbx)
jmp 0x5b7b4
movsd 0x1b8(%rbx), %xmm1
ucomisd 0x8e74f(%rip), %xmm1    # 0xe9a30
jbe 0x5b3cf
movsd 0x1d0(%rbx), %xmm0
ucomisd 0x8e739(%rip), %xmm0    # 0xe9a30
jbe 0x5b3cf
movsd 0x10(%rbx), %xmm2
cmpw $0x1, 0x4c4(%rbx)
jne 0x5b314
addsd 0xe8(%rbx), %xmm2
movsd 0x20(%rbx), %xmm0
cmpw $0x1, 0x4b4(%rbx)
jne 0x5b328
addsd 0x28(%rbx), %xmm0
cmpw $0x1, 0x4b6(%rbx)
jne 0x5b33a
addsd 0xf0(%rbx), %xmm0
cmpw $0x1, 0x4b8(%rbx)
jne 0x5b34c
addsd 0x330(%rbx), %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x10(%rsp)
movsd 0x8a492(%rip), %xmm0    # 0xe57f0
callq 0x8650
xorl %r15d, %r15d
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
seta %r15b
movsd 0x1a0(%rbx), %xmm1
movsd 0x8a46c(%rip), %xmm0    # 0xe57f0
callq 0x8650
leaq 0xa6690(%rip), %rax     # 0x101a20
movsd (%rax,%r15,8), %xmm1
callq 0x8650
movsd %xmm0, 0x188(%rbx)
movsd 0x198(%rbx), %xmm1
movsd 0x8a43d(%rip), %xmm0    # 0xe57f0
callq 0x8650
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x5b502
sqrtsd %xmm0, %xmm0
jmp 0x5b507
movsd 0x198(%rbx), %xmm2
ucomisd 0x8e651(%rip), %xmm2    # 0xe9a30
jbe 0x5b41b
movsd 0x1d0(%rbx), %xmm0
ucomisd 0x8e63f(%rip), %xmm0    # 0xe9a30
jbe 0x5b41b
movsd 0x8a3f5(%rip), %xmm0    # 0xe57f0
movapd %xmm2, %xmm1
callq 0x8650
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x5b73d
sqrtsd %xmm0, %xmm0
jmp 0x5b742
ucomisd 0x8e60d(%rip), %xmm1    # 0xe9a30
jbe 0x5b76c
movsd 0x1a0(%rbx), %xmm0
ucomisd 0x8e5f7(%rip), %xmm0    # 0xe9a30
jbe 0x5b76c
andpd 0x89df9(%rip), %xmm0    # 0xe5240
movlpd %xmm0, 0x1a0(%rbx)
movsd 0x10(%rbx), %xmm2
cmpw $0x1, 0x4c4(%rbx)
jne 0x5b466
addsd 0xe8(%rbx), %xmm2
movsd 0x20(%rbx), %xmm0
cmpw $0x1, 0x4b4(%rbx)
jne 0x5b47a
addsd 0x28(%rbx), %xmm0
cmpw $0x1, 0x4b6(%rbx)
jne 0x5b48c
addsd 0xf0(%rbx), %xmm0
cmpw $0x1, 0x4b8(%rbx)
jne 0x5b49e
addsd 0x330(%rbx), %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x10(%rsp)
movsd 0x8a340(%rip), %xmm0    # 0xe57f0
callq 0x8650
xorl %r15d, %r15d
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
seta %r15b
movsd 0x1a0(%rbx), %xmm1
movsd 0x8a31a(%rip), %xmm0    # 0xe57f0
callq 0x8650
leaq 0xa653e(%rip), %rax     # 0x101a20
movsd (%rax,%r15,8), %xmm1
callq 0x8650
movsd %xmm0, 0x188(%rbx)
movsd 0x190(%rbx), %xmm0
jmp 0x5b74a
callq 0x82d0
movsd %xmm0, 0x190(%rbx)
callq 0x81f0
movsd %xmm0, 0x1a8(%rbx)
movsd 0x188(%rbx), %xmm0
callq 0x81f0
movsd %xmm0, 0x1b0(%rbx)
movsd 0x1b8(%rbx), %xmm1
movsd 0x8a2af(%rip), %xmm0    # 0xe57f0
callq 0x8650
movsd %xmm0, 0x1c8(%rbx)
movsd 0x150(%rbx), %xmm0
callq 0x86d0
movsd %xmm0, 0x28(%rsp)
movsd 0x150(%rbx), %xmm0
callq 0x80a0
movsd 0x210(%rbx), %xmm0
movsd %xmm0, 0x10(%rsp)
movapd %xmm0, %xmm1
addsd 0x89cd8(%rip), %xmm1    # 0xe5260
movsd %xmm1, 0x18(%rsp)
movapd %xmm0, %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, 0x20(%rsp)
movapd %xmm1, %xmm0
divsd %xmm2, %xmm0
callq 0x5bcb4
mulsd 0x8cf07(%rip), %xmm0    # 0xe84b8
movsd %xmm0, 0x8(%rsp)
movsd 0x89ca1(%rip), %xmm1    # 0xe5260
movapd %xmm1, %xmm0
divsd 0x20(%rsp), %xmm0
addsd %xmm1, %xmm0
callq 0x5bcb4
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd %xmm0, %xmm0
addsd 0x89c6c(%rip), %xmm0    # 0xe5260
xorpd 0x89c34(%rip), %xmm0    # 0xe5230
divsd 0x20(%rsp), %xmm0
callq 0x8330
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x89c45(%rip), %xmm1    # 0xe5260
divsd 0x10(%rsp), %xmm1
addsd 0x8a1bf(%rip), %xmm1    # 0xe57e8
mulsd 0x8a67f(%rip), %xmm1    # 0xe5cb0
movsd %xmm1, 0x8(%rsp)
movsd 0x8b109(%rip), %xmm0    # 0xe6748
callq 0x8650
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x8aff0(%rip), %xmm3    # 0xe6650
divsd 0x18(%rsp), %xmm3
movsd 0x8b0da(%rip), %xmm1    # 0xe6748
subsd %xmm3, %xmm1
callq 0x8650
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x8afbd(%rip), %xmm1    # 0xe6650
mulsd 0x10(%rsp), %xmm1
divsd 0x18(%rsp), %xmm1
callq 0x8650
addsd 0x89bb4(%rip), %xmm0    # 0xe5260
movsd 0x8(%rsp), %xmm1
callq 0x8650
movsd (%rbx), %xmm1
mulsd 0x188(%rbx), %xmm1
movsd %xmm1, 0x18(%rsp)
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x89b83(%rip), %xmm0    # 0xe5260
subsd 0x28(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
addsd 0x8a0f7(%rip), %xmm1    # 0xe57e8
mulsd 0x8a5b7(%rip), %xmm1    # 0xe5cb0
callq 0x8650
movapd %xmm0, %xmm2
mulsd 0x18(%rsp), %xmm2
mulsd 0x8(%rsp), %xmm2
movsd %xmm2, 0x70(%rbx)
cmpw $0xb, 0xd1a(%rbx)
jl 0x5b76c
movsd 0x188(%rbx), %xmm0
movsd 0x190(%rbx), %xmm1
leaq 0xa6d35(%rip), %rdi     # 0x102469
movb $0x3, %al
callq 0x8030
jmp 0x5b76c
callq 0x82d0
movsd %xmm0, 0x190(%rbx)
callq 0x81f0
movsd %xmm0, 0x1a8(%rbx)
movsd 0x188(%rbx), %xmm0
callq 0x81f0
movsd %xmm0, 0x1b0(%rbx)
movsd 0x210(%rbx), %xmm0
movsd 0x8a06c(%rip), %xmm1    # 0xe57e8
addsd %xmm0, %xmm1
addsd 0x89ad8(%rip), %xmm0    # 0xe5260
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)
andq $0x0, 0x200(%rbx)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x1f0(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5bd4b
testl %eax, %eax
je 0x5b81e
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x89c06(%rip), %rsi     # 0xe53f0
leaq 0xa6cac(%rip), %rdx     # 0x10249d
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x8982a(%rip), %rsi     # 0xe5034
leaq 0xa6ad5(%rip), %rdx     # 0x1022e6
movq %rbx, %rdi
movl $0x499, %ecx            # imm = 0x499
jmp 0x5b8b8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5c205
testl %eax, %eax
je 0x5b86c
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x89bb5(%rip), %rsi     # 0xe53f0
leaq 0xa6c76(%rip), %rdx     # 0x1024b8
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x897d9(%rip), %rsi     # 0xe5034
leaq 0xa6a84(%rip), %rdx     # 0x1022e6
movq %rbx, %rdi
movl $0x49e, %ecx            # imm = 0x49E
jmp 0x5b8b8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5d605
testl %eax, %eax
je 0x5b8d4
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x89b67(%rip), %rsi     # 0xe53f0
leaq 0xa6c42(%rip), %rdx     # 0x1024d2
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x8978b(%rip), %rsi     # 0xe5034
leaq 0xa6a36(%rip), %rdx     # 0x1022e6
movq %rbx, %rdi
movl $0x4a3, %ecx            # imm = 0x4A3
movq %r14, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
addq $0x1058, %rsp           # imm = 0x1058
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x5d8ca
movw $0x1, 0x151c(%rbx)
xorl %eax, %eax
jmp 0x5b8c5