// File: /workspace/github_c_makefile_star2_O1/PoulinV[P]AxiCLASS/build/../source/input.c
// Function: input_try_unknown_parameters
int input_try_unknown_parameters(double * unknown_parameter,
                                 int unknown_parameters_size,
                                 void * voidpfzw,
                                 double * output,
                                 ErrorMsg errmsg){
  /** Summary */

  /** Define local variables */
  struct precision pr;        /* for precision parameters */
  struct background ba;       /* for cosmological background */
  struct thermodynamics th;           /* for thermodynamics */
  struct perturbations pt;         /* for source functions */
  struct transfer tr;        /* for transfer functions */
  struct primordial pm;       /* for primordial spectra */
  struct harmonic hr;          /* for output spectra */
  struct fourier fo;        /* for non-linear spectra */
  struct lensing le;          /* for lensed spectra */
  struct distortions sd;      /* for spectral distortions */
  struct output op;           /* for output files */

  int i;
  double rho_dcdm_today, rho_dr_today;
  struct fzerofun_workspace * pfzw;
  int input_verbose;
  int flag;
  int param;
  double ac;
  short compute_sigma8 = _FALSE_;

  /* Assume for now shooting did not fail */
  ba.shooting_failed = _FALSE_;

  pfzw = (struct fzerofun_workspace *) voidpfzw;
  /** Read input parameters */
  // This needs to be done with enough accuracy. A standard double has a relative
  // precision of around 1e-16, so 1e-20 should be good enough for the shooting
  for (i=0; i < unknown_parameters_size; i++) {
    class_sprintf(pfzw->fc.value[pfzw->unknown_parameters_index[i]],"%.20e",unknown_parameter[i]);
  }

  class_call(input_read_precisions(&(pfzw->fc),&pr,&ba,&th,&pt,&tr,&pm,&hr,&fo,&le,&sd,&op,
                                   errmsg),
             errmsg,
             errmsg);

  class_call(input_read_parameters(&(pfzw->fc),&pr,&ba,&th,&pt,&tr,&pm,&hr,&fo,&le,&sd,&op,
                                   errmsg),
             errmsg,
             errmsg);

  class_call(parser_read_int(&(pfzw->fc),"input_verbose",&param,&flag,errmsg),
             errmsg,
             errmsg);

  if (flag == _TRUE_)
    input_verbose = param;
  else
    input_verbose = 0;

  /** Optimise flags for sigma8 calculation.*/
  for (i=0; i < unknown_parameters_size; i++) {
    if (pfzw->target_name[i] == sigma8) {
      compute_sigma8 = _TRUE_;
    }
    if (pfzw->target_name[i] == S8) {
      compute_sigma8 = _TRUE_;
    }
  }

  /* Sigma8 depends on linear P(k), so no need to run anything except linear P(k) during shooting */
  if (compute_sigma8 == _TRUE_) {
    /* In June 2020 the k_max_for_pk was increased for higher precision,
       and in February 2022 the value was converted into a set of two precision parameters */
    pt.k_max_for_pk=
      MIN(MAX(pr.k_max_for_pk_sigma8_min, pt.k_max_for_pk),
          pr.k_max_for_pk_sigma8_max);
    pt.has_pk_matter=_TRUE_;
    pt.has_perturbations = _TRUE_;
    pt.has_cl_cmb_temperature = _FALSE_;
    pt.has_cls = _FALSE_;
    pt.has_cl_cmb_polarization = _FALSE_;
    pt.has_cl_cmb_lensing_potential = _FALSE_;
    pt.has_cl_number_count = _FALSE_;
    pt.has_cl_lensing_potential=_FALSE_;
    pt.has_density_transfers=_FALSE_;
    pt.has_velocity_transfers=_FALSE_;
    fo.has_pk_eq=_FALSE_;
    fo.method=nl_none;
  }

  /** Shoot forward into class up to required stage */
  if (pfzw->required_computation_stage >= cs_background){
    if (input_verbose>2)
      printf("Stage 1: background\n");
    ba.background_verbose = 0;
    class_call_except(background_init(&pr,&ba), ba.error_message, errmsg, background_free_input(&ba);thermodynamics_free_input(&th);perturbations_free_input(&pt););
  }

  if (pfzw->required_computation_stage >= cs_thermodynamics){
    if (input_verbose>2)
      printf("Stage 2: thermodynamics\n");
    pr.thermo_Nz_lin = 10000;
    pr.thermo_Nz_log = 500;
    th.thermodynamics_verbose = 0;
    th.hyrec_verbose = 0;
    class_call_except(thermodynamics_init(&pr,&ba,&th), th.error_message, errmsg, background_free(&ba);thermodynamics_free_input(&th);perturbations_free_input(&pt););
  }

  if (pfzw->required_computation_stage >= cs_perturbations){
    if (input_verbose>2)
      printf("Stage 3: perturbations\n");
    pt.perturbations_verbose = 0;
    class_call_except(perturbations_init(&pr,&ba,&th,&pt), pt.error_message, errmsg, thermodynamics_free(&th);background_free(&ba);perturbations_free_input(&pt););
  }

  if (pfzw->required_computation_stage >= cs_primordial){
    if (input_verbose>2)
      printf("Stage 4: primordial\n");
    pm.primordial_verbose = 0;
    class_call_except(primordial_init(&pr,&pt,&pm), pm.error_message, errmsg, perturbations_free(&pt);thermodynamics_free(&th);background_free(&ba));
  }

  if (pfzw->required_computation_stage >= cs_nonlinear){
    if (input_verbose>2)
      printf("Stage 5: nonlinear\n");
    fo.fourier_verbose = 0;
    class_call_except(fourier_init(&pr,&ba,&th,&pt,&pm,&fo), fo.error_message, errmsg, primordial_free(&pm);perturbations_free(&pt);thermodynamics_free(&th);background_free(&ba));
  }

  if (pfzw->required_computation_stage >= cs_transfer){
    if (input_verbose>2)
      printf("Stage 6: transfer\n");
    tr.transfer_verbose = 0;
    class_call_except(transfer_init(&pr,&ba,&th,&pt,&fo,&tr), tr.error_message, errmsg, fourier_free(&fo);primordial_free(&pm);perturbations_free(&pt);thermodynamics_free(&th);background_free(&ba));
  }

  if (pfzw->required_computation_stage >= cs_spectra){
    if (input_verbose>2)
      printf("Stage 7: spectra\n");
    hr.harmonic_verbose = 0;
    class_call_except(harmonic_init(&pr,&ba,&pt,&pm,&fo,&tr,&hr),hr.error_message, errmsg, transfer_free(&tr);fourier_free(&fo);primordial_free(&pm);perturbations_free(&pt);thermodynamics_free(&th);background_free(&ba));
  }

  /** Get the corresponding shoot variable and put into output */
  for (i=0; i < pfzw->target_size; i++) {
    switch (pfzw->target_name[i]) {
      case theta_s:
      case theta_s_100:
        output[i] = 100.*th.rs_rec/th.ra_rec-pfzw->target_value[i];
        break;
      case Neff:
        output[i] = ba.Neff-pfzw->target_value[i];
        break;
      case Omega_dcdmdr:
        rho_dcdm_today = ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_rho_dcdm];
        if (ba.has_dr == _TRUE_)
          rho_dr_today = ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_rho_dr];
        else
          rho_dr_today = 0.;
        output[i] = (rho_dcdm_today+rho_dr_today)/(ba.H0*ba.H0)-pfzw->target_value[i];
        break;
      case omega_dcdmdr:
        rho_dcdm_today = ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_rho_dcdm];
        if (ba.has_dr == _TRUE_)
          rho_dr_today = ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_rho_dr];
        else
          rho_dr_today = 0.;
        output[i] = (rho_dcdm_today+rho_dr_today)/(ba.H0*ba.H0)-pfzw->target_value[i]/ba.h/ba.h;
        break;
      case fraction_axion_ac: // TLS where to print out log10_fraction_axion_ac and axion_ac
        // output[i] = log10(ba.f_ede)-pfzw->target_value[i];
        output[i] = ba.f_ede-pfzw->target_value[i];
        if(input_verbose>10)printf("ba.f_ede %e  pfzw->target_value[i] %e output[i] %e\n", ba.f_ede,pfzw->target_value[i],output[i]);
        break;
      case log10_axion_ac:
        ac = 1./(pow(10,ba.log10_z_c)+1);
        output[i] = log10(ac)-pfzw->target_value[i];
         if(input_verbose>10)printf("ac %e  pfzw->target_value[i] %e output[i] %e\n", log10(ac),pfzw->target_value[i],output[i]);
        break;
      case log10_fraction_axion_ac_phi2n: // TLS where to print out log10_fraction_axion_ac and axion_ac
        output[i] = log10(ba.f_ede)-pfzw->target_value[i];
         // printf("ba.f_ede %e  pfzw->target_value[i] %e output[i] %e\n", log10(ba.f_ede),pfzw->target_value[i],output[i]);
        break;
      case Omega_scf_shoot_fa:
         output[i] = ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_rho_scf]/(ba.H0*ba.H0)
          -ba.Omega0_scf;
        pfzw->target_value[i] = ba.Omega0_scf;
        if(input_verbose>10){
            printf("Shooting in f_a for Omega_ax \n");
            printf("f_axion: %e\n", ba.f_axion);
            printf("rho_ax / rho_crit: %e\n",ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_rho_scf]/(ba.H0*ba.H0));
            printf("distance away from target: %e\n", ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_rho_scf]/(ba.H0*ba.H0) - ba.Omega0_scf);
          }
        break;
      case log10_axion_ac_phi2n:
        ac = 1./(pow(10,ba.log10_z_c)+1);
        output[i] = log10(ac)-pfzw->target_value[i];
         // printf("ac %e  pfzw->target_value[i] %e output[i] %e\n", log10(ac),pfzw->target_value[i],output[i]);
        break;

      case Omega_scf:
        /** - In case scalar field is used to fill, pba->Omega0_scf is not equal to pfzw->target_value[i].*/
      /*cjcomment is this the value of energy density used for matching in shooting? */
      /*COComment This must be updated to use value of rho from fluid equation */
        output[i] = ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_rho_scf]/(ba.H0*ba.H0)
          -ba.Omega0_scf;
        pfzw->target_value[i] = ba.Omega0_scf;
          // printf("output[i] for scalar field %e \n", output[i]);
          // COComment Old print statements for scalar field, not relevant now using fluid equations as phi no longer evolves to end
          // printf("Made up of minus : %e \n", -ba.Omega0_scf);
          // printf("background table [] %e where bt_size = %e, bg_size = %e and index_bg_rho_scf = %e \n", ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_rho_scf],ba.bt_size,ba.bg_size,ba.index_bg_rho_scf);
          // printf("backgroundtable[] / H0^2 = %e \n ", ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_rho_scf]/(ba.H0*ba.H0));
          if(input_verbose>10){
            printf("Where does the code end up? \n");
            printf("rho_ax / rho_crit: %e\n",ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_rho_scf]/(ba.H0*ba.H0));
            printf("distance away from target: %e\n", ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_rho_scf]/(ba.H0*ba.H0) - ba.Omega0_scf);
          }
          // printf("phi: %e\n", ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_phi_scf]);
          // printf("phidot: %e\n", ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_phi_prime_scf]);
          // printf("K.E (not divided by a, as a=1?): %e\n", ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_phi_prime_scf]*ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_phi_prime_scf]/2);
          // printf("potential: %e\n",ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_V_scf]);


        break;
      case Omega_ini_dcdm:
      case omega_ini_dcdm:
        rho_dcdm_today = ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_rho_dcdm];

        if (ba.has_dr == _TRUE_)
          rho_dr_today = ba.background_table[(ba.bt_size-1)*ba.bg_size+ba.index_bg_rho_dr];
        else
          rho_dr_today = 0.;
        output[i] = -(rho_dcdm_today+rho_dr_today)/(ba.H0*ba.H0)+ba.Omega0_dcdmdr;
        break;
      case a_peak_eq:
        output[i] = ba.a_peak-ba.a_eq;
        if(input_verbose>2) printf("a_peak from bg = %e \t a_peak - a_eq = %e\n", ba.a_peak, output[i]);
        break;
      case sigma8:
        output[i] = fo.sigma8[fo.index_pk_m];
        break;
      case S8:
        output[i] = fo.sigma8[fo.index_pk_m]*sqrt(ba.Omega0_m/0.3);
        break;
    }
  }

  /** Free structures */
  if (pfzw->required_computation_stage >= cs_spectra){
    class_call(harmonic_free(&hr), hr.error_message, errmsg);
  }
  if (pfzw->required_computation_stage >= cs_transfer){
    class_call(transfer_free(&tr), tr.error_message, errmsg);
  }
  if (pfzw->required_computation_stage >= cs_nonlinear){
    class_call(fourier_free(&fo), fo.error_message, errmsg);
  }
  if (pfzw->required_computation_stage >= cs_primordial){
    class_call(primordial_free(&pm), pm.error_message, errmsg);
  }
  if (pfzw->required_computation_stage >= cs_perturbations){
    class_call(perturbations_free(&pt), pt.error_message, errmsg);
  }
  if (pfzw->required_computation_stage >= cs_thermodynamics){
    class_call(thermodynamics_free(&th), th.error_message, errmsg);
  }
  if (pfzw->required_computation_stage >= cs_background){
    class_call(background_free(&ba), ba.error_message, errmsg);
  }

  /** Set filecontent to unread */
  for (i=0; i<pfzw->fc.size; i++) {
    pfzw->fc.read[i] = _FALSE_;
  }

  /** Free pointers allocated on input if neccessary */
  if (pfzw->required_computation_stage < cs_perturbations) {
    /** Some pointers in ppt may not be allocated if has_perturbations is _FALSE_, but this is handled in perturbations_free_input as neccessary. */
    perturbations_free_input(&pt);
  }
  if (pfzw->required_computation_stage < cs_thermodynamics) {
    thermodynamics_free_input(&th);
  }
  if (pfzw->required_computation_stage < cs_background) {
    background_free_input(&ba);
  }
  return _SUCCESS_;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x11e78, %rsp          # imm = 0x11E78
