// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../tools/hyperspherical.c
// Function: hyperspherical_HIS_create
int hyperspherical_HIS_create(int K,
                              double beta,
                              int nl,
                              int *lvec,
                              double xmin,
                              double xmax,
                              double sampling,
                              int l_WKB,
                              double phiminabs,
                              HyperInterpStruct *pHIS,
                              ErrorMsg error_message){
  /** Allocate storage for Hyperspherical Interpolation Structure (HIS).
      Then, compute the values of Phi and dPhi and complete the interpolation
      structure.
      Change to accomodate shared memory approach: Allocate all memory in a
      single call, and return the pointer as ppHIS. All pointers inside are
      then relative to ppHIS.
  */
  double deltax, beta2, lambda, x, xfwd;
  double *sqrtK, *one_over_sqrtK,*PhiL;
  int j, k, l, nx, lmax, l_recurrence_max;
  int current_chunk, index_x;

  beta2 = beta*beta;
  lmax = lvec[nl-1];
  lambda = 2*_PI_/beta;
  nx = (int) ((xmax-xmin)*sampling/lambda);
  nx = MAX(nx,2);
  deltax = (xmax-xmin)/(nx-1.0);
  //fprintf(stderr,"dx=%e\n",deltax);
  //fprintf(stderr,"%e %e\n",beta,sampling);
  //Set scalar values:
  pHIS->beta = beta;
  pHIS->delta_x = deltax;
  pHIS->l_size = nl;
  pHIS->x_size = nx;
  pHIS->K = K;
  //Set pointervalues in pHIS:

  class_alloc(pHIS->l, sizeof(int)*nl,error_message);
  class_alloc(pHIS->chi_at_phimin,sizeof(double)*nl,error_message);
  class_alloc(pHIS->x,sizeof(double)*nx,error_message);
  class_alloc(pHIS->sinK,sizeof(double)*nx,error_message);
  class_alloc(pHIS->cotK,sizeof(double)*nx,error_message);
  class_alloc(pHIS->phi,sizeof(double)*nx*nl,error_message);
  class_alloc(pHIS->dphi,sizeof(double)*nx*nl,error_message);

  //Order needed for trig interpolation: (We are using Taylor's remainder theorem)
  if (0.5*deltax*deltax < _TRIG_PRECISSION_)
    pHIS->trig_order = 1;
  else if ((pow(deltax,4)/24.0) < _TRIG_PRECISSION_)
    pHIS->trig_order = 3;
  else
    pHIS->trig_order = 5;

  //Copy lvector:
  for (j=0; j<nl; j++){
    pHIS->l[j] = lvec[j];
  }
  //Allocate sqrtK, and PhiL:
  class_alloc(sqrtK,(lmax+3)*sizeof(double),error_message);
  class_alloc(one_over_sqrtK,(lmax+3)*sizeof(double),error_message);
  //class_alloc(PhiL,(lmax+2)*sizeof(double),error_message);

  //Find l_WKB_min, the highest l in lvec where l<l_WKB:
  l_recurrence_max = -10;
  int index_recurrence_max=-10;
  for (k=nl-1; k>=0; k--){
    l = lvec[k];
    if (l<l_WKB){
        l_recurrence_max = l;
        index_recurrence_max = k;
        break;
    }
  }

  //Create xvector and set x, cotK, sinK, sqrtK and fwdidx:
  switch (K){
  case 0:
    xfwd = sqrt(l_recurrence_max*(l_recurrence_max+1.0))/beta;
    for (j=0; j<nx; j++){
      x = xmin + j*deltax;
      pHIS->x[j] = x;
      pHIS->sinK[j] = x;
      pHIS->cotK[j] = 1.0/x;
    }
    for (l=0; l<=(lmax+2); l++){
      sqrtK[l] = beta;
      one_over_sqrtK[l] = 1.0/sqrtK[l];
    }
    break;
  case 1:
    xfwd = asin(sqrt(l_recurrence_max*(l_recurrence_max+1.0))/beta);
    for (j=0; j<nx; j++){
      x = xmin + j*deltax;
      pHIS->x[j] = x;
      pHIS->sinK[j] = sin(x);
      pHIS->cotK[j] = 1.0/tan(x);
    }
    for (l=0; l<=(lmax+2); l++){
      sqrtK[l] = sqrt(beta2-l*l);
      one_over_sqrtK[l] = 1.0/sqrtK[l];
    }
    break;
  case -1:
    xfwd = asinh(sqrt(l_recurrence_max*(l_recurrence_max+1.0))/beta);
    for (j=0; j<nx; j++){
      x = xmin + j*deltax;
      pHIS->x[j] = x;
      pHIS->sinK[j] = sinh(x);
      pHIS->cotK[j] = 1.0/tanh(x);
    }
    for (l=0; l<=(lmax+2); l++){
      sqrtK[l] = sqrt(beta2+l*l);
      one_over_sqrtK[l] = 1.0/sqrtK[l];
    }
    break;
  default:
    return _FAILURE_;
  }

  int xfwdidx = (xfwd-xmin)/deltax;

  //Only work in parallel if K==0
  class_setup_parallel_optional(K == 0);

  //Calculate and assign Phi and dPhi values:
  for (j=0; j<MIN(nx,xfwdidx); j++){
    class_run_parallel_mutable(=,
    class_alloc(PhiL,(lmax+2)*sizeof(double),error_message);
    if ((K == 1) && ((int)(beta+0.2) == (lmax+1))) {
      PhiL[lmax+1] = 0.0;
      lmax--;
    }
    //Use backwards method:
    hyperspherical_backwards_recurrence(K,
                                        MIN(l_recurrence_max,lmax)+1,
                                        beta,
                                        pHIS->x[j],
                                        pHIS->sinK[j],
                                        pHIS->cotK[j],
                                        sqrtK,
                                        one_over_sqrtK,
                                        PhiL);
    //We have now populated PhiL at x, assign Phi and dPhi for all l in lvec:
    for (k=0; k<=index_recurrence_max; k++){
      l = lvec[k];
      pHIS->phi[k*nx+j] = PhiL[l];
      pHIS->dphi[k*nx+j] = l*pHIS->cotK[j]*PhiL[l]-sqrtK[l+1]*PhiL[l+1];
    }
    free(PhiL);
    return _SUCCESS_;
    );
  }

  for (j=xfwdidx; j<nx; j+=_HYPER_CHUNK_){
    class_run_parallel_mutable(=,
    //Use forwards method:
    current_chunk = MIN(_HYPER_CHUNK_,nx-j);
    class_alloc(PhiL,(lmax+2)*sizeof(double)*current_chunk,error_message);
    if ((K == 1) && ((int)(beta+0.2) == (lmax+1))) {
      for(k=0; k<(lmax+2)*current_chunk; k++){
        PhiL[k] = 0.0;
      }
      lmax--;
    }
    hyperspherical_forwards_recurrence_chunk(K,
                                              MIN(l_recurrence_max,lmax)+1,
                                              beta,
                                              pHIS->x+j,
                                              pHIS->sinK+j,
                                              pHIS->cotK+j,
                                              current_chunk,
                                              sqrtK,
                                              one_over_sqrtK,
                                              PhiL);

    //We have now populated PhiL at x, assign Phi and dPhi for all l in lvec:
    for (k=0; k<=index_recurrence_max; k++){
      l = lvec[k];
      for (index_x=0; index_x<current_chunk; index_x++){
        pHIS->phi[k*nx+j+index_x] = PhiL[l*current_chunk+index_x];
        pHIS->dphi[k*nx+j+index_x] = l*pHIS->cotK[j+index_x]*
          PhiL[l*current_chunk+index_x]-
          sqrtK[l+1]*PhiL[(l+1)*current_chunk+index_x];
      }
    }
    free(PhiL);
    return _SUCCESS_;
    );
  }
  class_finish_parallel();

  free(sqrtK);
  free(one_over_sqrtK);

  for (k=0; k<nl; k++){
    hyperspherical_get_xmin_from_approx(K,lvec[k],beta,0.,phiminabs,pHIS->chi_at_phimin+k,NULL);
  }

  //hyperspherical_get_xmin(pHIS,1.e-4,phiminabs,pHIS->chi_at_phimin);

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x8e8, %rsp            # imm = 0x8E8
movq %r9, %r15
movq %r8, %r14
movsd %xmm4, 0xd8(%rsp)
movl %ecx, %ebx
movsd 0xcf2aa(%rip), %xmm4    # 0xf1428
divsd %xmm0, %xmm4
movsd %xmm1, 0x8(%rsp)
subsd %xmm1, %xmm2
mulsd %xmm2, %xmm3
divsd %xmm4, %xmm3
cvttsd2si %xmm3, %eax
cmpl $0x3, %eax
movl $0x2, %ecx
cmovgel %eax, %ecx
movslq %esi, %rbp
leal -0x1(%rcx), %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movq %rdx, 0x68(%rsp)
movl -0x4(%rdx,%rbp,4), %eax
movq %rax, 0x58(%rsp)
divsd %xmm1, %xmm2
movsd %xmm0, 0x40(%rsp)
movsd %xmm0, 0x8(%r8)
movsd %xmm2, (%rsp)
movsd %xmm2, 0x10(%r8)
movq %rsi, 0x90(%rsp)
movl %esi, 0x1c(%r8)
movq %rcx, 0x78(%rsp)
movl %ecx, 0x30(%r8)
movl %edi, 0x34(%rsp)
movl %edi, (%r8)
leaq (,%rbp,4), %r12
movq %r12, %rdi
callq 0x8460
movq %rax, 0x20(%r14)
testq %rax, %rax
je 0x222dd
leaq (,%rbp,8), %r12
movq %r12, %rdi
callq 0x8460
movq %rax, 0x28(%r14)
testq %rax, %rax
je 0x2231b
movl 0x78(%rsp), %r12d
leaq (,%r12,8), %r13
movq %r13, %rdi
callq 0x8460
movq %rax, 0x38(%r14)
testq %rax, %rax
je 0x22359
movq %r13, %rdi
callq 0x8460
movq %rax, 0x40(%r14)
testq %rax, %rax
je 0x22397
movq %r13, %rdi
callq 0x8460
movq %rax, 0x48(%r14)
testq %rax, %rax
je 0x223d5
imulq %rbp, %r13
movq %r13, %rdi
callq 0x8460
movq %rax, 0x50(%r14)
testq %rax, %rax
je 0x22413
movq %r13, %rdi
callq 0x8460
movq %rax, 0x58(%r14)
testq %rax, %rax
je 0x22451
movsd 0xcca1f(%rip), %xmm1    # 0xeecd0
movsd (%rsp), %xmm0
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
movsd 0xcf16a(%rip), %xmm2    # 0xf1430
ucomisd %xmm1, %xmm2
jbe 0x2248f
movl $0x1, 0x18(%r14)
jmp 0x224c4
leaq 0xcbd20(%rip), %rsi     # 0xee004
leaq 0xcfe7b(%rip), %rdx     # 0xf2166
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0xcbd2d(%rip), %rsi     # 0xee034
leaq 0xcfe60(%rip), %rdx     # 0xf216e
movq %r15, %rdi
movl $0x32, %ecx
jmp 0x225d9
leaq 0xcbce2(%rip), %rsi     # 0xee004
leaq 0xcfe5f(%rip), %rdx     # 0xf2188
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0xcbcef(%rip), %rsi     # 0xee034
leaq 0xcfe22(%rip), %rdx     # 0xf216e
movq %r15, %rdi
movl $0x33, %ecx
jmp 0x225d9
leaq 0xcbca4(%rip), %rsi     # 0xee004
leaq 0xcfe35(%rip), %rdx     # 0xf219c
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0xcbcb1(%rip), %rsi     # 0xee034
leaq 0xcfde4(%rip), %rdx     # 0xf216e
movq %r15, %rdi
movl $0x34, %ecx
jmp 0x225d9
leaq 0xcbc66(%rip), %rsi     # 0xee004
leaq 0xcfdff(%rip), %rdx     # 0xf21a4
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0xcbc73(%rip), %rsi     # 0xee034
leaq 0xcfda6(%rip), %rdx     # 0xf216e
movq %r15, %rdi
movl $0x35, %ecx
jmp 0x225d9
leaq 0xcbc28(%rip), %rsi     # 0xee004
leaq 0xcfdcc(%rip), %rdx     # 0xf21af
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0xcbc35(%rip), %rsi     # 0xee034
leaq 0xcfd68(%rip), %rdx     # 0xf216e
movq %r15, %rdi
movl $0x36, %ecx
jmp 0x225d9
leaq 0xcbbea(%rip), %rsi     # 0xee004
leaq 0xcfd99(%rip), %rdx     # 0xf21ba
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0xcbbf7(%rip), %rsi     # 0xee034
leaq 0xcfd2a(%rip), %rdx     # 0xf216e
movq %r15, %rdi
movl $0x37, %ecx
jmp 0x225d9
leaq 0xcbbac(%rip), %rsi     # 0xee004
leaq 0xcfd65(%rip), %rdx     # 0xf21c4
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0xcbbb9(%rip), %rsi     # 0xee034
leaq 0xcfcec(%rip), %rdx     # 0xf216e
movq %r15, %rdi
movl $0x38, %ecx
jmp 0x225d9
movsd 0xcefa1(%rip), %xmm1    # 0xf1438
callq 0x8620
divsd 0xcd24c(%rip), %xmm0    # 0xef6f0
movsd 0xcef84(%rip), %xmm1    # 0xf1430
ucomisd %xmm0, %xmm1
jbe 0x224bc
movl $0x3, 0x18(%r14)
jmp 0x224c4
movl $0x5, 0x18(%r14)
movq 0x68(%rsp), %r8
movq 0x90(%rsp), %rdx
movq 0x58(%rsp), %rax
cltq
testl %edx, %edx
jle 0x224f3
movq 0x20(%r14), %rcx
movl %edx, %edx
xorl %esi, %esi
movl (%r8,%rsi,4), %edi
movl %edi, (%rcx,%rsi,4)
incq %rsi
cmpq %rsi, %rdx
jne 0x224e4
leaq 0x18(,%rax,8), %r13
movq %r13, %rdi
callq 0x8460
movq %rax, 0x70(%rsp)
testq %rax, %rax
je 0x22565
movq %r13, %rdi
callq 0x8460
testq %rax, %rax
je 0x225a0
movl $0xfffffff6, 0x14(%rsp) # imm = 0xFFFFFFF6
movq 0x90(%rsp), %rsi
testl %esi, %esi
jle 0x225fc
movq 0x68(%rsp), %rdx
movsd 0x40(%rsp), %xmm0
leal -0x1(%rsi), %edi
movl (%rdx,%rdi,4), %ecx
cmpl %ebx, %ecx
jl 0x2260f
decl %esi
jg 0x22541
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0xfffffff6, 0x4c(%rsp) # imm = 0xFFFFFFF6
jmp 0x22617
leaq 0xcba98(%rip), %rsi     # 0xee004
leaq 0xcfc65(%rip), %rdx     # 0xf21d8
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0xcbaa5(%rip), %rsi     # 0xee034
leaq 0xcfbd8(%rip), %rdx     # 0xf216e
movq %r15, %rdi
movl $0x47, %ecx
jmp 0x225d9
leaq 0xcba5d(%rip), %rsi     # 0xee004
leaq 0xcfc21(%rip), %rdx     # 0xf21cf
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0xcba6a(%rip), %rsi     # 0xee034
leaq 0xcfb9d(%rip), %rdx     # 0xf216e
movq %r15, %rdi
movl $0x48, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8e8, %rsp            # imm = 0x8E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leal -0x1(%rsi), %edi
movl $0xfffffff6, 0x4c(%rsp) # imm = 0xFFFFFFF6
movsd 0x40(%rsp), %xmm0
jmp 0x22617
movl %ecx, 0x14(%rsp)
movl %edi, 0x4c(%rsp)
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
movl 0x34(%rsp), %ecx
cmpl $-0x1, %ecx
movq %rax, 0x60(%rsp)
je 0x226aa
cmpl $0x1, %ecx
je 0x22673
movl $0x1, %ebx
testl %ecx, %ecx
jne 0x225e8
xorps %xmm1, %xmm1
cvtsi2sdl 0x14(%rsp), %xmm1
movsd 0xcbc14(%rip), %xmm0    # 0xee260
addsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movq %rdi, 0x98(%rsp)
jb 0x228e8
sqrtsd %xmm0, %xmm0
jmp 0x228f2
movsd %xmm2, 0x38(%rsp)
xorps %xmm1, %xmm1
cvtsi2sdl 0x14(%rsp), %xmm1
movsd 0xcbbd6(%rip), %xmm0    # 0xee260
addsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movq %rdi, 0x98(%rsp)
jb 0x226e8
sqrtsd %xmm0, %xmm0
jmp 0x226ed
xorps %xmm1, %xmm1
cvtsi2sdl 0x14(%rsp), %xmm1
movsd 0xcbba5(%rip), %xmm0    # 0xee260
addsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movq %rdi, 0x98(%rsp)
movsd %xmm2, 0x38(%rsp)
jb 0x22808
sqrtsd %xmm0, %xmm0
jmp 0x2280d
callq 0x82b0
movsd 0x40(%rsp), %xmm1
divsd %xmm1, %xmm0
callq 0x85a0
movsd %xmm0, 0x50(%rsp)
xorl %ebx, %ebx
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
mulsd (%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x38(%r14), %rax
movsd %xmm0, (%rax,%rbx,8)
callq 0x80a0
movq 0x40(%r14), %rax
movsd %xmm0, (%rax,%rbx,8)
movsd 0x18(%rsp), %xmm0
callq 0x8210
movsd 0xcbb1a(%rip), %xmm5    # 0xee260
movapd %xmm5, %xmm1
divsd %xmm0, %xmm1
movq 0x48(%r14), %rax
movsd %xmm1, (%rax,%rbx,8)
incq %rbx
cmpq %rbx, %r12
jne 0x22704
movq 0x58(%rsp), %rax
cmpl $-0x2, %eax
movsd (%rsp), %xmm3
movsd 0x8(%rsp), %xmm4
jl 0x22967
leal 0x2(%rax), %edx
xorl %ebx, %ebx
testl %edx, %edx
cmovlel %ebx, %edx
incl %edx
xorpd %xmm6, %xmm6
movq 0x60(%rsp), %rcx
movq %rdx, 0x18(%rsp)
movsd 0x38(%rsp), %xmm2
movl %ebx, %eax
imull %ebx, %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movapd %xmm2, %xmm0
subsd %xmm1, %xmm0
ucomisd %xmm6, %xmm0
jb 0x227b8
sqrtsd %xmm0, %xmm0
jmp 0x227e4
callq 0x82b0
xorpd %xmm6, %xmm6
movsd 0xcba97(%rip), %xmm5    # 0xee260
movsd 0x38(%rsp), %xmm2
movsd 0x8(%rsp), %xmm4
movsd (%rsp), %xmm3
movq 0x18(%rsp), %rdx
movq 0x60(%rsp), %rcx
movq 0x70(%rsp), %rax
movsd %xmm0, (%rax,%rbx,8)
movapd %xmm5, %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rcx,%rbx,8)
incq %rbx
cmpq %rbx, %rdx
jne 0x22798
jmp 0x2299e
callq 0x82b0
divsd 0x40(%rsp), %xmm0
callq 0x8470
movsd %xmm0, 0x50(%rsp)
xorl %ebx, %ebx
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
mulsd (%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x38(%r14), %rax
movsd %xmm0, (%rax,%rbx,8)
callq 0x8370
movq 0x40(%r14), %rax
movsd %xmm0, (%rax,%rbx,8)
movsd 0x18(%rsp), %xmm0
callq 0x80d0
movsd 0xcb9fe(%rip), %xmm5    # 0xee260
movapd %xmm5, %xmm1
divsd %xmm0, %xmm1
movq 0x48(%r14), %rax
movsd %xmm1, (%rax,%rbx,8)
incq %rbx
cmpq %rbx, %r12
jne 0x22820
movq 0x58(%rsp), %rax
cmpl $-0x2, %eax
movsd (%rsp), %xmm3
movsd 0x8(%rsp), %xmm4
jl 0x22967
leal 0x2(%rax), %edi
xorl %eax, %eax
testl %edi, %edi
cmovlel %eax, %edi
incl %edi
movq 0x70(%rsp), %rdx
movq 0x60(%rsp), %rsi
movsd 0x38(%rsp), %xmm2
movl %eax, %ecx
imull %eax, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
addsd %xmm2, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, (%rdx,%rax,8)
movapd %xmm5, %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rsi,%rax,8)
incq %rax
cmpq %rax, %rdi
jne 0x228b0
movq %rdi, 0x18(%rsp)
jmp 0x2299e
callq 0x82b0
movq 0x60(%rsp), %rax
movsd %xmm0, 0x50(%rsp)
movsd (%rsp), %xmm3
movsd 0x8(%rsp), %xmm4
movq 0x38(%r14), %rdi
movq 0x40(%r14), %rcx
movq 0x48(%r14), %rdx
xorl %esi, %esi
movsd 0xcb947(%rip), %xmm0    # 0xee260
xorps %xmm1, %xmm1
cvtsi2sd %esi, %xmm1
mulsd %xmm3, %xmm1
addsd %xmm4, %xmm1
movsd %xmm1, (%rdi,%rsi,8)
movsd %xmm1, (%rcx,%rsi,8)
movapd %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %r12
jne 0x22919
movsd 0x40(%rsp), %xmm1
movsd 0x50(%rsp), %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x50(%rsp)
movq 0x58(%rsp), %rcx
cmpl $-0x2, %ecx
jge 0x22972
movq $0x0, 0x18(%rsp)
jmp 0x2299e
leal 0x2(%rcx), %esi
divsd %xmm1, %xmm0
xorl %edx, %edx
testl %esi, %esi
cmovlel %edx, %esi
incl %esi
movq 0x70(%rsp), %rcx
movsd %xmm1, (%rcx,%rdx,8)
movsd %xmm0, (%rax,%rdx,8)
incq %rdx
cmpq %rdx, %rsi
jne 0x22987
movq %rsi, 0x18(%rsp)
movsd 0x50(%rsp), %xmm0
subsd %xmm4, %xmm0
divsd %xmm3, %xmm0
cvttsd2si %xmm0, %ebx
movl $0x1, %esi
cmpl $0x0, 0x34(%rsp)
jne 0x229c3
callq 0x1c686
movl %eax, %esi
leaq 0xe0(%rsp), %rdi
callq 0x1c736
xorpd %xmm0, %xmm0
movapd %xmm0, 0xb0(%rsp)
movq $0x0, 0xc0(%rsp)
movq 0x78(%rsp), %rax
cmpl %ebx, %eax
movl %ebx, %ecx
cmovll %eax, %ecx
movl %ecx, 0x50(%rsp)
testl %ebx, %ebx
movq %r15, 0x38(%rsp)
jle 0x22cc6
movl $0x0, 0x8(%rsp)
movabsq $0x100000001, %r12      # imm = 0x100000001
leaq 0x124821(%rip), %rax    # 0x147240
addq $0x10, %rax
movq %rax, 0xd0(%rsp)
movl %ebx, (%rsp)
movl $0x20, %edi
callq 0x83b0
movq %rax, %r13
movq %r12, 0x8(%rax)
movq 0xd0(%rsp), %rax
movq %rax, (%r13)
movl $0xa8, %edi
callq 0x83b0
movq %rax, %rbp
movq %r12, 0x8(%rax)
leaq 0x124a25(%rip), %rax    # 0x147488
movq %rax, (%rbp)
movq %rbp, %r12
addq $0x10, %r12
movq %r12, %rdi
leaq 0x20(%rsp), %rsi
callq 0x1d4aa
movq %r12, 0x10(%r13)
leaq 0x124a52(%rip), %rax    # 0x1474d8
movq %rax, 0x10(%rbp)
movq 0x58(%rsp), %rax
movl %eax, 0x40(%rbp)
movq %r15, 0x48(%rbp)
movl 0x34(%rsp), %eax
movl %eax, 0x50(%rbp)
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x58(%rbp)
movl 0x14(%rsp), %eax
movl %eax, 0x60(%rbp)
movq %r14, 0x68(%rbp)
movl 0x8(%rsp), %eax
movl %eax, 0x70(%rbp)
movq 0x70(%rsp), %rax
movq %rax, 0x78(%rbp)
movq 0x60(%rsp), %rax
movq %rax, 0x80(%rbp)
movq 0x98(%rsp), %rax
movl %eax, 0x88(%rbp)
movl 0x4c(%rsp), %eax
movl %eax, 0x8c(%rbp)
movq 0x18(%rsp), %rax
movl %eax, 0x90(%rbp)
movq 0x68(%rsp), %rax
movq %rax, 0x98(%rbp)
movq 0x78(%rsp), %rax
movl %eax, 0xa0(%rbp)
movq %rbp, 0x18(%r13)
movq %r13, %r12
addq $0x10, %r12
leaq 0xa0(%rsp), %rdi
movq %r12, %rsi
callq 0x1d3e8
movq %r12, 0x80(%rsp)
movq %r13, 0x88(%rsp)
movq 0x126475(%rip), %rax    # 0x148fb0
cmpb $0x0, (%rax)
je 0x22b46
incl 0x8(%r13)
jmp 0x22b4b
lock
incl 0x8(%r13)
movl $0x1, %ebp
lock
xaddl %ebp, 0x100(%rsp)
movl 0xe0(%rsp), %ecx
testl %ecx, %ecx
je 0x22bb8
xorl %r15d, %r15d
leal (%r15,%rbp), %eax
xorl %edx, %edx
divl %ecx
movq 0x108(%rsp), %r12
imulq $0xb0, %rdx, %rbx
leaq (%r12,%rbx), %rdi
addq $0x58, %rdi
movq %rdi, 0x20(%rsp)
callq 0x8080
testl %eax, %eax
sete 0x28(%rsp)
je 0x22c82
leaq 0x20(%rsp), %rdi
callq 0x1d204
incl %r15d
movl 0xe0(%rsp), %ecx
cmpl %ecx, %r15d
jb 0x22b67
jmp 0x22bba
xorl %ecx, %ecx
movl %ebp, %eax
xorl %edx, %edx
divl %ecx
movq 0x108(%rsp), %r12
imulq $0xb0, %rdx, %rbx
leaq (%r12,%rbx), %rax
addq $0x58, %rax
movq %rax, 0x20(%rsp)
movb $0x0, 0x28(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x1d294
addq %rbx, %r12
movb $0x1, 0x28(%rsp)
movq %r12, %rdi
leaq 0x80(%rsp), %rsi
callq 0x2ffd6
movq 0x38(%rsp), %r15
leaq 0x20(%rsp), %rdi
callq 0x1d204
subq $-0x80, %r12
movq %r12, %rdi
callq 0x81c0
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x22c30
callq 0x1d330
movl (%rsp), %ebx
movabsq $0x100000001, %r12      # imm = 0x100000001
movq %r13, %rdi
callq 0x1d330
leaq 0xb0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x1dd2e
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x22c6c
callq 0x1d330
movl 0x8(%rsp), %eax
incl %eax
movl %eax, 0x8(%rsp)
cmpl 0x50(%rsp), %eax
jne 0x22a2e
jmp 0x22cc6
addq %rbx, %r12
movq %r12, %rdi
leaq 0x80(%rsp), %rsi
callq 0x2ffd6
leaq 0x20(%rsp), %rdi
callq 0x1d204
subq $-0x80, %r12
movq %r12, %rdi
callq 0x81c0
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
movq 0x38(%rsp), %r15
jne 0x22c2b
jmp 0x22c30
cmpl %ebx, 0x78(%rsp)
jle 0x22f77
movabsq $0x100000001, %r12      # imm = 0x100000001
leaq 0x12455f(%rip), %rax    # 0x147240
addq $0x10, %rax
movq %rax, 0x8(%rsp)
movl $0x20, %edi
callq 0x83b0
movq %rax, %r13
movl %ebx, (%rsp)
movq %r12, 0x8(%rax)
movq 0x8(%rsp), %rax
movq %rax, (%r13)
movl $0xa8, %edi
callq 0x83b0
movq %rax, %rbp
movq %r12, 0x8(%rax)
leaq 0x124849(%rip), %rax    # 0x147568
movq %rax, (%rbp)
movq %rbp, %r12
addq $0x10, %r12
movq %r12, %rdi
leaq 0x20(%rsp), %rsi
callq 0x1d4aa
movq %r12, 0x10(%r13)
leaq 0x124876(%rip), %rax    # 0x1475b8
movq %rax, 0x10(%rbp)
movq 0x78(%rsp), %rax
movl %eax, 0x3c(%rbp)
movl (%rsp), %eax
movl %eax, 0x40(%rbp)
movq 0x58(%rsp), %rax
movl %eax, 0x50(%rbp)
movq %r15, 0x58(%rbp)
movl 0x34(%rsp), %eax
movl %eax, 0x60(%rbp)
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x68(%rbp)
movq 0x98(%rsp), %rax
movl %eax, 0x70(%rbp)
movl 0x14(%rsp), %eax
movl %eax, 0x74(%rbp)
movq %r14, 0x78(%rbp)
movq 0x70(%rsp), %rax
movq %rax, 0x80(%rbp)
movq 0x60(%rsp), %rax
movq %rax, 0x88(%rbp)
movl 0x4c(%rsp), %eax
movl %eax, 0x90(%rbp)
movq 0x18(%rsp), %rax
movl %eax, 0x94(%rbp)
movq 0x68(%rsp), %rax
movq %rax, 0x98(%rbp)
movq %rbp, 0x18(%r13)
movq %r13, %r12
addq $0x10, %r12
leaq 0xa0(%rsp), %rdi
movq %r12, %rsi
callq 0x1d3e8
movq %r12, 0x80(%rsp)
movq %r13, 0x88(%rsp)
movq 0x1261bd(%rip), %rax    # 0x148fb0
cmpb $0x0, (%rax)
je 0x22dfe
incl 0x8(%r13)
jmp 0x22e03
lock
incl 0x8(%r13)
movl $0x1, %ebp
lock
xaddl %ebp, 0x100(%rsp)
movl 0xe0(%rsp), %ecx
testl %ecx, %ecx
je 0x22e70
xorl %r15d, %r15d
leal (%r15,%rbp), %eax
xorl %edx, %edx
divl %ecx
movq 0x108(%rsp), %r12
imulq $0xb0, %rdx, %rbx
leaq (%r12,%rbx), %rdi
addq $0x58, %rdi
movq %rdi, 0x20(%rsp)
callq 0x8080
testl %eax, %eax
sete 0x28(%rsp)
je 0x22f33
leaq 0x20(%rsp), %rdi
callq 0x1d204
incl %r15d
movl 0xe0(%rsp), %ecx
cmpl %ecx, %r15d
jb 0x22e1f
jmp 0x22e72
xorl %ecx, %ecx
movl %ebp, %eax
xorl %edx, %edx
divl %ecx
movq 0x108(%rsp), %r12
imulq $0xb0, %rdx, %rbx
leaq (%r12,%rbx), %rax
addq $0x58, %rax
movq %rax, 0x20(%rsp)
movb $0x0, 0x28(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x1d294
addq %rbx, %r12
movb $0x1, 0x28(%rsp)
movq %r12, %rdi
leaq 0x80(%rsp), %rsi
callq 0x308b8
movq 0x38(%rsp), %r15
leaq 0x20(%rsp), %rdi
callq 0x1d204
subq $-0x80, %r12
movq %r12, %rdi
callq 0x81c0
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x22ee8
callq 0x1d330
movl (%rsp), %ebx
movabsq $0x100000001, %r12      # imm = 0x100000001
movq %r13, %rdi
callq 0x1d330
leaq 0xb0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x1dd2e
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x22f24
callq 0x1d330
addl $0x10, %ebx
cmpl 0x78(%rsp), %ebx
jl 0x22cea
jmp 0x22f77
addq %rbx, %r12
movq %r12, %rdi
leaq 0x80(%rsp), %rsi
callq 0x308b8
leaq 0x20(%rsp), %rdi
callq 0x1d204
subq $-0x80, %r12
movq %r12, %rdi
callq 0x81c0
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
movq 0x38(%rsp), %r15
jne 0x22ee3
jmp 0x22ee8
movq 0xb0(%rsp), %rbx
movq 0xb8(%rsp), %r15
cmpq %r15, %rbx
je 0x22fdd
movq %rbx, %rdi
callq 0x1c7ba
testl %eax, %eax
jne 0x23046
addq $0x10, %rbx
cmpq %r15, %rbx
jne 0x22f8c
movq 0xb0(%rsp), %rbx
movq 0xb8(%rsp), %r15
cmpq %rbx, %r15
je 0x22fdd
movq %rbx, %r12
movq 0x8(%r12), %rdi
testq %rdi, %rdi
je 0x22fcc
callq 0x1d330
addq $0x10, %r12
cmpq %r15, %r12
jne 0x22fbd
movq %rbx, 0xb8(%rsp)
movq 0x70(%rsp), %rdi
callq 0x8410
movq 0x60(%rsp), %rdi
callq 0x8410
movq 0x90(%rsp), %rax
testl %eax, %eax
jle 0x2304d
movl %eax, %r15d
shlq $0x3, %r15
xorl %ebx, %ebx
xorl %r12d, %r12d
movq 0x68(%rsp), %rax
movl 0x34(%rsp), %ebp
movl (%rax), %esi
movq 0x28(%r14), %rdx
addq %r12, %rdx
movl %ebp, %edi
movsd 0x40(%rsp), %xmm0
movsd 0xd8(%rsp), %xmm2
movq %rax, %r13
callq 0x23118
movq %r13, %rax
addq $0x8, %r12
addq $0x4, %rax
cmpq %r12, %r15
jne 0x23012
jmp 0x2304f
movl $0x1, %ebx
jmp 0x2304f
xorl %ebx, %ebx
leaq 0xb0(%rsp), %rdi
callq 0x1c806
leaq 0xe0(%rsp), %rdi
callq 0x1c84c
jmp 0x225e8
jmp 0x2307d
jmp 0x2307d
jmp 0x230cc
jmp 0x23078
jmp 0x2307d
movq %rax, %rbx
jmp 0x2308a
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x1d204
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x2309c
callq 0x1d330
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x230ee
callq 0x1d330
jmp 0x230ee
jmp 0x230ba
jmp 0x230cc
jmp 0x230d1
jmp 0x230d6
jmp 0x230eb
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
jne 0x230f1
jmp 0x230f6
movq %rax, %rbx
jmp 0x230f6
movq %rax, %rbx
jmp 0x230e1
movq %rax, %rbx
movq %rbp, %rdi
callq 0x8380
movq %r13, %rdi
callq 0x8380
jmp 0x230f6
movq %rax, %rbx
movq %r13, %rdi
callq 0x1d330
leaq 0xb0(%rsp), %rdi
callq 0x1c806
leaq 0xe0(%rsp), %rdi
callq 0x1c84c
movq %rbx, %rdi
callq 0x8650