// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1088, %rsp           # imm = 0x1088
movsd %xmm3, 0x50(%rsp)
movsd %xmm2, 0x20(%rsp)
movq %r9, %r14
movl %r8d, %ebx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rbp
movq %rdi, %r13
movq 0x10d0(%rsp), %rax
movsd %xmm1, (%rax)
movsd %xmm0, (%rsp)
movsd %xmm1, 0x60(%rsp)
callq 0x8d6b1
testl %eax, %eax
je 0x7e02e
addq $0x6c8a, %r15           # imm = 0x6C8A
leaq 0x73415(%rip), %rsi     # 0xf13f0
leaq 0x9adf0(%rip), %rdx     # 0x118dd2
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x73036(%rip), %rsi     # 0xf1034
leaq 0x9af80(%rip), %rdx     # 0x118f85
movq %r15, %rdi
movl $0xe54, %ecx            # imm = 0xE54
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
addq $0x1088, %rsp           # imm = 0x1088
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10d0(%rsp), %r8
movq %r15, 0x10(%rsp)
movq %r13, 0x18(%rsp)
movq 0x10d8(%rsp), %r13
movl 0x10c0(%rsp), %edi
cmpl $0x0, 0x178(%r14)
jle 0x7e07b
movq 0x180(%r14), %rax
movq (%r13), %rcx
xorl %edx, %edx
movl (%rax,%rdx,4), %esi
movl %esi, (%rcx,%rdx,4)
incq %rdx
movslq 0x178(%r14), %rsi
cmpq %rsi, %rdx
jl 0x7e066
cmpl $0x1, %edi
jne 0x7e090
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x8(%r8)
xorl %eax, %eax
jmp 0x7e01c
movq %rbp, 0x28(%rsp)
movslq %edi, %rax
leaq -0x8(,%rax,8), %r15
movq %r15, %rdi
callq 0x8460
testq %rax, %rax
je 0x7e2b1
movq %rax, %rbp
movq %r12, 0x38(%rsp)
cmpl $0x0, 0x178(%r14)
jle 0x7e2f8
movq 0x10c8(%rsp), %rcx
xorl %r12d, %r12d
xorl %edx, %edx
movsd 0x20(%rsp), %xmm3
movq 0x18(%rsp), %r9
movl %ebx, %r8d
movl 0x10c0(%rsp), %r10d
movsd 0x50(%rsp), %xmm2
movsd 0x60(%rsp), %xmm0
movl (%rcx,%r12,4), %esi
cmpl $0x2, %esi
jl 0x7e254
movl %r8d, %r15d
movq %r13, %rax
movq 0x10(%rsp), %r13
movq (%rax), %rax
movl (%rax,%r12,4), %eax
movq %rax, 0x68(%rsp)
movslq %edx, %rdx
movq %rdx, 0x48(%rsp)
addl $-0x2, %esi
xorl %ecx, %ecx
movapd %xmm0, %xmm4
movapd %xmm0, %xmm1
movl %esi, 0x5c(%rsp)
addsd %xmm3, %xmm1
mulsd 0x73b91(%rip), %xmm1    # 0xf1cd0
movapd %xmm3, %xmm0
subsd %xmm4, %xmm0
ucomisd %xmm2, %xmm0
movq %rcx, 0x70(%rsp)
jbe 0x7e1fb
movq 0x68(%rsp), %rax
leal (%rcx,%rax), %ebx
movsd %xmm3, 0x78(%rsp)
movsd %xmm4, 0x30(%rsp)
movq %r9, %rdi
movq 0x28(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r13, %rcx
movl %r15d, %r8d
movsd (%rsp), %xmm0
movsd %xmm1, 0x40(%rsp)
movq %r14, %r9
callq 0x8d6b1
testl %eax, %eax
jne 0x7e26c
movq 0x180(%r14), %rax
cmpl %ebx, (%rax,%r12,4)
jg 0x7e1c2
movsd 0x40(%rsp), %xmm1
movapd %xmm1, %xmm4
movq 0x18(%rsp), %r9
movsd 0x50(%rsp), %xmm2
movsd 0x78(%rsp), %xmm3
jmp 0x7e1dd
movsd 0x40(%rsp), %xmm3
movsd 0x30(%rsp), %xmm4
movapd %xmm4, %xmm1
movq 0x18(%rsp), %r9
movsd 0x50(%rsp), %xmm2
addsd %xmm3, %xmm1
mulsd 0x73ae7(%rip), %xmm1    # 0xf1cd0
movapd %xmm3, %xmm0
subsd %xmm4, %xmm0
ucomisd %xmm2, %xmm0
ja 0x7e15e
movq 0x48(%rsp), %rax
movsd %xmm1, (%rbp,%rax,8)
incq %rax
movq %rax, 0x48(%rsp)
movq 0x70(%rsp), %rcx
leal 0x1(%rcx), %eax
movapd %xmm1, %xmm4
movl 0x5c(%rsp), %esi
cmpl %esi, %ecx
movl %eax, %ecx
movsd 0x20(%rsp), %xmm3
jne 0x7e133
movl %r15d, %r8d
movq 0x10d8(%rsp), %r13
movl 0x10c0(%rsp), %r10d
movsd 0x60(%rsp), %xmm0
movq 0x48(%rsp), %rdx
movq 0x10c8(%rsp), %rcx
incq %r12
movslq 0x178(%r14), %rax
cmpq %rax, %r12
jl 0x7e0f6
jmp 0x7e310
addq $0x6c8a, %r13           # imm = 0x6C8A
leaq 0x73176(%rip), %rsi     # 0xf13f0
leaq 0x9ad42(%rip), %rdx     # 0x118fc3
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x72d97(%rip), %rsi     # 0xf1034
leaq 0x9ace1(%rip), %rdx     # 0x118f85
movq %r13, %rdi
movl $0xe86, %ecx            # imm = 0xE86
jmp 0x7e00d
leaq 0x72d4c(%rip), %rsi     # 0xf1004
leaq 0x9acf0(%rip), %rdx     # 0x118faf
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x30c2c
movq 0x10(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x72d4d(%rip), %rsi     # 0xf1034
leaq 0x9ac97(%rip), %rdx     # 0x118f85
movl $0xe67, %ecx            # imm = 0xE67
jmp 0x7e00d
xorl %edx, %edx
movsd 0x20(%rsp), %xmm3
movq 0x18(%rsp), %r9
movl %ebx, %r8d
movl 0x10c0(%rsp), %r10d
leal -0x1(%r10), %ecx
cmpl %ecx, %edx
jne 0x7e8a4
movl $0x1, %eax
cmpl $0x2, %r10d
movq 0x10d0(%rsp), %r12
jl 0x7e392
movl %r10d, %edx
movl %ecx, %ecx
movl $0x1, %eax
movsd -0x8(%r12,%rax,8), %xmm0
xorl %esi, %esi
movsd 0x20(%rsp), %xmm2
movsd (%rbp,%rsi,8), %xmm1
movapd %xmm1, %xmm3
cmpltpd %xmm2, %xmm3
movapd %xmm0, %xmm4
cmpltpd %xmm1, %xmm4
andpd %xmm3, %xmm4
movd %xmm4, %edi
testb $0x1, %dil
jne 0x7e372
movapd %xmm2, %xmm1
incq %rsi
movapd %xmm1, %xmm2
cmpq %rsi, %rcx
jne 0x7e348
movsd %xmm1, (%r12,%rax,8)
incq %rax
cmpq %rdx, %rax
jne 0x7e339
movsd 0x20(%rsp), %xmm3
movl %eax, %ecx
movsd %xmm3, (%r12,%rcx,8)
cmpl %r10d, %eax
jne 0x7e904
cmpl $0x2, %r10d
movsd (%rsp), %xmm0
jl 0x7e81e
movl %r10d, %ebx
movl $0x1, %r10d
movsd 0x7390d(%rip), %xmm3    # 0xf1cd0
movl %r8d, 0xc(%rsp)
movq %r10, %r15
movsd (%r12,%r10,8), %xmm1
addsd 0x8(%r12,%r10,8), %xmm1
mulsd %xmm3, %xmm1
movq %r9, %rdi
movq 0x28(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %r14, %r9
callq 0x8d6b1
testl %eax, %eax
jne 0x7e9ed
leaq 0x1(%r15), %r10
movl 0x178(%r14), %edi
testl %edi, %edi
movsd (%rsp), %xmm0
movsd 0x738b8(%rip), %xmm3    # 0xf1cd0
jle 0x7e44b
movq 0x180(%r14), %rsi
movq -0x8(%r13,%r15,8), %rcx
movq (%r13,%r15,8), %rax
xorl %edx, %edx
movl (%rsi,%rdx,4), %edi
movl %edi, (%rax,%rdx,4)
cmpl (%rcx,%rdx,4), %edi
jl 0x7e964
incq %rdx
movslq 0x178(%r14), %rdi
cmpq %rdi, %rdx
jl 0x7e42d
testl %edi, %edi
jle 0x7e47b
movq -0x8(%r13,%r15,8), %rax
movq (%r13,%r15,8), %rcx
movl %edi, %esi
xorl %edi, %edi
xorl %edx, %edx
movl (%rcx,%rdi,4), %r8d
xorl %r9d, %r9d
cmpl (%rax,%rdi,4), %r8d
setne %r9b
addl %r9d, %edx
incq %rdi
cmpq %rdi, %rsi
jne 0x7e45f
jmp 0x7e47d
xorl %edx, %edx
cmpl $0x1, %edx
jne 0x7ea37
movq 0x10(%rsp), %rax
cmpw $0x3, 0x6c88(%rax)
movq 0x18(%rsp), %r9
movl 0xc(%rsp), %r8d
jl 0x7e815
movq %rbx, 0x40(%rsp)
movq 0x10(%rsp), %rbx
cmpw $0x1, 0xe(%rbx)
jne 0x7e735
cmpl %r8d, 0x848(%rbx)
jne 0x7e735
movq -0x8(%r13,%r15,8), %rcx
movslq 0x160(%r14), %rax
cmpl $0x0, (%rcx,%rax,4)
jne 0x7e522
movq (%r13,%r15,8), %rcx
cmpl $0x1, (%rcx,%rax,4)
jne 0x7e522
movq 0xcda57(%rip), %rax     # 0x14bf40
movq (%rax), %rdi
movsd (%r12,%r15,8), %xmm1
leaq 0x9ae57(%rip), %rsi     # 0x119350
movsd (%rsp), %xmm0
movb $0x2, %al
movq %r10, %rbx
callq 0x84e0
movq %rbx, %r10
movsd 0x737bd(%rip), %xmm3    # 0xf1cd0
movl 0xc(%rsp), %r8d
movq 0x18(%rsp), %r9
movsd (%rsp), %xmm0
movq -0x8(%r13,%r15,8), %rcx
movslq 0x164(%r14), %rax
cmpl $0x0, (%rcx,%rax,4)
jne 0x7e57f
movq (%r13,%r15,8), %rcx
cmpl $0x1, (%rcx,%rax,4)
jne 0x7e57f
movq 0xcd9fa(%rip), %rax     # 0x14bf40
movq (%rax), %rdi
movsd (%r12,%r15,8), %xmm1
leaq 0x9ae3d(%rip), %rsi     # 0x119393
movsd (%rsp), %xmm0
movb $0x2, %al
movq %r10, %rbx
callq 0x84e0
movq %rbx, %r10
movsd 0x73760(%rip), %xmm3    # 0xf1cd0
movl 0xc(%rsp), %r8d
movq 0x18(%rsp), %r9
movsd (%rsp), %xmm0
movq 0x28(%rsp), %rax
cmpw $0x1, 0x4c6(%rax)
jne 0x7e5eb
movq -0x8(%r13,%r15,8), %rcx
movslq 0x16c(%r14), %rax
cmpl $0x0, (%rcx,%rax,4)
jne 0x7e5eb
movq (%r13,%r15,8), %rcx
cmpl $0x1, (%rcx,%rax,4)
jne 0x7e5eb
movq 0xcd98e(%rip), %rax     # 0x14bf40
movq (%rax), %rdi
movsd (%r12,%r15,8), %xmm1
leaq 0x9ae18(%rip), %rsi     # 0x1193da
movsd (%rsp), %xmm0
movb $0x2, %al
movq %r10, %rbx
callq 0x84e0
movq %rbx, %r10
movsd 0x736f4(%rip), %xmm3    # 0xf1cd0
movl 0xc(%rsp), %r8d
movq 0x18(%rsp), %r9
movsd (%rsp), %xmm0
movq 0x38(%rsp), %rax
cmpw $0x1, 0x38(%rax)
jne 0x7e654
movq -0x8(%r13,%r15,8), %rcx
movslq 0x168(%r14), %rax
cmpl $0x0, (%rcx,%rax,4)
jne 0x7e654
movq (%r13,%r15,8), %rcx
cmpl $0x1, (%rcx,%rax,4)
jne 0x7e654
movq 0xcd925(%rip), %rax     # 0x14bf40
movq (%rax), %rdi
movsd (%r12,%r15,8), %xmm1
leaq 0x9adfb(%rip), %rsi     # 0x119426
movsd (%rsp), %xmm0
movb $0x2, %al
movq %r10, %rbx
callq 0x84e0
movq %rbx, %r10
movsd 0x7368b(%rip), %xmm3    # 0xf1cd0
movl 0xc(%rsp), %r8d
movq 0x18(%rsp), %r9
movsd (%rsp), %xmm0
movq 0x28(%rsp), %rax
cmpw $0x1, 0x4c4(%rax)
jne 0x7e6c0
movq -0x8(%r13,%r15,8), %rcx
movslq 0x170(%r14), %rax
cmpl $0x0, (%rcx,%rax,4)
jne 0x7e6c0
movq (%r13,%r15,8), %rcx
cmpl $0x1, (%rcx,%rax,4)
jne 0x7e6c0
movq 0xcd8b9(%rip), %rax     # 0x14bf40
movq (%rax), %rdi
movsd (%r12,%r15,8), %xmm1
leaq 0x9add7(%rip), %rsi     # 0x11946e
movsd (%rsp), %xmm0
movb $0x2, %al
movq %r10, %rbx
callq 0x84e0
movq %rbx, %r10
movsd 0x7361f(%rip), %xmm3    # 0xf1cd0
movl 0xc(%rsp), %r8d
movq 0x18(%rsp), %r9
movsd (%rsp), %xmm0
movq 0x28(%rsp), %rax
cmpw $0x1, 0x4be(%rax)
movq 0x10(%rsp), %rbx
jne 0x7e735
movq -0x8(%r13,%r15,8), %rcx
movslq 0x174(%r14), %rax
cmpl $0x0, (%rcx,%rax,4)
jne 0x7e735
movq (%r13,%r15,8), %rcx
cmpl $0x1, (%rcx,%rax,4)
jne 0x7e735
movq 0xcd848(%rip), %rax     # 0x14bf40
movq (%rax), %rdi
movsd (%r12,%r15,8), %xmm1
leaq 0x9ada2(%rip), %rsi     # 0x1194aa
movsd (%rsp), %xmm0
movb $0x2, %al
movq %r10, 0x30(%rsp)
callq 0x84e0
movq 0x30(%rsp), %r10
movsd 0x735aa(%rip), %xmm3    # 0xf1cd0
movl 0xc(%rsp), %r8d
movq 0x18(%rsp), %r9
movsd (%rsp), %xmm0
cmpw $0x1, 0x12(%rbx)
movq 0x40(%rsp), %rbx
jne 0x7e815
movq 0x10(%rsp), %rax
cmpl %r8d, 0x84c(%rax)
jne 0x7e815
movq -0x8(%r13,%r15,8), %rcx
movslq 0x160(%r14), %rax
cmpl $0x0, (%rcx,%rax,4)
jne 0x7e7b8
movq (%r13,%r15,8), %rcx
cmpl $0x1, (%rcx,%rax,4)
jne 0x7e7b8
movq 0xcd7c5(%rip), %rax     # 0x14bf40
movq (%rax), %rdi
movsd (%r12,%r15,8), %xmm1
leaq 0x9ad5d(%rip), %rsi     # 0x1194e8
movsd (%rsp), %xmm0
movb $0x2, %al
movq %r10, 0x30(%rsp)
callq 0x84e0
movq 0x30(%rsp), %r10
movsd 0x73527(%rip), %xmm3    # 0xf1cd0
movl 0xc(%rsp), %r8d
movq 0x18(%rsp), %r9
movsd (%rsp), %xmm0
movq -0x8(%r13,%r15,8), %rcx
movslq 0x164(%r14), %rax
cmpl $0x0, (%rcx,%rax,4)
jne 0x7e815
movq (%r13,%r15,8), %rcx
cmpl $0x1, (%rcx,%rax,4)
jne 0x7e815
movq 0xcd764(%rip), %rax     # 0x14bf40
movq (%rax), %rdi
movsd (%r12,%r15,8), %xmm1
leaq 0x9ad4b(%rip), %rsi     # 0x119537
movsd (%rsp), %xmm0
movb $0x2, %al
movq %r10, %r15
callq 0x84e0
movq %r15, %r10
movsd 0x734ca(%rip), %xmm3    # 0xf1cd0
movl 0xc(%rsp), %r8d
movq 0x18(%rsp), %r9
movsd (%rsp), %xmm0
cmpq %rbx, %r10
jne 0x7e3c8
movq %rbp, %rdi
movq %r9, %r15
movl %r8d, %ebx
callq 0x8410
movq %r15, %rdi
movq 0x28(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x10(%rsp), %r15
movq %r15, %rcx
movl %ebx, %r8d
movsd (%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movq %r14, %r9
callq 0x8d6b1
testl %eax, %eax
je 0x7e08c
addq $0x6c8a, %r15           # imm = 0x6C8A
leaq 0x72b83(%rip), %rsi     # 0xf13f0
leaq 0x9a5d2(%rip), %rdx     # 0x118e46
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x727a4(%rip), %rsi     # 0xf1034
leaq 0x9a6ee(%rip), %rdx     # 0x118f85
movq %r15, %rdi
movl $0xf28, %ecx            # imm = 0xF28
jmp 0x7e00d
leaq 0x9a760(%rip), %rsi     # 0x11900b
leaq 0x80(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x727be(%rip), %rsi     # 0xf1082
leaq 0x9a780(%rip), %rdx     # 0x11904b
leaq 0x880(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
movq 0x10(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x72741(%rip), %rsi     # 0xf1034
leaq 0x9a68b(%rip), %rdx     # 0x118f85
movl $0xe9f, %ecx            # imm = 0xE9F
jmp 0x7e9e5
leaq 0x9a768(%rip), %rsi     # 0x119073
leaq 0x80(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x7275e(%rip), %rsi     # 0xf1082
leaq 0x9a7a8(%rip), %rdx     # 0x1190d3
leaq 0x880(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
movq 0x10(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x726e1(%rip), %rsi     # 0xf1034
leaq 0x9a62b(%rip), %rdx     # 0x118f85
movl $0xeb6, %ecx            # imm = 0xEB6
jmp 0x7e9e5
movl (%rcx,%rdx,4), %ecx
movl (%rax,%rdx,4), %r8d
movsd (%r12,%r15,8), %xmm2
movsd -0x8(%r12,%r15,8), %xmm1
addsd %xmm2, %xmm1
mulsd %xmm3, %xmm1
addsd (%r12,%r10,8), %xmm2
mulsd %xmm3, %xmm2
leaq 0x9a7ec(%rip), %rsi     # 0x11917d
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movb $0x3, %al
callq 0x30c2c
leaq 0x726d8(%rip), %rsi     # 0xf1082
leaq 0x9a863(%rip), %rdx     # 0x119214
leaq 0x880(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
movq 0x10(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x7265b(%rip), %rsi     # 0xf1034
leaq 0x9a5a5(%rip), %rdx     # 0x118f85
movl $0xed7, %ecx            # imm = 0xED7
movq %r15, %r8
jmp 0x7e010
movq 0x10(%rsp), %rbx
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x729f0(%rip), %rsi     # 0xf13f0
leaq 0x9a6f0(%rip), %rdx     # 0x1190f7
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x72611(%rip), %rsi     # 0xf1034
leaq 0x9a55b(%rip), %rdx     # 0x118f85
movq %rbx, %rdi
movl $0xec6, %ecx            # imm = 0xEC6
jmp 0x7e00d
movsd (%r12,%r15,8), %xmm1
leaq 0x9a824(%rip), %rsi     # 0x119268
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movb $0x2, %al
callq 0x30c2c
leaq 0x72625(%rip), %rsi     # 0xf1082
leaq 0x9a8cb(%rip), %rdx     # 0x11932f
leaq 0x880(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
movq 0x10(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x725a8(%rip), %rsi     # 0xf1034
leaq 0x9a4f2(%rip), %rdx     # 0x118f85
movl $0xee5, %ecx            # imm = 0xEE5
jmp 0x7e9e5