movq %r8, %rbp
movq %rcx, 0x18(%rsp)
movq %rdx, %r14
movw $0x0, 0x538(%rsp)
movl %esi, 0x8(%rsp)
testl %esi, %esi
jle 0x3fc28
movq %rdi, %r12
movl 0x8(%rsp), %r15d
xorl %ebx, %ebx
leaq 0xb37bc(%rip), %r13     # 0xf33a4
movsd (%r12,%rbx,8), %xmm0
xorl %edi, %edi
xorl %esi, %esi
movq %r13, %rdx
movb $0x1, %al
callq 0x8550
movq (%r14), %rcx
movslq (%rcx,%rbx,4), %rdi
shlq $0xa, %rdi
addq 0x20(%r14), %rdi
incl %eax
movslq %eax, %rsi
movsd (%r12,%rbx,8), %xmm0
movq %r13, %rdx
movb $0x1, %al
callq 0x8550
incq %rbx
cmpq %rbx, %r15
jne 0x3fbe8
leaq 0x8(%r14), %r12
subq $0x40, %rsp
movq %rbp, 0x30(%rsp)
leaq 0x4ad0(%rsp), %rsi
movq %r12, %rdi
callq 0x32551
addq $0x40, %rsp
cmpl $0x1, %eax
jne 0x3fc8c
leaq 0xb179b(%rip), %rsi     # 0xf13f0
leaq 0xb7944(%rip), %rdx     # 0xf75a0
leaq 0x7720(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xb13bc(%rip), %rsi     # 0xf1034
leaq 0xb7b1a(%rip), %rdx     # 0xf7799
movq %rbp, %rdi
movl $0x775, %ecx            # imm = 0x775
jmp 0x3fd98
subq $0x8, %rsp
leaq 0xf458(%rsp), %rax
leaq 0x10078(%rsp), %r10
leaq 0xebc0(%rsp), %r11
movq %rbp, %rbx
leaq 0x1d48(%rsp), %rbp
leaq 0x5cc8(%rsp), %r13
leaq 0x26e0(%rsp), %r15
leaq 0x4a98(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x3230(%rsp), %rcx
leaq 0x7728(%rsp), %r8
leaq 0x65b8(%rsp), %r9
movq %r12, %rdi
pushq %rbx
pushq %rax
pushq %r10
pushq %r11
pushq %rbp
pushq %r13
pushq %r15
callq 0x3ccb8
addq $0x40, %rsp
testl %eax, %eax
je 0x3fd3e
leaq 0xb16e6(%rip), %rsi     # 0xf13f0
leaq 0xb78f6(%rip), %rdx     # 0xf7607
leaq 0x1540(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xb1307(%rip), %rsi     # 0xf1034
leaq 0xb7a65(%rip), %rdx     # 0xf7799
movq %rbx, %rdi
movl $0x77a, %ecx            # imm = 0x77A
jmp 0x3fd98
leaq 0xb654f(%rip), %rsi     # 0xf6294
leaq 0x10(%rsp), %rdx
leaq 0x14(%rsp), %rcx
movq %r12, %rdi
movq %rbx, %r8
callq 0x1e6c0
cmpl $0x1, %eax
jne 0x3fdbb
leaq 0xb168a(%rip), %rsi     # 0xf13f0
leaq 0xb7a49(%rip), %rdx     # 0xf77b6
leaq 0x1540(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xb12ab(%rip), %rsi     # 0xf1034
leaq 0xb7a09(%rip), %rdx     # 0xf7799
movq %rbx, %rdi
movl $0x77e, %ecx            # imm = 0x77E
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %ebx
movl %ebx, %eax
addq $0x11e78, %rsp          # imm = 0x11E78
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r12d, %r12d
cmpl $0x1, 0x14(%rsp)
jne 0x3fdca
movl 0x10(%rsp), %r12d
movl 0x8(%rsp), %ecx
testl %ecx, %ecx
movq 0x18(%rsp), %r15
jle 0x3fe6a
movq 0x30(%r14), %rax
movl %ecx, %ecx
xorl %edx, %edx
movl $0x1, %esi
xorl %edi, %edi
movl (%rax,%rdx,4), %r8d
andl $-0x2, %r8d
cmpl $0xe, %r8d
cmovel %esi, %edi
incq %rdx
cmpq %rdx, %rcx
jne 0x3fdea
cmpw $0x1, %di
jne 0x3fe6a
movsd 0x7778(%rsp), %xmm0
maxsd 0x52d0(%rsp), %xmm0
minsd 0x52d8(%rsp), %xmm0
movsd %xmm0, 0x7778(%rsp)
movw $0x1, 0x7720(%rsp)
xorl %eax, %eax
movw %ax, 0x772c(%rsp)
movq $0x0, 0x7748(%rsp)
movq $0x10000, 0x7750(%rsp) # imm = 0x10000
movw %ax, 0x1d68(%rsp)
movl $0x0, 0x1d40(%rsp)
cmpl $0x3, %r12d
jl 0x3fe7c
leaq 0xcd822(%rip), %rdi     # 0x10d699
callq 0x8510
leaq 0x20(%rsp), %rsi
movw $0x0, 0xd1a(%rsi)
leaq 0x4a90(%rsp), %rdi
callq 0x61036
cmpl $0x1, %eax
jne 0x3fef3
leaq 0xd3c(%rsp), %rcx
leaq 0xb1545(%rip), %rsi     # 0xf13f0
leaq 0xb7945(%rip), %rdx     # 0xf77f7
leaq 0x1540(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0xb1169(%rip), %rsi     # 0xf1034
leaq 0xb78c7(%rip), %rdx     # 0xf7799
movq %rbx, %rdi
movl $0x7a9, %ecx            # imm = 0x7A9
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
leaq 0x20(%rsp), %rdi
callq 0x647c7
jmp 0x3ff9c
cmpl $0x0, 0x44(%r14)
je 0x3ffbb
cmpl $0x3, %r12d
jl 0x3ff10
leaq 0xcd7a2(%rip), %rdi     # 0x10d6ad
callq 0x8510
movabsq $0x1f400002710, %rax    # imm = 0x1F400002710
leaq 0x4a90(%rsp), %rdi
movq %rax, 0x1a8(%rdi)
leaq 0x3228(%rsp), %rdx
movl $0x0, 0x1060(%rdx)
leaq 0x20(%rsp), %rsi
callq 0x69a95
cmpl $0x1, %eax
jne 0x3ffbb
leaq 0x428c(%rsp), %rcx
leaq 0xb1497(%rip), %rsi     # 0xf13f0
leaq 0xb78b0(%rip), %rdx     # 0xf7810
leaq 0x1540(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0xb10bb(%rip), %rsi     # 0xf1034
leaq 0xb7819(%rip), %rdx     # 0xf7799
movq %rbx, %rdi
movl $0x7b3, %ecx            # imm = 0x7B3
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
leaq 0x20(%rsp), %rdi
callq 0x6474d
leaq 0x3228(%rsp), %rdi
callq 0x6dce4
leaq 0x7720(%rsp), %rdi
callq 0x7a388
jmp 0x3fda2
cmpl $0x2, 0x44(%r14)
jb 0x4006c
cmpl $0x3, %r12d
jl 0x3ffd8
leaq 0xcd6f2(%rip), %rdi     # 0x10d6c5
callq 0x8510
leaq 0x7720(%rsp), %rcx
movw $0x0, 0x6c88(%rcx)
leaq 0x4a90(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x3228(%rsp), %rdx
callq 0x75f3c
cmpl $0x1, %eax
jne 0x4006c
leaq 0xe3aa(%rsp), %rcx
leaq 0xb13d9(%rip), %rsi     # 0xf13f0
leaq 0xb7813(%rip), %rdx     # 0xf7831
leaq 0x1540(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0xb0ffd(%rip), %rsi     # 0xf1034
leaq 0xb775b(%rip), %rdx     # 0xf7799
movq %rbx, %rdi
movl $0x7ba, %ecx            # imm = 0x7BA
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
leaq 0x3228(%rsp), %rdi
callq 0x6dc22
leaq 0x20(%rsp), %rdi
callq 0x6474d
jmp 0x3ffa9
cmpl $0x3, 0x44(%r14)
jb 0x40101
cmpl $0x3, %r12d
jl 0x40089
leaq 0xcd658(%rip), %rdi     # 0x10d6dc
callq 0x8510
leaq 0x26d8(%rsp), %rdx
movw $0x0, 0x328(%rdx)
leaq 0x4a90(%rsp), %rdi
leaq 0x7720(%rsp), %rsi
callq 0x979d2
cmpl $0x1, %eax
jne 0x40101
leaq 0x2a02(%rsp), %rcx
leaq 0xb132d(%rip), %rsi     # 0xf13f0
leaq 0xb778b(%rip), %rdx     # 0xf7855
leaq 0x1540(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0xb0f51(%rip), %rsi     # 0xf1034
leaq 0xb76af(%rip), %rdx     # 0xf7799
movq %rbx, %rdi
movl $0x7c1, %ecx            # imm = 0x7C1
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
jmp 0x40332
cmpl $0x4, 0x44(%r14)
jb 0x401ac
cmpl $0x3, %r12d
jl 0x4011e
leaq 0xcd5d7(%rip), %rdi     # 0x10d6f0
callq 0x8510
leaq 0x1d40(%rsp), %r9
movw $0x0, 0x190(%r9)
leaq 0x4a90(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x3228(%rsp), %rdx
leaq 0x7720(%rsp), %rcx
leaq 0x26d8(%rsp), %r8
callq 0xa2df5
cmpl $0x1, %eax
jne 0x401ac
leaq 0x1ed2(%rsp), %rcx
leaq 0xb1282(%rip), %rsi     # 0xf13f0
leaq 0xb76fd(%rip), %rdx     # 0xf7872
leaq 0x1540(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0xb0ea6(%rip), %rsi     # 0xf1034
leaq 0xb7604(%rip), %rdx     # 0xf7799
movq %rbx, %rdi
movl $0x7c8, %ecx            # imm = 0x7C8
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
jmp 0x40325
cmpl $0x5, 0x44(%r14)
jb 0x40257
cmpl $0x3, %r12d
jl 0x401c9
leaq 0xcd53f(%rip), %rdi     # 0x10d703
callq 0x8510
leaq 0x65b0(%rsp), %r9
movw $0x0, 0x968(%r9)
leaq 0x4a90(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x3228(%rsp), %rdx
leaq 0x7720(%rsp), %rcx
leaq 0x1d40(%rsp), %r8
callq 0xa6de6
cmpl $0x1, %eax
jne 0x40257
leaq 0x6f1a(%rsp), %rcx
leaq 0xb11d7(%rip), %rsi     # 0xf13f0
leaq 0xb7678(%rip), %rdx     # 0xf7898
leaq 0x1540(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0xb0dfb(%rip), %rsi     # 0xf1034
leaq 0xb7559(%rip), %rdx     # 0xf7799
movq %rbx, %rdi
movl $0x7cf, %ecx            # imm = 0x7CF
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
jmp 0x40318
cmpl $0x6, 0x44(%r14)
jb 0x4035b
cmpl $0x3, %r12d
jl 0x40274
leaq 0xcd4a6(%rip), %rdi     # 0x10d715
callq 0x8510
movw $0x0, 0x5da8(%rsp)
subq $0x8, %rsp
leaq 0x4a98(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x7728(%rsp), %rdx
leaq 0x26e0(%rsp), %rcx
leaq 0x1d48(%rsp), %r8
leaq 0x65b8(%rsp), %r9
pushq %r13
callq 0xb6460
addq $0x10, %rsp
cmpl $0x1, %eax
jne 0x4035b
leaq 0x5daa(%rsp), %rcx
leaq 0xb111e(%rip), %rsi     # 0xf13f0
leaq 0xb75e6(%rip), %rdx     # 0xf78bf
leaq 0x1540(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0xb0d42(%rip), %rsi     # 0xf1034
leaq 0xb74a0(%rip), %rdx     # 0xf7799
movq %rbx, %rdi
movl $0x7d6, %ecx            # imm = 0x7D6
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
leaq 0x65b0(%rsp), %rdi
callq 0xab3bf
leaq 0x1d40(%rsp), %rdi
callq 0xa6046
leaq 0x26d8(%rsp), %rdi
callq 0x99a1a
leaq 0x7720(%rsp), %rdi
callq 0x7a3b2
leaq 0x3228(%rsp), %rdi
callq 0x6dc22
leaq 0x20(%rsp), %rdi
callq 0x6474d
jmp 0x3fda2
cmpl $0x0, 0x40(%r14)
jle 0x40875
xorl %r13d, %r13d
leaq 0xb5978(%rip), %rbp     # 0xf5ce8
movq 0x30(%r14), %rax
movl (%rax,%r13,4), %eax
cmpq $0xf, %rax
ja 0x4062e
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
jmpq *%rax
movsd 0x4168(%rsp), %xmm0
mulsd 0xb1983(%rip), %xmm0    # 0xf1d20
divsd 0x4178(%rsp), %xmm0
jmp 0x4061e
movq 0x480(%rsp), %rax
movslq 0x460(%rsp), %rdx
decq %rdx
movslq 0x45c(%rsp), %rcx
imulq %rdx, %rcx
xorpd %xmm0, %xmm0
cmpw $0x1, 0x4da(%rsp)
jne 0x403ec
movslq 0x3d8(%rsp), %rdx
movslq %ecx, %rsi
addq %rdx, %rsi
movsd (%rax,%rsi,8), %xmm0
movslq 0x3d4(%rsp), %rdx
addq %rdx, %rcx
addsd (%rax,%rcx,8), %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x128(%rsp), %xmm2
mulsd %xmm1, %xmm1
divsd %xmm1, %xmm0
subsd %xmm0, %xmm2
movsd %xmm2, (%r15,%r13,8)
jmp 0x4062e
movq 0x1e08(%rsp), %rax
movslq 0x1d94(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
jmp 0x40628
movsd 0x220(%rsp), %xmm0
jmp 0x404f4
movq 0x480(%rsp), %rax
movslq 0x460(%rsp), %rdx
decq %rdx
movslq 0x45c(%rsp), %rcx
imulq %rdx, %rcx
xorpd %xmm0, %xmm0
cmpw $0x1, 0x4da(%rsp)
jne 0x4048b
movslq 0x3d8(%rsp), %rdx
movslq %ecx, %rsi
addq %rdx, %rsi
movsd (%rax,%rsi,8), %xmm0
movslq 0x3d4(%rsp), %rdx
addq %rdx, %rcx
addsd (%rax,%rcx,8), %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
mulsd %xmm1, %xmm1
divsd %xmm1, %xmm0
movq 0x38(%r14), %rax
movsd (%rax,%r13,8), %xmm1
divsd %xmm2, %xmm1
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
jmp 0x40628
movsd 0x210(%rsp), %xmm1
movsd 0xb1315(%rip), %xmm0    # 0xf17f0
callq 0x8620
movsd 0xb0d78(%rip), %xmm1    # 0xf1260
addsd %xmm1, %xmm0
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x81d0
jmp 0x4061e
movsd 0x210(%rsp), %xmm1
movsd 0xb12e1(%rip), %xmm0    # 0xf17f0
callq 0x8620
movsd 0xb0d44(%rip), %xmm1    # 0xf1260
addsd %xmm1, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movapd %xmm1, %xmm0
callq 0x81d0
movq 0x38(%r14), %rax
subsd (%rax,%r13,8), %xmm0
movsd %xmm0, (%r15,%r13,8)
cmpl $0xb, %r12d
jl 0x4062e
movsd 0x8(%rsp), %xmm0
callq 0x81d0
movq 0x38(%r14), %rax
movsd (%rax,%r13,8), %xmm1
movsd (%r15,%r13,8), %xmm2
leaq 0xb73af(%rip), %rdi     # 0xf791e
jmp 0x40849
movsd 0x348(%rsp), %xmm0
jmp 0x4061e
movq 0x1e08(%rsp), %rax
movslq 0x1d94(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd 0x360(%rsp), %xmm0
divsd 0xb0d08(%rip), %xmm0    # 0xf12b0
ucomisd 0xb0ca8(%rip), %xmm0    # 0xf1258
jb 0x40855
sqrtsd %xmm0, %xmm0
jmp 0x40866
movq 0x480(%rsp), %rax
movslq 0x460(%rsp), %rdx
decq %rdx
movslq 0x45c(%rsp), %rcx
imulq %rdx, %rcx
xorpd %xmm0, %xmm0
cmpw $0x1, 0x4da(%rsp)
jne 0x40600
movslq 0x3d8(%rsp), %rdx
movslq %ecx, %rsi
addq %rdx, %rsi
movsd (%rax,%rsi,8), %xmm0
movslq 0x3d4(%rsp), %rdx
addq %rdx, %rcx
addsd (%rax,%rcx,8), %xmm0
movsd 0x20(%rsp), %xmm1
mulsd %xmm1, %xmm1
divsd %xmm1, %xmm0
movq 0x38(%r14), %rax
subsd (%rax,%r13,8), %xmm0
movsd %xmm0, (%r15,%r13,8)
incq %r13
movslq 0x40(%r14), %rax
cmpq %rax, %r13
jl 0x40370
jmp 0x40875
movsd 0xd8(%rsp), %xmm0
movapd %xmm0, %xmm1
subsd 0x380(%rsp), %xmm1
movsd %xmm1, (%r15,%r13,8)
cmpl $0x3, %r12d
jl 0x4062e
leaq 0xb7323(%rip), %rdi     # 0xf798f
movb $0x2, %al
callq 0x8030
jmp 0x4062e
movslq 0x460(%rsp), %rax
decq %rax
movslq 0x45c(%rsp), %rcx
imulq %rax, %rcx
movslq 0x3f0(%rsp), %rax
addq %rcx, %rax
movq 0x480(%rsp), %rcx
movsd (%rcx,%rax,8), %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x148(%rsp), %xmm2
mulsd %xmm1, %xmm1
divsd %xmm1, %xmm0
subsd %xmm2, %xmm0
movsd %xmm0, (%r15,%r13,8)
movq 0x38(%r14), %rax
movsd %xmm2, (%rax,%r13,8)
cmpl $0xb, %r12d
jl 0x4062e
leaq 0xcd046(%rip), %rdi     # 0x10d726
callq 0x8510
jmp 0x40771
movslq 0x460(%rsp), %rax
decq %rax
movslq 0x45c(%rsp), %rcx
imulq %rax, %rcx
movslq 0x3f0(%rsp), %rax
addq %rcx, %rax
movq 0x480(%rsp), %rcx
movsd (%rcx,%rax,8), %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x148(%rsp), %xmm2
mulsd %xmm1, %xmm1
divsd %xmm1, %xmm0
subsd %xmm2, %xmm0
movsd %xmm0, (%r15,%r13,8)
movq 0x38(%r14), %rax
movsd %xmm2, (%rax,%r13,8)
cmpl $0xb, %r12d
jl 0x4062e
leaq 0xccfee(%rip), %rdi     # 0x10d743
callq 0x8510
movsd 0x1b0(%rsp), %xmm0
leaq 0xb71e2(%rip), %rdi     # 0xf794c
movb $0x1, %al
callq 0x8030
movq 0x480(%rsp), %rax
movslq 0x460(%rsp), %rcx
decq %rcx
movslq 0x45c(%rsp), %rdx
imulq %rcx, %rdx
movslq 0x3f0(%rsp), %rcx
addq %rdx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x20(%rsp), %xmm1
mulsd %xmm1, %xmm1
divsd %xmm1, %xmm0
leaq 0xb71a4(%rip), %rdi     # 0xf7959
movb $0x1, %al
callq 0x8030
movq 0x480(%rsp), %rax
movslq 0x460(%rsp), %rcx
decq %rcx
movslq 0x45c(%rsp), %rdx
imulq %rcx, %rdx
movslq 0x3f0(%rsp), %rcx
addq %rdx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x20(%rsp), %xmm1
mulsd %xmm1, %xmm1
divsd %xmm1, %xmm0
subsd 0x148(%rsp), %xmm0
leaq 0xb7167(%rip), %rdi     # 0xf7970
movb $0x1, %al
callq 0x8030
jmp 0x4062e
movsd 0x220(%rsp), %xmm0
movq 0x38(%r14), %rax
movapd %xmm0, %xmm2
subsd (%rax,%r13,8), %xmm2
movsd %xmm2, (%r15,%r13,8)
cmpl $0xb, %r12d
jl 0x4062e
movsd (%rax,%r13,8), %xmm1
leaq 0xb70a1(%rip), %rdi     # 0xf78ea
movb $0x3, %al
callq 0x8030
jmp 0x4062e
movsd %xmm1, 0x8(%rsp)
callq 0x82b0
movsd 0x8(%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, (%r15,%r13,8)
jmp 0x4062e
cmpl $0x6, 0x44(%r14)
jb 0x408d1
leaq 0x5cc0(%rsp), %rdi
callq 0xb796a
cmpl $0x1, %eax
jne 0x408d1
leaq 0x5daa(%rsp), %rcx
leaq 0xb0b53(%rip), %rsi     # 0xf13f0
leaq 0xb7115(%rip), %rdx     # 0xf79b9
leaq 0x1540(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0xb0777(%rip), %rsi     # 0xf1034
leaq 0xb6ed5(%rip), %rdx     # 0xf7799
movq %rbx, %rdi
movl $0x843, %ecx            # imm = 0x843
jmp 0x3fd98
cmpl $0x5, 0x44(%r14)
jb 0x4092d
leaq 0x65b0(%rsp), %rdi
callq 0xab3bf
cmpl $0x1, %eax
jne 0x4092d
leaq 0x6f1a(%rsp), %rcx
leaq 0xb0af7(%rip), %rsi     # 0xf13f0
leaq 0xb70cc(%rip), %rdx     # 0xf79cc
leaq 0x1540(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0xb071b(%rip), %rsi     # 0xf1034
leaq 0xb6e79(%rip), %rdx     # 0xf7799
movq %rbx, %rdi
movl $0x846, %ecx            # imm = 0x846
jmp 0x3fd98
cmpl $0x4, 0x44(%r14)
jb 0x40989
leaq 0x1d40(%rsp), %rdi
callq 0xa6046
cmpl $0x1, %eax
jne 0x40989
leaq 0x1ed2(%rsp), %rcx
leaq 0xb0a9b(%rip), %rsi     # 0xf13f0
leaq 0xb7083(%rip), %rdx     # 0xf79df
leaq 0x1540(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0xb06bf(%rip), %rsi     # 0xf1034
leaq 0xb6e1d(%rip), %rdx     # 0xf7799
movq %rbx, %rdi
movl $0x849, %ecx            # imm = 0x849
jmp 0x3fd98
cmpl $0x3, 0x44(%r14)
jb 0x409e5
leaq 0x26d8(%rsp), %rdi
callq 0x99a1a
cmpl $0x1, %eax
jne 0x409e5
leaq 0x2a02(%rsp), %rcx
leaq 0xb0a3f(%rip), %rsi     # 0xf13f0
leaq 0xb7039(%rip), %rdx     # 0xf79f1
leaq 0x1540(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0xb0663(%rip), %rsi     # 0xf1034
leaq 0xb6dc1(%rip), %rdx     # 0xf7799
movq %rbx, %rdi
movl $0x84c, %ecx            # imm = 0x84C
jmp 0x3fd98
cmpl $0x2, 0x44(%r14)
jb 0x40a41
leaq 0x7720(%rsp), %rdi
callq 0x7a3b2
cmpl $0x1, %eax
jne 0x40a41
leaq 0xe3aa(%rsp), %rcx
leaq 0xb09e3(%rip), %rsi     # 0xf13f0
leaq 0xb6ff2(%rip), %rdx     # 0xf7a06
leaq 0x1540(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0xb0607(%rip), %rsi     # 0xf1034
leaq 0xb6d65(%rip), %rdx     # 0xf7799
movq %rbx, %rdi
movl $0x84f, %ecx            # imm = 0x84F
jmp 0x3fd98
cmpl $0x0, 0x44(%r14)
je 0x40a9d
leaq 0x3228(%rsp), %rdi
callq 0x6dc22
cmpl $0x1, %eax
jne 0x40a9d
leaq 0x428c(%rsp), %rcx
leaq 0xb0987(%rip), %rsi     # 0xf13f0
leaq 0xb6fae(%rip), %rdx     # 0xf7a1e
leaq 0x1540(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0xb05ab(%rip), %rsi     # 0xf1034
leaq 0xb6d09(%rip), %rdx     # 0xf7799
movq %rbx, %rdi
movl $0x852, %ecx            # imm = 0x852
jmp 0x3fd98
leaq 0x20(%rsp), %rdi
callq 0x6474d
cmpl $0x1, %eax
jne 0x40aef
leaq 0xd3c(%rsp), %rcx
leaq 0xb0935(%rip), %rsi     # 0xf13f0
leaq 0xb6f75(%rip), %rdx     # 0xf7a37
leaq 0x1540(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0xb0559(%rip), %rsi     # 0xf1034
leaq 0xb6cb7(%rip), %rdx     # 0xf7799
movq %rbx, %rdi
movl $0x855, %ecx            # imm = 0x855
jmp 0x3fd98
movl 0x10(%r14), %edx
testl %edx, %edx
jle 0x40b05
movq 0x28(%r14), %rdi
addq %rdx, %rdx
xorl %esi, %esi
callq 0x8200
cmpl $0x1, 0x44(%r14)
ja 0x40b19
leaq 0x7720(%rsp), %rdi
callq 0x7a388
xorl %ebx, %ebx
cmpl $0x0, 0x44(%r14)
jne 0x3fda7
leaq 0x3228(%rsp), %rdi
callq 0x6dce4
jmp 0x3fda7