// File: /workspace/github_c_makefile_star2_O1/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 0x61075
leaq 0xad32c(%rip), %rdi     # 0x10e387
leaq 0x941bf(%rip), %rsi     # 0xf5221
xorl %eax, %eax
callq 0x8030
leaq 0xaf3d7(%rip), %rdi     # 0x110447
callq 0x8510
cmpw $0x1, 0x518(%rbx)
jne 0x610e4
leaq 0x51a(%rbx), %rdx
leaq 0xad314(%rip), %rsi     # 0x10e3a1
leaq 0x50(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x8ffdf(%rip), %rsi     # 0xf1082
leaq 0xad33d(%rip), %rdx     # 0x10e3e7
leaq 0x850(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8ff67(%rip), %rsi     # 0xf1034
leaq 0xad332(%rip), %rdx     # 0x10e406
movq %rbx, %rdi
movl $0x3bb, %ecx            # imm = 0x3BB
movq %r15, %r8
jmp 0x61f28
movq %rbx, %rdi
callq 0x61f58
cmpw $0x1, 0x4be(%rbx)
jne 0x611af
cmpw $0x1, 0x4b4(%rbx)
jne 0x611af
cmpw $0x2, 0xd1a(%rbx)
jl 0x6112d
movsd 0x288(%rbx), %xmm0
divsd 0x28(%rbx), %xmm0
leaq 0xad2f0(%rip), %rdi     # 0x10e416
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 0x611af
divsd %xmm2, %xmm1
leaq 0xad2d5(%rip), %rsi     # 0x10e430
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x30c2c
leaq 0x8ff11(%rip), %rsi     # 0xf1082
leaq 0xad2ed(%rip), %rdx     # 0x10e465
leaq 0x850(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8fe99(%rip), %rsi     # 0xf1034
leaq 0xad264(%rip), %rdx     # 0x10e406
movq %rbx, %rdi
movl $0x3c5, %ecx            # imm = 0x3C5
jmp 0x610dc
cmpw $0x1, 0x4c2(%rbx)
jne 0x6166c
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 0x6074e
testl %eax, %eax
je 0x6122d
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x901f7(%rip), %rsi     # 0xf13f0
leaq 0xad2a1(%rip), %rdx     # 0x10e4a1
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x8fe1b(%rip), %rsi     # 0xf1034
leaq 0xad1e6(%rip), %rdx     # 0x10e406
movq %rbx, %rdi
movl $0x3cc, %ecx            # imm = 0x3CC
jmp 0x61f25
cmpl $0x1, 0x44(%rbx)
jne 0x6166c
movsd 0x10(%rbx), %xmm0
cmpw $0x1, 0x4c4(%rbx)
jne 0x6124e
addsd 0xe8(%rbx), %xmm0
movsd 0x20(%rbx), %xmm1
cmpw $0x1, 0x4b4(%rbx)
jne 0x61262
addsd 0x28(%rbx), %xmm1
cmpw $0x1, 0x4b6(%rbx)
jne 0x61274
addsd 0xf0(%rbx), %xmm1
cmpw $0x1, 0x4b8(%rbx)
movsd %xmm0, 0x8(%rsp)
jne 0x6128c
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 0x9317d(%rip), %xmm1    # 0xf4458
callq 0x8620
movsd %xmm0, 0x20(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x9317a(%rip), %xmm1    # 0xf4470
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 0x6133e
movapd %xmm2, %xmm3
sqrtsd %xmm0, %xmm0
jmp 0x6134f
callq 0x82b0
movsd 0x18(%rsp), %xmm3
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
ucomisd 0xac703(%rip), %xmm2    # 0x10da60
jbe 0x61378
movq $0x0, 0x70(%rbx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x80(%rbx)
jmp 0x6163f
divsd %xmm3, %xmm1
xorl %eax, %eax
ucomisd 0x38(%rsp), %xmm1
seta %al
leaq 0xac792(%rip), %rcx     # 0x10db20
movsd (%rcx,%rax,8), %xmm1
movsd %xmm1, 0x8(%rsp)
divsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
movsd 0x8feb5(%rip), %xmm1    # 0xf1260
movapd %xmm1, %xmm0
subsd 0x30(%rsp), %xmm0
subsd %xmm2, %xmm1
mulsd 0x9090f(%rip), %xmm1    # 0xf1cd0
movsd %xmm0, 0x20(%rsp)
callq 0x8620
movsd 0x10(%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
mulsd 0x91290(%rip), %xmm1    # 0xf2670
addsd 0x90918(%rip), %xmm1    # 0xf1d00
mulsd 0x946d0(%rip), %xmm1    # 0xf5ac0
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 0x6141b
sqrtsd %xmm0, %xmm0
jmp 0x61436
movsd %xmm3, 0x8(%rsp)
callq 0x82b0
xorpd %xmm4, %xmm4
movsd 0x8(%rsp), %xmm3
movsd 0x10(%rsp), %xmm2
movapd %xmm2, %xmm1
addsd 0x8fe1e(%rip), %xmm1    # 0xf1260
movsd %xmm1, 0x8(%rsp)
movsd 0x90398(%rip), %xmm1    # 0xf17e8
addsd %xmm2, %xmm1
movsd %xmm1, 0x30(%rsp)
mulsd %xmm0, %xmm3
divsd 0x18(%rsp), %xmm3
movsd %xmm3, 0x80(%rbx)
movsd 0x90(%rbx), %xmm0
mulsd 0x911f4(%rip), %xmm0    # 0xf2670
ucomisd %xmm4, %xmm0
jb 0x61488
sqrtsd %xmm0, %xmm0
jmp 0x61493
callq 0x82b0
movsd 0x10(%rsp), %xmm2
divsd 0x80(%rbx), %xmm0
movsd %xmm0, 0x18(%rsp)
movapd %xmm2, %xmm1
mulsd 0x90823(%rip), %xmm1    # 0xf1cd0
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 0x62398
mulsd 0x92ff7(%rip), %xmm0    # 0xf44e8
movsd %xmm0, 0x18(%rsp)
movsd 0x8fd61(%rip), %xmm1    # 0xf1260
movapd %xmm1, %xmm0
divsd 0x28(%rsp), %xmm0
addsd %xmm1, %xmm0
callq 0x62398
movsd 0x18(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd %xmm0, %xmm0
addsd 0x8fd2c(%rip), %xmm0    # 0xf1260
xorpd 0x8fcf4(%rip), %xmm0    # 0xf1230
divsd 0x28(%rsp), %xmm0
callq 0x8310
mulsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x8fd05(%rip), %xmm1    # 0xf1260
divsd 0x10(%rsp), %xmm1
addsd 0x9027f(%rip), %xmm1    # 0xf17e8
mulsd 0x9075f(%rip), %xmm1    # 0xf1cd0
movsd %xmm1, 0x18(%rsp)
movsd 0x91101(%rip), %xmm0    # 0xf2680
callq 0x8620
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x910d0(%rip), %xmm3    # 0xf2670
divsd 0x8(%rsp), %xmm3
movsd 0x910d2(%rip), %xmm1    # 0xf2680
subsd %xmm3, %xmm1
callq 0x8620
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x10(%rsp), %xmm1
mulsd 0x91097(%rip), %xmm1    # 0xf2670
divsd 0x8(%rsp), %xmm1
callq 0x8620
addsd 0x8fc74(%rip), %xmm0    # 0xf1260
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 0x906ad(%rip), %xmm1    # 0xf1cd0
movsd 0x20(%rsp), %xmm0
callq 0x8620
mulsd 0x8(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x70(%rbx)
cmpw $0x2, 0xd1a(%rbx)
jl 0x6166c
movsd 0x70(%rbx), %xmm2
movsd 0x80(%rbx), %xmm0
movsd 0x88(%rbx), %xmm1
leaq 0xace76(%rip), %rdi     # 0x10e4db
movb $0x3, %al
callq 0x8030
cmpw $0x0, 0xd1a(%rbx)
jle 0x616e7
cmpw $0x1, 0x4be(%rbx)
jne 0x616e7
cmpl $0x0, 0x248(%rbx)
jle 0x616e7
xorl %eax, %eax
leaq 0xacea1(%rip), %r15     # 0x10e533
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 0x61692
cmpw $0x1, 0x4bc(%rbx)
jne 0x61e3a
movl 0x160(%rbx), %eax
cmpl $0x2, %eax
je 0x61738
cmpl $0x4, %eax
jne 0x61926
movq 0x168(%rbx), %rax
movsd (%rax), %xmm0
mulsd 0x94414(%rip), %xmm0    # 0xf5b30
divsd (%rbx), %xmm0
movsd %xmm0, 0x188(%rbx)
movq $0x0, 0x218(%rbx)
jmp 0x61e1e
movsd 0x190(%rbx), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jbe 0x6193b
movsd 0x188(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x6193b
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 0x8fac6(%rip), %xmm1    # 0xf1260
movsd %xmm1, 0x18(%rsp)
movapd %xmm0, %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, 0x20(%rsp)
movapd %xmm1, %xmm0
divsd %xmm2, %xmm0
callq 0x62398
mulsd 0x92d25(%rip), %xmm0    # 0xf44e8
movsd %xmm0, 0x8(%rsp)
movsd 0x8fa8f(%rip), %xmm1    # 0xf1260
movapd %xmm1, %xmm0
divsd 0x20(%rsp), %xmm0
addsd %xmm1, %xmm0
callq 0x62398
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd %xmm0, %xmm0
addsd 0x8fa5a(%rip), %xmm0    # 0xf1260
xorpd 0x8fa22(%rip), %xmm0    # 0xf1230
divsd 0x20(%rsp), %xmm0
callq 0x8310
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x8fa33(%rip), %xmm1    # 0xf1260
divsd 0x10(%rsp), %xmm1
addsd 0x8ffad(%rip), %xmm1    # 0xf17e8
mulsd 0x9048d(%rip), %xmm1    # 0xf1cd0
movsd %xmm1, 0x8(%rsp)
movsd 0x90e2f(%rip), %xmm0    # 0xf2680
callq 0x8620
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x90dfe(%rip), %xmm3    # 0xf2670
divsd 0x18(%rsp), %xmm3
movsd 0x90e00(%rip), %xmm1    # 0xf2680
subsd %xmm3, %xmm1
callq 0x8620
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x90dcb(%rip), %xmm1    # 0xf2670
mulsd 0x10(%rsp), %xmm1
divsd 0x18(%rsp), %xmm1
callq 0x8620
addsd 0x8f9a2(%rip), %xmm0    # 0xf1260
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 0x8f971(%rip), %xmm0    # 0xf1260
subsd 0x28(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
addsd 0x8fee5(%rip), %xmm1    # 0xf17e8
mulsd 0x903c5(%rip), %xmm1    # 0xf1cd0
callq 0x8620
mulsd 0x18(%rsp), %xmm0
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x70(%rbx)
jmp 0x61dd6
xorl %eax, %eax
movq %rax, 0x188(%rbx)
movq %rax, 0x218(%rbx)
jmp 0x61e1e
movsd 0x1b8(%rbx), %xmm1
ucomisd 0x941f5(%rip), %xmm1    # 0xf5b40
jbe 0x61a39
movsd 0x1d0(%rbx), %xmm0
ucomisd 0x941df(%rip), %xmm0    # 0xf5b40
jbe 0x61a39
movsd 0x10(%rbx), %xmm2
cmpw $0x1, 0x4c4(%rbx)
jne 0x6197e
addsd 0xe8(%rbx), %xmm2
movsd 0x20(%rbx), %xmm0
cmpw $0x1, 0x4b4(%rbx)
jne 0x61992
addsd 0x28(%rbx), %xmm0
cmpw $0x1, 0x4b6(%rbx)
jne 0x619a4
addsd 0xf0(%rbx), %xmm0
cmpw $0x1, 0x4b8(%rbx)
jne 0x619b6
addsd 0x330(%rbx), %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x10(%rsp)
movsd 0x8fe28(%rip), %xmm0    # 0xf17f0
callq 0x8620
xorl %r15d, %r15d
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
seta %r15b
movsd 0x1a0(%rbx), %xmm1
movsd 0x8fe02(%rip), %xmm0    # 0xf17f0
callq 0x8620
leaq 0xac136(%rip), %rax     # 0x10db30
movsd (%rax,%r15,8), %xmm1
callq 0x8620
movsd %xmm0, 0x188(%rbx)
movsd 0x198(%rbx), %xmm1
movsd 0x8fdd3(%rip), %xmm0    # 0xf17f0
callq 0x8620
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x61b6c
sqrtsd %xmm0, %xmm0
jmp 0x61b71
movsd 0x198(%rbx), %xmm2
ucomisd 0x940f7(%rip), %xmm2    # 0xf5b40
jbe 0x61a85
movsd 0x1d0(%rbx), %xmm0
ucomisd 0x940e5(%rip), %xmm0    # 0xf5b40
jbe 0x61a85
movsd 0x8fd8b(%rip), %xmm0    # 0xf17f0
movapd %xmm2, %xmm1
callq 0x8620
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x61da7
sqrtsd %xmm0, %xmm0
jmp 0x61dac
ucomisd 0x940b3(%rip), %xmm1    # 0xf5b40
jbe 0x61dd6
movsd 0x1a0(%rbx), %xmm0
ucomisd 0x9409d(%rip), %xmm0    # 0xf5b40
jbe 0x61dd6
andpd 0x8f78f(%rip), %xmm0    # 0xf1240
movlpd %xmm0, 0x1a0(%rbx)
movsd 0x10(%rbx), %xmm2
cmpw $0x1, 0x4c4(%rbx)
jne 0x61ad0
addsd 0xe8(%rbx), %xmm2
movsd 0x20(%rbx), %xmm0
cmpw $0x1, 0x4b4(%rbx)
jne 0x61ae4
addsd 0x28(%rbx), %xmm0
cmpw $0x1, 0x4b6(%rbx)
jne 0x61af6
addsd 0xf0(%rbx), %xmm0
cmpw $0x1, 0x4b8(%rbx)
jne 0x61b08
addsd 0x330(%rbx), %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x10(%rsp)
movsd 0x8fcd6(%rip), %xmm0    # 0xf17f0
callq 0x8620
xorl %r15d, %r15d
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
seta %r15b
movsd 0x1a0(%rbx), %xmm1
movsd 0x8fcb0(%rip), %xmm0    # 0xf17f0
callq 0x8620
leaq 0xabfe4(%rip), %rax     # 0x10db30
movsd (%rax,%r15,8), %xmm1
callq 0x8620
movsd %xmm0, 0x188(%rbx)
movsd 0x190(%rbx), %xmm0
jmp 0x61db4
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 0x8fc45(%rip), %xmm0    # 0xf17f0
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 0x8f66e(%rip), %xmm1    # 0xf1260
movsd %xmm1, 0x18(%rsp)
movapd %xmm0, %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, 0x20(%rsp)
movapd %xmm1, %xmm0
divsd %xmm2, %xmm0
callq 0x62398
mulsd 0x928cd(%rip), %xmm0    # 0xf44e8
movsd %xmm0, 0x8(%rsp)
movsd 0x8f637(%rip), %xmm1    # 0xf1260
movapd %xmm1, %xmm0
divsd 0x20(%rsp), %xmm0
addsd %xmm1, %xmm0
callq 0x62398
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd %xmm0, %xmm0
addsd 0x8f602(%rip), %xmm0    # 0xf1260
xorpd 0x8f5ca(%rip), %xmm0    # 0xf1230
divsd 0x20(%rsp), %xmm0
callq 0x8310
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x8f5db(%rip), %xmm1    # 0xf1260
divsd 0x10(%rsp), %xmm1
addsd 0x8fb55(%rip), %xmm1    # 0xf17e8
mulsd 0x90035(%rip), %xmm1    # 0xf1cd0
movsd %xmm1, 0x8(%rsp)
movsd 0x909d7(%rip), %xmm0    # 0xf2680
callq 0x8620
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x909a6(%rip), %xmm3    # 0xf2670
divsd 0x18(%rsp), %xmm3
movsd 0x909a8(%rip), %xmm1    # 0xf2680
subsd %xmm3, %xmm1
callq 0x8620
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x1c8(%rbx), %xmm0
movsd 0x90973(%rip), %xmm1    # 0xf2670
mulsd 0x10(%rsp), %xmm1
divsd 0x18(%rsp), %xmm1
callq 0x8620
addsd 0x8f54a(%rip), %xmm0    # 0xf1260
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 0x8f519(%rip), %xmm0    # 0xf1260
subsd 0x28(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
addsd 0x8fa8d(%rip), %xmm1    # 0xf17e8
mulsd 0x8ff6d(%rip), %xmm1    # 0xf1cd0
callq 0x8620
movapd %xmm0, %xmm2
mulsd 0x18(%rsp), %xmm2
mulsd 0x8(%rsp), %xmm2
movsd %xmm2, 0x70(%rbx)
cmpw $0xb, 0xd1a(%rbx)
jl 0x61dd6
movsd 0x188(%rbx), %xmm0
movsd 0x190(%rbx), %xmm1
leaq 0xac7eb(%rip), %rdi     # 0x10e589
movb $0x3, %al
callq 0x8030
jmp 0x61dd6
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 0x8fa02(%rip), %xmm1    # 0xf17e8
addsd %xmm0, %xmm1
addsd 0x8f46e(%rip), %xmm0    # 0xf1260
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 0x62432
testl %eax, %eax
je 0x61e8b
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8f599(%rip), %rsi     # 0xf13f0
leaq 0xac75f(%rip), %rdx     # 0x10e5bd
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x8f1bd(%rip), %rsi     # 0xf1034
leaq 0xac588(%rip), %rdx     # 0x10e406
movq %rbx, %rdi
movl $0x499, %ecx            # imm = 0x499
jmp 0x61f25
movq %r14, %rdi
movq %rbx, %rsi
callq 0x62955
testl %eax, %eax
je 0x61ed9
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8f548(%rip), %rsi     # 0xf13f0
leaq 0xac729(%rip), %rdx     # 0x10e5d8
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x8f16c(%rip), %rsi     # 0xf1034
leaq 0xac537(%rip), %rdx     # 0x10e406
movq %rbx, %rdi
movl $0x49e, %ecx            # imm = 0x49E
jmp 0x61f25
movq %r14, %rdi
movq %rbx, %rsi
callq 0x63da7
testl %eax, %eax
je 0x61f43
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8f4fa(%rip), %rsi     # 0xf13f0
leaq 0xac6f5(%rip), %rdx     # 0x10e5f2
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x8f11e(%rip), %rsi     # 0xf1034
leaq 0xac4e9(%rip), %rdx     # 0x10e406
movq %rbx, %rdi
movl $0x4a3, %ecx            # imm = 0x4A3
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
addq $0x1058, %rsp           # imm = 0x1058
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x6408d
movw $0x1, 0x151c(%rbx)
xorl %eax, %eax
jmp 0x61f34