// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../source/perturbations.c
// Function: perturbations_find_approximation_switches
int perturbations_find_approximation_switches(
                                              struct precision * ppr,
                                              struct background * pba,
                                              struct thermodynamics * pth,
                                              struct perturbations * ppt,
                                              int index_md,
                                              double k,
                                              struct perturbations_workspace * ppw,
                                              double tau_ini,
                                              double tau_end,
                                              double precision,
                                              int interval_number,
                                              int * interval_number_of,
                                              double * interval_limit, /* interval_limit[index_interval] (already allocated) */
                                              int ** interval_approx   /* interval_approx[index_interval][index_ap] (already allocated) */
                                              ){

  /** Summary: */

  int index_ap;
  int index_switch;
  int index_switch_tot;
  int num_switch;
  double tau_min,lower_bound,upper_bound;
  double mid=0;
  double * unsorted_tau_switch;
  double next_tau_switch;
  int flag_ini;
  int num_switching_at_given_time;

  /** - write in output arrays the initial time and approximation */

  interval_limit[0]=tau_ini;

  class_call(perturbations_approximations(ppr,
                                          pba,
                                          pth,
                                          ppt,
                                          index_md,
                                          k,
                                          tau_ini,
                                          ppw),
             ppt->error_message,
             ppt->error_message);

  for (index_ap=0; index_ap<ppw->ap_size; index_ap++)
    interval_approx[0][index_ap]=ppw->approx[index_ap];

  /** - if there are no approximation switches, just write final time and return */

  if (interval_number == 1) {

    interval_limit[1]=tau_end;

  }

  /** - if there are switches, consider approximations one after each
      other.  Find switching time by bisection. Store all switches in
      arbitrary order in array unsorted_tau_switch[ ] */

  else {

    class_alloc(unsorted_tau_switch,(interval_number-1)*sizeof(double),ppt->error_message);

    index_switch_tot=0;

    for (index_ap=0; index_ap<ppw->ap_size; index_ap++) {

      if (interval_number_of[index_ap] > 1) {

        num_switch = interval_number_of[index_ap]-1;

        tau_min = tau_ini;

        flag_ini = interval_approx[0][index_ap];

        for (index_switch=0; index_switch<num_switch; index_switch++) {

          lower_bound=tau_min;
          upper_bound=tau_end;
          mid = 0.5*(lower_bound+upper_bound);

          while (upper_bound - lower_bound > precision) {

            class_call(perturbations_approximations(ppr,
                                                    pba,
                                                    pth,
                                                    ppt,
                                                    index_md,
                                                    k,
                                                    mid,
                                                    ppw),
                       ppt->error_message,
                       ppt->error_message);

            if (ppw->approx[index_ap] > flag_ini+index_switch) {
              upper_bound=mid;
            }
            else {
              lower_bound=mid;
            }

            mid = 0.5*(lower_bound+upper_bound);

          }

          unsorted_tau_switch[index_switch_tot]=mid;
          index_switch_tot++;

          tau_min=mid;

        }
      }
    }

    class_test(index_switch_tot != (interval_number-1),
               ppt->error_message,
               "bug in approximation switch search routine: should have %d = %d",
               index_switch_tot,interval_number-1);

    /** - now sort interval limits in correct order */

    index_switch_tot=1;

    while (index_switch_tot < interval_number) {

      next_tau_switch=tau_end;
      for (index_switch=0; index_switch<interval_number-1; index_switch++) {
        if ((unsorted_tau_switch[index_switch] > interval_limit[index_switch_tot-1]) &&
            (unsorted_tau_switch[index_switch] < next_tau_switch)) {
          next_tau_switch=unsorted_tau_switch[index_switch];
        }
      }
      interval_limit[index_switch_tot]=next_tau_switch;
      index_switch_tot++;
    }

    interval_limit[index_switch_tot]=tau_end;

    class_test(index_switch_tot != interval_number,
               ppt->error_message,
               "most probably two approximation switching time were found to be equal, which cannot be handled\n");

    /** - store each approximation in chronological order */

    for (index_switch=1; index_switch<interval_number; index_switch++) {

      class_call(perturbations_approximations(ppr,
                                              pba,
                                              pth,
                                              ppt,
                                              index_md,
                                              k,
                                              0.5*(interval_limit[index_switch]+interval_limit[index_switch+1]),
                                              ppw),

                 ppt->error_message,
                 ppt->error_message);

      for (index_ap=0; index_ap<ppw->ap_size; index_ap++) {
        interval_approx[index_switch][index_ap]=ppw->approx[index_ap];

        /* check here that approximation does not go backward (remember
           that by definition the value of an approximation can only
           increase) */
        class_test(interval_approx[index_switch][index_ap] < interval_approx[index_switch-1][index_ap],
                   ppt->error_message,
                   "The approximation with label %d is not defined correctly: it goes backward (from %d to %d) for k=%e and between tau=%e and %e; this cannot be handled\n",
                   index_ap,
                   interval_approx[index_switch-1][index_ap],
                   interval_approx[index_switch][index_ap],
                   k,
                   0.5*(interval_limit[index_switch-1]+interval_limit[index_switch]),
                   0.5*(interval_limit[index_switch]+interval_limit[index_switch+1])
                   );
      }

      /* check here that more than one approximation is not switched on at a given time */
      num_switching_at_given_time=0;
      for (index_ap=0; index_ap<ppw->ap_size; index_ap++) {
        if (interval_approx[index_switch][index_ap] != interval_approx[index_switch-1][index_ap])
          num_switching_at_given_time++;
      }
      class_test(num_switching_at_given_time != 1,
                 ppt->error_message,
                 "for k=%e, at tau=%g, you switch %d approximations at the same time, this cannot be handled. Usually happens in two cases: triggers for different approximations coincide, or one approx is reversible\n",
                 k,
                 interval_limit[index_switch],
                 num_switching_at_given_time);

      if (ppt->perturbations_verbose>2) {

        if (_scalars_) {

          if ((interval_approx[index_switch-1][ppw->index_ap_tca]==(int)tca_on) &&
              (interval_approx[index_switch][ppw->index_ap_tca]==(int)tca_off))
            fprintf(stdout,"Mode k=%e: will switch off tight-coupling approximation at tau=%e\n",k,interval_limit[index_switch]);
          //fprintf(stderr,"Mode k=%e: will switch off tight-coupling approximation at tau=%e\n",k,interval_limit[index_switch]);  //TBC

          if ((interval_approx[index_switch-1][ppw->index_ap_rsa]==(int)rsa_off) &&
              (interval_approx[index_switch][ppw->index_ap_rsa]==(int)rsa_on))
            fprintf(stdout,"Mode k=%e: will switch on radiation streaming approximation at tau=%e\n",k,interval_limit[index_switch]);

          if (pba->has_idr == _TRUE_){
            if ((interval_approx[index_switch-1][ppw->index_ap_rsa_idr]==(int)rsa_idr_off) &&
                (interval_approx[index_switch][ppw->index_ap_rsa_idr]==(int)rsa_idr_on))
              fprintf(stdout,"Mode k=%e: will switch on dark radiation streaming approximation at tau=%e\n",k,interval_limit[index_switch]);
          }

          if (pth->has_idm_dr == _TRUE_){
            if ((interval_approx[index_switch-1][ppw->index_ap_tca_idm_dr]==(int)tca_idm_dr_on) &&
                (interval_approx[index_switch][ppw->index_ap_tca_idm_dr]==(int)tca_idm_dr_off))
              fprintf(stdout,"Mode k=%e: will switch off dark tight-coupling approximation at tau=%e\n",k,interval_limit[index_switch]);
          }

          if (pba->has_ur == _TRUE_) {
            if ((interval_approx[index_switch-1][ppw->index_ap_ufa]==(int)ufa_off) &&
                (interval_approx[index_switch][ppw->index_ap_ufa]==(int)ufa_on)) {
              fprintf(stdout,"Mode k=%e: will switch on ur fluid approximation at tau=%e\n",k,interval_limit[index_switch]);
            }
          }
          if (pba->has_ncdm == _TRUE_) {
            if ((interval_approx[index_switch-1][ppw->index_ap_ncdmfa]==(int)ncdmfa_off) &&
                (interval_approx[index_switch][ppw->index_ap_ncdmfa]==(int)ncdmfa_on)) {
              fprintf(stdout,"Mode k=%e: will switch on ncdm fluid approximation at tau=%e\n",k,interval_limit[index_switch]);
            }
          }
        }

        if (_tensors_) {

          if ((interval_approx[index_switch-1][ppw->index_ap_tca]==(int)tca_on) &&
              (interval_approx[index_switch][ppw->index_ap_tca]==(int)tca_off))
            fprintf(stdout,"Mode k=%e: will switch off tight-coupling approximation for tensors at tau=%e\n",k,interval_limit[index_switch]);

          if ((interval_approx[index_switch-1][ppw->index_ap_rsa]==(int)rsa_off) &&
              (interval_approx[index_switch][ppw->index_ap_rsa]==(int)rsa_on))
            fprintf(stdout,"Mode k=%e: will switch on radiation streaming approximation for tensors at tau=%e\n",k,interval_limit[index_switch]);

        }
      }
    }

    free(unsorted_tau_switch);

    class_call(perturbations_approximations(ppr,
                                            pba,
                                            pth,
                                            ppt,
                                            index_md,
                                            k,
                                            tau_end,
                                            ppw),

               ppt->error_message,
               ppt->error_message);
  }

  return _SUCCESS_;
}

