// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../source/thermodynamics.c
// Function: thermodynamics_set_parameters_reionization
int thermodynamics_set_parameters_reionization(
                                               struct precision * ppr,
                                               struct background * pba,
                                               struct thermodynamics * pth,
                                               struct thermo_reionization_parameters * preio
                                               ) {

  /** Summary: */

  /** Define local variables */
  int bin;
  int point;
  double xe_input,xe_actual,z_sup;

  /** - allocate the vector of parameters defining the function \f$ X_e(z) \f$ */
  class_alloc(preio->reionization_parameters,preio->re_size*sizeof(double),pth->error_message);

  class_test(ppr->reionization_sampling <= 0.0,
             pth->error_message,
             "stop to avoid division by zero. Reionization stepsize has to be larger than zero");

  switch (pth->reio_parametrization) {

    /** - (a) no reionization */
  case reio_none:
    preio->reionization_parameters[preio->index_re_reio_start] = 0.;
    break;

    /** - (b) if reionization implemented like in CAMB, or half tanh like in  1209.0247 */
  case reio_camb:
  case reio_half_tanh:

    /** - --> set values of these parameters, excepted those depending on the reionization redshift */

    if (pth->reio_parametrization == reio_camb) {
      /* xe_after_reio: H + singly ionized He (checked before that denominator is non-zero) */
      preio->reionization_parameters[preio->index_re_xe_after] = 1. + pth->YHe/(_not4_*(1.-pth->YHe));
    }
    if (pth->reio_parametrization == reio_half_tanh) {
      /* xe_after_reio: neglect He ionization */
      preio->reionization_parameters[preio->index_re_xe_after] = 1.;
      //+ 2*pth->YHe/(_not4_*(1.-pth->YHe));    /* xe_after_reio: H + fully ionized He */
    }

    preio->reionization_parameters[preio->index_re_reio_exponent] = pth->reionization_exponent; /* reio_exponent */
    preio->reionization_parameters[preio->index_re_reio_width] = pth->reionization_width;    /* reio_width */
    preio->reionization_parameters[preio->index_re_helium_fullreio_fraction] = pth->YHe/(_not4_*(1.-pth->YHe)); /* helium_fullreio_fraction (checked before that denominator is non-zero) */
    preio->reionization_parameters[preio->index_re_helium_fullreio_redshift] = pth->helium_fullreio_redshift; /* helium_fullreio_redshift */
    preio->reionization_parameters[preio->index_re_helium_fullreio_width] = pth->helium_fullreio_width;    /* helium_fullreio_width */

    class_test(preio->reionization_parameters[preio->index_re_reio_exponent]==0,
               pth->error_message,
               "stop to avoid division by zero");

    class_test(preio->reionization_parameters[preio->index_re_reio_width]==0,
               pth->error_message,
               "stop to avoid division by zero");

    class_test(preio->reionization_parameters[preio->index_re_helium_fullreio_width]==0,
               pth->error_message,
               "stop to avoid division by zero");

    /** - --> if reionization redshift given as an input, initialize the remaining values*/

    if (pth->reio_z_or_tau == reio_z) {

      /* reionization redshift */
      preio->reionization_parameters[preio->index_re_reio_redshift] = pth->z_reio;

      /* infer starting redshift for hydrogen */

      if (pth->reio_parametrization == reio_camb) {

        preio->reionization_parameters[preio->index_re_reio_start] = preio->reionization_parameters[preio->index_re_reio_redshift]+
          ppr->reionization_start_factor*pth->reionization_width;

        /* if starting redshift for helium is larger, take that one (does not happen in realistic models) */
        if (preio->reionization_parameters[preio->index_re_reio_start] <
            pth->helium_fullreio_redshift+ppr->reionization_start_factor*pth->helium_fullreio_width)

          preio->reionization_parameters[preio->index_re_reio_start] =
            pth->helium_fullreio_redshift+ppr->reionization_start_factor*pth->helium_fullreio_width;

      }
      else {

        preio->reionization_parameters[preio->index_re_reio_start] = pth->z_reio;
      }

      class_test(preio->reionization_parameters[preio->index_re_reio_start] > ppr->reionization_z_start_max,
                 pth->error_message,
                 "starting redshift for reionization > reionization_z_start_max = %e\n",ppr->reionization_z_start_max);

    }

    /** - --> if reionization optical depth given as an input, find reionization redshift by bisection and initialize the remaining values */
    if (pth->reio_z_or_tau == reio_tau) {
      z_sup = ppr->reionization_z_start_max-ppr->reionization_start_factor*pth->reionization_width;
      class_test(z_sup < 0.,
                 pth->error_message,
                 "parameters are such that reionization cannot take place before today while starting after z_start_max; need to increase z_start_max");

      /* maximum possible reionization redshift */
      preio->reionization_parameters[preio->index_re_reio_redshift] = z_sup;
      /* maximum possible starting redshift */
      preio->reionization_parameters[preio->index_re_reio_start] = ppr->reionization_z_start_max;
    }
    break;

    /** - (c) if reionization implemented with reio_bins_tanh scheme */
  case reio_bins_tanh:

    /* this algorithm requires at least two bin centers (i.e. at least 4 values in the (z,xe) array, counting the edges). */
    class_test(pth->binned_reio_num<2,
               pth->error_message,
               "current implementation of binned reio requires at least two bin centers");

    /* check that this input can be interpreted by the code */
    for (bin=1; bin<pth->binned_reio_num; bin++) {
      class_test(pth->binned_reio_z[bin-1]>=pth->binned_reio_z[bin],
                 pth->error_message,
                 "value of reionization bin centers z_i expected to be passed in growing order: %e, %e",
                 pth->binned_reio_z[bin-1],
                 pth->binned_reio_z[bin]);
    }

    /* the code will not only copy here the "bin centers" passed in input. It will add an initial and final value for (z,xe).
       First, fill all entries except the first and the last */
    for (bin=1; bin<preio->re_z_size-1; bin++) {
      preio->reionization_parameters[preio->index_re_first_z+bin] = pth->binned_reio_z[bin-1];
      preio->reionization_parameters[preio->index_re_first_xe+bin] = pth->binned_reio_xe[bin-1];
    }

    /* find largest value of z in the array. We choose to define it as z_(i_max) + 2*(the distance between z_(i_max) and z_(i_max-1)). E.g. if
       the bins are in 10,12,14, the largest z will be 18. */
    preio->reionization_parameters[preio->index_re_first_z+preio->re_z_size-1] =
      preio->reionization_parameters[preio->index_re_first_z+preio->re_z_size-2]
      +2.*(preio->reionization_parameters[preio->index_re_first_z+preio->re_z_size-2]
           -preio->reionization_parameters[preio->index_re_first_z+preio->re_z_size-3]);

    /* copy this value in reio_start */
    preio->reionization_parameters[preio->index_re_reio_start] = preio->reionization_parameters[preio->index_re_first_z+preio->re_z_size-1];

    /* check it's not too big */
    class_test(preio->reionization_parameters[preio->index_re_reio_start] > ppr->reionization_z_start_max,
               pth->error_message,
               "starting redshift for reionization = %e, reionization_z_start_max = %e, you must change the binning or increase reionization_z_start_max",
               preio->reionization_parameters[preio->index_re_reio_start],
               ppr->reionization_z_start_max);

    /* find smallest value of z in the array. We choose to define it as z_0 - (the distance between z_1 and z_0). E.g. if
       the bins are in 10,12,14, the stop redshift will be 8. */
    preio->reionization_parameters[preio->index_re_first_z] =
      2.*preio->reionization_parameters[preio->index_re_first_z+1]
      -preio->reionization_parameters[preio->index_re_first_z+2];

    /* check it's not too small */
    /* 6.06.2015: changed this test to simply imposing that the first z is at least zero */
    /*
      class_test(preio->reionization_parameters[preio->index_re_first_z] < 0,
      pth->error_message,
      "final redshift for reionization = %e, you must change the binning or redefine the way in which the code extrapolates below the first value of z_i",preio->reionization_parameters[preio->index_re_first_z]);
    */
    if (preio->reionization_parameters[preio->index_re_first_z] < 0) {
      preio->reionization_parameters[preio->index_re_first_z] = 0.;
    }

    /* infer xe after reio */
    preio->reionization_parameters[preio->index_re_first_xe] = 1. + pth->YHe/(_not4_*(1.-pth->YHe)); /* xe_after_reio: H + singly ionized He (note: segmentation fault impossible,
                                                                                                        checked before that denominator is non-zero) */

    /* pass step sharpness parameter */
    preio->reionization_parameters[preio->index_re_step_sharpness] = pth->binned_reio_step_sharpness;
    break;

    /** - (d) if reionization implemented with reio_many_tanh scheme */
  case reio_many_tanh:

    /* this algorithm requires at least one jump centers */
    class_test(pth->many_tanh_num<1,
               pth->error_message,
               "current implementation of reio_many_tanh requires at least one jump center");

    /* check that z input can be interpreted by the code */
    for (bin=1; bin<pth->many_tanh_num; bin++) {
      class_test(pth->many_tanh_z[bin-1]>=pth->many_tanh_z[bin],
                 pth->error_message,
                 "value of reionization bin centers z_i expected to be passed in growing order: %e, %e",
                 pth->many_tanh_z[bin-1],
                 pth->many_tanh_z[bin]);

    }

    /* the code will not only copy here the "jump centers" passed in input. It will add an initial and final value for (z,xe).
       First, fill all entries except the first and the last */
    for (bin=1; bin<preio->re_z_size-1; bin++) {

      preio->reionization_parameters[preio->index_re_first_z+bin] = pth->many_tanh_z[bin-1];

      /* check that xe input can be interpreted by the code */
      xe_input = pth->many_tanh_xe[bin-1];
      if (xe_input >= 0.) {
        xe_actual = xe_input;
      }
      //-1 means "after hydrogen + first helium recombination"
      else if ((xe_input<-0.9) && (xe_input>-1.1)) {
        xe_actual = 1. + pth->YHe/(_not4_*(1.-pth->YHe));
      }
      //-2 means "after hydrogen + second helium recombination"
      else if ((xe_input<-1.9) && (xe_input>-2.1)) {
        xe_actual = 1. + 2.*pth->YHe/(_not4_*(1.-pth->YHe));
      }
      //other negative number is nonsense
      else {
        class_stop(pth->error_message,
                   "Your entry for many_tanh_xe[%d] is %e, this makes no sense (either positive or 0,-1,-2)",
                   bin-1,pth->many_tanh_xe[bin-1]);
      }

      preio->reionization_parameters[preio->index_re_first_xe+bin] = xe_actual;
    }

    /* find largest value of z in the array. We choose to define it as z_(i_max) + ppr->reionization_start_factor*step_sharpness. */
    preio->reionization_parameters[preio->index_re_first_z+preio->re_z_size-1] =
      preio->reionization_parameters[preio->index_re_first_z+preio->re_z_size-2]
      +ppr->reionization_start_factor*pth->many_tanh_width;

    /* copy this value in reio_start */
    preio->reionization_parameters[preio->index_re_reio_start] = preio->reionization_parameters[preio->index_re_first_z+preio->re_z_size-1];

    /* check it's not too big */
    class_test(preio->reionization_parameters[preio->index_re_reio_start] > ppr->reionization_z_start_max,
               pth->error_message,
               "starting redshift for reionization = %e, reionization_z_start_max = %e, you must change the binning or increase reionization_z_start_max",
               preio->reionization_parameters[preio->index_re_reio_start],
               ppr->reionization_z_start_max);

    /* find smallest value of z in the array. We choose to define it as z_0 - ppr->reionization_start_factor*step_sharpness, but at least zero. */
    preio->reionization_parameters[preio->index_re_first_z] =
      preio->reionization_parameters[preio->index_re_first_z+1]
      -ppr->reionization_start_factor*pth->many_tanh_width;

    if (preio->reionization_parameters[preio->index_re_first_z] < 0) {
      preio->reionization_parameters[preio->index_re_first_z] = 0.;
    }

    /* infer xe after reio */
    preio->reionization_parameters[preio->index_re_first_xe] = preio->reionization_parameters[preio->index_re_first_xe+1];

    /* if we want to model only hydrogen reionization and neglect both helium reionization */
    //preio->reionization_parameters[preio->index_re_first_xe] = 1.;

    /* if we want to model only hydrogen + first helium reionization and neglect second helium reionization */
    //preio->reionization_parameters[preio->index_re_first_xe] = 1. + pth->YHe/(_not4_*(1.-pth->YHe));

    /* if we want to model hydrogen + two helium reionization */
    //preio->reionization_parameters[preio->index_re_first_xe] = 1. + 2.*pth->YHe/(_not4_*(1.-pth->YHe));

    /* pass step sharpness parameter */
    class_test(pth->many_tanh_width<=0,
               pth->error_message,
               "many_tanh_width must be strictly positive, you passed %e",
               pth->many_tanh_width);

    preio->reionization_parameters[preio->index_re_step_sharpness] = pth->many_tanh_width;
    break;

    /** - (e) if reionization implemented with reio_inter scheme */
  case reio_inter:

    /* this parametrization requires at least one point (z,xe) */
    class_test(pth->reio_inter_num<1,
               pth->error_message,
               "current implementation of reio_inter requires at least one point (z,xe)");

    /* this parametrization requires that the first z value is zero */
    class_test(pth->reio_inter_z[0] != 0.,
               pth->error_message,
               "For reio_inter scheme, the first value of reio_inter_z[...]  should always be zero, you passed %e",
               pth->reio_inter_z[0]);

    /* check that z input can be interpreted by the code */
    for (point=1; point<pth->reio_inter_num; point++) {
      class_test(pth->reio_inter_z[point-1]>=pth->reio_inter_z[point],
                 pth->error_message,
                 "value of reionization bin centers z_i expected to be passed in growing order, unlike: %e, %e",
                 pth->reio_inter_z[point-1],
                 pth->reio_inter_z[point]);
    }

    /* this parametrization requires that the last x_i value is zero (the code will substitute it with the value that one would get in
       absence of reionization, as compute by the recombination code) */
    class_test(pth->reio_inter_xe[pth->reio_inter_num-1] != 0.,
               pth->error_message,
               "For reio_inter scheme, the last value of reio_inter_xe[...]  should always be zero, you passed %e",
               pth->reio_inter_xe[pth->reio_inter_num-1]);

    /* copy here the (z,xe) values passed in input. */
    for (point=0; point<preio->re_z_size; point++) {

      preio->reionization_parameters[preio->index_re_first_z+point] = pth->reio_inter_z[point];

      /* check that xe input can be interpreted by the code */
      xe_input = pth->reio_inter_xe[point];
      if (xe_input >= 0.) {
        xe_actual = xe_input;
      }
      //-1 means "after hydrogen + first helium recombination"
      else if ((xe_input<-0.9) && (xe_input>-1.1)) {
        xe_actual = 1. + pth->YHe/(_not4_*(1.-pth->YHe));
      }
      //-2 means "after hydrogen + second helium recombination"
      else if ((xe_input<-1.9) && (xe_input>-2.1)) {
        xe_actual = 1. + 2.*pth->YHe/(_not4_*(1.-pth->YHe));
      }
      //other negative number is nonsense
      else {
        class_stop(pth->error_message,
                   "Your entry for reio_inter_xe[%d] is %e, this makes no sense (either positive or 0,-1,-2)",
                   point,pth->reio_inter_xe[point]);
      }

      preio->reionization_parameters[preio->index_re_first_xe+point] = xe_actual;
    }

    /* copy highest redshift in reio_start */
    preio->reionization_parameters[preio->index_re_reio_start] = preio->reionization_parameters[preio->index_re_first_z+preio->re_z_size-1];

    /* check it's not too big */
    class_test(preio->reionization_parameters[preio->index_re_reio_start] > ppr->reionization_z_start_max,
               pth->error_message,
               "starting redshift for reionization = %e, reionization_z_start_max = %e, you must change the binning or increase reionization_z_start_max",
               preio->reionization_parameters[preio->index_re_reio_start],
               ppr->reionization_z_start_max);
    break;

  default:
    class_stop(pth->error_message,
               "value of reio_parametrization=%d unclear",pth->reio_parametrization);
    break;
  }

  /* infer conf_time_reio from z_reio */
  class_call(background_tau_of_z(pba,pth->z_reio,&(pth->conf_time_reio)),
             pba->error_message,
             pth->error_message);

  return _SUCCESS_;

}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movslq 0x40(%rcx), %r13
leaq (,%r13,8), %rdi
callq 0x8490
movq %rax, 0x38(%r15)
testq %rax, %rax
je 0x655f7
xorpd %xmm0, %xmm0
ucomisd 0x3f0(%r12), %xmm0
jae 0x6563b
movl 0x18(%rbx), %edx
cmpq $0x5, %rdx
ja 0x65880
pushq $0x30
popq %rcx
leaq 0x9f10c(%rip), %rsi     # 0x1046c8
movslq (%rsi,%rdx,4), %rdi
addq %rsi, %rdi
jmpq *%rdi
cmpl $0x1, %edx
jne 0x656ad
movsd (%rbx), %xmm0
movsd 0x7fc86(%rip), %xmm1    # 0xe5260
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
mulsd 0x9ef66(%rip), %xmm2    # 0x104550
divsd %xmm2, %xmm0
addsd %xmm1, %xmm0
jmp 0x656ba
shll $0x3, %r13d
leaq 0x7fa02(%rip), %rsi     # 0xe5004
leaq 0xa0189(%rip), %rdx     # 0x105792
movq %rsp, %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7fa0d(%rip), %rsi     # 0xe5034
leaq 0xa0183(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x4a0, %ecx            # imm = 0x4A0
movq %r14, %r8
jmp 0x65692
leaq 0xa019a(%rip), %rsi     # 0x1057dc
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x7fa2c(%rip), %rsi     # 0xe5082
leaq 0xa01d0(%rip), %rdx     # 0x10582d
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7f9b4(%rip), %rsi     # 0xe5034
leaq 0xa012a(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x4a4, %ecx            # imm = 0x4A4
movq %r15, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
cmpl $0x3, %edx
jne 0x656c3
movsd 0x7fba6(%rip), %xmm0    # 0xe5260
movslq 0x10(%r15), %rsi
movsd %xmm0, (%rax,%rsi,8)
movsd 0x48(%rbx), %xmm0
movslq 0x4(%r15), %rdi
movsd %xmm0, (%rax,%rdi,8)
movsd 0x40(%rbx), %xmm1
movslq 0x8(%r15), %rsi
movsd %xmm1, (%rax,%rsi,8)
movsd (%rbx), %xmm0
movsd 0x7fb75(%rip), %xmm2    # 0xe5260
subsd %xmm0, %xmm2
mulsd 0x9ee59(%rip), %xmm2    # 0x104550
divsd %xmm2, %xmm0
movslq 0x14(%r15), %r8
movsd %xmm0, (%rax,%r8,8)
movsd 0x50(%rbx), %xmm2
movslq 0x18(%r15), %r8
movsd %xmm2, (%rax,%r8,8)
movsd 0x58(%rbx), %xmm0
movslq 0x1c(%r15), %r8
movsd %xmm0, (%rax,%r8,8)
movsd (%rax,%rdi,8), %xmm4
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm4
jne 0x65962
jp 0x65962
leaq 0x815ba(%rip), %rsi     # 0xe6cfd
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x7f92b(%rip), %rsi     # 0xe5082
leaq 0xa00f1(%rip), %rdx     # 0x10584f
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7f8b3(%rip), %rsi     # 0xe5034
leaq 0xa0029(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x4c5, %ecx            # imm = 0x4C5
jmp 0x6568f
movslq 0x60(%rbx), %rcx
cmpq $0x2, %rcx
jge 0x659d0
leaq 0xa029b(%rip), %rsi     # 0x105a45
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x7f8c4(%rip), %rsi     # 0xe5082
leaq 0xa02c8(%rip), %rdx     # 0x105a8d
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7f84c(%rip), %rsi     # 0xe5034
leaq 0x9ffc2(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x504, %ecx            # imm = 0x504
jmp 0x6568f
movslq 0xa0(%rbx), %rdx
testq %rdx, %rdx
jle 0x65a4d
movq 0xa8(%rbx), %rcx
movsd (%rcx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x65827
jnp 0x65dd5
leaq 0xa051d(%rip), %rsi     # 0x105d4b
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x2e014
leaq 0x7f840(%rip), %rsi     # 0xe5082
leaq 0xa0564(%rip), %rdx     # 0x105dad
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7f7c8(%rip), %rsi     # 0xe5034
leaq 0x9ff3e(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x5a8, %ecx            # imm = 0x5A8
jmp 0x6568f
leaq 0x9fe14(%rip), %rsi     # 0x10569b
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x7fcea(%rip), %rsi     # 0xe5585
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7f776(%rip), %rsi     # 0xe5034
leaq 0x9feec(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x5e3, %ecx            # imm = 0x5E3
jmp 0x6568f
movslq 0x80(%rbx), %rcx
testq %rcx, %rcx
jle 0x65aa6
pushq $0x1
popq %rdx
cmpq %rdx, %rcx
je 0x65aff
movq 0x88(%rbx), %rsi
movsd -0x8(%rsi,%rdx,8), %xmm0
movsd (%rsi,%rdx,8), %xmm1
incq %rdx
ucomisd %xmm1, %xmm0
jb 0x658e5
leaq 0xa0194(%rip), %rsi     # 0x105aa4
movq %rsp, %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x2e014
leaq 0x7f75e(%rip), %rsi     # 0xe5082
leaq 0xa02ea(%rip), %rdx     # 0x105c15
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7f6e6(%rip), %rsi     # 0xe5034
leaq 0x9fe5c(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x54e, %ecx            # imm = 0x54E
jmp 0x6568f
movsd (%rax,%rsi,8), %xmm4
ucomisd %xmm3, %xmm4
jne 0x65be0
jp 0x65be0
leaq 0x8137f(%rip), %rsi     # 0xe6cfd
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x7f6f0(%rip), %rsi     # 0xe5082
leaq 0x9fef7(%rip), %rdx     # 0x105890
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7f678(%rip), %rsi     # 0xe5034
leaq 0x9fdee(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x4c9, %ecx            # imm = 0x4C9
jmp 0x6568f
pushq $0x1
popq %rdx
cmpq %rdx, %rcx
je 0x65cf0
movq 0x68(%rbx), %rsi
movsd -0x8(%rsi,%rdx,8), %xmm0
movsd (%rsi,%rdx,8), %xmm1
incq %rdx
ucomisd %xmm1, %xmm0
jb 0x659d3
leaq 0xa00a9(%rip), %rsi     # 0x105aa4
movq %rsp, %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x2e014
leaq 0x7f673(%rip), %rsi     # 0xe5082
leaq 0xa00e3(%rip), %rdx     # 0x105af9
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7f5fb(%rip), %rsi     # 0xe5034
leaq 0x9fd71(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x50c, %ecx            # imm = 0x50C
jmp 0x6568f
leaq 0xa0299(%rip), %rsi     # 0x105ced
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x7f61a(%rip), %rsi     # 0xe5082
leaq 0xa02c6(%rip), %rdx     # 0x105d35
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7f5a2(%rip), %rsi     # 0xe5034
leaq 0x9fd18(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x5a2, %ecx            # imm = 0x5A2
jmp 0x6568f
leaq 0xa0108(%rip), %rsi     # 0x105bb5
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x7f5c1(%rip), %rsi     # 0xe5082
leaq 0xa0138(%rip), %rdx     # 0x105c00
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7f549(%rip), %rsi     # 0xe5034
leaq 0x9fcbf(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x546, %ecx            # imm = 0x546
jmp 0x6568f
movslq 0x20(%r15), %rcx
leaq -0x1(%rcx), %rsi
movq %rax, %rdi
addq $0x8, %rdi
xorl %edx, %edx
xorpd %xmm1, %xmm1
movsd 0x7f79c(%rip), %xmm2    # 0xe52b8
movsd 0x9ea84(%rip), %xmm3    # 0x1045a8
movsd 0x7f734(%rip), %xmm4    # 0xe5260
movsd 0x9ea1c(%rip), %xmm5    # 0x104550
movsd 0x9ea74(%rip), %xmm6    # 0x1045b0
movsd 0x9ea74(%rip), %xmm7    # 0x1045b8
leaq 0x1(%rdx), %r8
cmpq %rsi, %r8
jge 0x65c49
movq 0x88(%rbx), %r9
movsd (%r9,%rdx,8), %xmm0
movslq 0x24(%r15), %r9
movsd %xmm0, (%rdi,%r9,8)
movq 0x90(%rbx), %r9
movsd (%r9,%rdx,8), %xmm0
ucomisd %xmm1, %xmm0
jae 0x65bcb
ucomisd %xmm0, %xmm2
jbe 0x65b97
ucomisd %xmm3, %xmm0
jbe 0x65b97
movsd (%rbx), %xmm0
movapd %xmm4, %xmm8
subsd %xmm0, %xmm8
jmp 0x65bbd
ucomisd %xmm0, %xmm6
jbe 0x66075
ucomisd %xmm7, %xmm0
jbe 0x66075
movsd (%rbx), %xmm0
movapd %xmm4, %xmm8
subsd %xmm0, %xmm8
addsd %xmm0, %xmm0
mulsd %xmm5, %xmm8
divsd %xmm8, %xmm0
addsd %xmm4, %xmm0
movslq 0x28(%r15), %rdx
movsd %xmm0, (%rdi,%rdx,8)
addq $0x8, %rdi
movq %r8, %rdx
jmp 0x65b44
ucomisd %xmm3, %xmm0
jne 0x66010
jp 0x66010
leaq 0x81106(%rip), %rsi     # 0xe6cfd
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x7f477(%rip), %rsi     # 0xe5082
leaq 0x9fcbc(%rip), %rdx     # 0x1058ce
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7f3ff(%rip), %rsi     # 0xe5034
leaq 0x9fb75(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x4cd, %ecx            # imm = 0x4CD
jmp 0x6568f
movslq 0x24(%r15), %rdx
addq %rdx, %rcx
movsd 0x98(%rbx), %xmm0
movsd 0x400(%r12), %xmm3
mulsd %xmm0, %xmm3
movsd -0x10(%rax,%rcx,8), %xmm2
addsd %xmm3, %xmm2
movsd %xmm2, -0x8(%rax,%rcx,8)
movslq 0x30(%r15), %rcx
movsd %xmm2, (%rax,%rcx,8)
movsd 0x3e8(%r12), %xmm1
ucomisd %xmm1, %xmm2
jbe 0x65e4e
leaq 0x9fe92(%rip), %rsi     # 0x105b2c
movq %rsp, %r14
movq %r14, %rdi
movapd %xmm2, %xmm0
movb $0x2, %al
callq 0x2e014
leaq 0x7f3d0(%rip), %rsi     # 0xe5082
leaq 0x9fca2(%rip), %rdx     # 0x10595b
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7f358(%rip), %rsi     # 0xe5034
leaq 0x9face(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x57c, %ecx            # imm = 0x57C
jmp 0x6568f
movslq 0x20(%r15), %rcx
leaq -0x1(%rcx), %rdx
movq %rax, %rsi
addq $0x8, %rsi
pushq $0x1
popq %rdi
cmpq %rdx, %rdi
jge 0x65d3a
movq 0x68(%rbx), %r8
movsd -0x8(%r8,%rdi,8), %xmm0
movslq 0x24(%r15), %r8
movsd %xmm0, (%rsi,%r8,8)
movq 0x70(%rbx), %r8
movsd -0x8(%r8,%rdi,8), %xmm0
movslq 0x28(%r15), %r8
movsd %xmm0, (%rsi,%r8,8)
incq %rdi
addq $0x8, %rsi
jmp 0x65d02
movslq 0x24(%r15), %rdx
addq %rdx, %rcx
movsd -0x10(%rax,%rcx,8), %xmm1
movapd %xmm1, %xmm0
subsd -0x18(%rax,%rcx,8), %xmm0
addsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rax,%rcx,8)
movslq 0x30(%r15), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x3e8(%r12), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x65ed7
leaq 0x9fda9(%rip), %rsi     # 0x105b2c
movq %rsp, %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x2e014
leaq 0x7f2eb(%rip), %rsi     # 0xe5082
leaq 0x9fbbd(%rip), %rdx     # 0x10595b
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7f273(%rip), %rsi     # 0xe5034
leaq 0x9f9e9(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x525, %ecx            # imm = 0x525
jmp 0x6568f
pushq $0x1
popq %rsi
cmpq %rsi, %rdx
je 0x65f9a
movsd -0x8(%rcx,%rsi,8), %xmm0
movsd (%rcx,%rsi,8), %xmm1
incq %rsi
ucomisd %xmm1, %xmm0
jb 0x65dd8
leaq 0x9ffcc(%rip), %rsi     # 0x105dc8
movq %rsp, %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x2e014
leaq 0x7f272(%rip), %rsi     # 0xe5082
leaq 0xa000e(%rip), %rdx     # 0x105e25
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7f1fa(%rip), %rsi     # 0xe5034
leaq 0x9f970(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x5b0, %ecx            # imm = 0x5B0
jmp 0x6568f
movsd 0x8(%rax,%rdx,8), %xmm1
subsd %xmm3, %xmm1
xorpd %xmm2, %xmm2
ucomisd %xmm0, %xmm2
maxsd %xmm1, %xmm2
movsd %xmm2, (%rax,%rdx,8)
movslq 0x28(%r15), %rcx
movsd 0x8(%rax,%rcx,8), %xmm1
movsd %xmm1, (%rax,%rcx,8)
jb 0x65f26
leaq 0x9fe17(%rip), %rsi     # 0x105c9c
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x2e014
leaq 0x7f1e9(%rip), %rsi     # 0xe5082
leaq 0x9fe35(%rip), %rdx     # 0x105cd5
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7f171(%rip), %rsi     # 0xe5034
leaq 0x9f8e7(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x597, %ecx            # imm = 0x597
jmp 0x6568f
movsd 0x8(%rax,%rdx,8), %xmm0
addsd %xmm0, %xmm0
subsd 0x10(%rax,%rdx,8), %xmm0
xorpd %xmm1, %xmm1
maxsd %xmm0, %xmm1
movsd %xmm1, (%rax,%rdx,8)
movsd (%rbx), %xmm0
movsd 0x7f360(%rip), %xmm1    # 0xe5260
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
mulsd 0x9e640(%rip), %xmm2    # 0x104550
divsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movslq 0x28(%r15), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x78(%rbx), %xmm0
pushq $0x2c
popq %rcx
movslq (%r15,%rcx), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x28(%rbx), %xmm0
leaq 0xfc0(%rbx), %rsi
movq %r14, %rdi
callq 0x58adb
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x1, %ecx
jne 0x6569c
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x7f48f(%rip), %rsi     # 0xe53f0
leaq 0x9ffdd(%rip), %rdx     # 0x105f45
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7f0ae(%rip), %rsi     # 0xe5034
leaq 0x9f824(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x5ea, %ecx            # imm = 0x5EA
jmp 0x6568f
movq 0xb0(%rbx), %rsi
movsd -0x8(%rsi,%rdx,8), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x65fb7
jnp 0x660c7
leaq 0x9fe9c(%rip), %rsi     # 0x105e5a
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x2e014
leaq 0x7f0b0(%rip), %rsi     # 0xe5082
leaq 0x9fee3(%rip), %rdx     # 0x105ebc
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7f038(%rip), %rsi     # 0xe5034
leaq 0x9f7ae(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x5b8, %ecx            # imm = 0x5B8
jmp 0x6568f
movl 0x1c(%rbx), %esi
cmpl $0x1, %esi
je 0x66217
testl %esi, %esi
jne 0x65f32
movsd 0x28(%rbx), %xmm3
movslq (%r15), %rcx
movsd %xmm3, (%rax,%rcx,8)
cmpl $0x1, %edx
jne 0x6629a
movsd 0x400(%r12), %xmm4
mulsd %xmm4, %xmm1
addsd %xmm1, %xmm3
movslq 0x30(%r15), %rcx
movsd %xmm3, (%rax,%rcx,8)
mulsd %xmm4, %xmm0
addsd %xmm2, %xmm0
ucomisd %xmm3, %xmm0
jbe 0x662a3
movsd %xmm0, (%rax,%rcx,8)
movapd %xmm0, %xmm3
jmp 0x662a3
leaq 0x9fbc8(%rip), %rsi     # 0x105c44
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x2e014
leaq 0x7f4f5(%rip), %rsi     # 0xe5585
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7ef81(%rip), %rsi     # 0xe5034
leaq 0x9f6f7(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x569, %ecx            # imm = 0x569
jmp 0x6568f
movslq 0x20(%r15), %rdi
xorl %edx, %edx
testl %edi, %edi
movl $0x0, %r8d
cmovgl %edi, %r8d
movsd 0x7f1d7(%rip), %xmm2    # 0xe52b8
movsd 0x9e4bf(%rip), %xmm3    # 0x1045a8
movsd 0x7f16f(%rip), %xmm4    # 0xe5260
movsd 0x9e457(%rip), %xmm5    # 0x104550
movsd 0x9e4af(%rip), %xmm6    # 0x1045b0
movsd 0x9e4af(%rip), %xmm7    # 0x1045b8
cmpq %rdx, %r8
je 0x66194
movsd (%rcx,%rdx,8), %xmm0
movslq 0x24(%r15), %r9
addq %rdx, %r9
movsd %xmm0, (%rax,%r9,8)
movsd (%rsi,%rdx,8), %xmm0
ucomisd %xmm1, %xmm0
jae 0x6617f
ucomisd %xmm0, %xmm2
jbe 0x6614b
ucomisd %xmm3, %xmm0
jbe 0x6614b
movsd (%rbx), %xmm0
movapd %xmm4, %xmm8
subsd %xmm0, %xmm8
jmp 0x66171
ucomisd %xmm0, %xmm6
jbe 0x6631d
ucomisd %xmm7, %xmm0
jbe 0x6631d
movsd (%rbx), %xmm0
movapd %xmm4, %xmm8
subsd %xmm0, %xmm8
addsd %xmm0, %xmm0
mulsd %xmm5, %xmm8
divsd %xmm8, %xmm0
addsd %xmm4, %xmm0
movslq 0x28(%r15), %r9
addq %rdx, %r9
movsd %xmm0, (%rax,%r9,8)
incq %rdx
jmp 0x66109
movslq 0x24(%r15), %rcx
addq %rdi, %rcx
movsd -0x8(%rax,%rcx,8), %xmm0
movslq 0x30(%r15), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x3e8(%r12), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x65f32
leaq 0x9f967(%rip), %rsi     # 0x105b2c
movq %rsp, %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x2e014
leaq 0x7eea9(%rip), %rsi     # 0xe5082
leaq 0x9f77b(%rip), %rdx     # 0x10595b
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7ee31(%rip), %rsi     # 0xe5034
leaq 0x9f5a7(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x5de, %ecx            # imm = 0x5DE
jmp 0x6568f
movsd 0x3e8(%r12), %xmm0
mulsd 0x400(%r12), %xmm1
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm1
jbe 0x66310
leaq 0x9f76e(%rip), %rsi     # 0x1059b6
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x7ee26(%rip), %rsi     # 0xe5082
leaq 0x9f7d7(%rip), %rdx     # 0x105a3a
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7edae(%rip), %rsi     # 0xe5034
leaq 0x9f524(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x4f5, %ecx            # imm = 0x4F5
jmp 0x6568f
movslq 0x30(%r15), %rcx
movsd %xmm3, (%rax,%rcx,8)
movsd 0x3e8(%r12), %xmm0
ucomisd %xmm0, %xmm3
jbe 0x65f32
leaq 0x9f659(%rip), %rsi     # 0x105917
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x2e014
leaq 0x7edb0(%rip), %rsi     # 0xe5082
leaq 0x9f682(%rip), %rdx     # 0x10595b
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7ed38(%rip), %rsi     # 0xe5034
leaq 0x9f4ae(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x4ec, %ecx            # imm = 0x4EC
jmp 0x6568f
movslq (%r15), %rdx
movsd %xmm2, (%rax,%rdx,8)
jmp 0x65f29
leaq 0x9fbc8(%rip), %rsi     # 0x105eec
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x2e014
leaq 0x7f24d(%rip), %rsi     # 0xe5585
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7ecd9(%rip), %rsi     # 0xe5034
leaq 0x9f44f(%rip), %rdx     # 0x1057b1
movq %rbx, %rdi
movl $0x5d0, %ecx            # imm = 0x5D0
jmp 0x6568f