// File: /workspace/github_c_makefile_star2_O1/PoulinV[P]AxiCLASS/build/../source/primordial.c
// Function: primordial_init
int primordial_init(
                    struct precision  * ppr,
                    struct perturbations   * ppt,
                    struct primordial * ppm
                    ) {

  /** Summary: */

  /** - define local variables */

  double k,k_min,k_max;
  int index_md,index_ic1,index_ic2,index_ic1_ic2,index_k;
  double pk,pk1,pk2;
  double dlnk,lnpk_pivot,lnpk_minus,lnpk_plus,lnpk_minusminus,lnpk_plusplus;
  /* uncomment if you use optional test below
     (for correlated isocurvature modes) */
  //double cos_delta_k;

  /** - check that we really need to compute the primordial spectra */

  if (ppt->has_perturbations == _FALSE_) {
    ppm->lnk_size=0;
    if (ppm->primordial_verbose > 0)
      printf("No perturbations requested. Primordial module skipped.\n");
    return _SUCCESS_;
  }
  else {
    if (ppm->primordial_verbose > 0)
      printf("Computing primordial spectra");
  }

  /** - get kmin and kmax from perturbation structure. Test that they make sense. */

  k_min = ppt->k_min; /* first value, inferred from perturbations structure */
  if (ppm->has_k_max_for_primordial_pk == _TRUE_){
    k_max = ppm->k_max_for_primordial_pk; /* last value, user-defined (i.e. if specified in .ini file) */
  }
  else{
    k_max = ppt->k_max; /* last value, inferred from perturbations structure */
  }

  class_test(k_min <= 0.,
             ppm->error_message,
             "k_min negative or null: stop to avoid segmentation fault");

  class_test(k_max <= 0.,
             ppm->error_message,
             "k_max negative or null: stop to avoid segmentation fault");

  class_test(ppm->k_pivot <= 0.,
             ppm->error_message,
             "k_pivot negative or null: stop to avoid segmentation fault");

  class_test(ppr->k_per_decade_primordial <= 0.,
             ppm->error_message,
             "k_per_decade_primordial negative or null: stop to avoid segmentation fault");

  class_test(ppr->k_per_decade_primordial <= _K_PER_DECADE_PRIMORDIAL_MIN_,
             ppm->error_message,
             "k_per_decade_primordial = %e: you ask for such a sparse sampling of the primordial spectrum that this is probably a mistake",
             ppr->k_per_decade_primordial);

  /** - allocate and fill values of \f$ \ln{k}\f$'s */

  class_call(primordial_get_lnk_list(ppm,
                                     k_min,
                                     k_max,
                                     ppr->k_per_decade_primordial
                                     ),
             ppm->error_message,
             ppm->error_message);

  /** - define indices and allocate tables in primordial structure */

  class_call(primordial_indices(ppt,
                                ppm),
             ppm->error_message,
             ppm->error_message);

  /** - deal with case of analytic primordial spectra (with amplitudes, tilts, runnings, etc.) */

  if (ppm->primordial_spec_type == analytic_Pk) {

    if (ppm->primordial_verbose > 0)
      printf(" (analytic spectrum)\n");

    class_call_except(primordial_analytic_spectrum_init(ppt,
                                                        ppm),
                      ppm->error_message,
                      ppm->error_message,
                      primordial_free(ppm));

    for (index_k = 0; index_k < ppm->lnk_size; index_k++) {

      k=exp(ppm->lnk[index_k]);

      for (index_md = 0; index_md < ppt->md_size; index_md++) {
        for (index_ic1 = 0; index_ic1 < ppm->ic_size[index_md]; index_ic1++) {
          for (index_ic2 = index_ic1; index_ic2 < ppm->ic_size[index_md]; index_ic2++) {

            index_ic1_ic2 = index_symmetric_matrix(index_ic1,index_ic2,ppm->ic_size[index_md]);

            if (ppm->is_non_zero[index_md][index_ic1_ic2] == _TRUE_) {

              class_call(primordial_analytic_spectrum(ppm,
                                                      index_md,
                                                      index_ic1_ic2,
                                                      k,
                                                      &pk),
                         ppm->error_message,
                         ppm->error_message);

              if (index_ic1 == index_ic2) {

                /* diagonal coefficients: ln[P(k)] */

                ppm->lnpk[index_md][index_k*ppm->ic_ic_size[index_md]+index_ic1_ic2] = log(pk);
              }
              else {

                /* non-diagonal coefficients: cosDelta(k) = P(k)_12/sqrt[P(k)_1 P(k)_2] */

                class_call(primordial_analytic_spectrum(ppm,
                                                        index_md,
                                                        index_symmetric_matrix(index_ic1,index_ic1,ppm->ic_size[index_md]),
                                                        k,
                                                        &pk1),
                           ppm->error_message,
                           ppm->error_message);

                class_call(primordial_analytic_spectrum(ppm,
                                                        index_md,
                                                        index_symmetric_matrix(index_ic2,index_ic2,ppm->ic_size[index_md]),
                                                        k,
                                                        &pk2),
                           ppm->error_message,
                           ppm->error_message);

                /* either return an error if correlation is too large... */
                /*
                  cos_delta_k = pk/sqrt(pk1*pk2);
                  class_test_except((cos_delta_k < -1.) || (cos_delta_k > 1.),
                  ppm->error_message,
                  primordial_free(ppm),
                  "correlation angle between IC's takes unphysical values");

                  ppm->lnpk[index_md][index_k*ppm->ic_ic_size[index_md]+index_ic1_ic2] = cos_delta_k;
                */

                /* ... or enforce definite positive correlation matrix */

                if (pk > sqrt(pk1*pk2))
                  ppm->lnpk[index_md][index_k*ppm->ic_ic_size[index_md]+index_ic1_ic2] = 1.;
                else if (pk < -sqrt(pk1*pk2))
                  ppm->lnpk[index_md][index_k*ppm->ic_ic_size[index_md]+index_ic1_ic2] = -1.;
                else
                  ppm->lnpk[index_md][index_k*ppm->ic_ic_size[index_md]+index_ic1_ic2] = pk/sqrt(pk1*pk2);


              }
            }
            else {

              /* non-diagonal coefficients when ic's are uncorrelated */

              ppm->lnpk[index_md][index_k*ppm->ic_ic_size[index_md]+index_ic1_ic2] = 0.;
            }
          }
        }
      }
    }
  }

  /** - deal with case of inflation with given \f$V(\phi)\f$ or \f$H(\phi)\f$ */

  else if ((ppm->primordial_spec_type == inflation_V) || (ppm->primordial_spec_type == inflation_H) || (ppm->primordial_spec_type == inflation_V_end)) {

    class_call(primordial_inflation_indices(ppm),
               ppm->error_message,
               ppm->error_message);

    if (ppm->primordial_verbose > 0)
      printf(" (simulating inflation)\n");

    class_call_except(primordial_inflation_solve_inflation(ppt,ppm,ppr),
                      ppm->error_message,
                      ppm->error_message,
                      primordial_free(ppm));

  }

  /** - deal with the case of external calculation of \f$ P_k \f$*/

  else if (ppm->primordial_spec_type == external_Pk) {

    class_test(ppt->has_scalars == _FALSE_,
               ppm->error_message,
               "external Pk module cannot work if you do not ask for scalar modes");

    class_test(ppt->has_vectors == _TRUE_,
               ppm->error_message,
               "external Pk module cannot work if you ask for vector modes");

    class_test(ppt->has_bi == _TRUE_ || ppt->has_cdi == _TRUE_ || ppt->has_nid == _TRUE_ || ppt->has_niv == _TRUE_,
               ppm->error_message,
               "external Pk module cannot work if you ask for isocurvature modes (but that could be implemented easily in the future!)");

    if (ppm->primordial_verbose > 0)
      printf(" (Pk calculated externally)\n");

    class_call_except(primordial_external_spectrum_init(ppt,ppm),
                      ppm->error_message,
                      ppm->error_message,
                      primordial_free(ppm));
  }

  else {

    class_test(0==0,
               ppm->error_message,
               "primordial spectrum type not recognized");

  }

  /** - compute second derivative of each \f$ \ln{P_k} \f$ versus lnk with spline, in view of interpolation */

  for (index_md = 0; index_md < ppm->md_size; index_md++) {

    class_call(array_spline_table_lines(ppm->lnk,
                                        ppm->lnk_size,
                                        ppm->lnpk[index_md],
                                        ppm->ic_ic_size[index_md],
                                        ppm->ddlnpk[index_md],
                                        _SPLINE_EST_DERIV_,
                                        ppm->error_message),
               ppm->error_message,
               ppm->error_message);

  }

  /** - derive spectral parameters from numerically computed spectra
      (not used by the rest of the code, but useful to keep in memory for several types of investigation) */

  if (ppm->primordial_spec_type != analytic_Pk) {

    dlnk = log(10.)/ppr->k_per_decade_primordial;

    if (ppt->has_scalars == _TRUE_) {

      class_call(primordial_spectrum_at_k(ppm,
                                          ppt->index_md_scalars,
                                          logarithmic,
                                          log(ppm->k_pivot),
                                          &lnpk_pivot),
                 ppm->error_message,
                 ppm->error_message);

      class_call(primordial_spectrum_at_k(ppm,
                                          ppt->index_md_scalars,
                                          logarithmic,
                                          log(ppm->k_pivot)+dlnk,

                                          &lnpk_plus),
                 ppm->error_message,
                 ppm->error_message);

      class_call(primordial_spectrum_at_k(ppm,
                                          ppt->index_md_scalars,
                                          logarithmic,
                                          log(ppm->k_pivot)-dlnk,
                                          &lnpk_minus),
                 ppm->error_message,
                 ppm->error_message);

      ppm->A_s = exp(lnpk_pivot);
      ppm->n_s = (lnpk_plus-lnpk_minus)/(2.*dlnk)+1.;
      ppm->alpha_s = (lnpk_plus-2.*lnpk_pivot+lnpk_minus)/pow(dlnk,2);

      /** - expression for alpha_s comes from:

          `ns_2 = (lnpk_plus-lnpk_pivot)/(dlnk)+1`

          `ns_1 = (lnpk_pivot-lnpk_minus)/(dlnk)+1`

          `alpha_s = dns/dlnk = (ns_2-ns_1)/dlnk = (lnpk_plus-lnpk_pivot-lnpk_pivot+lnpk_minus)/(dlnk)/(dlnk)`

      **/

      class_call(primordial_spectrum_at_k(ppm,
                                          ppt->index_md_scalars,
                                          logarithmic,
                                          log(ppm->k_pivot)+2.*dlnk,

                                          &lnpk_plusplus),
                 ppm->error_message,
                 ppm->error_message);

      class_call(primordial_spectrum_at_k(ppm,
                                          ppt->index_md_scalars,
                                          logarithmic,
                                          log(ppm->k_pivot)-2.*dlnk,
                                          &lnpk_minusminus),
                 ppm->error_message,
                 ppm->error_message);

      /** - expression for beta_s:

          `ppm->beta_s = (alpha_plus-alpha_minus)/dlnk = (lnpk_plusplus-2.*lnpk_plus+lnpk_pivot -
          (lnpk_pivot-2.*lnpk_minus+lnpk_minusminus)/pow(dlnk,3)`
      **/

      /* Simplification of the beta_s expression: */

      ppm->beta_s = (lnpk_plusplus-2.*lnpk_plus+2.*lnpk_minus-lnpk_minusminus)/pow(dlnk,3);

      if (ppm->primordial_verbose > 0)
        printf(" -> A_s=%g  n_s=%g  alpha_s=%g\n",ppm->A_s,ppm->n_s,ppm->alpha_s);

    }

    if (ppt->has_tensors == _TRUE_) {

      class_call(primordial_spectrum_at_k(ppm,
                                          ppt->index_md_tensors,
                                          logarithmic,
                                          log(ppm->k_pivot),
                                          &lnpk_pivot),
                 ppm->error_message,
                 ppm->error_message);

      class_call(primordial_spectrum_at_k(ppm,
                                          ppt->index_md_tensors,
                                          logarithmic,
                                          log(ppm->k_pivot)+dlnk,
                                          &lnpk_plus),
                 ppm->error_message,
                 ppm->error_message);

      class_call(primordial_spectrum_at_k(ppm,
                                          ppt->index_md_tensors,
                                          logarithmic,
                                          log(ppm->k_pivot)-dlnk,
                                          &lnpk_minus),
                 ppm->error_message,
                 ppm->error_message);

      ppm->r = exp(lnpk_pivot)/ppm->A_s;
      ppm->n_t = (lnpk_plus-lnpk_minus)/(2.*dlnk);
      ppm->alpha_t = (lnpk_plus-2.*lnpk_pivot+lnpk_minus)/pow(dlnk,2);

      if (ppm->primordial_verbose > 0)
        printf(" -> r=%g  n_t=%g  alpha_t=%g\n",ppm->r,ppm->n_t,ppm->alpha_t);

    }

  }

  ppm->is_allocated = _TRUE_;

  return _SUCCESS_;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1098, %rsp           # imm = 0x1098
movq %rdx, %rbx
cmpw $0x0, (%rsi)
je 0x97ad0
movq %rsi, %r12
movq %rdi, %r14
cmpw $0x0, 0x328(%rbx)
jle 0x97a0e
leaq 0x83ee8(%rip), %rdi     # 0x11b8ef
xorl %eax, %eax
callq 0x8030
leaq 0x10(%rbx), %rcx
leaq 0x9e8(%r12), %rax
cmpl $0x1, 0x8(%rbx)
cmoveq %rcx, %rax
movsd 0x9e0(%r12), %xmm0
xorpd %xmm2, %xmm2
ucomisd %xmm0, %xmm2
jae 0x97afb
movsd (%rax), %xmm1
ucomisd %xmm1, %xmm2
jae 0x97b59
xorpd %xmm3, %xmm3
ucomisd (%rbx), %xmm3
jae 0x97bb7
movsd 0x680(%r14), %xmm2
ucomisd %xmm2, %xmm3
jae 0x97c15
movsd 0x597ef(%rip), %xmm3    # 0xf1260
ucomisd %xmm2, %xmm3
jae 0x97c70
movq %rbx, %rdi
callq 0x989f2
testl %eax, %eax
je 0x97cf0
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x59957(%rip), %rsi     # 0xf13f0
leaq 0x8407c(%rip), %rdx     # 0x11bb1c
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x59578(%rip), %rsi     # 0xf1034
leaq 0x83e8e(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x127, %ecx            # imm = 0x127
jmp 0x97d3f
movl $0x0, 0x290(%rbx)
xorl %ebp, %ebp
cmpw $0x0, 0x328(%rbx)
jle 0x97cdc
leaq 0x86747(%rip), %rdi     # 0x11e238
callq 0x8510
jmp 0x97cdc
leaq 0x83e0a(%rip), %rsi     # 0x11b90c
leaq 0x90(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x59567(%rip), %rsi     # 0xf1082
leaq 0x83e23(%rip), %rdx     # 0x11b945
leaq 0x890(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x594ef(%rip), %rsi     # 0xf1034
leaq 0x83e05(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x10c, %ecx            # imm = 0x10C
jmp 0x97ccd
leaq 0x83e01(%rip), %rsi     # 0x11b961
leaq 0x90(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x59509(%rip), %rsi     # 0xf1082
leaq 0x83e1a(%rip), %rdx     # 0x11b99a
leaq 0x890(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x59491(%rip), %rsi     # 0xf1034
leaq 0x83da7(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x110, %ecx            # imm = 0x110
jmp 0x97ccd
leaq 0x83de8(%rip), %rsi     # 0x11b9a6
leaq 0x90(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x594ab(%rip), %rsi     # 0xf1082
leaq 0x83e03(%rip), %rdx     # 0x11b9e1
leaq 0x890(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x59433(%rip), %rsi     # 0xf1034
leaq 0x83d49(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x114, %ecx            # imm = 0x114
jmp 0x97ccd
leaq 0x83dd8(%rip), %rsi     # 0x11b9f4
leaq 0x90(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x5944d(%rip), %rsi     # 0xf1082
leaq 0x83e03(%rip), %rdx     # 0x11ba3f
leaq 0x890(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x593d5(%rip), %rsi     # 0xf1034
leaq 0x83ceb(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x118, %ecx            # imm = 0x118
jmp 0x97ccd
leaq 0x83deb(%rip), %rsi     # 0x11ba62
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movapd %xmm2, %xmm0
movb $0x1, %al
callq 0x30c2c
leaq 0x593ee(%rip), %rsi     # 0xf1082
leaq 0x83e43(%rip), %rdx     # 0x11bade
leaq 0x890(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x59376(%rip), %rsi     # 0xf1034
leaq 0x83c8c(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x11d, %ecx            # imm = 0x11D
movq %r15, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %ebp
movl %ebp, %eax
addq $0x1098, %rsp           # imm = 0x1098
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
movq %rbx, %rsi
callq 0x98b83
testl %eax, %eax
je 0x97d44
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x596e3(%rip), %rsi     # 0xf13f0
leaq 0x83e52(%rip), %rdx     # 0x11bb66
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x59304(%rip), %rsi     # 0xf1034
leaq 0x83c1a(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x12e, %ecx            # imm = 0x12E
movq %r14, %r8
jmp 0x97cd0
movl 0x18(%rbx), %eax
leal -0x2(%rax), %ecx
cmpl $0x3, %ecx
movq %r12, 0x20(%rsp)
jae 0x97dcf
movq %rbx, %rdi
callq 0x99b58
cmpw $0x0, 0x328(%rbx)
jle 0x97d72
leaq 0x8649e(%rip), %rdi     # 0x11e20b
callq 0x8510
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, 0x50(%rsp)
movq %r14, %rdx
callq 0x99bd6
testl %eax, %eax
je 0x982a9
leaq 0x32a(%rbx), %r14
leaq 0x59655(%rip), %rsi     # 0xf13f0
leaq 0x83e0d(%rip), %rdx     # 0x11bbaf
leaq 0x90(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x59276(%rip), %rsi     # 0xf1034
leaq 0x83b8c(%rip), %rdx     # 0x11b951
movq %r14, %rdi
movl $0x19c, %ecx            # imm = 0x19C
jmp 0x97e49
cmpl $0x5, %eax
je 0x97e60
testl %eax, %eax
jne 0x97ed8
cmpw $0x0, 0x328(%rbx)
jle 0x97df6
leaq 0x86432(%rip), %rdi     # 0x11e223
callq 0x8510
movq %r12, %rdi
movq %rbx, %rsi
callq 0x98f64
testl %eax, %eax
je 0x97f94
leaq 0x32a(%rbx), %r14
leaq 0x595d9(%rip), %rsi     # 0xf13f0
leaq 0x83d65(%rip), %rdx     # 0x11bb83
leaq 0x90(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x591fa(%rip), %rsi     # 0xf1034
leaq 0x83b10(%rip), %rdx     # 0x11b951
movq %r14, %rdi
movl $0x13b, %ecx            # imm = 0x13B
movq %r15, %r8
xorl %eax, %eax
callq 0x30c2c
movq %rbx, %rdi
callq 0x99a1a
jmp 0x97cd7
cmpw $0x0, 0xe(%r12)
je 0x97f36
cmpw $0x1, 0x10(%r12)
jne 0x983fc
leaq 0x83da2(%rip), %rsi     # 0x11bc23
leaq 0x90(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x591e8(%rip), %rsi     # 0xf1082
leaq 0x71f68(%rip), %rdx     # 0x109e09
leaq 0x890(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x59170(%rip), %rsi     # 0xf1034
leaq 0x83a86(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x1aa, %ecx            # imm = 0x1AA
jmp 0x97ccd
leaq 0x83e21(%rip), %rsi     # 0x11bd00
leaq 0x90(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x5918a(%rip), %rsi     # 0xf1082
leaq 0x83e29(%rip), %rdx     # 0x11bd28
leaq 0x890(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x59112(%rip), %rsi     # 0xf1034
leaq 0x83a28(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x1bd, %ecx            # imm = 0x1BD
jmp 0x97ccd
leaq 0x83ca4(%rip), %rsi     # 0x11bbe1
leaq 0x90(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x5912c(%rip), %rsi     # 0xf1082
leaq 0x71e54(%rip), %rdx     # 0x109db1
leaq 0x890(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x590b4(%rip), %rsi     # 0xf1034
leaq 0x839ca(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x1a6, %ecx            # imm = 0x1A6
jmp 0x97ccd
movq %r14, 0x50(%rsp)
cmpl $0x0, 0x290(%rbx)
jle 0x982a9
xorl %edx, %edx
movq %rdx, 0x18(%rsp)
movq 0x298(%rbx), %rax
movsd (%rax,%rdx,8), %xmm0
callq 0x8670
movq 0x18(%rsp), %rdx
cmpl $0x0, 0x854(%r12)
jle 0x98296
movapd %xmm0, %xmm1
xorl %r15d, %r15d
movsd %xmm0, 0x10(%rsp)
movq 0x280(%rbx), %rax
cmpl $0x0, (%rax,%r15,4)
jle 0x9827d
movl $0x2, %ecx
movl $0x0, 0x3c(%rsp)
xorl %r13d, %r13d
movl %ecx, 0x60(%rsp)
movq 0x280(%rbx), %rax
movl (%rax,%r15,4), %r14d
cmpl %r14d, %r13d
jge 0x9825e
movl 0x3c(%rsp), %eax
shrl %eax
negl %eax
movq %rax, 0x68(%rsp)
leal 0x1(%r13), %eax
imull %r13d, %eax
shrl %eax
movl %eax, 0x64(%rsp)
xorl %ebp, %ebp
movl %r13d, %r12d
cmpl %r12d, %r13d
jbe 0x98055
imull %r12d, %r14d
addl %r13d, %r14d
leal 0x1(%r12), %eax
imull %r12d, %eax
shrl %eax
subl %eax, %r14d
jmp 0x98064
imull %r13d, %r14d
movq 0x68(%rsp), %rax
addl %r12d, %eax
addl %eax, %r14d
movq 0x2b0(%rbx), %rax
movq (%rax,%r15,8), %rax
movslq %r14d, %rcx
xorpd %xmm0, %xmm0
cmpw $0x1, (%rax,%rcx,2)
jne 0x98222
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %edx
movapd %xmm1, %xmm0
leaq 0x890(%rsp), %rcx
callq 0x9788a
testl %ebp, %ebp
je 0x98136
movq 0x280(%rbx), %rax
movl (%rax,%r15,4), %edx
incl %edx
imull %r13d, %edx
subl 0x64(%rsp), %edx
movq %rbx, %rdi
movl %r15d, %esi
movsd 0x10(%rsp), %xmm0
leaq 0x88(%rsp), %rcx
callq 0x9788a
movq 0x280(%rbx), %rax
movl (%rax,%r15,4), %edx
incl %edx
imull %r12d, %edx
leal 0x1(%r12), %eax
imull %r12d, %eax
shrl %eax
subl %eax, %edx
movq %rbx, %rdi
movl %r15d, %esi
movsd 0x10(%rsp), %xmm0
leaq 0x80(%rsp), %rcx
callq 0x9788a
movsd 0x890(%rsp), %xmm2
movsd 0x88(%rsp), %xmm3
mulsd 0x80(%rsp), %xmm3
ucomisd 0x5912d(%rip), %xmm3    # 0xf1258
jb 0x98154
xorps %xmm0, %xmm0
sqrtsd %xmm3, %xmm0
jmp 0x98175
movsd 0x890(%rsp), %xmm0
callq 0x82c0
movq 0x18(%rsp), %rdx
movsd 0x10(%rsp), %xmm1
jmp 0x98222
movapd %xmm3, %xmm0
movsd %xmm2, 0x28(%rsp)
movsd %xmm3, 0x58(%rsp)
callq 0x82b0
movsd 0x58(%rsp), %xmm3
movsd 0x28(%rsp), %xmm2
movq 0x18(%rsp), %rdx
ucomisd %xmm0, %xmm2
movsd 0x590da(%rip), %xmm0    # 0xf1260
movsd 0x10(%rsp), %xmm1
ja 0x98222
ucomisd 0x590be(%rip), %xmm3    # 0xf1258
jb 0x981a5
xorps %xmm0, %xmm0
sqrtsd %xmm3, %xmm0
jmp 0x981d1
movapd %xmm3, %xmm0
movsd %xmm2, 0x28(%rsp)
movsd %xmm3, 0x58(%rsp)
callq 0x82b0
movsd 0x58(%rsp), %xmm3
movsd 0x28(%rsp), %xmm2
movsd 0x10(%rsp), %xmm1
movq 0x18(%rsp), %rdx
xorpd 0x59057(%rip), %xmm0    # 0xf1230
ucomisd %xmm2, %xmm0
movsd 0x59603(%rip), %xmm0    # 0xf17e8
ja 0x98222
ucomisd 0x59069(%rip), %xmm3    # 0xf1258
jb 0x981fa
xorps %xmm0, %xmm0
sqrtsd %xmm3, %xmm0
jmp 0x9821a
movapd %xmm3, %xmm0
movsd %xmm2, 0x28(%rsp)
callq 0x82b0
movsd 0x28(%rsp), %xmm2
movsd 0x10(%rsp), %xmm1
movq 0x18(%rsp), %rdx
divsd %xmm0, %xmm2
movapd %xmm2, %xmm0
movq 0x288(%rbx), %rax
movq 0x2a0(%rbx), %rcx
movq (%rcx,%r15,8), %rcx
movl (%rax,%r15,4), %eax
imull %edx, %eax
addl %r14d, %eax
cltq
movsd %xmm0, (%rcx,%rax,8)
incl %r12d
movq 0x280(%rbx), %rax
movl (%rax,%r15,4), %r14d
decl %ebp
cmpl %r14d, %r12d
jl 0x98039
incl %r13d
movq 0x280(%rbx), %rax
movl 0x60(%rsp), %ecx
addl %ecx, 0x3c(%rsp)
addl $0x2, %ecx
cmpl (%rax,%r15,4), %r13d
jl 0x98001
incq %r15
movq 0x20(%rsp), %r12
movslq 0x854(%r12), %rax
cmpq %rax, %r15
jl 0x97fdf
incq %rdx
movslq 0x290(%rbx), %rax
cmpq %rax, %rdx
jl 0x97fa8
cmpl $0x0, 0x278(%rbx)
jle 0x98311
leaq 0x32a(%rbx), %r14
xorl %r15d, %r15d
movq 0x298(%rbx), %rdi
movl 0x290(%rbx), %esi
movq 0x2a0(%rbx), %rax
movq (%rax,%r15,8), %rdx
movq 0x288(%rbx), %rax
movl (%rax,%r15,4), %ecx
movq 0x2a8(%rbx), %rax
movq (%rax,%r15,8), %r8
movq %r14, (%rsp)
movl $0x1, %r9d
callq 0x14191
cmpl $0x1, %eax
je 0x983bb
incq %r15
movslq 0x278(%rbx), %rax
cmpq %rax, %r15
jl 0x982bc
cmpl $0x0, 0x18(%rbx)
je 0x989e2
movsd 0x7d125(%rip), %xmm0    # 0x115448
movq 0x50(%rsp), %rax
divsd 0x680(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
cmpw $0x1, 0xe(%r12)
jne 0x987da
movl 0x848(%r12), %r14d
movsd (%rbx), %xmm0
callq 0x82c0
movl $0x1, %ebp
leaq 0x30(%rsp), %rcx
movq %rbx, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x97030
testl %eax, %eax
je 0x98482
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x5906c(%rip), %rsi     # 0xf13f0
leaq 0x83a32(%rip), %rdx     # 0x11bdbd
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x58c8d(%rip), %rsi     # 0xf1034
leaq 0x835a3(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x1e0, %ecx            # imm = 0x1E0
jmp 0x9894f
leaq 0x5902e(%rip), %rsi     # 0xf13f0
leaq 0x83964(%rip), %rdx     # 0x11bd2d
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x58c4f(%rip), %rsi     # 0xf1034
leaq 0x83565(%rip), %rdx     # 0x11b951
movq %r14, %rdi
movl $0x1cd, %ecx            # imm = 0x1CD
movq %rbx, %r8
jmp 0x97cd0
cmpw $0x1, 0x16(%r12)
je 0x98424
cmpw $0x1, 0x18(%r12)
je 0x98424
cmpw $0x1, 0x1a(%r12)
je 0x98424
cmpw $0x1, 0x1c(%r12)
jne 0x9857e
leaq 0x83833(%rip), %rsi     # 0x11bc5e
leaq 0x90(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x58c3e(%rip), %rsi     # 0xf1082
leaq 0x71a7a(%rip), %rdx     # 0x109ec5
leaq 0x890(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x58bc6(%rip), %rsi     # 0xf1034
leaq 0x834dc(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x1ae, %ecx            # imm = 0x1AE
jmp 0x97ccd
movl 0x848(%r12), %r14d
movsd (%rbx), %xmm0
callq 0x82c0
addsd 0x10(%rsp), %xmm0
movl $0x1, %ebp
leaq 0x40(%rsp), %rcx
movq %rbx, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x97030
testl %eax, %eax
je 0x984fc
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x58f2b(%rip), %rsi     # 0xf13f0
leaq 0x83953(%rip), %rdx     # 0x11be1f
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x58b4c(%rip), %rsi     # 0xf1034
leaq 0x83462(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x1e9, %ecx            # imm = 0x1E9
jmp 0x9894f
movq 0x20(%rsp), %rax
movl 0x848(%rax), %r14d
movsd (%rbx), %xmm0
callq 0x82c0
subsd 0x10(%rsp), %xmm0
movl $0x1, %ebp
leaq 0x48(%rsp), %rcx
movq %rbx, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x97030
testl %eax, %eax
je 0x985f6
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x58ea9(%rip), %rsi     # 0xf13f0
leaq 0x83937(%rip), %rdx     # 0x11be85
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x58aca(%rip), %rsi     # 0xf1034
leaq 0x833e0(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x1f1, %ecx            # imm = 0x1F1
jmp 0x9894f
movq %r14, 0x50(%rsp)
cmpw $0x0, 0x328(%rbx)
jle 0x98599
leaq 0x85c5b(%rip), %rdi     # 0x11e1ef
callq 0x8510
movq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x9a83a
testl %eax, %eax
je 0x982a9
leaq 0x32a(%rbx), %r14
leaq 0x58e31(%rip), %rsi     # 0xf13f0
leaq 0x8370f(%rip), %rdx     # 0x11bcd5
leaq 0x90(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x58a52(%rip), %rsi     # 0xf1034
leaq 0x83368(%rip), %rdx     # 0x11b951
movq %r14, %rdi
movl $0x1b6, %ecx            # imm = 0x1B6
jmp 0x97e49
movsd 0x30(%rsp), %xmm0
callq 0x8670
movsd %xmm0, 0x20(%rbx)
movsd 0x40(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
movsd 0x10(%rsp), %xmm3
movapd %xmm3, %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, 0x18(%rsp)
divsd %xmm4, %xmm2
addsd 0x58c26(%rip), %xmm2    # 0xf1260
movsd %xmm2, 0x28(%rbx)
movsd 0x30(%rsp), %xmm2
addsd %xmm2, %xmm2
subsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movapd %xmm3, %xmm1
mulsd %xmm3, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rbx)
movq 0x20(%rsp), %rax
movl 0x848(%rax), %r14d
movsd (%rbx), %xmm0
callq 0x82c0
addsd 0x18(%rsp), %xmm0
movl $0x1, %ebp
leaq 0x70(%rsp), %rcx
movq %rbx, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x97030
testl %eax, %eax
je 0x986e0
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x58d47(%rip), %rsi     # 0xf13f0
leaq 0x8383c(%rip), %rdx     # 0x11beec
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x58968(%rip), %rsi     # 0xf1034
leaq 0x8327e(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x208, %ecx            # imm = 0x208
jmp 0x9894f
movq 0x20(%rsp), %rax
movl 0x848(%rax), %r14d
movsd (%rbx), %xmm0
callq 0x82c0
subsd 0x18(%rsp), %xmm0
movl $0x1, %ebp
leaq 0x78(%rsp), %rcx
movq %rbx, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x97030
testl %eax, %eax
je 0x9875e
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x58cc9(%rip), %rsi     # 0xf13f0
leaq 0x8382b(%rip), %rdx     # 0x11bf59
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x588ea(%rip), %rsi     # 0xf1034
leaq 0x83200(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x210, %ecx            # imm = 0x210
jmp 0x9894f
movsd 0x70(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
addsd %xmm1, %xmm1
subsd %xmm1, %xmm0
movsd 0x48(%rsp), %xmm1
addsd %xmm1, %xmm1
addsd %xmm0, %xmm1
subsd 0x78(%rsp), %xmm1
movsd %xmm1, 0x18(%rsp)
movsd 0x59eec(%rip), %xmm1    # 0xf2680
movsd 0x10(%rsp), %xmm0
callq 0x8620
movsd 0x18(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x38(%rbx)
cmpw $0x0, 0x328(%rbx)
movq 0x20(%rsp), %r12
jle 0x987da
movsd 0x20(%rbx), %xmm0
movsd 0x28(%rbx), %xmm1
movsd 0x30(%rbx), %xmm2
leaq 0x837f5(%rip), %rdi     # 0x11bfc8
movb $0x3, %al
callq 0x8030
cmpw $0x1, 0x12(%r12)
jne 0x989e2
movl 0x84c(%r12), %r14d
movsd (%rbx), %xmm0
callq 0x82c0
movl $0x1, %ebp
leaq 0x30(%rsp), %rcx
movq %rbx, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x97030
testl %eax, %eax
je 0x9885b
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x58bcc(%rip), %rsi     # 0xf13f0
leaq 0x837bd(%rip), %rdx     # 0x11bfe8
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x587ed(%rip), %rsi     # 0xf1034
leaq 0x83103(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x229, %ecx            # imm = 0x229
jmp 0x9894f
movq 0x20(%rsp), %rax
movl 0x84c(%rax), %r14d
movsd (%rbx), %xmm0
callq 0x82c0
addsd 0x10(%rsp), %xmm0
movl $0x1, %ebp
leaq 0x40(%rsp), %rcx
movq %rbx, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x97030
testl %eax, %eax
je 0x988d6
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x58b4e(%rip), %rsi     # 0xf13f0
leaq 0x837a1(%rip), %rdx     # 0x11c04a
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x5876f(%rip), %rsi     # 0xf1034
leaq 0x83085(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x231, %ecx            # imm = 0x231
jmp 0x9894f
movq 0x20(%rsp), %rax
movl 0x84c(%rax), %r14d
movsd (%rbx), %xmm0
callq 0x82c0
subsd 0x10(%rsp), %xmm0
movl $0x1, %ebp
leaq 0x48(%rsp), %rcx
movq %rbx, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x97030
testl %eax, %eax
je 0x9895e
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x58ad3(%rip), %rsi     # 0xf13f0
leaq 0x8378c(%rip), %rdx     # 0x11c0b0
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x586f4(%rip), %rsi     # 0xf1034
leaq 0x8300a(%rip), %rdx     # 0x11b951
movq %rbx, %rdi
movl $0x239, %ecx            # imm = 0x239
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
jmp 0x97cdc
movsd 0x30(%rsp), %xmm0
callq 0x8670
movsd 0x40(%rsp), %xmm2
movsd 0x48(%rsp), %xmm1
movapd %xmm2, %xmm3
subsd %xmm1, %xmm3
movsd 0x10(%rsp), %xmm5
movapd %xmm5, %xmm4
addsd %xmm5, %xmm4
unpcklpd %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0]
movsd 0x20(%rbx), %xmm3
unpcklpd %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0]
divpd %xmm3, %xmm0
movupd %xmm0, 0x40(%rbx)
movsd 0x30(%rsp), %xmm0
addsd %xmm0, %xmm0
subsd %xmm0, %xmm2
addsd %xmm1, %xmm2
mulsd %xmm5, %xmm5
divsd %xmm5, %xmm2
movsd %xmm2, 0x50(%rbx)
cmpw $0x0, 0x328(%rbx)
jle 0x989e2
movsd 0x40(%rbx), %xmm0
movsd 0x48(%rbx), %xmm1
leaq 0x8373c(%rip), %rdi     # 0x11c117
movb $0x3, %al
callq 0x8030
movw $0x1, 0xb48(%rbx)
xorl %ebp, %ebp
jmp 0x97cdc