// File: /workspace/github_c_makefile_star2_O3/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 0x8460
movq %rax, 0x38(%r15)
testq %rax, %rax
je 0x699ae
xorpd %xmm0, %xmm0
ucomisd 0x3f0(%r12), %xmm0
jae 0x699f2
movl 0x18(%rbx), %edx
cmpq $0x5, %rdx
ja 0x69c37
movl $0x30, %ecx
leaq 0xa3eb5(%rip), %rsi     # 0x10d828
movslq (%rsi,%rdx,4), %rdi
addq %rsi, %rdi
jmpq *%rdi
cmpl $0x1, %edx
jne 0x69a66
movsd (%rbx), %xmm0
movsd 0x848cf(%rip), %xmm1    # 0xee260
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
mulsd 0xa3cef(%rip), %xmm2    # 0x10d690
divsd %xmm2, %xmm0
addsd %xmm1, %xmm0
jmp 0x69a73
shll $0x3, %r13d
leaq 0x8464b(%rip), %rsi     # 0xee004
leaq 0xa4f32(%rip), %rdx     # 0x10e8f2
movq %rsp, %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84656(%rip), %rsi     # 0xee034
leaq 0xa4f2c(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x4a0, %ecx            # imm = 0x4A0
movq %r14, %r8
jmp 0x69a49
leaq 0xa4f43(%rip), %rsi     # 0x10e93c
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x84675(%rip), %rsi     # 0xee082
leaq 0xa4f79(%rip), %rdx     # 0x10e98d
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x845fd(%rip), %rsi     # 0xee034
leaq 0xa4ed3(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x4a4, %ecx            # imm = 0x4A4
movq %r15, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
cmpl $0x3, %edx
jne 0x69a7c
movsd 0x847ed(%rip), %xmm0    # 0xee260
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 0x847bc(%rip), %xmm2    # 0xee260
subsd %xmm0, %xmm2
mulsd 0xa3be0(%rip), %xmm2    # 0x10d690
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 0x69db3
jp 0x69db3
leaq 0x86241(%rip), %rsi     # 0xefd3d
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x84572(%rip), %rsi     # 0xee082
leaq 0xa4e98(%rip), %rdx     # 0x10e9af
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x844fa(%rip), %rsi     # 0xee034
leaq 0xa4dd0(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x4c5, %ecx            # imm = 0x4C5
jmp 0x69a46
movslq 0x60(%rbx), %rdx
cmpq $0x2, %rdx
jge 0x69e21
leaq 0xa5042(%rip), %rsi     # 0x10eba5
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x8450b(%rip), %rsi     # 0xee082
leaq 0xa506f(%rip), %rdx     # 0x10ebed
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84493(%rip), %rsi     # 0xee034
leaq 0xa4d69(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x504, %ecx            # imm = 0x504
jmp 0x69a46
movl 0xa0(%rbx), %edx
testl %edx, %edx
jle 0x69e9e
movq 0xa8(%rbx), %rcx
movsd (%rcx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x69bde
jnp 0x6a012
leaq 0xa52c6(%rip), %rsi     # 0x10eeab
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x30af0
leaq 0x84489(%rip), %rsi     # 0xee082
leaq 0xa530d(%rip), %rdx     # 0x10ef0d
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84411(%rip), %rsi     # 0xee034
leaq 0xa4ce7(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x5a8, %ecx            # imm = 0x5A8
jmp 0x69a46
leaq 0xa4bbd(%rip), %rsi     # 0x10e7fb
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x84933(%rip), %rsi     # 0xee585
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x843bf(%rip), %rsi     # 0xee034
leaq 0xa4c95(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x5e3, %ecx            # imm = 0x5E3
jmp 0x69a46
movl 0x80(%rbx), %ecx
testl %ecx, %ecx
jle 0x69ef7
cmpl $0x1, %ecx
je 0x69cc5
movq 0x88(%rbx), %rdx
movl $0x1, %esi
movsd -0x8(%rdx,%rsi,8), %xmm0
movsd (%rdx,%rsi,8), %xmm1
ucomisd %xmm1, %xmm0
jae 0x6a1ed
incq %rsi
cmpq %rsi, %rcx
jne 0x69ca8
movl 0x20(%r15), %esi
cmpl $0x2, %esi
jle 0x6a0b7
leal -0x1(%rsi), %edi
movq 0x88(%rbx), %r8
movq 0x90(%rbx), %r9
movslq 0x24(%r15), %rcx
leaq (%rax,%rcx,8), %r10
addq $0x8, %r10
movq %rax, %r11
addq $0x8, %r11
decq %rdi
xorl %edx, %edx
xorpd %xmm1, %xmm1
movsd 0x845b1(%rip), %xmm2    # 0xee2b8
movsd 0xa39d9(%rip), %xmm3    # 0x10d6e8
movsd 0x84549(%rip), %xmm4    # 0xee260
movsd 0xa3971(%rip), %xmm5    # 0x10d690
movsd 0xa39c9(%rip), %xmm6    # 0x10d6f0
movsd 0xa39c9(%rip), %xmm7    # 0x10d6f8
movsd (%r8,%rdx,8), %xmm0
movsd %xmm0, (%r10,%rdx,8)
movsd (%r9,%rdx,8), %xmm0
ucomisd %xmm1, %xmm0
jae 0x69d97
ucomisd %xmm0, %xmm2
jbe 0x69d63
ucomisd %xmm3, %xmm0
jbe 0x69d63
movsd (%rbx), %xmm0
movapd %xmm4, %xmm8
subsd %xmm0, %xmm8
jmp 0x69d89
ucomisd %xmm0, %xmm6
jbe 0x6a5a6
ucomisd %xmm7, %xmm0
jbe 0x6a5a6
movsd (%rbx), %xmm0
movapd %xmm4, %xmm8
subsd %xmm0, %xmm8
addsd %xmm0, %xmm0
mulsd %xmm5, %xmm8
divsd %xmm8, %xmm0
addsd %xmm4, %xmm0
movslq 0x28(%r15), %r13
leaq (%r11,%r13,8), %r13
movsd %xmm0, (%r13,%rdx,8)
incq %rdx
cmpq %rdx, %rdi
jne 0x69d2f
jmp 0x6a0bb
movsd (%rax,%rsi,8), %xmm4
ucomisd %xmm3, %xmm4
jne 0x69f50
jp 0x69f50
leaq 0x85f6e(%rip), %rsi     # 0xefd3d
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x8429f(%rip), %rsi     # 0xee082
leaq 0xa4c06(%rip), %rdx     # 0x10e9f0
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84227(%rip), %rsi     # 0xee034
leaq 0xa4afd(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x4c9, %ecx            # imm = 0x4C9
jmp 0x69a46
movq 0x68(%rbx), %rcx
movl $0x1, %esi
movsd -0x8(%rcx,%rsi,8), %xmm0
movsd (%rcx,%rsi,8), %xmm1
ucomisd %xmm1, %xmm0
jae 0x69fb9
incq %rsi
cmpq %rsi, %rdx
jne 0x69e2a
movl 0x20(%r15), %esi
cmpl $0x2, %esi
jle 0x6a246
leal -0x1(%rsi), %edi
movslq 0x24(%r15), %rdx
movq 0x70(%rbx), %r8
movslq 0x28(%r15), %r9
leaq (%rax,%r9,8), %r9
addq $0x8, %r9
leaq (%rax,%rdx,8), %r10
addq $0x8, %r10
decq %rdi
xorl %r11d, %r11d
movsd (%rcx,%r11,8), %xmm0
movsd %xmm0, (%r10,%r11,8)
movsd (%r8,%r11,8), %xmm0
movsd %xmm0, (%r9,%r11,8)
incq %r11
cmpq %r11, %rdi
jne 0x69e79
jmp 0x6a24a
leaq 0xa4fa8(%rip), %rsi     # 0x10ee4d
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x841c9(%rip), %rsi     # 0xee082
leaq 0xa4fd5(%rip), %rdx     # 0x10ee95
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84151(%rip), %rsi     # 0xee034
leaq 0xa4a27(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x5a2, %ecx            # imm = 0x5A2
jmp 0x69a46
leaq 0xa4e17(%rip), %rsi     # 0x10ed15
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x84170(%rip), %rsi     # 0xee082
leaq 0xa4e47(%rip), %rdx     # 0x10ed60
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x840f8(%rip), %rsi     # 0xee034
leaq 0xa49ce(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x546, %ecx            # imm = 0x546
jmp 0x69a46
ucomisd %xmm3, %xmm0
jne 0x6a3a7
jp 0x6a3a7
leaq 0x85dd6(%rip), %rsi     # 0xefd3d
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x84107(%rip), %rsi     # 0xee082
leaq 0xa4aac(%rip), %rdx     # 0x10ea2e
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x8408f(%rip), %rsi     # 0xee034
leaq 0xa4965(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x4cd, %ecx            # imm = 0x4CD
jmp 0x69a46
leaq 0xa4c44(%rip), %rsi     # 0x10ec04
movq %rsp, %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x30af0
leaq 0x840ae(%rip), %rsi     # 0xee082
leaq 0xa4c7e(%rip), %rdx     # 0x10ec59
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84036(%rip), %rsi     # 0xee034
leaq 0xa490c(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x50c, %ecx            # imm = 0x50C
jmp 0x69a46
movl $0x1, %edi
cmpl $0x1, %edx
je 0x6a041
movl $0x1, %esi
movsd -0x8(%rcx,%rsi,8), %xmm0
movsd (%rcx,%rsi,8), %xmm1
ucomisd %xmm1, %xmm0
jae 0x6a54d
incq %rsi
cmpq %rsi, %rdx
jne 0x6a021
movq %rdx, %rdi
movq 0xb0(%rbx), %rsi
movsd -0x8(%rsi,%rdi,8), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x6a05e
jnp 0x6a408
leaq 0xa4f55(%rip), %rsi     # 0x10efba
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x30af0
leaq 0x84009(%rip), %rsi     # 0xee082
leaq 0xa4f9c(%rip), %rdx     # 0x10f01c
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x83f91(%rip), %rsi     # 0xee034
leaq 0xa4867(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x5b8, %ecx            # imm = 0x5B8
jmp 0x69a46
movl 0x24(%r15), %ecx
addl %ecx, %esi
movslq %esi, %rdx
movsd 0x98(%rbx), %xmm0
movsd 0x400(%r12), %xmm3
mulsd %xmm0, %xmm3
movsd -0x10(%rax,%rdx,8), %xmm2
addsd %xmm3, %xmm2
movsd %xmm2, -0x8(%rax,%rdx,8)
movslq 0x30(%r15), %rdx
movsd %xmm2, (%rax,%rdx,8)
movsd 0x3e8(%r12), %xmm1
ucomisd %xmm1, %xmm2
jbe 0x6a15c
leaq 0xa4b86(%rip), %rsi     # 0x10ec8c
movq %rsp, %r14
movq %r14, %rdi
movapd %xmm2, %xmm0
movb $0x2, %al
callq 0x30af0
leaq 0x83f64(%rip), %rsi     # 0xee082
leaq 0xa4996(%rip), %rdx     # 0x10eabb
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x83eec(%rip), %rsi     # 0xee034
leaq 0xa47c2(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x57c, %ecx            # imm = 0x57C
jmp 0x69a46
movslq %ecx, %rcx
movsd 0x8(%rax,%rcx,8), %xmm1
subsd %xmm3, %xmm1
xorpd %xmm2, %xmm2
ucomisd %xmm0, %xmm2
maxsd %xmm1, %xmm2
movsd %xmm2, (%rax,%rcx,8)
movslq 0x28(%r15), %rcx
movsd 0x8(%rax,%rcx,8), %xmm1
movsd %xmm1, (%rax,%rcx,8)
movl $0x2c, %ecx
jb 0x6a336
leaq 0xa4c61(%rip), %rsi     # 0x10edfc
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x30af0
leaq 0x83ed3(%rip), %rsi     # 0xee082
leaq 0xa4c7f(%rip), %rdx     # 0x10ee35
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x83e5b(%rip), %rsi     # 0xee034
leaq 0xa4731(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x597, %ecx            # imm = 0x597
jmp 0x69a46
leaq 0xa4a10(%rip), %rsi     # 0x10ec04
movq %rsp, %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x30af0
leaq 0x83e7a(%rip), %rsi     # 0xee082
leaq 0xa4b66(%rip), %rdx     # 0x10ed75
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x83e02(%rip), %rsi     # 0xee034
leaq 0xa46d8(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x54e, %ecx            # imm = 0x54E
jmp 0x69a46
movl 0x24(%r15), %edx
addl %edx, %esi
movslq %esi, %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 0x6a2df
leaq 0xa49ff(%rip), %rsi     # 0x10ec8c
movq %rsp, %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x30af0
leaq 0x83de1(%rip), %rsi     # 0xee082
leaq 0xa4813(%rip), %rdx     # 0x10eabb
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x83d69(%rip), %rsi     # 0xee034
leaq 0xa463f(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x525, %ecx            # imm = 0x525
jmp 0x69a46
movslq %edx, %rcx
movsd 0x8(%rax,%rcx,8), %xmm0
addsd %xmm0, %xmm0
subsd 0x10(%rax,%rcx,8), %xmm0
xorpd %xmm1, %xmm1
maxsd %xmm0, %xmm1
movsd %xmm1, (%rax,%rcx,8)
movsd (%rbx), %xmm0
movsd 0x83f55(%rip), %xmm1    # 0xee260
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
mulsd 0xa3375(%rip), %xmm2    # 0x10d690
divsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movslq 0x28(%r15), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x78(%rbx), %xmm0
movl $0x2c, %ecx
movslq (%r15,%rcx), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x28(%rbx), %xmm0
leaq 0xfc0(%rbx), %rsi
movq %r14, %rdi
callq 0x5c896
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x1, %ecx
jne 0x69a55
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x84082(%rip), %rsi     # 0xee3f0
leaq 0xa4d30(%rip), %rdx     # 0x10f0a5
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x83ca1(%rip), %rsi     # 0xee034
leaq 0xa4577(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x5ea, %ecx            # imm = 0x5EA
jmp 0x69a46
movl 0x1c(%rbx), %esi
cmpl $0x1, %esi
je 0x6a5f8
testl %esi, %esi
jne 0x6a33f
movsd 0x28(%rbx), %xmm3
movslq (%r15), %rcx
movsd %xmm3, (%rax,%rcx,8)
cmpl $0x1, %edx
jne 0x6a67b
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 0x6a684
movsd %xmm0, (%rax,%rcx,8)
movapd %xmm0, %xmm3
jmp 0x6a684
movslq 0x20(%r15), %rdi
movslq 0x24(%r15), %r8
testq %rdi, %rdi
jle 0x6a4cb
leaq (%rax,%r8,8), %r9
xorl %edx, %edx
movsd 0x83e91(%rip), %xmm2    # 0xee2b8
movsd 0xa32b9(%rip), %xmm3    # 0x10d6e8
movsd 0x83e29(%rip), %xmm4    # 0xee260
movsd 0xa3251(%rip), %xmm5    # 0x10d690
movsd 0xa32a9(%rip), %xmm6    # 0x10d6f0
movsd 0xa32a9(%rip), %xmm7    # 0x10d6f8
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, (%r9,%rdx,8)
movsd (%rsi,%rdx,8), %xmm0
ucomisd %xmm1, %xmm0
jae 0x6a4b5
ucomisd %xmm0, %xmm2
jbe 0x6a481
ucomisd %xmm3, %xmm0
jbe 0x6a481
movsd (%rbx), %xmm0
movapd %xmm4, %xmm8
subsd %xmm0, %xmm8
jmp 0x6a4a7
ucomisd %xmm0, %xmm6
jbe 0x6a6fe
ucomisd %xmm7, %xmm0
jbe 0x6a6fe
movsd (%rbx), %xmm0
movapd %xmm4, %xmm8
subsd %xmm0, %xmm8
addsd %xmm0, %xmm0
mulsd %xmm5, %xmm8
divsd %xmm8, %xmm0
addsd %xmm4, %xmm0
movslq 0x28(%r15), %r10
leaq (%rax,%r10,8), %r10
movsd %xmm0, (%r10,%rdx,8)
incq %rdx
cmpq %rdx, %rdi
jne 0x6a44f
addl %edi, %r8d
movslq %r8d, %rcx
movsd -0x8(%rax,%rcx,8), %xmm0
movslq 0x30(%r15), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x3e8(%r12), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x6a33f
leaq 0xa4791(%rip), %rsi     # 0x10ec8c
movq %rsp, %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x30af0
leaq 0x83b73(%rip), %rsi     # 0xee082
leaq 0xa45a5(%rip), %rdx     # 0x10eabb
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x83afb(%rip), %rsi     # 0xee034
leaq 0xa43d1(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x5de, %ecx            # imm = 0x5DE
jmp 0x69a46
leaq 0xa49d4(%rip), %rsi     # 0x10ef28
movq %rsp, %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x30af0
leaq 0x83b1a(%rip), %rsi     # 0xee082
leaq 0xa4a16(%rip), %rdx     # 0x10ef85
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x83aa2(%rip), %rsi     # 0xee034
leaq 0xa4378(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x5b0, %ecx            # imm = 0x5B0
jmp 0x69a46
leaq 0xa47f7(%rip), %rsi     # 0x10eda4
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x30af0
leaq 0x83fc4(%rip), %rsi     # 0xee585
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x83a50(%rip), %rsi     # 0xee034
leaq 0xa4326(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x569, %ecx            # imm = 0x569
jmp 0x69a46
movsd 0x3e8(%r12), %xmm0
mulsd 0x400(%r12), %xmm1
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm1
jbe 0x6a6f1
leaq 0xa44ed(%rip), %rsi     # 0x10eb16
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x83a45(%rip), %rsi     # 0xee082
leaq 0xa4556(%rip), %rdx     # 0x10eb9a
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x839cd(%rip), %rsi     # 0xee034
leaq 0xa42a3(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x4f5, %ecx            # imm = 0x4F5
jmp 0x69a46
movslq 0x30(%r15), %rcx
movsd %xmm3, (%rax,%rcx,8)
movsd 0x3e8(%r12), %xmm0
ucomisd %xmm0, %xmm3
jbe 0x6a33f
leaq 0xa43d8(%rip), %rsi     # 0x10ea77
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x30af0
leaq 0x839cf(%rip), %rsi     # 0xee082
leaq 0xa4401(%rip), %rdx     # 0x10eabb
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x83957(%rip), %rsi     # 0xee034
leaq 0xa422d(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x4ec, %ecx            # imm = 0x4EC
jmp 0x69a46
movslq (%r15), %rdx
movsd %xmm2, (%rax,%rdx,8)
jmp 0x6a336
leaq 0xa4947(%rip), %rsi     # 0x10f04c
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x30af0
leaq 0x83e6c(%rip), %rsi     # 0xee585
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x838f8(%rip), %rsi     # 0xee034
leaq 0xa41ce(%rip), %rdx     # 0x10e911
movq %rbx, %rdi
movl $0x5d0, %ecx            # imm = 0x5D0
jmp 0x69a46