// Assembly:
subq $0x68b8, %rsp           # imm = 0x68B8
movq 0x68d8(%rsp), %rax
movq 0x68d0(%rsp), %rax
movq 0x68c8(%rsp), %rax
movl 0x68c0(%rsp), %eax
movq %rdi, 0x68a8(%rsp)
movq %rsi, 0x68a0(%rsp)
movq %rdx, 0x6898(%rsp)
movq %rcx, 0x6890(%rsp)
movl %r8d, 0x688c(%rsp)
movsd %xmm0, 0x6880(%rsp)
movq %r9, 0x6878(%rsp)
movsd %xmm1, 0x6870(%rsp)
movsd %xmm2, 0x6868(%rsp)
movsd %xmm3, 0x6860(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x6830(%rsp)
movsd 0x6870(%rsp), %xmm0
movq 0x68d0(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x68a8(%rsp), %rdi
movq 0x68a0(%rsp), %rsi
movq 0x6898(%rsp), %rdx
movq 0x6890(%rsp), %rcx
movl 0x688c(%rsp), %r8d
movsd 0x6880(%rsp), %xmm0
movsd 0x6870(%rsp), %xmm1
movq 0x6878(%rsp), %r9
callq 0xf8d30
cmpl $0x1, %eax
jne 0xd9524
leaq 0x6010(%rsp), %rdi
movq 0x6890(%rsp), %rcx
addq $0x6c8a, %rcx           # imm = 0x6C8A
leaq 0xf8f03(%rip), %rsi     # 0x1d23d8
leaq 0x12096e(%rip), %rdx    # 0x1f9e4a
movb $0x0, %al
callq 0x5b9c0
movq 0x6890(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x6010(%rsp), %r8
leaq 0xf8b33(%rip), %rsi     # 0x1d2034
leaq 0x120af5(%rip), %rdx    # 0x1f9ffd
movl $0xe54, %ecx            # imm = 0xE54
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x68b4(%rsp)
jmp 0xda608
movl $0x0, 0x685c(%rsp)
movl 0x685c(%rsp), %eax
movq 0x6878(%rsp), %rcx
cmpl 0x178(%rcx), %eax
jge 0xd9589
movq 0x6878(%rsp), %rax
movq 0x180(%rax), %rax
movslq 0x685c(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x68d8(%rsp), %rax
movq (%rax), %rax
movslq 0x685c(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x685c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x685c(%rsp)
jmp 0xd952f
cmpl $0x1, 0x68c0(%rsp)
jne 0xd95ae
movsd 0x6868(%rsp), %xmm0
movq 0x68d0(%rsp), %rax
movsd %xmm0, 0x8(%rax)
jmp 0xda5fd
movl 0x68c0(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x6828(%rsp)
cmpq $0x0, 0x6828(%rsp)
jne 0xd9653
movl 0x68c0(%rsp), %eax
subl $0x1, %eax
cltq
shlq $0x3, %rax
movl %eax, 0x600c(%rsp)
leaq 0x5800(%rsp), %rdi
movl 0x600c(%rsp), %ecx
leaq 0xf8a00(%rip), %rsi     # 0x1d2004
leaq 0x120a1c(%rip), %rdx    # 0x1fa027
movb $0x0, %al
callq 0x5b9c0
movq 0x6890(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x5800(%rsp), %r8
leaq 0xf8a04(%rip), %rsi     # 0x1d2034
leaq 0x1209c6(%rip), %rdx    # 0x1f9ffd
movl $0xe67, %ecx            # imm = 0xE67
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x68b4(%rsp)
jmp 0xda608
movl $0x0, 0x6854(%rsp)
movl $0x0, 0x685c(%rsp)
movl 0x685c(%rsp), %eax
movq 0x6878(%rsp), %rcx
cmpl 0x178(%rcx), %eax
jge 0xd991d
movq 0x68c8(%rsp), %rax
movslq 0x685c(%rsp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jle 0xd9905
movq 0x68c8(%rsp), %rax
movslq 0x685c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
subl $0x1, %eax
movl %eax, 0x6850(%rsp)
movsd 0x6870(%rsp), %xmm0
movsd %xmm0, 0x6848(%rsp)
movq 0x68d8(%rsp), %rax
movq (%rax), %rax
movslq 0x685c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x681c(%rsp)
movl $0x0, 0x6858(%rsp)
movl 0x6858(%rsp), %eax
cmpl 0x6850(%rsp), %eax
jge 0xd9903
movsd 0x6848(%rsp), %xmm0
movsd %xmm0, 0x6840(%rsp)
movsd 0x6868(%rsp), %xmm0
movsd %xmm0, 0x6838(%rsp)
movsd 0x6840(%rsp), %xmm1
addsd 0x6838(%rsp), %xmm1
movsd 0xf9541(%rip), %xmm0    # 0x1d2c88
mulsd %xmm1, %xmm0
movsd %xmm0, 0x6830(%rsp)
movsd 0x6838(%rsp), %xmm0
subsd 0x6840(%rsp), %xmm0
ucomisd 0x6860(%rsp), %xmm0
jbe 0xd98ac
movq 0x68a8(%rsp), %rdi
movq 0x68a0(%rsp), %rsi
movq 0x6898(%rsp), %rdx
movq 0x6890(%rsp), %rcx
movl 0x688c(%rsp), %r8d
movsd 0x6880(%rsp), %xmm0
movsd 0x6830(%rsp), %xmm1
movq 0x6878(%rsp), %r9
callq 0xf8d30
cmpl $0x1, %eax
jne 0xd982e
leaq 0x5000(%rsp), %rdi
movq 0x6890(%rsp), %rcx
addq $0x6c8a, %rcx           # imm = 0x6C8A
leaq 0xf8bf9(%rip), %rsi     # 0x1d23d8
leaq 0x120855(%rip), %rdx    # 0x1fa03b
movb $0x0, %al
callq 0x5b9c0
movq 0x6890(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x5000(%rsp), %r8
leaq 0xf8829(%rip), %rsi     # 0x1d2034
leaq 0x1207eb(%rip), %rdx    # 0x1f9ffd
movl $0xe86, %ecx            # imm = 0xE86
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x68b4(%rsp)
jmp 0xda608
movq 0x6878(%rsp), %rax
movq 0x180(%rax), %rax
movslq 0x685c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl 0x681c(%rsp), %ecx
addl 0x6858(%rsp), %ecx
cmpl %ecx, %eax
jle 0xd986e
movsd 0x6830(%rsp), %xmm0
movsd %xmm0, 0x6838(%rsp)
jmp 0xd9880
movsd 0x6830(%rsp), %xmm0
movsd %xmm0, 0x6840(%rsp)
movsd 0x6840(%rsp), %xmm1
addsd 0x6838(%rsp), %xmm1
movsd 0xf93ee(%rip), %xmm0    # 0x1d2c88
mulsd %xmm1, %xmm0
movsd %xmm0, 0x6830(%rsp)
jmp 0xd9754
movsd 0x6830(%rsp), %xmm0
movq 0x6828(%rsp), %rax
movslq 0x6854(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x6854(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6854(%rsp)
movsd 0x6830(%rsp), %xmm0
movsd %xmm0, 0x6848(%rsp)
movl 0x6858(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6858(%rsp)
jmp 0xd96f5
jmp 0xd9905
jmp 0xd9907
movl 0x685c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x685c(%rsp)
jmp 0xd9669
movl 0x6854(%rsp), %eax
movl 0x68c0(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0xd99c3
leaq 0x4800(%rsp), %rdi
movl 0x6854(%rsp), %edx
movl 0x68c0(%rsp), %ecx
subl $0x1, %ecx
leaq 0x12072d(%rip), %rsi    # 0x1fa083
movb $0x0, %al
callq 0x5b9c0
leaq 0x4000(%rsp), %rdi
leaq 0x4800(%rsp), %rcx
leaq 0xf870e(%rip), %rsi     # 0x1d2082
leaq 0x120748(%rip), %rdx    # 0x1fa0c3
movb $0x0, %al
callq 0x5b9c0
movq 0x6890(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x4000(%rsp), %r8
leaq 0xf8694(%rip), %rsi     # 0x1d2034
leaq 0x120656(%rip), %rdx    # 0x1f9ffd
movl $0xe9f, %ecx            # imm = 0xE9F
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x68b4(%rsp)
jmp 0xda608
movl $0x1, 0x6854(%rsp)
movl 0x6854(%rsp), %eax
cmpl 0x68c0(%rsp), %eax
jge 0xd9ad7
movsd 0x6868(%rsp), %xmm0
movsd %xmm0, 0x6820(%rsp)
movl $0x0, 0x6858(%rsp)
movl 0x6858(%rsp), %eax
movl 0x68c0(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0xd9aa3
movq 0x6828(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x68d0(%rsp), %rax
movl 0x6854(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
ucomisd (%rax,%rcx,8), %xmm0
jbe 0xd9a8b
movq 0x6828(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd 0x6820(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xd9a8b
movq 0x6828(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x6820(%rsp)
jmp 0xd9a8d
movl 0x6858(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6858(%rsp)
jmp 0xd99ff
movsd 0x6820(%rsp), %xmm0
movq 0x68d0(%rsp), %rax
movslq 0x6854(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x6854(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6854(%rsp)
jmp 0xd99ce
movsd 0x6868(%rsp), %xmm0
movq 0x68d0(%rsp), %rax
movslq 0x6854(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x6854(%rsp), %eax
cmpl 0x68c0(%rsp), %eax
je 0xd9b81
leaq 0x3800(%rsp), %rdi
leaq 0x1205d7(%rip), %rsi    # 0x1fa0eb
movb $0x0, %al
callq 0x5b9c0
leaq 0x3000(%rsp), %rdi
leaq 0x3800(%rsp), %rcx
leaq 0xf8550(%rip), %rsi     # 0x1d2082
leaq 0x120612(%rip), %rdx    # 0x1fa14b
movb $0x0, %al
callq 0x5b9c0
movq 0x6890(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x3000(%rsp), %r8
leaq 0xf84d6(%rip), %rsi     # 0x1d2034
leaq 0x120498(%rip), %rdx    # 0x1f9ffd
movl $0xeb6, %ecx            # imm = 0xEB6
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x68b4(%rsp)
jmp 0xda608
movl $0x1, 0x6858(%rsp)
movl 0x6858(%rsp), %eax
cmpl 0x68c0(%rsp), %eax
jge 0xda542
movq 0x68a8(%rsp), %rdi
movq 0x68a0(%rsp), %rsi
movq 0x6898(%rsp), %rdx
movq 0x6890(%rsp), %rcx
movl 0x688c(%rsp), %r8d
movsd 0x6880(%rsp), %xmm0
movq 0x68d0(%rsp), %rax
movslq 0x6858(%rsp), %r9
movsd (%rax,%r9,8), %xmm2
movq 0x68d0(%rsp), %rax
movl 0x6858(%rsp), %r9d
addl $0x1, %r9d
movslq %r9d, %r9
addsd (%rax,%r9,8), %xmm2
movsd 0xf907c(%rip), %xmm1    # 0x1d2c88
mulsd %xmm2, %xmm1
movq 0x6878(%rsp), %r9
callq 0xf8d30
cmpl $0x1, %eax
jne 0xd9c8f
leaq 0x2800(%rsp), %rdi
movq 0x6890(%rsp), %rcx
addq $0x6c8a, %rcx           # imm = 0x6C8A
leaq 0xf8798(%rip), %rsi     # 0x1d23d8
leaq 0x120528(%rip), %rdx    # 0x1fa16f
movb $0x0, %al
callq 0x5b9c0
movq 0x6890(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x2800(%rsp), %r8
leaq 0xf83c8(%rip), %rsi     # 0x1d2034
leaq 0x12038a(%rip), %rdx    # 0x1f9ffd
movl $0xec6, %ecx            # imm = 0xEC6
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x68b4(%rsp)
jmp 0xda608
movl $0x0, 0x685c(%rsp)
movl 0x685c(%rsp), %eax
movq 0x6878(%rsp), %rcx
cmpl 0x178(%rcx), %eax
jge 0xd9e95
movq 0x6878(%rsp), %rax
movq 0x180(%rax), %rax
movslq 0x685c(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x68d8(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x685c(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x68d8(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x685c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movq 0x68d8(%rsp), %rcx
movl 0x6858(%rsp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movslq 0x685c(%rsp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0xd9e7d
leaq 0x2000(%rsp), %rdi
movl 0x685c(%rsp), %edx
movq 0x68d8(%rsp), %rax
movl 0x6858(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq 0x685c(%rsp), %rcx
movl (%rax,%rcx,4), %ecx
movq 0x68d8(%rsp), %rax
movslq 0x6858(%rsp), %rsi
movq (%rax,%rsi,8), %rax
movslq 0x685c(%rsp), %rsi
movl (%rax,%rsi,4), %r8d
movsd 0x6880(%rsp), %xmm0
movq 0x68d0(%rsp), %rax
movl 0x6858(%rsp), %esi
subl $0x1, %esi
movslq %esi, %rsi
movsd (%rax,%rsi,8), %xmm2
movq 0x68d0(%rsp), %rax
movslq 0x6858(%rsp), %rsi
addsd (%rax,%rsi,8), %xmm2
movsd 0xf8ebe(%rip), %xmm1    # 0x1d2c88
mulsd %xmm2, %xmm1
movq 0x68d0(%rsp), %rax
movslq 0x6858(%rsp), %rsi
movsd (%rax,%rsi,8), %xmm3
movq 0x68d0(%rsp), %rax
movl 0x6858(%rsp), %esi
addl $0x1, %esi
movslq %esi, %rsi
addsd (%rax,%rsi,8), %xmm3
movsd 0xf8e83(%rip), %xmm2    # 0x1d2c88
mulsd %xmm3, %xmm2
leaq 0x1203e5(%rip), %rsi    # 0x1fa1f5
movb $0x3, %al
callq 0x5b9c0
leaq 0x1800(%rsp), %rdi
leaq 0x2000(%rsp), %rcx
leaq 0xf8254(%rip), %rsi     # 0x1d2082
leaq 0x120457(%rip), %rdx    # 0x1fa28c
movb $0x0, %al
callq 0x5b9c0
movq 0x6890(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x1800(%rsp), %r8
leaq 0xf81da(%rip), %rsi     # 0x1d2034
leaq 0x12019c(%rip), %rdx    # 0x1f9ffd
movl $0xed7, %ecx            # imm = 0xED7
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x68b4(%rsp)
jmp 0xda608
jmp 0xd9e7f
movl 0x685c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x685c(%rsp)
jmp 0xd9c9a
movl $0x0, 0x6818(%rsp)
movl $0x0, 0x685c(%rsp)
movl 0x685c(%rsp), %eax
movq 0x6878(%rsp), %rcx
cmpl 0x178(%rcx), %eax
jge 0xd9f30
movq 0x68d8(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x685c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movq 0x68d8(%rsp), %rcx
movl 0x6858(%rsp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movslq 0x685c(%rsp), %rdx
cmpl (%rcx,%rdx,4), %eax
je 0xd9f18
movl 0x6818(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6818(%rsp)
jmp 0xd9f1a
movl 0x685c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x685c(%rsp)
jmp 0xd9eab
cmpl $0x1, 0x6818(%rsp)
je 0xd9fdf
leaq 0x1000(%rsp), %rdi
movsd 0x6880(%rsp), %xmm0
movq 0x68d0(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
movl 0x6818(%rsp), %edx
leaq 0x12036e(%rip), %rsi    # 0x1fa2e0
movb $0x2, %al
callq 0x5b9c0
leaq 0x800(%rsp), %rdi
leaq 0x1000(%rsp), %rcx
leaq 0xf80f2(%rip), %rsi     # 0x1d2082
leaq 0x120410(%rip), %rdx    # 0x1fa3a7
movb $0x0, %al
callq 0x5b9c0
movq 0x6890(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x800(%rsp), %r8
leaq 0xf8078(%rip), %rsi     # 0x1d2034
leaq 0x12003a(%rip), %rdx    # 0x1f9ffd
movl $0xee5, %ecx            # imm = 0xEE5
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x68b4(%rsp)
jmp 0xda608
movq 0x6890(%rsp), %rax
movswl 0x6c88(%rax), %eax
cmpl $0x2, %eax
jle 0xda52a
movq 0x6890(%rsp), %rax
movswl 0xe(%rax), %eax
cmpl $0x1, %eax
jne 0xda3dc
movl 0x688c(%rsp), %eax
movq 0x6890(%rsp), %rcx
cmpl 0x848(%rcx), %eax
jne 0xda3dc
movq 0x68d8(%rsp), %rax
movl 0x6858(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq 0x6878(%rsp), %rcx
movslq 0x160(%rcx), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xda0b4
movq 0x68d8(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x6878(%rsp), %rcx
movslq 0x160(%rcx), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0xda0b4
movq 0x169f0b(%rip), %rax    # 0x243f90
movq (%rax), %rdi
movsd 0x6880(%rsp), %xmm0
movq 0x68d0(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
leaq 0x12031b(%rip), %rsi    # 0x1fa3c8
movb $0x2, %al
callq 0x84e0
movq 0x68d8(%rsp), %rax
movl 0x6858(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq 0x6878(%rsp), %rcx
movslq 0x164(%rcx), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xda141
movq 0x68d8(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x6878(%rsp), %rcx
movslq 0x164(%rcx), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0xda141
movq 0x169e7e(%rip), %rax    # 0x243f90
movq (%rax), %rdi
movsd 0x6880(%rsp), %xmm0
movq 0x68d0(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
leaq 0x1202d1(%rip), %rsi    # 0x1fa40b
movb $0x2, %al
callq 0x84e0
movq 0x68a0(%rsp), %rax
movswl 0x4c6(%rax), %eax
cmpl $0x1, %eax
jne 0xda1e8
movq 0x68d8(%rsp), %rax
movl 0x6858(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq 0x6878(%rsp), %rcx
movslq 0x16c(%rcx), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xda1e6
movq 0x68d8(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x6878(%rsp), %rcx
movslq 0x16c(%rcx), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0xda1e6
movq 0x169dd9(%rip), %rax    # 0x243f90
movq (%rax), %rdi
movsd 0x6880(%rsp), %xmm0
movq 0x68d0(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
leaq 0x120273(%rip), %rsi    # 0x1fa452
movb $0x2, %al
callq 0x84e0
jmp 0xda1e8
movq 0x6898(%rsp), %rax
movswl 0x38(%rax), %eax
cmpl $0x1, %eax
jne 0xda28c
movq 0x68d8(%rsp), %rax
movl 0x6858(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq 0x6878(%rsp), %rcx
movslq 0x168(%rcx), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xda28a
movq 0x68d8(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x6878(%rsp), %rcx
movslq 0x168(%rcx), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0xda28a
movq 0x169d35(%rip), %rax    # 0x243f90
movq (%rax), %rdi
movsd 0x6880(%rsp), %xmm0
movq 0x68d0(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
leaq 0x12021b(%rip), %rsi    # 0x1fa49e
movb $0x2, %al
callq 0x84e0
jmp 0xda28c
movq 0x68a0(%rsp), %rax
movswl 0x4c4(%rax), %eax
cmpl $0x1, %eax
jne 0xda333
movq 0x68d8(%rsp), %rax
movl 0x6858(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq 0x6878(%rsp), %rcx
movslq 0x170(%rcx), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xda331
movq 0x68d8(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x6878(%rsp), %rcx
movslq 0x170(%rcx), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0xda331
movq 0x169c8e(%rip), %rax    # 0x243f90
movq (%rax), %rdi
movsd 0x6880(%rsp), %xmm0
movq 0x68d0(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
leaq 0x1201bc(%rip), %rsi    # 0x1fa4e6
movb $0x2, %al
callq 0x84e0
jmp 0xda333
movq 0x68a0(%rsp), %rax
movswl 0x4be(%rax), %eax
cmpl $0x1, %eax
jne 0xda3da
movq 0x68d8(%rsp), %rax
movl 0x6858(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq 0x6878(%rsp), %rcx
movslq 0x174(%rcx), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xda3d8
movq 0x68d8(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x6878(%rsp), %rcx
movslq 0x174(%rcx), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0xda3d8
movq 0x169be7(%rip), %rax    # 0x243f90
movq (%rax), %rdi
movsd 0x6880(%rsp), %xmm0
movq 0x68d0(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
leaq 0x120151(%rip), %rsi    # 0x1fa522
movb $0x2, %al
callq 0x84e0
jmp 0xda3da
jmp 0xda3dc
movq 0x6890(%rsp), %rax
movswl 0x12(%rax), %eax
cmpl $0x1, %eax
jne 0xda528
movl 0x688c(%rsp), %eax
movq 0x6890(%rsp), %rcx
cmpl 0x84c(%rcx), %eax
jne 0xda528
movq 0x68d8(%rsp), %rax
movl 0x6858(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq 0x6878(%rsp), %rcx
movslq 0x160(%rcx), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xda499
movq 0x68d8(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x6878(%rsp), %rcx
movslq 0x160(%rcx), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0xda499
movq 0x169b26(%rip), %rax    # 0x243f90
movq (%rax), %rdi
movsd 0x6880(%rsp), %xmm0
movq 0x68d0(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
leaq 0x1200ce(%rip), %rsi    # 0x1fa560
movb $0x2, %al
callq 0x84e0
movq 0x68d8(%rsp), %rax
movl 0x6858(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq 0x6878(%rsp), %rcx
movslq 0x164(%rcx), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xda526
movq 0x68d8(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x6878(%rsp), %rcx
movslq 0x164(%rcx), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0xda526
movq 0x169a99(%rip), %rax    # 0x243f90
movq (%rax), %rdi
movsd 0x6880(%rsp), %xmm0
movq 0x68d0(%rsp), %rax
movslq 0x6858(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
leaq 0x120090(%rip), %rsi    # 0x1fa5af
movb $0x2, %al
callq 0x84e0
jmp 0xda528
jmp 0xda52a
jmp 0xda52c
movl 0x6858(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6858(%rsp)
jmp 0xd9b8c
movq 0x6828(%rsp), %rdi
callq 0x8420
movq 0x68a8(%rsp), %rdi
movq 0x68a0(%rsp), %rsi
movq 0x6898(%rsp), %rdx
movq 0x6890(%rsp), %rcx
movl 0x688c(%rsp), %r8d
movsd 0x6880(%rsp), %xmm0
movsd 0x6868(%rsp), %xmm1
movq 0x6878(%rsp), %r9
callq 0xf8d30
cmpl $0x1, %eax
jne 0xda5fb
movq %rsp, %rdi
movq 0x6890(%rsp), %rcx
addq $0x6c8a, %rcx           # imm = 0x6C8A
leaq 0xf7e24(%rip), %rsi     # 0x1d23d8
leaq 0x11f903(%rip), %rdx    # 0x1f9ebe
movb $0x0, %al
callq 0x5b9c0
movq 0x6890(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
movq %rsp, %r8
leaq 0xf7a59(%rip), %rsi     # 0x1d2034
leaq 0x11fa1b(%rip), %rdx    # 0x1f9ffd
movl $0xf28, %ecx            # imm = 0xF28
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x68b4(%rsp)
jmp 0xda608
jmp 0xda5fd
movl $0x0, 0x68b4(%rsp)
movl 0x68b4(%rsp), %eax
addq $0x68b8, %rsp           # imm = 0x68B8
retq
nopw (%rax,%rax)