// File: /workspace/github_c_makefile_star2_O1/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 0x6c3fc
xorpd %xmm0, %xmm0
ucomisd 0x3f0(%r12), %xmm0
jae 0x6c440
movl 0x18(%rbx), %edx
cmpq $0x5, %rdx
ja 0x6c5a1
leaq 0xa44fd(%rip), %rcx     # 0x1107d8
movslq (%rcx,%rdx,4), %rsi
addq %rcx, %rsi
jmpq *%rsi
cmpl $0x1, %edx
jne 0x6c316
movsd (%rbx), %xmm0
movsd 0x84f6b(%rip), %xmm1    # 0xf1260
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
mulsd 0xa436b(%rip), %xmm2    # 0x110670
divsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movslq 0x10(%r15), %rcx
movsd %xmm0, (%rax,%rcx,8)
cmpl $0x3, %edx
jne 0x6c32d
movslq 0x10(%r15), %rcx
movabsq $0x3ff0000000000000, %rsi # imm = 0x3FF0000000000000
movq %rsi, (%rax,%rcx,8)
movsd 0x48(%rbx), %xmm0
movslq 0x4(%r15), %rsi
movsd %xmm0, (%rax,%rsi,8)
movsd 0x40(%rbx), %xmm1
movslq 0x8(%r15), %rcx
movsd %xmm1, (%rax,%rcx,8)
movsd (%rbx), %xmm0
movsd 0x84f0b(%rip), %xmm2    # 0xf1260
subsd %xmm0, %xmm2
mulsd 0xa430f(%rip), %xmm2    # 0x110670
divsd %xmm2, %xmm0
movslq 0x14(%r15), %rdi
movsd %xmm0, (%rax,%rdi,8)
movsd 0x50(%rbx), %xmm2
movslq 0x18(%r15), %rdi
movsd %xmm2, (%rax,%rdi,8)
movsd 0x58(%rbx), %xmm0
movslq 0x1c(%r15), %rdi
movsd %xmm0, (%rax,%rdi,8)
movsd (%rax,%rsi,8), %xmm4
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm4
jne 0x6c7ba
jp 0x6c7ba
leaq 0x86983(%rip), %rsi     # 0xf2d2d
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x84cc4(%rip), %rsi     # 0xf1082
leaq 0xa559a(%rip), %rdx     # 0x11195f
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84c4c(%rip), %rsi     # 0xf1034
leaq 0xa54d2(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x4c5, %ecx            # imm = 0x4C5
jmp 0x6c494
shll $0x3, %r13d
leaq 0x84bfd(%rip), %rsi     # 0xf1004
leaq 0xa5494(%rip), %rdx     # 0x1118a2
movq %rsp, %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84c08(%rip), %rsi     # 0xf1034
leaq 0xa548e(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x4a0, %ecx            # imm = 0x4A0
movq %r14, %r8
jmp 0x6c497
leaq 0xa54a5(%rip), %rsi     # 0x1118ec
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x84c27(%rip), %rsi     # 0xf1082
leaq 0xa54db(%rip), %rdx     # 0x11193d
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84baf(%rip), %rsi     # 0xf1034
leaq 0xa5435(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x4a4, %ecx            # imm = 0x4A4
movq %r15, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movslq 0x60(%rbx), %rcx
cmpq $0x2, %rcx
jge 0x6c828
leaq 0xa568c(%rip), %rsi     # 0x111b55
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x84ba5(%rip), %rsi     # 0xf1082
leaq 0xa56b9(%rip), %rdx     # 0x111b9d
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84b2d(%rip), %rsi     # 0xf1034
leaq 0xa53b3(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x504, %ecx            # imm = 0x504
jmp 0x6c494
movl 0xa0(%rbx), %edx
testl %edx, %edx
jle 0x6c938
movq 0xa8(%rbx), %rcx
movsd (%rcx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x6c544
jnp 0x6cab7
movsd (%rcx), %xmm0
leaq 0xa590c(%rip), %rsi     # 0x111e5b
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x30c2c
leaq 0x84b1f(%rip), %rsi     # 0xf1082
leaq 0xa5953(%rip), %rdx     # 0x111ebd
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84aa7(%rip), %rsi     # 0xf1034
leaq 0xa532d(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x5a8, %ecx            # imm = 0x5A8
jmp 0x6c494
leaq 0xa5203(%rip), %rsi     # 0x1117ab
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x84fc9(%rip), %rsi     # 0xf1585
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84a55(%rip), %rsi     # 0xf1034
leaq 0xa52db(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x5e3, %ecx            # imm = 0x5E3
jmp 0x6c494
movl 0x80(%rbx), %ecx
testl %ecx, %ecx
jle 0x6c991
cmpl $0x1, %ecx
je 0x6c62b
movq 0x88(%rbx), %rdx
movl $0x1, %esi
movsd -0x8(%rdx,%rsi,8), %xmm0
ucomisd (%rdx,%rsi,8), %xmm0
jae 0x6cbdf
incq %rsi
cmpq %rsi, %rcx
jne 0x6c612
movslq 0x20(%r15), %rcx
cmpq $0x3, %rcx
jl 0x6c713
leal -0x1(%rcx), %esi
movq 0x88(%rbx), %r8
movq 0x90(%rbx), %rdi
movslq 0x24(%r15), %rdx
leaq (%rax,%rdx,8), %r9
addq $0x8, %r9
movq %rax, %r10
addq $0x8, %r10
decq %rsi
xorl %edx, %edx
xorpd %xmm0, %xmm0
movsd 0x84c4a(%rip), %xmm1    # 0xf12b8
movsd 0xa4052(%rip), %xmm2    # 0x1106c8
movsd 0x84be2(%rip), %xmm3    # 0xf1260
movsd 0xa3fea(%rip), %xmm4    # 0x110670
movsd 0xa4042(%rip), %xmm5    # 0x1106d0
movsd 0xa4042(%rip), %xmm6    # 0x1106d8
movsd (%r8,%rdx,8), %xmm7
movsd %xmm7, (%r9,%rdx,8)
movsd (%rdi,%rdx,8), %xmm7
ucomisd %xmm0, %xmm7
jae 0x6c6fd
ucomisd %xmm7, %xmm1
jbe 0x6c6c9
ucomisd %xmm2, %xmm7
jbe 0x6c6c9
movsd (%rbx), %xmm7
movapd %xmm3, %xmm8
subsd %xmm7, %xmm8
jmp 0x6c6ef
ucomisd %xmm7, %xmm5
jbe 0x6ceaa
ucomisd %xmm6, %xmm7
jbe 0x6ceaa
movsd (%rbx), %xmm7
movapd %xmm3, %xmm8
subsd %xmm7, %xmm8
addsd %xmm7, %xmm7
mulsd %xmm4, %xmm8
divsd %xmm8, %xmm7
addsd %xmm3, %xmm7
movslq 0x28(%r15), %r11
leaq (%r10,%r11,8), %r11
movsd %xmm7, (%r11,%rdx,8)
incq %rdx
cmpq %rdx, %rsi
jne 0x6c696
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 0x6cb56
leaq 0xa54d8(%rip), %rsi     # 0x111c3c
movq %rsp, %r14
movq %r14, %rdi
movapd %xmm2, %xmm0
movb $0x2, %al
callq 0x30c2c
leaq 0x84906(%rip), %rsi     # 0xf1082
leaq 0xa52e8(%rip), %rdx     # 0x111a6b
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x8488e(%rip), %rsi     # 0xf1034
leaq 0xa5114(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x57c, %ecx            # imm = 0x57C
jmp 0x6c494
movsd (%rax,%rcx,8), %xmm4
ucomisd %xmm3, %xmm4
jne 0x6c9ea
jp 0x6c9ea
leaq 0x86557(%rip), %rsi     # 0xf2d2d
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x84898(%rip), %rsi     # 0xf1082
leaq 0xa51af(%rip), %rdx     # 0x1119a0
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84820(%rip), %rsi     # 0xf1034
leaq 0xa50a6(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x4c9, %ecx            # imm = 0x4C9
jmp 0x6c494
movq 0x68(%rbx), %rdx
movl $0x1, %esi
movsd -0x8(%rdx,%rsi,8), %xmm0
ucomisd (%rdx,%rsi,8), %xmm0
jae 0x6ca53
incq %rsi
cmpq %rsi, %rcx
jne 0x6c831
movslq 0x20(%r15), %rcx
cmpq $0x3, %rcx
jl 0x6c89d
leal -0x1(%rcx), %edx
movq 0x68(%rbx), %rsi
movq 0x70(%rbx), %rdi
movslq 0x24(%r15), %r9
movslq 0x28(%r15), %r8
leaq (%rax,%r8,8), %r8
addq $0x8, %r8
leaq (%rax,%r9,8), %r9
addq $0x8, %r9
decq %rdx
xorl %r10d, %r10d
movsd (%rsi,%r10,8), %xmm0
movsd %xmm0, (%r9,%r10,8)
movsd (%rdi,%r10,8), %xmm0
movsd %xmm0, (%r8,%r10,8)
incq %r10
cmpq %r10, %rdx
jne 0x6c87d
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 0x6cc43
leaq 0xa5356(%rip), %rsi     # 0x111c3c
movq %rsp, %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x30c2c
leaq 0x84788(%rip), %rsi     # 0xf1082
leaq 0xa516a(%rip), %rdx     # 0x111a6b
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84710(%rip), %rsi     # 0xf1034
leaq 0xa4f96(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x525, %ecx            # imm = 0x525
jmp 0x6c494
leaq 0xa54be(%rip), %rsi     # 0x111dfd
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x8472f(%rip), %rsi     # 0xf1082
leaq 0xa54eb(%rip), %rdx     # 0x111e45
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x846b7(%rip), %rsi     # 0xf1034
leaq 0xa4f3d(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x5a2, %ecx            # imm = 0x5A2
jmp 0x6c494
leaq 0xa532d(%rip), %rsi     # 0x111cc5
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x846d6(%rip), %rsi     # 0xf1082
leaq 0xa535d(%rip), %rdx     # 0x111d10
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x8465e(%rip), %rsi     # 0xf1034
leaq 0xa4ee4(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x546, %ecx            # imm = 0x546
jmp 0x6c494
ucomisd %xmm3, %xmm0
jne 0x6cc9b
jp 0x6cc9b
leaq 0x8632c(%rip), %rsi     # 0xf2d2d
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x8466d(%rip), %rsi     # 0xf1082
leaq 0xa4fc2(%rip), %rdx     # 0x1119de
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x845f5(%rip), %rsi     # 0xf1034
leaq 0xa4e7b(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x4cd, %ecx            # imm = 0x4CD
jmp 0x6c494
movsd -0x8(%rdx,%rsi,8), %xmm0
movsd (%rdx,%rsi,8), %xmm1
leaq 0xa514f(%rip), %rsi     # 0x111bb4
movq %rsp, %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x30c2c
leaq 0x84609(%rip), %rsi     # 0xf1082
leaq 0xa5189(%rip), %rdx     # 0x111c09
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84591(%rip), %rsi     # 0xf1034
leaq 0xa4e17(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x50c, %ecx            # imm = 0x50C
jmp 0x6c494
cmpl $0x1, %edx
je 0x6cada
movl $0x1, %esi
movsd -0x8(%rcx,%rsi,8), %xmm0
ucomisd (%rcx,%rsi,8), %xmm0
jae 0x6ce46
incq %rsi
cmpq %rsi, %rdx
jne 0x6cac1
movq 0xb0(%rbx), %rsi
movsd -0x8(%rsi,%rdx,8), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x6caf7
jnp 0x6ccfc
movsd -0x8(%rsi,%rdx,8), %xmm0
leaq 0xa5466(%rip), %rsi     # 0x111f6a
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x30c2c
leaq 0x8456a(%rip), %rsi     # 0xf1082
leaq 0xa54ad(%rip), %rdx     # 0x111fcc
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x844f2(%rip), %rsi     # 0xf1034
leaq 0xa4d78(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x5b8, %ecx            # imm = 0x5B8
jmp 0x6c494
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 0x6cc92
leaq 0xa521f(%rip), %rsi     # 0x111dac
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x30c2c
leaq 0x844e1(%rip), %rsi     # 0xf1082
leaq 0xa523d(%rip), %rdx     # 0x111de5
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84469(%rip), %rsi     # 0xf1034
leaq 0xa4cef(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x597, %ecx            # imm = 0x597
jmp 0x6c494
movsd -0x8(%rdx,%rsi,8), %xmm0
movsd (%rdx,%rsi,8), %xmm1
leaq 0xa4fc3(%rip), %rsi     # 0x111bb4
movq %rsp, %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x30c2c
leaq 0x8447d(%rip), %rsi     # 0xf1082
leaq 0xa5119(%rip), %rdx     # 0x111d25
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84405(%rip), %rsi     # 0xf1034
leaq 0xa4c8b(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x54e, %ecx            # imm = 0x54E
jmp 0x6c494
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 0x845f4(%rip), %xmm1    # 0xf1260
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
mulsd 0xa39f4(%rip), %xmm2    # 0x110670
divsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movslq 0x28(%r15), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x78(%rbx), %xmm0
addq $0x2c, %r15
jmp 0x6d010
movl 0x1c(%rbx), %ecx
cmpl $0x1, %ecx
je 0x6cf85
testl %ecx, %ecx
jne 0x6d018
movsd 0x28(%rbx), %xmm3
movslq (%r15), %rsi
movsd %xmm3, (%rax,%rsi,8)
cmpl $0x1, %edx
jne 0x6cf01
movsd 0x400(%r12), %xmm4
mulsd %xmm4, %xmm0
mulsd %xmm1, %xmm4
addsd %xmm3, %xmm4
movslq 0x30(%r15), %rdx
movsd %xmm4, (%rax,%rdx,8)
addsd %xmm2, %xmm0
ucomisd %xmm4, %xmm0
jbe 0x6cf0a
movsd %xmm0, (%rax,%rdx,8)
jmp 0x6cf0a
movslq 0x20(%r15), %rdi
testq %rdi, %rdi
jle 0x6cdc3
movslq 0x24(%r15), %rdx
leaq (%rax,%rdx,8), %r8
xorl %edx, %edx
xorpd %xmm0, %xmm0
movsd 0x84599(%rip), %xmm1    # 0xf12b8
movsd 0xa39a1(%rip), %xmm2    # 0x1106c8
movsd 0x84531(%rip), %xmm3    # 0xf1260
movsd 0xa3939(%rip), %xmm4    # 0x110670
movsd 0xa3991(%rip), %xmm5    # 0x1106d0
movsd 0xa3991(%rip), %xmm6    # 0x1106d8
movsd (%rcx,%rdx,8), %xmm7
movsd %xmm7, (%r8,%rdx,8)
movsd (%rsi,%rdx,8), %xmm7
ucomisd %xmm0, %xmm7
jae 0x6cdad
ucomisd %xmm7, %xmm1
jbe 0x6cd79
ucomisd %xmm2, %xmm7
jbe 0x6cd79
movsd (%rbx), %xmm7
movapd %xmm3, %xmm8
subsd %xmm7, %xmm8
jmp 0x6cd9f
ucomisd %xmm7, %xmm5
jbe 0x6d080
ucomisd %xmm6, %xmm7
jbe 0x6d080
movsd (%rbx), %xmm7
movapd %xmm3, %xmm8
subsd %xmm7, %xmm8
addsd %xmm7, %xmm7
mulsd %xmm4, %xmm8
divsd %xmm8, %xmm7
addsd %xmm3, %xmm7
movslq 0x28(%r15), %r9
leaq (%rax,%r9,8), %r9
movsd %xmm7, (%r9,%rdx,8)
incq %rdx
cmpq %rdx, %rdi
jne 0x6cd47
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 0x6d018
leaq 0xa4e48(%rip), %rsi     # 0x111c3c
movq %rsp, %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x30c2c
leaq 0x8427a(%rip), %rsi     # 0xf1082
leaq 0xa4c5c(%rip), %rdx     # 0x111a6b
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84202(%rip), %rsi     # 0xf1034
leaq 0xa4a88(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x5de, %ecx            # imm = 0x5DE
jmp 0x6c494
movsd -0x8(%rcx,%rsi,8), %xmm0
movsd (%rcx,%rsi,8), %xmm1
leaq 0xa5080(%rip), %rsi     # 0x111ed8
movq %rsp, %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x30c2c
leaq 0x84216(%rip), %rsi     # 0xf1082
leaq 0xa50c2(%rip), %rdx     # 0x111f35
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x8419e(%rip), %rsi     # 0xf1034
leaq 0xa4a24(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x5b0, %ecx            # imm = 0x5B0
jmp 0x6c494
movsd (%rdi,%rdx,8), %xmm0
leaq 0xa4e9e(%rip), %rsi     # 0x111d54
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x30c2c
leaq 0x846bb(%rip), %rsi     # 0xf1585
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84147(%rip), %rsi     # 0xf1034
leaq 0xa49cd(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x569, %ecx            # imm = 0x569
jmp 0x6c494
movslq 0x30(%r15), %rdx
movsd %xmm3, (%rax,%rdx,8)
movslq 0x30(%r15), %rdx
movsd (%rax,%rdx,8), %xmm2
movsd 0x3e8(%r12), %xmm0
ucomisd %xmm0, %xmm2
jbe 0x6cf7c
leaq 0xa4afd(%rip), %rsi     # 0x111a27
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x30c2c
leaq 0x84144(%rip), %rsi     # 0xf1082
leaq 0xa4b26(%rip), %rdx     # 0x111a6b
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x840cc(%rip), %rsi     # 0xf1034
leaq 0xa4952(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x4ec, %ecx            # imm = 0x4EC
jmp 0x6c494
cmpl $0x1, %ecx
jne 0x6d018
movsd 0x3e8(%r12), %xmm0
mulsd 0x400(%r12), %xmm1
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm1
jbe 0x6d004
leaq 0xa4b14(%rip), %rsi     # 0x111ac6
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x840bc(%rip), %rsi     # 0xf1082
leaq 0xa4b7d(%rip), %rdx     # 0x111b4a
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84044(%rip), %rsi     # 0xf1034
leaq 0xa48ca(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x4f5, %ecx            # imm = 0x4F5
jmp 0x6c494
movslq (%r15), %rcx
movsd %xmm2, (%rax,%rcx,8)
addq $0x30, %r15
movslq (%r15), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x28(%rbx), %xmm0
leaq 0xfc0(%rbx), %rsi
movq %r14, %rdi
callq 0x5efb7
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x1, %ecx
jne 0x6c4a3
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x843a9(%rip), %rsi     # 0xf13f0
leaq 0xa5007(%rip), %rdx     # 0x112055
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x83fc8(%rip), %rsi     # 0xf1034
leaq 0xa484e(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x5ea, %ecx            # imm = 0x5EA
jmp 0x6c494
movsd (%rsi,%rdx,8), %xmm0
leaq 0xa4f70(%rip), %rsi     # 0x111ffc
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x30c2c
leaq 0x844e5(%rip), %rsi     # 0xf1585
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x83f71(%rip), %rsi     # 0xf1034
leaq 0xa47f7(%rip), %rdx     # 0x1118c1
movq %rbx, %rdi
movl $0x5d0, %ecx            # imm = 0x5D0
jmp 0x6c494