// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../source/thermodynamics.c
// Function: thermodynamics_reionization_evolve_with_tau
int thermodynamics_reionization_evolve_with_tau(
                                                struct thermodynamics_parameters_and_workspace * ptpaw,
                                                double mz_ini,
                                                double mz_end,
                                                double * mz_output,
                                                int mz_size
                                                ) {

  /** Summary: */

  /** Define local variables */
  int counter;
  double z_sup,z_mid,z_inf;
  double tau_sup,tau_mid,tau_inf;

  int index_ti;
  int last_index_back_mz_ini;

  struct precision * ppr;
  struct background * pba;
  struct thermodynamics * pth;
  struct thermo_workspace * ptw;

  /* function pointer to ODE evolver and names of possible evolvers */
  extern int evolver_rk(EVOLVER_PROTOTYPE);
  extern int evolver_ndf15(EVOLVER_PROTOTYPE);
  int (*generic_evolver)(EVOLVER_PROTOTYPE) = evolver_ndf15;

  /* pointers towards two thermo vector stuctures (see below) */

  struct thermo_vector * ptvs; // Vector for storing the initial conditions
  struct thermo_vector * ptv; // Temporary vector as workspace

  /** - Remame fields to avoid heavy notations */

  ppr = ptpaw->ppr;
  pba = ptpaw->pba;
  pth = ptpaw->pth;
  ptw = ptpaw->ptw;

  /** - Choose evolver */

  switch (ppr->thermo_evolver) {
  case rk:
    generic_evolver = evolver_rk;
    break;
  case ndf15:
    generic_evolver = evolver_ndf15;
    break;
  }

  /** - ptvs will be a pointer towards the same thermo vector that was
      used in the previous approximation schemes; it contains values
      that will serve here to set initial conditions. */

  ptvs = ptw->ptdw->ptv;

  /** - ptv is a pointer towards a whole new thermo vector used for
      the calculations in the bisection, that we must allocate and
      initialize */

  class_alloc(ptv,sizeof(struct thermo_vector),pth->error_message);

  /* allocate vector indices dynamically */
  index_ti = 0;
  class_define_index(ptv->index_ti_D_Tmat,_TRUE_,index_ti,1);
  class_define_index(ptv->index_ti_x_He,_TRUE_,index_ti,1);
  class_define_index(ptv->index_ti_x_H,_TRUE_,index_ti,1);
  class_define_index(ptv->index_ti_T_idm,pba->has_idm,index_ti,1);
  ptv->ti_size = index_ti;

  /* Allocate all arrays used during the evolution */
  class_calloc(ptv->y,ptv->ti_size,sizeof(double),pth->error_message);
  class_alloc(ptv->dy,ptv->ti_size*sizeof(double),pth->error_message);
  class_alloc(ptv->used_in_output,ptv->ti_size*sizeof(int),pth->error_message);

  for (index_ti=0; index_ti<ptv->ti_size; index_ti++) {
    ptv->used_in_output[index_ti] = _TRUE_;
  }

  /** - Initialize the values of the temporary vector */
  ptv->y[ptv->index_ti_D_Tmat] = ptvs->y[ptvs->index_ti_D_Tmat];
  ptv->y[ptv->index_ti_x_H] = ptvs->y[ptvs->index_ti_x_H];
  ptv->y[ptv->index_ti_x_He] = ptvs->y[ptvs->index_ti_x_He];
  if (pba->has_idm == _TRUE_)
    ptv->y[ptv->index_ti_T_idm] = ptvs->y[ptvs->index_ti_T_idm];

  ptw->ptdw->ptv = ptv;

  /** - Evolve quantities through reionization assuming upper value of z_reio */

  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 */
  ptw->ptrp->reionization_parameters[ptw->ptrp->index_re_reio_redshift] = z_sup;
  /* maximum possible starting redshift */
  switch (pth->reio_parametrization) {
  case reio_camb:
    ptw->ptrp->reionization_parameters[ptw->ptrp->index_re_reio_start] = ppr->reionization_z_start_max;
    break;
  case reio_half_tanh:
    ptw->ptrp->reionization_parameters[ptw->ptrp->index_re_reio_start] = z_sup;
    break;
  default:
    class_stop(pth->error_message,"Should not be there: tau_reio acan be an input only for reio_camb and reio_half_tanh");
    break;
  }

  /* ptaw->ptw->last_index_back has been properly set according to the
     redshift z = -mz_inbi, we should keep memory of it */
  last_index_back_mz_ini = ptpaw->ptw->last_index_back;

  /* Calculate a first ionization history at upper limit */
  class_call(generic_evolver(thermodynamics_derivs,
                             mz_ini,
                             mz_end,
                             ptv->y,
                             ptv->used_in_output,
                             ptv->ti_size,
                             ptpaw,
                             ppr->tol_thermo_integration,
                             ppr->smallest_allowed_variation,
                             thermodynamics_timescale,  // timescale
                             ppr->thermo_integration_stepsize, // stepsize
                             mz_output, // values of z for output
                             mz_size, // size of previous array
                             thermodynamics_sources, // function for output
                             NULL, // print variables
                             pth->error_message),
             pth->error_message,
             pth->error_message);

  /* infer corresponding tau_reio */
  class_call(thermodynamics_reionization_get_tau(ppr,
                                                 pba,
                                                 pth,
                                                 ptw),
             pth->error_message,
             pth->error_message);

  tau_sup=ptw->reionization_optical_depth;

  class_test(tau_sup < pth->tau_reio,
             pth->error_message,
             "parameters are such that reionization cannot start after z_start_max");

  /** - Restore initial conditions */
  ptv->y[ptv->index_ti_D_Tmat] = ptvs->y[ptvs->index_ti_D_Tmat];
  ptv->y[ptv->index_ti_x_H] = ptvs->y[ptvs->index_ti_x_H];
  ptv->y[ptv->index_ti_x_He] = ptvs->y[ptvs->index_ti_x_He];
  if (pba->has_idm == _TRUE_)
    ptv->y[ptv->index_ti_T_idm] = ptvs->y[ptvs->index_ti_T_idm];

  /** - Evolve quantities through reionization assuming lower value of z_reio */

  z_inf = 0.;

  /* minimum possible reionization redshift */
  ptw->ptrp->reionization_parameters[ptw->ptrp->index_re_reio_redshift] = z_inf;
  /* minimum possible starting redshift */
  switch (pth->reio_parametrization) {
  case reio_camb:
    ptw->ptrp->reionization_parameters[ptw->ptrp->index_re_reio_start] = ppr->reionization_start_factor*pth->reionization_width;
    if (ptw->ptrp->reionization_parameters[ptw->ptrp->index_re_reio_start] < pth->helium_fullreio_redshift+ppr->reionization_start_factor*pth->helium_fullreio_width) {
      ptw->ptrp->reionization_parameters[ptw->ptrp->index_re_reio_start] = pth->helium_fullreio_redshift+ppr->reionization_start_factor*pth->helium_fullreio_width;
    }
  case reio_half_tanh:
    ptw->ptrp->reionization_parameters[ptw->ptrp->index_re_reio_start] = z_inf;
    break;
  default:
    class_stop(pth->error_message,"Should not be there: tau_reio acan be an input only for reio_camb and reio_half_tanh");
    break;
  }

  /* reset ptaw->ptw->last_index_back to match the redshift z = -mz_inbi */
  ptpaw->ptw->last_index_back = last_index_back_mz_ini;

  /* Calculate a second ionization history at lower limit */
  class_call(generic_evolver(thermodynamics_derivs,
                             mz_ini,
                             mz_end,
                             ptv->y,
                             ptv->used_in_output,
                             ptv->ti_size,
                             ptpaw,
                             ppr->tol_thermo_integration,
                             ppr->smallest_allowed_variation,
                             thermodynamics_timescale,  // timescale
                             ppr->thermo_integration_stepsize, // stepsize
                             mz_output, // values of z for output
                             mz_size, // size of previous array
                             thermodynamics_sources, // function for output
                             NULL, // print variables
                             pth->error_message),
             pth->error_message,
             pth->error_message);

  /* infer corresponding tau_reio */
  class_call(thermodynamics_reionization_get_tau(ppr,
                                                 pba,
                                                 pth,
                                                 ptw),
             pth->error_message,
             pth->error_message);

  tau_inf=ptw->reionization_optical_depth;

  class_test(tau_inf > pth->tau_reio,
             pth->error_message,
             "CLASS cannot reach the low value of tau_reio that was selected, even when setting z_reio as low as 0.\nThis means that some additional physical component is requiring some minimal tau_reio_min = %.10e.\nThis is usually caused by strong energy injections or other modifications of the x_e(z) behaviour.",tau_inf);

  /** - Restore initial conditions */
  ptv->y[ptv->index_ti_D_Tmat] = ptvs->y[ptvs->index_ti_D_Tmat];
  ptv->y[ptv->index_ti_x_H] = ptvs->y[ptvs->index_ti_x_H];
  ptv->y[ptv->index_ti_x_He] = ptvs->y[ptvs->index_ti_x_He];
  if (pba->has_idm == _TRUE_)
    ptv->y[ptv->index_ti_T_idm] = ptvs->y[ptvs->index_ti_T_idm];

  /** - Evolve quantities through reionization, trying intermediate values of z_reio by bisection */
  counter=0;
  while ((tau_sup-tau_inf) > pth->tau_reio * ppr->reionization_optical_depth_tol) {
    z_mid=0.5*(z_sup+z_inf);

    /* reionization redshift */
    ptw->ptrp->reionization_parameters[ptw->ptrp->index_re_reio_redshift] = z_mid;

    /* infer starting redshift for hydrogen (Note, that this is only the start of the ADDITIONAL tanh re-ionization function)*/
    switch (pth->reio_parametrization) {
    case reio_camb:
      ptw->ptrp->reionization_parameters[ptw->ptrp->index_re_reio_start] = ptw->ptrp->reionization_parameters[ptw->ptrp->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 (ptw->ptrp->reionization_parameters[ptw->ptrp->index_re_reio_start] < pth->helium_fullreio_redshift+ppr->reionization_start_factor*pth->helium_fullreio_width) {
        ptw->ptrp->reionization_parameters[ptw->ptrp->index_re_reio_start] = pth->helium_fullreio_redshift+ppr->reionization_start_factor*pth->helium_fullreio_width;
      }
      break;
    case reio_half_tanh:
      ptw->ptrp->reionization_parameters[ptw->ptrp->index_re_reio_start] = z_mid;
      break;
    default:
      class_stop(pth->error_message,"Should not be there: tau_reio acan be an input only for reio_camb and reio_half_tanh");
      break;
    }

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

    /* reset ptaw->ptw->last_index_back to match the redshift z = -mz_inbi */
    ptpaw->ptw->last_index_back = last_index_back_mz_ini;

    /* Compute a new ionization history */
    class_call(generic_evolver(thermodynamics_derivs,
                               mz_ini,
                               mz_end,
                               ptv->y,
                               ptv->used_in_output,
                               ptv->ti_size,
                               ptpaw,
                               ppr->tol_thermo_integration,
                               ppr->smallest_allowed_variation,
                               thermodynamics_timescale,  // timescale
                               ppr->thermo_integration_stepsize, // stepsize
                               mz_output, // values of z for output
                               mz_size, // size of previous array
                               thermodynamics_sources, // function for output
                               NULL, // print variables
                               pth->error_message),
               pth->error_message,
               pth->error_message);

    /* infer corresponding tau_reio */
    class_call(thermodynamics_reionization_get_tau(ppr,
                                                   pba,
                                                   pth,
                                                   ptw),
               pth->error_message,
               pth->error_message);

    tau_mid=ptw->reionization_optical_depth;

    /* trial */
    if (tau_mid > pth->tau_reio) {
      z_sup=z_mid;
      tau_sup=tau_mid;
    }
    else {
      z_inf=z_mid;
      tau_inf=tau_mid;
    }

    /* Restore initial conditions */
    ptv->y[ptv->index_ti_D_Tmat] = ptvs->y[ptvs->index_ti_D_Tmat];
    ptv->y[ptv->index_ti_x_H] = ptvs->y[ptvs->index_ti_x_H];
    ptv->y[ptv->index_ti_x_He] = ptvs->y[ptvs->index_ti_x_He];
    if (pba->has_idm == _TRUE_)
      ptv->y[ptv->index_ti_T_idm] = ptvs->y[ptvs->index_ti_T_idm];

    /* counter to avoid infinite loop */
    counter++;
    class_test(counter > _MAX_IT_,
               pth->error_message,
               "while searching for reionization_optical_depth, maximum number of iterations exceeded");
  }

  /** - Store the ionization redshift in the thermodynamics structure */
  pth->z_reio = ptw->ptrp->reionization_parameters[ptw->ptrp->index_re_reio_redshift];

  /** - Free tempeoraty thermo vector */
  class_call(thermodynamics_vector_free(ptv),
             pth->error_message,
             pth->error_message);

  /* point ptw->ptdw->ptv to same location as when entering the function */
  ptw->ptdw->ptv = ptvs;

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1098, %rsp           # imm = 0x1098
movl %edx, %r13d
movq %rsi, 0x68(%rsp)
movsd %xmm1, 0x60(%rsp)
movsd %xmm0, 0x58(%rsp)
movq 0x8(%rdi), %rax
movq %rax, 0x28(%rsp)
movq 0x18(%rdi), %r12
cmpl $0x0, 0x1b0(%rax)
jne 0x6bba3
leaq -0x5eb71(%rip), %rax    # 0xd030
jmp 0x6bbaa
leaq -0x5e4f2(%rip), %rax    # 0xd6b8
movq %rax, 0x18(%rsp)
movq (%rdi), %rbp
movq %rdi, 0x50(%rsp)
movq 0x10(%rdi), %rbx
movq 0x80(%r12), %r15
movq 0xb8(%r15), %rax
movq %rax, 0x20(%rsp)
movl $0x30, %edi
callq 0x8460
testq %rax, %rax
je 0x6bc25
movq %rax, %r14
movq %rbx, 0x30(%rsp)
movl $0x0, 0xc(%rax)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x4(%r14)
movq %rbp, 0x40(%rsp)
movzwl 0x4b6(%rbp), %ebx
testw %bx, %bx
movq %r12, 0x8(%rsp)
movq %r13, 0x48(%rsp)
je 0x6bc6c
movl $0x3, 0x10(%r14)
movl $0x4, %eax
jmp 0x6bc71
leaq 0x823d8(%rip), %rsi     # 0xee004
leaq 0xa3dfd(%rip), %rdx     # 0x10fa30
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movl $0x30, %ecx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x823dc(%rip), %rsi     # 0xee034
leaq 0xa3ea0(%rip), %rdx     # 0x10faff
movq %rbx, %rdi
movl $0x8bc, %ecx            # imm = 0x8BC
jmp 0x6bf21
movl $0x3, %eax
movl %eax, (%r14)
movl %eax, %r12d
movl $0x8, %esi
movq %r12, %rdi
callq 0x8250
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x6be4a
movq %rax, %r13
leal (,%r12,8), %edi
callq 0x8460
movq %rax, 0x20(%r14)
testq %rax, %rax
je 0x6be93
leal (,%r12,4), %edi
callq 0x8460
movq %rax, 0x28(%r14)
testq %rax, %rax
je 0x6bedb
leaq -0x1(%r12), %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
xorl %ecx, %ecx
testb %cl, %cl
jne 0x6bce3
movl $0x1, (%rax)
pxor 0x82fa5(%rip), %xmm0    # 0xeec90
movdqa 0xa1abd(%rip), %xmm2    # 0x10d7b0
pshufd $0xf5, %xmm2, %xmm4     # xmm4 = xmm2[1,1,3,3]
pcmpgtd %xmm0, %xmm2
pshufd $0xf5, %xmm0, %xmm1     # xmm1 = xmm0[1,1,3,3]
pcmpeqd %xmm1, %xmm4
pand %xmm2, %xmm4
pcmpeqd %xmm3, %xmm3
pxor %xmm3, %xmm4
pextrw $0x4, %xmm4, %ecx
testb $0x1, %cl
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
je 0x6bd2c
movl $0x1, 0x4(%rax)
movdqa 0xa1a8c(%rip), %xmm4    # 0x10d7c0
pshufd $0xf5, %xmm4, %xmm2     # xmm2 = xmm4[1,1,3,3]
pcmpgtd %xmm0, %xmm4
pcmpeqd %xmm1, %xmm2
pand %xmm4, %xmm2
pxor %xmm2, %xmm3
pextrw $0x0, %xmm3, %ecx
testb $0x1, %cl
je 0x6bd5a
movl $0x1, 0x8(%rax)
pcmpeqd %xmm0, %xmm0
pxor %xmm0, %xmm2
pextrw $0x4, %xmm2, %ecx
testb $0x1, %cl
je 0x6bd73
movl $0x1, 0xc(%rax)
movq 0x18(%rsi), %rcx
movslq 0xc(%rsi), %rdx
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, (%r13)
movslq 0x4(%rsi), %rdx
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, 0x10(%r13)
movslq 0x8(%rsi), %rdx
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, 0x8(%r13)
cmpw $0x1, %bx
jne 0x6bdb9
movslq 0x10(%rsi), %rdx
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, 0x18(%r13)
movq %r14, 0xb8(%r15)
movsd 0x3e8(%rdi), %xmm1
movsd 0x400(%rdi), %xmm0
movq 0x30(%rsp), %rbx
mulsd 0x40(%rbx), %xmm0
subsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x6bf42
leaq 0xa2d23(%rip), %rsi     # 0x10eb16
leaq 0x90(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x82276(%rip), %rsi     # 0xee082
leaq 0xa2d87(%rip), %rdx     # 0x10eb9a
leaq 0x890(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x821fe(%rip), %rsi     # 0xee034
leaq 0xa3cc2(%rip), %rdx     # 0x10faff
movq %rbx, %rdi
movl $0x8dd, %ecx            # imm = 0x8DD
jmp 0x6c0e0
leaq 0x821b3(%rip), %rsi     # 0xee004
leaq 0xa3bf7(%rip), %rdx     # 0x10fa4f
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movl $0x8, %ecx
xorl %eax, %eax
callq 0x30af0
movq 0x30(%rsp), %rdi
addq $0x1064, %rdi           # imm = 0x1064
leaq 0x821b2(%rip), %rsi     # 0xee034
leaq 0xa3c76(%rip), %rdx     # 0x10faff
movl $0x8c7, %ecx            # imm = 0x8C7
jmp 0x6bf21
shll $0x3, %r12d
leaq 0x82166(%rip), %rsi     # 0xee004
leaq 0xa3bb1(%rip), %rdx     # 0x10fa56
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x30af0
movq 0x30(%rsp), %rdi
addq $0x1064, %rdi           # imm = 0x1064
leaq 0x82167(%rip), %rsi     # 0xee034
leaq 0xa3c2b(%rip), %rdx     # 0x10faff
movl $0x8c8, %ecx            # imm = 0x8C8
jmp 0x6bf21
shll $0x2, %r12d
leaq 0x8211e(%rip), %rsi     # 0xee004
leaq 0xa3b71(%rip), %rdx     # 0x10fa5e
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x30af0
movq 0x30(%rsp), %rdi
addq $0x1064, %rdi           # imm = 0x1064
leaq 0x8211f(%rip), %rsi     # 0xee034
leaq 0xa3be3(%rip), %rdx     # 0x10faff
movl $0x8c9, %ecx            # imm = 0x8C9
movq %r14, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x1098, %rsp           # imm = 0x1098
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rcx
movq 0x88(%rcx), %rcx
movq 0x38(%rcx), %rdx
movslq (%rcx), %rsi
movsd %xmm1, (%rdx,%rsi,8)
movl 0x18(%rbx), %esi
movapd %xmm1, %xmm0
cmpl $0x3, %esi
je 0x6bf77
cmpl $0x1, %esi
jne 0x6c08e
movsd 0x3e8(%rdi), %xmm0
movsd %xmm1, 0x38(%rsp)
movslq 0x30(%rcx), %rcx
movsd %xmm0, (%rdx,%rcx,8)
movq 0x8(%rsp), %r15
movl 0x78(%r15), %ebp
movsd 0xa28(%rdi), %xmm3
movsd 0x1b8(%rdi), %xmm2
movsd 0x1c0(%rdi), %xmm4
leaq 0x1064(%rbx), %rcx
subq $0x8, %rsp
leaq 0x871(%rip), %rdi       # 0x6c82a
leaq 0x130b(%rip), %r9       # 0x6d2cb
movsd 0x60(%rsp), %xmm0
movsd 0x68(%rsp), %xmm1
movq %r13, %rsi
movq %rcx, %r13
movq %rax, %rdx
movl %r12d, %ecx
movq 0x58(%rsp), %r8
pushq %r13
pushq $0x0
pushq 0xdcfb1(%rip)           # 0x148f98
pushq 0x68(%rsp)
pushq 0x90(%rsp)
callq *0x48(%rsp)
addq $0x30, %rsp
cmpl $0x1, %eax
jne 0x6c03a
leaq 0x823ea(%rip), %rsi     # 0xee3f0
leaq 0xa3b73(%rip), %rdx     # 0x10fb80
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x8200b(%rip), %rsi     # 0xee034
leaq 0xa3acf(%rip), %rdx     # 0x10faff
movq %r13, %rdi
movl $0x904, %ecx            # imm = 0x904
jmp 0x6c086
movq %rbx, %rdx
movq %r15, %rcx
callq 0x6d8dc
testl %eax, %eax
je 0x6c0e8
leaq 0x8239c(%rip), %rsi     # 0xee3f0
leaq 0xa338c(%rip), %rdx     # 0x10f3e7
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x81fbd(%rip), %rsi     # 0xee034
leaq 0xa3a81(%rip), %rdx     # 0x10faff
movq %r13, %rdi
movl $0x90c, %ecx            # imm = 0x90C
movq %rbx, %r8
jmp 0x6bf24
leaq 0xa3a96(%rip), %rsi     # 0x10fb2b
leaq 0x90(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x824d7(%rip), %rsi     # 0xee585
leaq 0x890(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x81f63(%rip), %rsi     # 0xee034
leaq 0xa3a27(%rip), %rdx     # 0x10faff
movq %rbx, %rdi
movl $0x8ea, %ecx            # imm = 0x8EA
movq %r15, %r8
jmp 0x6bf24
movq %r15, %r12
movsd 0x70(%r15), %xmm2
movsd 0x20(%rbx), %xmm0
ucomisd %xmm2, %xmm0
jbe 0x6c153
leaq 0xa3bac(%rip), %rsi     # 0x10fcaf
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x81f66(%rip), %rsi     # 0xee082
leaq 0xa3bd1(%rip), %rdx     # 0x10fcf4
leaq 0x890(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x81ef5(%rip), %rsi     # 0xee034
leaq 0xa39b9(%rip), %rdx     # 0x10faff
movq %r13, %rdi
movl $0x912, %ecx            # imm = 0x912
jmp 0x6bf21
movq 0x20(%rsp), %rdx
movq 0x18(%rdx), %rax
movslq 0xc(%rdx), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x18(%r14), %rsi
movslq 0xc(%r14), %rcx
movsd %xmm0, (%rsi,%rcx,8)
movslq 0x4(%rdx), %rcx
movsd (%rax,%rcx,8), %xmm0
movslq 0x4(%r14), %rcx
movsd %xmm0, (%rsi,%rcx,8)
movslq 0x8(%rdx), %rcx
movsd (%rax,%rcx,8), %xmm0
movslq 0x8(%r14), %rcx
movsd %xmm0, (%rsi,%rcx,8)
movq 0x40(%rsp), %r15
cmpw $0x1, 0x4b6(%r15)
jne 0x6c1b8
movslq 0x10(%rdx), %rcx
movsd (%rax,%rcx,8), %xmm0
movslq 0x10(%r14), %rax
movsd %xmm0, (%rsi,%rax,8)
movq 0x88(%r12), %rcx
movq 0x38(%rcx), %rax
movslq (%rcx), %rdx
movq $0x0, (%rax,%rdx,8)
movl 0x18(%rbx), %edx
cmpl $0x1, %edx
movq 0x28(%rsp), %rdi
je 0x6c1f1
cmpl $0x3, %edx
jne 0x6c32b
movsd %xmm2, 0x10(%rsp)
movslq 0x30(%rcx), %rcx
jmp 0x6c22a
movsd 0x400(%rdi), %xmm1
mulsd 0x40(%rbx), %xmm1
movslq 0x30(%rcx), %rcx
movsd %xmm1, (%rax,%rcx,8)
movsd 0x400(%rdi), %xmm0
mulsd 0x58(%rbx), %xmm0
addsd 0x50(%rbx), %xmm0
ucomisd %xmm1, %xmm0
movsd %xmm2, 0x10(%rsp)
jbe 0x6c22a
movsd %xmm0, (%rax,%rcx,8)
xorl %r10d, %r10d
movq %r10, (%rax,%rcx,8)
movq 0x50(%rsp), %r8
movq 0x18(%r8), %rax
movl %ebp, 0x78(%rax)
movq 0x28(%r14), %rdx
movl (%r14), %ecx
movsd 0xa28(%rdi), %xmm3
movsd 0x1b8(%rdi), %xmm2
movsd 0x1c0(%rdi), %xmm4
subq $0x8, %rsp
leaq 0x5c3(%rip), %rdi       # 0x6c82a
leaq 0x105d(%rip), %r9       # 0x6d2cb
movsd 0x60(%rsp), %xmm0
movsd 0x68(%rsp), %xmm1
pushq %r13
pushq %r10
pushq 0xdcd14(%rip)           # 0x148f98
pushq 0x68(%rsp)
pushq 0x90(%rsp)
callq *0x48(%rsp)
addq $0x30, %rsp
cmpl $0x1, %eax
jne 0x6c2da
leaq 0x8214d(%rip), %rsi     # 0xee3f0
leaq 0xa38d6(%rip), %rdx     # 0x10fb80
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x81d6e(%rip), %rsi     # 0xee034
leaq 0xa3832(%rip), %rdx     # 0x10faff
movq %r13, %rdi
movl $0x945, %ecx            # imm = 0x945
jmp 0x6c086
movq %rbx, %rdx
movq %r12, %rcx
callq 0x6d8dc
testl %eax, %eax
je 0x6c37b
leaq 0x820fc(%rip), %rsi     # 0xee3f0
leaq 0xa30ec(%rip), %rdx     # 0x10f3e7
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x81d1d(%rip), %rsi     # 0xee034
leaq 0xa37e1(%rip), %rdx     # 0x10faff
movq %r13, %rdi
movl $0x94d, %ecx            # imm = 0x94D
jmp 0x6c086
leaq 0xa37f9(%rip), %rsi     # 0x10fb2b
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x8223a(%rip), %rsi     # 0xee585
leaq 0x890(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x30af0
leaq 0x81ccd(%rip), %rsi     # 0xee034
leaq 0xa3791(%rip), %rdx     # 0x10faff
movq %r13, %rdi
movl $0x92c, %ecx            # imm = 0x92C
jmp 0x6bf21
movsd 0x70(%r12), %xmm0
ucomisd 0x20(%rbx), %xmm0
jbe 0x6c3e0
leaq 0xa397c(%rip), %rsi     # 0x10fd0c
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
movb $0x1, %al
callq 0x30af0
leaq 0x81cd9(%rip), %rsi     # 0xee082
leaq 0xa3a88(%rip), %rdx     # 0x10fe38
leaq 0x890(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x81c68(%rip), %rsi     # 0xee034
leaq 0xa372c(%rip), %rdx     # 0x10faff
movq %r13, %rdi
movl $0x953, %ecx            # imm = 0x953
jmp 0x6bf21
movq %r13, %r12
movq 0x20(%rsp), %rdx
movq 0x18(%rdx), %rax
movslq 0xc(%rdx), %rcx
movsd (%rax,%rcx,8), %xmm1
movq 0x18(%r14), %rsi
movslq 0xc(%r14), %rcx
movsd %xmm1, (%rsi,%rcx,8)
movslq 0x4(%rdx), %rcx
movsd (%rax,%rcx,8), %xmm1
movslq 0x4(%r14), %rcx
movsd %xmm1, (%rsi,%rcx,8)
movslq 0x8(%rdx), %rcx
movsd (%rax,%rcx,8), %xmm1
movslq 0x8(%r14), %rcx
movsd %xmm1, (%rsi,%rcx,8)
cmpw $0x1, 0x4b6(%r15)
jne 0x6c443
movslq 0x10(%rdx), %rcx
movsd (%rax,%rcx,8), %xmm1
movslq 0x10(%r14), %rax
movsd %xmm1, (%rsi,%rax,8)
xorpd %xmm1, %xmm1
movsd %xmm1, 0x70(%rsp)
movl $0x2711, %r13d          # imm = 0x2711
movq 0x28(%rsp), %rdi
movsd 0x38(%rsp), %xmm3
movsd 0x10(%rsp), %xmm4
movq 0x8(%rsp), %r15
movapd %xmm4, %xmm2
subsd %xmm0, %xmm2
movsd 0x20(%rbx), %xmm1
mulsd 0x3f8(%rdi), %xmm1
ucomisd %xmm1, %xmm2
jbe 0x6c6ca
movsd 0x70(%rsp), %xmm2
addsd %xmm3, %xmm2
mulsd 0x82836(%rip), %xmm2    # 0xeecd0
movq 0x8(%rsp), %rax
movq 0x88(%rax), %rcx
movq 0x38(%rcx), %rax
movslq (%rcx), %rdx
movsd %xmm2, (%rax,%rdx,8)
movl 0x18(%rbx), %edx
cmpl $0x3, %edx
movsd %xmm2, 0x78(%rsp)
je 0x6c4fd
cmpl $0x1, %edx
jne 0x6c7da
movsd 0x400(%rdi), %xmm1
mulsd 0x40(%rbx), %xmm1
addsd %xmm2, %xmm1
movslq 0x30(%rcx), %rcx
movsd %xmm1, (%rax,%rcx,8)
movsd 0x400(%rdi), %xmm2
mulsd 0x58(%rbx), %xmm2
addsd 0x50(%rbx), %xmm2
ucomisd %xmm1, %xmm2
ja 0x6c501
jmp 0x6c50a
movslq 0x30(%rcx), %rcx
movsd %xmm2, (%rax,%rcx,8)
movapd %xmm2, %xmm1
movapd %xmm0, 0x80(%rsp)
movsd %xmm4, 0x10(%rsp)
movsd %xmm3, 0x38(%rsp)
movsd 0x3e8(%rdi), %xmm0
ucomisd %xmm0, %xmm1
ja 0x6c707
movq 0x50(%rsp), %r8
movq 0x18(%r8), %rax
movl %ebp, 0x78(%rax)
movq 0x28(%r14), %rdx
movl (%r14), %ecx
movsd 0xa28(%rdi), %xmm3
movsd 0x1b8(%rdi), %xmm2
movsd 0x1c0(%rdi), %xmm4
subq $0x8, %rsp
leaq 0x2c3(%rip), %rdi       # 0x6c82a
movsd 0x60(%rsp), %xmm0
movsd 0x68(%rsp), %xmm1
leaq 0xd51(%rip), %r9        # 0x6d2cb
pushq %r12
pushq $0x0
pushq 0xdca14(%rip)           # 0x148f98
pushq 0x68(%rsp)
pushq 0x90(%rsp)
callq *0x48(%rsp)
addq $0x30, %rsp
cmpl $0x1, %eax
je 0x6c75e
movq %rbx, %rdx
movq %r15, %rcx
callq 0x6d8dc
testl %eax, %eax
jne 0x6c79c
movsd 0x70(%r15), %xmm1
movsd 0x20(%rbx), %xmm5
ucomisd %xmm5, %xmm1
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rdx
movsd 0x38(%rsp), %xmm3
movsd 0x10(%rsp), %xmm4
movsd 0x78(%rsp), %xmm0
ja 0x6c5e8
movsd %xmm0, 0x70(%rsp)
jmp 0x6c5f0
movapd %xmm1, %xmm4
movapd %xmm0, %xmm3
movq 0x40(%rsp), %r8
movq 0x18(%rdx), %rax
movslq 0xc(%rdx), %rcx
movsd (%rax,%rcx,8), %xmm2
movq 0x18(%r14), %rsi
movslq 0xc(%r14), %rcx
movsd %xmm2, (%rsi,%rcx,8)
movslq 0x4(%rdx), %rcx
movsd (%rax,%rcx,8), %xmm2
movslq 0x4(%r14), %rcx
movsd %xmm2, (%rsi,%rcx,8)
movslq 0x8(%rdx), %rcx
movsd (%rax,%rcx,8), %xmm2
movslq 0x8(%r14), %rcx
movsd %xmm2, (%rsi,%rcx,8)
cmpw $0x1, 0x4b6(%r8)
jne 0x6c650
movslq 0x10(%rdx), %rcx
movsd (%rax,%rcx,8), %xmm2
movslq 0x10(%r14), %rax
movsd %xmm2, (%rsi,%rax,8)
cmpltsd %xmm1, %xmm5
movapd 0x80(%rsp), %xmm0
andpd %xmm5, %xmm0
andnpd %xmm1, %xmm5
orpd %xmm5, %xmm0
decl %r13d
jne 0x6c469
leaq 0xa387c(%rip), %rsi     # 0x10fef6
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x819ef(%rip), %rsi     # 0xee082
leaq 0xa38b2(%rip), %rdx     # 0x10ff4c
leaq 0x890(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x8197e(%rip), %rsi     # 0xee034
leaq 0xa3442(%rip), %rdx     # 0x10faff
movq %r12, %rdi
movl $0x9b0, %ecx            # imm = 0x9B0
jmp 0x6bf21
movq 0x8(%rsp), %r15
movq 0x88(%r15), %rax
movq 0x38(%rax), %rcx
movslq (%rax), %rax
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, 0x28(%rbx)
movq %r14, %rdi
movq %rdx, %rbx
callq 0x6dafb
movq 0x80(%r15), %rax
movq %rbx, 0xb8(%rax)
xorl %eax, %eax
jmp 0x6bf30
leaq 0xa3742(%rip), %rsi     # 0x10fe50
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
movb $0x1, %al
callq 0x30af0
leaq 0x8195b(%rip), %rsi     # 0xee082
leaq 0xa3765(%rip), %rdx     # 0x10fe93
leaq 0x890(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x818ea(%rip), %rsi     # 0xee034
leaq 0xa33ae(%rip), %rdx     # 0x10faff
movq %r12, %rdi
movl $0x978, %ecx            # imm = 0x978
jmp 0x6bf21
leaq 0x81c8b(%rip), %rsi     # 0xee3f0
leaq 0xa3414(%rip), %rdx     # 0x10fb80
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x818ac(%rip), %rsi     # 0xee034
leaq 0xa3370(%rip), %rdx     # 0x10faff
movq %r12, %rdi
movl $0x98f, %ecx            # imm = 0x98F
jmp 0x6c086
leaq 0x81c4d(%rip), %rsi     # 0xee3f0
leaq 0xa2c3d(%rip), %rdx     # 0x10f3e7
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x8186e(%rip), %rsi     # 0xee034
leaq 0xa3332(%rip), %rdx     # 0x10faff
movq %r12, %rdi
movl $0x997, %ecx            # imm = 0x997
jmp 0x6c086
leaq 0xa334a(%rip), %rsi     # 0x10fb2b
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x81d8b(%rip), %rsi     # 0xee585
leaq 0x890(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x30af0
leaq 0x8181e(%rip), %rsi     # 0xee034
leaq 0xa32e2(%rip), %rdx     # 0x10faff
movq %r12, %rdi
movl $0x972, %ecx            # imm = 0x972
jmp 0x6bf21