// File: /workspace/github_c_makefile_star2_O1/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, %r13
movq %r8, %r14
movsd %xmm4, 0xd8(%rsp)
movl %ecx, %ebx
movq %rdx, %rbp
movsd 0xd2267(%rip), %xmm4    # 0xf4418
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, %r12
leal -0x1(%rcx), %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movl -0x4(%rdx,%r12,4), %eax
movq %rax, 0x70(%rsp)
divsd %xmm1, %xmm2
movsd %xmm0, 0x48(%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, 0x24(%rsp)
movl %edi, (%r8)
leaq (,%r12,4), %r15
movq %r15, %rdi
callq 0x8460
movq %rax, 0x20(%r14)
testq %rax, %rax
je 0x2231e
leaq (,%r12,8), %r15
movq %r15, %rdi
callq 0x8460
movq %rax, 0x28(%r14)
testq %rax, %rax
je 0x2235c
movq %r13, 0x18(%rsp)
movl 0x78(%rsp), %r15d
leaq (,%r15,8), %r13
movq %r13, %rdi
callq 0x8460
movq %rax, 0x38(%r14)
testq %rax, %rax
je 0x2239a
movq %r13, %rdi
callq 0x8460
movq %rax, 0x40(%r14)
testq %rax, %rax
je 0x223da
movq %r13, %rdi
callq 0x8460
movq %rax, 0x48(%r14)
testq %rax, %rax
je 0x2241a
imulq %r12, %r13
movq %r13, %rdi
callq 0x8460
movq %rax, 0x50(%r14)
testq %rax, %rax
je 0x2245a
movq %r13, %rdi
callq 0x8460
movq %rax, 0x58(%r14)
testq %rax, %rax
je 0x2249a
movsd 0xcf9eb(%rip), %xmm1    # 0xf1cd0
movsd (%rsp), %xmm0
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
movsd 0xd2126(%rip), %xmm2    # 0xf4420
ucomisd %xmm1, %xmm2
jbe 0x224da
movl $0x1, 0x18(%r14)
movq 0x90(%rsp), %rdx
movq 0x70(%rsp), %rax
jmp 0x2251c
leaq 0xcecdf(%rip), %rsi     # 0xf1004
leaq 0xd2e2a(%rip), %rdx     # 0xf5156
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xcecec(%rip), %rsi     # 0xf1034
leaq 0xd2e0f(%rip), %rdx     # 0xf515e
movq %r13, %rdi
movl $0x32, %ecx
jmp 0x22629
leaq 0xceca1(%rip), %rsi     # 0xf1004
leaq 0xd2e0e(%rip), %rdx     # 0xf5178
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xcecae(%rip), %rsi     # 0xf1034
leaq 0xd2dd1(%rip), %rdx     # 0xf515e
movq %r13, %rdi
movl $0x33, %ecx
jmp 0x22629
leaq 0xcec63(%rip), %rsi     # 0xf1004
leaq 0xd2de4(%rip), %rdx     # 0xf518c
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xcec70(%rip), %rsi     # 0xf1034
leaq 0xd2d93(%rip), %rdx     # 0xf515e
movq 0x18(%rsp), %rdi
movl $0x34, %ecx
jmp 0x22629
leaq 0xcec23(%rip), %rsi     # 0xf1004
leaq 0xd2dac(%rip), %rdx     # 0xf5194
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xcec30(%rip), %rsi     # 0xf1034
leaq 0xd2d53(%rip), %rdx     # 0xf515e
movq 0x18(%rsp), %rdi
movl $0x35, %ecx
jmp 0x22629
leaq 0xcebe3(%rip), %rsi     # 0xf1004
leaq 0xd2d77(%rip), %rdx     # 0xf519f
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xcebf0(%rip), %rsi     # 0xf1034
leaq 0xd2d13(%rip), %rdx     # 0xf515e
movq 0x18(%rsp), %rdi
movl $0x36, %ecx
jmp 0x22629
leaq 0xceba3(%rip), %rsi     # 0xf1004
leaq 0xd2d42(%rip), %rdx     # 0xf51aa
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xcebb0(%rip), %rsi     # 0xf1034
leaq 0xd2cd3(%rip), %rdx     # 0xf515e
movq 0x18(%rsp), %rdi
movl $0x37, %ecx
jmp 0x22629
leaq 0xceb63(%rip), %rsi     # 0xf1004
leaq 0xd2d0c(%rip), %rdx     # 0xf51b4
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xceb70(%rip), %rsi     # 0xf1034
leaq 0xd2c93(%rip), %rdx     # 0xf515e
movq 0x18(%rsp), %rdi
movl $0x38, %ecx
jmp 0x22629
movsd 0xd1f46(%rip), %xmm1    # 0xf4428
callq 0x8620
divsd 0xd0201(%rip), %xmm0    # 0xf26f0
movsd 0xd1f29(%rip), %xmm1    # 0xf4420
ucomisd %xmm0, %xmm1
movq 0x70(%rsp), %rax
jbe 0x2250c
movl $0x3, 0x18(%r14)
jmp 0x22514
movl $0x5, 0x18(%r14)
movq 0x90(%rsp), %rdx
cltq
testl %edx, %edx
jle 0x22539
movq 0x20(%r14), %rcx
movl %edx, %edx
xorl %esi, %esi
movl (%rbp,%rsi,4), %edi
movl %edi, (%rcx,%rsi,4)
incq %rsi
cmpq %rsi, %rdx
jne 0x2252a
leaq 0x18(,%rax,8), %r13
movq %r13, %rdi
callq 0x8460
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x225b1
movq %r13, %rdi
callq 0x8460
testq %rax, %rax
je 0x225ee
movl $0xfffffff6, 0x20(%rsp) # imm = 0xFFFFFFF6
movq 0x90(%rsp), %rdx
testl %edx, %edx
jle 0x2264c
movq 0x18(%rsp), %r12
movsd 0x48(%rsp), %xmm0
movl 0x24(%rsp), %r13d
leal -0x1(%rdx), %esi
movl (%rbp,%rsi,4), %ecx
cmpl %ebx, %ecx
jl 0x22669
decl %edx
jg 0x2258c
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xfffffff6, 0x54(%rsp) # imm = 0xFFFFFFF6
jmp 0x22671
leaq 0xcea4c(%rip), %rsi     # 0xf1004
leaq 0xd2c09(%rip), %rdx     # 0xf51c8
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xcea59(%rip), %rsi     # 0xf1034
leaq 0xd2b7c(%rip), %rdx     # 0xf515e
movq 0x18(%rsp), %rdi
movl $0x47, %ecx
jmp 0x22629
leaq 0xcea0f(%rip), %rsi     # 0xf1004
leaq 0xd2bc3(%rip), %rdx     # 0xf51bf
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xcea1c(%rip), %rsi     # 0xf1034
leaq 0xd2b3f(%rip), %rdx     # 0xf515e
movq 0x18(%rsp), %rdi
movl $0x48, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x30c2c
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(%rdx), %esi
movl $0xfffffff6, 0x54(%rsp) # imm = 0xFFFFFFF6
movq 0x18(%rsp), %r12
movsd 0x48(%rsp), %xmm0
movl 0x24(%rsp), %r13d
jmp 0x22671
movl %ecx, 0x20(%rsp)
movl %esi, 0x54(%rsp)
mulsd %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
cmpl $-0x1, %r13d
movq %rax, 0x60(%rsp)
je 0x226ff
cmpl $0x1, %r13d
je 0x226ce
movl $0x1, %ebx
testl %r13d, %r13d
jne 0x22638
xorps %xmm1, %xmm1
cvtsi2sdl 0x20(%rsp), %xmm1
movsd 0xcebb9(%rip), %xmm0    # 0xf1260
addsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movq %rsi, 0x98(%rsp)
jb 0x2309b
sqrtsd %xmm0, %xmm0
jmp 0x230a5
xorps %xmm1, %xmm1
cvtsi2sdl 0x20(%rsp), %xmm1
movsd 0xceb81(%rip), %xmm0    # 0xf1260
addsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movq %rsi, 0x98(%rsp)
jb 0x22737
sqrtsd %xmm0, %xmm0
jmp 0x2273c
xorps %xmm1, %xmm1
cvtsi2sdl 0x20(%rsp), %xmm1
movsd 0xceb50(%rip), %xmm0    # 0xf1260
addsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movq %rsi, 0x98(%rsp)
jb 0x22853
sqrtsd %xmm0, %xmm0
jmp 0x22858
callq 0x82b0
movsd 0x48(%rsp), %xmm1
divsd %xmm1, %xmm0
callq 0x85a0
movsd %xmm0, 0x58(%rsp)
xorl %ebx, %ebx
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
mulsd (%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0x38(%r14), %rax
movsd %xmm0, (%rax,%rbx,8)
callq 0x80a0
movq 0x40(%r14), %rax
movsd %xmm0, (%rax,%rbx,8)
movsd 0x28(%rsp), %xmm0
callq 0x8210
movsd 0xceacb(%rip), %xmm5    # 0xf1260
movapd %xmm5, %xmm1
divsd %xmm0, %xmm1
movq 0x48(%r14), %rax
movsd %xmm1, (%rax,%rbx,8)
incq %rbx
cmpq %rbx, %r15
jne 0x22753
movq 0x70(%rsp), %rax
cmpl $-0x2, %eax
movsd (%rsp), %xmm3
movsd 0x8(%rsp), %xmm4
jl 0x228db
leal 0x2(%rax), %ebx
xorl %edx, %edx
testl %ebx, %ebx
cmovlel %edx, %ebx
incl %ebx
xorpd %xmm6, %xmm6
movq 0x60(%rsp), %rcx
movsd 0x30(%rsp), %xmm2
movl %edx, %eax
imull %edx, %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movapd %xmm2, %xmm0
subsd %xmm1, %xmm0
ucomisd %xmm6, %xmm0
jb 0x22802
sqrtsd %xmm0, %xmm0
jmp 0x2282f
movq %rdx, %r15
callq 0x82b0
xorpd %xmm6, %xmm6
movsd 0xcea4a(%rip), %xmm5    # 0xf1260
movsd 0x30(%rsp), %xmm2
movsd 0x8(%rsp), %xmm4
movsd (%rsp), %xmm3
movq %r15, %rdx
movq 0x60(%rsp), %rcx
movq 0x10(%rsp), %rax
movsd %xmm0, (%rax,%rdx,8)
movapd %xmm5, %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rbx
jne 0x227e2
jmp 0x2296c
callq 0x82b0
divsd 0x48(%rsp), %xmm0
callq 0x8470
movsd %xmm0, 0x58(%rsp)
xorl %ebx, %ebx
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
mulsd (%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0x38(%r14), %rax
movsd %xmm0, (%rax,%rbx,8)
callq 0x8370
movq 0x40(%r14), %rax
movsd %xmm0, (%rax,%rbx,8)
movsd 0x28(%rsp), %xmm0
callq 0x80d0
movsd 0xce9b3(%rip), %xmm5    # 0xf1260
movapd %xmm5, %xmm1
divsd %xmm0, %xmm1
movq 0x48(%r14), %rax
movsd %xmm1, (%rax,%rbx,8)
incq %rbx
cmpq %rbx, %r15
jne 0x2286b
movq 0x70(%rsp), %rax
cmpl $-0x2, %eax
movsd (%rsp), %xmm3
movsd 0x8(%rsp), %xmm4
jge 0x228e9
movq $0x0, 0x68(%rsp)
jmp 0x22971
leal 0x2(%rax), %ebx
xorl %edx, %edx
testl %ebx, %ebx
cmovlel %edx, %ebx
incl %ebx
xorpd %xmm6, %xmm6
movq 0x60(%rsp), %rcx
movsd 0x30(%rsp), %xmm2
movl %edx, %eax
imull %edx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
addsd %xmm2, %xmm0
ucomisd %xmm6, %xmm0
jb 0x22920
sqrtsd %xmm0, %xmm0
jmp 0x2294d
movq %rdx, %r15
callq 0x82b0
xorpd %xmm6, %xmm6
movsd 0xce92c(%rip), %xmm5    # 0xf1260
movsd 0x30(%rsp), %xmm2
movsd 0x8(%rsp), %xmm4
movsd (%rsp), %xmm3
movq %r15, %rdx
movq 0x60(%rsp), %rcx
movq 0x10(%rsp), %rax
movsd %xmm0, (%rax,%rdx,8)
movapd %xmm5, %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rbx
jne 0x22904
movq %rdx, 0x68(%rsp)
movq 0x10(%rsp), %rbx
movsd 0x58(%rsp), %xmm0
subsd %xmm4, %xmm0
divsd %xmm3, %xmm0
cvttsd2si %xmm0, %r15d
movl $0x1, %esi
testl %r13d, %r13d
jne 0x2299a
callq 0x1c5f0
movl %eax, %esi
leaq 0xe0(%rsp), %rdi
callq 0x1c6a0
xorpd %xmm0, %xmm0
movapd %xmm0, 0xb0(%rsp)
movq $0x0, 0xc0(%rsp)
movq 0x78(%rsp), %rax
cmpl %r15d, %eax
movl %r15d, %ecx
cmovll %eax, %ecx
movl %ecx, 0x58(%rsp)
testl %r15d, %r15d
movq %rbp, (%rsp)
movq %r14, 0x8(%rsp)
jle 0x22cd3
movl $0x0, 0x28(%rsp)
leaq 0x1277fd(%rip), %rax    # 0x14a1f0
addq $0x10, %rax
movq %rax, 0xd0(%rsp)
movl $0x20, %edi
callq 0x83b0
movl %r15d, %r14d
movabsq $0x100000001, %r15      # imm = 0x100000001
movq %r15, 0x8(%rax)
movq %rax, 0x30(%rsp)
movq 0xd0(%rsp), %rcx
movq %rcx, (%rax)
movl $0xa8, %edi
callq 0x83b0
movq %rax, %rbp
movq %r15, 0x8(%rax)
leaq 0x127a2e(%rip), %rax    # 0x14a470
movq %rax, (%rbp)
movq %rbp, %r15
addq $0x10, %r15
movq %r15, %rdi
leaq 0x38(%rsp), %rsi
callq 0x1d42e
movq 0x30(%rsp), %rcx
movq %r15, 0x10(%rcx)
leaq 0x127a56(%rip), %rax    # 0x14a4c0
movq %rax, 0x10(%rbp)
movq 0x70(%rsp), %rax
movl %eax, 0x40(%rbp)
movq %r12, 0x48(%rbp)
movl %r13d, 0x50(%rbp)
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x58(%rbp)
movl 0x20(%rsp), %eax
movl %eax, 0x60(%rbp)
movq 0x8(%rsp), %rax
movq %rax, 0x68(%rbp)
movl 0x28(%rsp), %eax
movl %eax, 0x70(%rbp)
movq %rbx, 0x78(%rbp)
movq 0x60(%rsp), %rax
movq %rax, 0x80(%rbp)
movq 0x98(%rsp), %rax
movl %eax, 0x88(%rbp)
movl 0x54(%rsp), %eax
movl %eax, 0x8c(%rbp)
movq 0x68(%rsp), %rax
movl %eax, 0x90(%rbp)
movq (%rsp), %rax
movq %rax, 0x98(%rbp)
movq 0x78(%rsp), %rax
movl %eax, 0xa0(%rbp)
movq %rbp, 0x18(%rcx)
movq %rcx, %rbx
movq %rcx, %r15
addq $0x10, %r15
leaq 0xa0(%rsp), %rdi
movq %r15, %rsi
callq 0x1d35e
movq %r15, 0x80(%rsp)
movq %rbx, 0x88(%rsp)
movq 0x129492(%rip), %rax    # 0x14bfb0
cmpb $0x0, (%rax)
je 0x22b28
incl 0x8(%rbx)
jmp 0x22b2c
lock
incl 0x8(%rbx)
movl %r14d, %r15d
movl $0x1, %ebp
lock
xaddl %ebp, 0x100(%rsp)
movl 0xe0(%rsp), %ecx
testl %ecx, %ecx
je 0x22bd4
xorl %ebx, %ebx
leal (%rbx,%rbp), %eax
xorl %edx, %edx
divl %ecx
movq 0x108(%rsp), %r15
imulq $0xb0, %rdx, %r13
leaq (%r15,%r13), %rdi
addq $0x58, %rdi
movq %rdi, 0x38(%rsp)
callq 0x8080
movl %eax, %r12d
testl %eax, %eax
sete 0x40(%rsp)
je 0x22b8e
leaq 0x38(%rsp), %rdi
callq 0x1d17a
jmp 0x22bb7
addq %r13, %r15
movq %r15, %rdi
leaq 0x80(%rsp), %rsi
callq 0x30124
leaq 0x38(%rsp), %rdi
callq 0x1d17a
subq $-0x80, %r15
movq %r15, %rdi
callq 0x81c0
testl %r12d, %r12d
movl %r14d, %r15d
je 0x22c64
incl %ebx
movl 0xe0(%rsp), %ecx
cmpl %ecx, %ebx
jb 0x22b4e
movl %ebp, %eax
xorl %edx, %edx
divl 0xe0(%rsp)
movq 0x108(%rsp), %r12
imulq $0xb0, %rdx, %rbx
leaq (%r12,%rbx), %rax
addq $0x58, %rax
movq %rax, 0x38(%rsp)
movb $0x0, 0x40(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x1d20a
addq %rbx, %r12
movb $0x1, 0x40(%rsp)
movq %r12, %rdi
leaq 0x80(%rsp), %rsi
callq 0x30124
movq (%rsp), %rbp
movq 0x8(%rsp), %r14
leaq 0x38(%rsp), %rdi
callq 0x1d17a
subq $-0x80, %r12
movq %r12, %rdi
callq 0x81c0
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
movq 0x10(%rsp), %rbx
je 0x22c58
callq 0x1d2a6
movq 0x18(%rsp), %r12
movl 0x24(%rsp), %r13d
jmp 0x22c8e
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x22c76
callq 0x1d2a6
movq 0x18(%rsp), %r12
movq (%rsp), %rbp
movl 0x24(%rsp), %r13d
movq 0x10(%rsp), %rbx
movq 0x8(%rsp), %r14
movq 0x30(%rsp), %rdi
callq 0x1d2a6
leaq 0xb0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x1dcb8
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x22cbf
callq 0x1d2a6
movl 0x28(%rsp), %eax
incl %eax
movl %eax, 0x28(%rsp)
cmpl 0x58(%rsp), %eax
jne 0x229ff
cmpl %r15d, 0x78(%rsp)
jle 0x22fb4
leaq 0x12750b(%rip), %rax    # 0x14a1f0
addq $0x10, %rax
movq %rax, 0x30(%rsp)
movl $0x20, %edi
callq 0x83b0
movl %r15d, %r14d
movabsq $0x100000001, %r15      # imm = 0x100000001
movq %r15, 0x8(%rax)
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rcx
movq %rcx, (%rax)
movl $0xa8, %edi
callq 0x83b0
movq %rax, %rbp
movq %r15, 0x8(%rax)
leaq 0x127822(%rip), %rax    # 0x14a550
movq %rax, (%rbp)
movq %rbp, %r15
addq $0x10, %r15
movq %r15, %rdi
leaq 0x38(%rsp), %rsi
callq 0x1d42e
movq 0x28(%rsp), %rcx
movq %r15, 0x10(%rcx)
leaq 0x12784a(%rip), %rax    # 0x14a5a0
movq %rax, 0x10(%rbp)
movq 0x78(%rsp), %rax
movl %eax, 0x3c(%rbp)
movl %r14d, 0x40(%rbp)
movq 0x70(%rsp), %rax
movl %eax, 0x50(%rbp)
movq %r12, 0x58(%rbp)
movl %r13d, 0x60(%rbp)
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x68(%rbp)
movq 0x98(%rsp), %rax
movl %eax, 0x70(%rbp)
movl 0x20(%rsp), %eax
movl %eax, 0x74(%rbp)
movq 0x8(%rsp), %rax
movq %rax, 0x78(%rbp)
movq %rbx, 0x80(%rbp)
movq 0x60(%rsp), %rax
movq %rax, 0x88(%rbp)
movl 0x54(%rsp), %eax
movl %eax, 0x90(%rbp)
movq 0x68(%rsp), %rax
movl %eax, 0x94(%rbp)
movq (%rsp), %rax
movq %rax, 0x98(%rbp)
movq %rbp, 0x18(%rcx)
movq %rcx, %rbx
movq %rcx, %r15
addq $0x10, %r15
leaq 0xa0(%rsp), %rdi
movq %r15, %rsi
callq 0x1d35e
movq %r15, 0x80(%rsp)
movq %rbx, 0x88(%rsp)
movq 0x1291ac(%rip), %rax    # 0x14bfb0
cmpb $0x0, (%rax)
je 0x22e0e
incl 0x8(%rbx)
jmp 0x22e12
lock
incl 0x8(%rbx)
movl %r14d, %r15d
movl $0x1, %ebp
lock
xaddl %ebp, 0x100(%rsp)
movl 0xe0(%rsp), %ecx
testl %ecx, %ecx
je 0x22eba
xorl %ebx, %ebx
leal (%rbx,%rbp), %eax
xorl %edx, %edx
divl %ecx
movq 0x108(%rsp), %r15
imulq $0xb0, %rdx, %r13
leaq (%r15,%r13), %rdi
addq $0x58, %rdi
movq %rdi, 0x38(%rsp)
callq 0x8080
movl %eax, %r12d
testl %eax, %eax
sete 0x40(%rsp)
je 0x22e74
leaq 0x38(%rsp), %rdi
callq 0x1d17a
jmp 0x22e9d
addq %r13, %r15
movq %r15, %rdi
leaq 0x80(%rsp), %rsi
callq 0x309f2
leaq 0x38(%rsp), %rdi
callq 0x1d17a
subq $-0x80, %r15
movq %r15, %rdi
callq 0x81c0
testl %r12d, %r12d
movl %r14d, %r15d
je 0x22f4a
incl %ebx
movl 0xe0(%rsp), %ecx
cmpl %ecx, %ebx
jb 0x22e34
movl %ebp, %eax
xorl %edx, %edx
divl 0xe0(%rsp)
movq 0x108(%rsp), %r12
imulq $0xb0, %rdx, %rbx
leaq (%r12,%rbx), %rax
addq $0x58, %rax
movq %rax, 0x38(%rsp)
movb $0x0, 0x40(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x1d20a
addq %rbx, %r12
movb $0x1, 0x40(%rsp)
movq %r12, %rdi
leaq 0x80(%rsp), %rsi
callq 0x309f2
movq (%rsp), %rbp
movq 0x8(%rsp), %r14
leaq 0x38(%rsp), %rdi
callq 0x1d17a
subq $-0x80, %r12
movq %r12, %rdi
callq 0x81c0
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
movq 0x10(%rsp), %rbx
je 0x22f3e
callq 0x1d2a6
movq 0x18(%rsp), %r12
movl 0x24(%rsp), %r13d
jmp 0x22f74
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x22f5c
callq 0x1d2a6
movq 0x18(%rsp), %r12
movq (%rsp), %rbp
movl 0x24(%rsp), %r13d
movq 0x10(%rsp), %rbx
movq 0x8(%rsp), %r14
movq 0x28(%rsp), %rdi
callq 0x1d2a6
leaq 0xb0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x1dcb8
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x22fa5
callq 0x1d2a6
addl $0x10, %r15d
cmpl 0x78(%rsp), %r15d
jl 0x22cee
movq 0xb0(%rsp), %rbx
movq 0xb8(%rsp), %r15
cmpq %r15, %rbx
je 0x22fdf
movq %rbx, %rdi
callq 0x1c724
testl %eax, %eax
jne 0x23073
addq $0x10, %rbx
jmp 0x22fc4
movq 0xb0(%rsp), %rbx
movq 0xb8(%rsp), %r15
cmpq %rbx, %r15
je 0x23017
movq %rbx, %r12
movq 0x8(%r12), %rdi
testq %rdi, %rdi
je 0x23006
callq 0x1d2a6
addq $0x10, %r12
cmpq %r15, %r12
jne 0x22ff7
movq %rbx, 0xb8(%rsp)
movq 0x10(%rsp), %rdi
callq 0x8410
movq 0x60(%rsp), %rdi
callq 0x8410
movq 0x90(%rsp), %rax
testl %eax, %eax
jle 0x2307a
movl %eax, %r15d
shlq $0x3, %r15
xorl %ebx, %ebx
xorl %r12d, %r12d
movl (%rbp), %esi
movq 0x28(%r14), %rdx
addq %r12, %rdx
movl %r13d, %edi
movsd 0x48(%rsp), %xmm0
movsd 0xd8(%rsp), %xmm2
callq 0x23262
addq $0x8, %r12
addq $0x4, %rbp
cmpq %r12, %r15
jne 0x23043
jmp 0x2307c
movl $0x1, %ebx
jmp 0x2307c
xorl %ebx, %ebx
leaq 0xb0(%rsp), %rdi
callq 0x1c770
leaq 0xe0(%rsp), %rdi
callq 0x1c7b0
jmp 0x22638
callq 0x82b0
movq 0x60(%rsp), %rax
movsd %xmm0, 0x58(%rsp)
movq 0x10(%rsp), %rbx
movsd (%rsp), %xmm3
movsd 0x8(%rsp), %xmm4
movq 0x38(%r14), %rdi
movq 0x40(%r14), %rcx
movq 0x48(%r14), %rdx
xorl %esi, %esi
movsd 0xce18f(%rip), %xmm0    # 0xf1260
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, %r15
jne 0x230d1
movsd 0x48(%rsp), %xmm1
movsd 0x58(%rsp), %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x58(%rsp)
movq 0x70(%rsp), %rcx
cmpl $-0x2, %ecx
jge 0x2312d
movq $0x0, 0x68(%rsp)
jmp 0x22976
addl $0x2, %ecx
divsd %xmm1, %xmm0
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
incl %ecx
movsd %xmm1, (%rbx,%rdx,8)
movsd %xmm0, (%rax,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x2313d
movq %rdx, 0x68(%rsp)
jmp 0x22976
jmp 0x2318f
movq %rax, %rbx
jmp 0x231da
jmp 0x231cd
movq %rax, %rbx
jmp 0x23212
jmp 0x23205
jmp 0x2318f
movq %rax, %rbx
jmp 0x23181
movq %rax, %rbx
movq %rbp, %rdi
callq 0x8380
movq 0x28(%rsp), %rdi
jmp 0x231ac
movq %rax, %rbx
jmp 0x231fe
jmp 0x231bb
movq %rax, %rbx
jmp 0x23240
movq %rax, %rbx
jmp 0x231a7
movq %rax, %rbx
movq %rbp, %rdi
callq 0x8380
movq 0x30(%rsp), %rdi
callq 0x8380
jmp 0x23240
movq %rax, %rbx
jmp 0x23236
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
jne 0x2323b
jmp 0x23240
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x1d17a
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x231ec
callq 0x1d2a6
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x231fe
callq 0x1d2a6
movq 0x28(%rsp), %rdi
jmp 0x2323b
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x1d17a
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x23224
callq 0x1d2a6
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x23236
callq 0x1d2a6
movq 0x30(%rsp), %rdi
callq 0x1d2a6
leaq 0xb0(%rsp), %rdi
callq 0x1c770
leaq 0xe0(%rsp), %rdi
callq 0x1c7b0
movq %rbx, %rdi
callq 0x8650