// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/quickshift.c
// Function: vl_quickshift_process
VL_EXPORT
void vl_quickshift_process(VlQS * q)
{
  vl_qs_type const *I = q->image;
  int        *parents = q->parents;
  vl_qs_type *E = q->density;
  vl_qs_type *dists = q->dists;
  vl_qs_type *M = 0, *n = 0 ;
  vl_qs_type sigma = q->sigma ;
  vl_qs_type tau = q->tau;
  vl_qs_type tau2 = tau*tau;

  int K = q->channels, d;
  int N1 = q->height, N2 = q->width;
  int i1,i2, j1,j2, R, tR;

  d = 2 + K ; /* Total dimensions include spatial component (x,y) */

  if (q->medoid) { /* n and M are only used in mediod shift */
    M = (vl_qs_type *) vl_calloc(N1*N2*d, sizeof(vl_qs_type)) ;
    n = (vl_qs_type *) vl_calloc(N1*N2,   sizeof(vl_qs_type)) ;
  }

  R = (int) ceil (3 * sigma) ;
  tR = (int) ceil (tau) ;

  /* -----------------------------------------------------------------
   *                                                                 n
   * -------------------------------------------------------------- */

  /* If we are doing medoid shift, initialize n to the inner product of the
   * image with itself
   */
  if (n) {
    for (i2 = 0 ; i2 < N2 ; ++ i2) {
      for (i1 = 0 ; i1 < N1 ; ++ i1) {
        n [i1 + N1 * i2] = vl_quickshift_inner(I,N1,N2,K,
                                               i1,i2,
                                               i1,i2) ;
      }
    }
  }

  /* -----------------------------------------------------------------
   *                                                 E = - [oN'*F]', M
   * -------------------------------------------------------------- */

  /*
     D_ij = d(x_i,x_j)
     E_ij = exp(- .5 * D_ij / sigma^2) ;
     F_ij = - E_ij
     E_i  = sum_j E_ij
     M_di = sum_j X_j F_ij

     E is the parzen window estimate of the density
     0 = dissimilar to everything, windowsize = identical
  */

  for (i2 = 0 ; i2 < N2 ; ++ i2) {
    for (i1 = 0 ; i1 < N1 ; ++ i1) {

      int j1min = VL_MAX(i1 - R, 0   ) ;
      int j1max = VL_MIN(i1 + R, N1-1) ;
      int j2min = VL_MAX(i2 - R, 0   ) ;
      int j2max = VL_MIN(i2 + R, N2-1) ;

      /* For each pixel in the window compute the distance between it and the
       * source pixel */
      for (j2 = j2min ; j2 <= j2max ; ++ j2) {
        for (j1 = j1min ; j1 <= j1max ; ++ j1) {
          vl_qs_type Dij = vl_quickshift_distance(I,N1,N2,K, i1,i2, j1,j2) ;
          /* Make distance a similarity */
          vl_qs_type Fij = - exp(- Dij / (2*sigma*sigma)) ;

          /* E is E_i above */
          E [i1 + N1 * i2] -= Fij ;

          if (M) {
            /* Accumulate votes for the median */
            int k ;
            M [i1 + N1*i2 + (N1*N2) * 0] += j1 * Fij ;
            M [i1 + N1*i2 + (N1*N2) * 1] += j2 * Fij ;
            for (k = 0 ; k < K ; ++k) {
              M [i1 + N1*i2 + (N1*N2) * (k+2)] +=
                I [j1 + N1*j2 + (N1*N2) * k] * Fij ;
            }
          }

        } /* j1 */
      } /* j2 */

    }  /* i1 */
  } /* i2 */

  /* -----------------------------------------------------------------
   *                                               Find best neighbors
   * -------------------------------------------------------------- */

  if (q->medoid) {

    /*
       Qij = - nj Ei - 2 sum_k Gjk Mik
       n is I.^2
    */

    /* medoid shift */
    for (i2 = 0 ; i2 < N2 ; ++i2) {
      for (i1 = 0 ; i1 < N1 ; ++i1) {

        vl_qs_type sc_best = 0  ;
        /* j1/j2 best are the best indicies for each i */
        vl_qs_type j1_best = i1 ;
        vl_qs_type j2_best = i2 ;

        int j1min = VL_MAX(i1 - R, 0   ) ;
        int j1max = VL_MIN(i1 + R, N1-1) ;
        int j2min = VL_MAX(i2 - R, 0   ) ;
        int j2max = VL_MIN(i2 + R, N2-1) ;

        for (j2 = j2min ; j2 <= j2max ; ++ j2) {
          for (j1 = j1min ; j1 <= j1max ; ++ j1) {

            vl_qs_type Qij = - n [j1 + j2 * N1] * E [i1 + i2 * N1] ;
            int k ;

            Qij -= 2 * j1 * M [i1 + i2 * N1 + (N1*N2) * 0] ;
            Qij -= 2 * j2 * M [i1 + i2 * N1 + (N1*N2) * 1] ;
            for (k = 0 ; k < K ; ++k) {
              Qij -= 2 *
                I [j1 + j2 * N1 + (N1*N2) * k] *
                M [i1 + i2 * N1 + (N1*N2) * (k + 2)] ;
            }

            if (Qij > sc_best) {
              sc_best = Qij ;
              j1_best = j1 ;
              j2_best = j2 ;
            }
          }
        }

        /* parents_i is the linear index of j which is the best pair
         * dists_i is the score of the best match
         */
        parents [i1 + N1 * i2] = j1_best + N1 * j2_best ;
        dists[i1 + N1 * i2] = sc_best ;
      }
    }

  } else {

    /* Quickshift assigns each i to the closest j which has an increase in the
     * density (E). If there is no j s.t. Ej > Ei, then dists_i == inf (a root
     * node in one of the trees of merges).
     */
    for (i2 = 0 ; i2 < N2 ; ++i2) {
      for (i1 = 0 ; i1 < N1 ; ++i1) {

        vl_qs_type E0 = E [i1 + N1 * i2] ;
        vl_qs_type d_best = VL_QS_INF ;
        vl_qs_type j1_best = i1   ;
        vl_qs_type j2_best = i2   ;

        int j1min = VL_MAX(i1 - tR, 0   ) ;
        int j1max = VL_MIN(i1 + tR, N1-1) ;
        int j2min = VL_MAX(i2 - tR, 0   ) ;
        int j2max = VL_MIN(i2 + tR, N2-1) ;

        for (j2 = j2min ; j2 <= j2max ; ++ j2) {
          for (j1 = j1min ; j1 <= j1max ; ++ j1) {
            if (E [j1 + N1 * j2] > E0) {
              vl_qs_type Dij = vl_quickshift_distance(I,N1,N2,K, i1,i2, j1,j2) ;
              if (Dij <= tau2 && Dij < d_best) {
                d_best = Dij ;
                j1_best = j1 ;
                j2_best = j2 ;
              }
            }
          }
        }

        /* parents is the index of the best pair */
        /* dists_i is the minimal distance, inf implies no Ej > Ei within
         * distance tau from the point */
        parents [i1 + N1 * i2] = j1_best + N1 * j2_best ;
        dists[i1 + N1 * i2] = sqrt(d_best) ;
      }
    }
  }

  if (M) vl_free(M) ;
  if (n) vl_free(n) ;
}

// Assembly:
subq $0x158, %rsp            # imm = 0x158
movq %rdi, 0x150(%rsp)
movq 0x150(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x148(%rsp)
movq 0x150(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x140(%rsp)
movq 0x150(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x138(%rsp)
movq 0x150(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x130(%rsp)
movq $0x0, 0x128(%rsp)
movq $0x0, 0x120(%rsp)
movq 0x150(%rsp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x118(%rsp)
movq 0x150(%rsp), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, 0x110(%rsp)
movsd 0x110(%rsp), %xmm0
mulsd 0x110(%rsp), %xmm0
movsd %xmm0, 0x108(%rsp)
movq 0x150(%rsp), %rax
movl 0x10(%rax), %eax
movl %eax, 0x104(%rsp)
movq 0x150(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0xfc(%rsp)
movq 0x150(%rsp), %rax
movl 0xc(%rax), %eax
movl %eax, 0xf8(%rsp)
movl 0x104(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x100(%rsp)
movq 0x150(%rsp), %rax
cmpl $0x0, 0x14(%rax)
je 0x47612
movl 0xfc(%rsp), %eax
imull 0xf8(%rsp), %eax
imull 0x100(%rsp), %eax
movslq %eax, %rdi
movl $0x8, %esi
callq 0x9a70
movq %rax, 0x128(%rsp)
movl 0xfc(%rsp), %eax
imull 0xf8(%rsp), %eax
movslq %eax, %rdi
movl $0x8, %esi
callq 0x9a70
movq %rax, 0x120(%rsp)
movsd 0x11aae(%rip), %xmm0    # 0x590c8
mulsd 0x118(%rsp), %xmm0
callq 0x9b70
cvttsd2si %xmm0, %eax
movl %eax, 0xe4(%rsp)
movsd 0x110(%rsp), %xmm0
callq 0x9b70
cvttsd2si %xmm0, %eax
movl %eax, 0xe0(%rsp)
cmpq $0x0, 0x120(%rsp)
je 0x4773a
movl $0x0, 0xf0(%rsp)
movl 0xf0(%rsp), %eax
cmpl 0xf8(%rsp), %eax
jge 0x47738
movl $0x0, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
cmpl 0xfc(%rsp), %eax
jge 0x47720
movq 0x148(%rsp), %rdi
movl 0xfc(%rsp), %esi
movl 0xf8(%rsp), %edx
movl 0x104(%rsp), %ecx
movl 0xf4(%rsp), %r8d
movl 0xf0(%rsp), %r9d
movl 0xf4(%rsp), %r10d
movl 0xf0(%rsp), %eax
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x484b0
movq 0x120(%rsp), %rax
movl 0xf4(%rsp), %ecx
movl 0xfc(%rsp), %edx
imull 0xf0(%rsp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x47685
jmp 0x47722
movl 0xf0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf0(%rsp)
jmp 0x47666
jmp 0x4773a
movl $0x0, 0xf0(%rsp)
movl 0xf0(%rsp), %eax
cmpl 0xf8(%rsp), %eax
jge 0x47baa
movl $0x0, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
cmpl 0xfc(%rsp), %eax
jge 0x47b92
movl 0xf4(%rsp), %eax
subl 0xe4(%rsp), %eax
cmpl $0x0, %eax
jle 0x4779f
movl 0xf4(%rsp), %eax
subl 0xe4(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0x477a7
xorl %eax, %eax
movl %eax, 0x44(%rsp)
jmp 0x477a7
movl 0x44(%rsp), %eax
movl %eax, 0xdc(%rsp)
movl 0xf4(%rsp), %eax
addl 0xe4(%rsp), %eax
movl 0xfc(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x477e2
movl 0xf4(%rsp), %eax
addl 0xe4(%rsp), %eax
movl %eax, 0x40(%rsp)
jmp 0x477f0
movl 0xfc(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x40(%rsp)
movl 0x40(%rsp), %eax
movl %eax, 0xd8(%rsp)
movl 0xf0(%rsp), %eax
subl 0xe4(%rsp), %eax
cmpl $0x0, %eax
jle 0x47822
movl 0xf0(%rsp), %eax
subl 0xe4(%rsp), %eax
movl %eax, 0x3c(%rsp)
jmp 0x4782a
xorl %eax, %eax
movl %eax, 0x3c(%rsp)
jmp 0x4782a
movl 0x3c(%rsp), %eax
movl %eax, 0xd4(%rsp)
movl 0xf0(%rsp), %eax
addl 0xe4(%rsp), %eax
movl 0xf8(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x47865
movl 0xf0(%rsp), %eax
addl 0xe4(%rsp), %eax
movl %eax, 0x38(%rsp)
jmp 0x47873
movl 0xf8(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x38(%rsp)
movl 0x38(%rsp), %eax
movl %eax, 0xd0(%rsp)
movl 0xd4(%rsp), %eax
movl %eax, 0xe8(%rsp)
movl 0xe8(%rsp), %eax
cmpl 0xd0(%rsp), %eax
jg 0x47b7a
movl 0xdc(%rsp), %eax
movl %eax, 0xec(%rsp)
movl 0xec(%rsp), %eax
cmpl 0xd8(%rsp), %eax
jg 0x47b62
movq 0x148(%rsp), %rdi
movl 0xfc(%rsp), %esi
movl 0xf8(%rsp), %edx
movl 0x104(%rsp), %ecx
movl 0xf4(%rsp), %r8d
movl 0xf0(%rsp), %r9d
movl 0xec(%rsp), %r10d
movl 0xe8(%rsp), %eax
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x485a0
movsd %xmm0, 0xc8(%rsp)
movsd 0xc8(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x117a4(%rip), %xmm1    # 0x590e0
mulsd 0x118(%rsp), %xmm1
mulsd 0x118(%rsp), %xmm1
divsd %xmm1, %xmm0
callq 0x9c10
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0xc0(%rsp)
movsd 0xc0(%rsp), %xmm1
movq 0x138(%rsp), %rax
movl 0xf4(%rsp), %ecx
movl 0xfc(%rsp), %edx
imull 0xf0(%rsp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
cmpq $0x0, 0x128(%rsp)
je 0x47b4a
cvtsi2sdl 0xec(%rsp), %xmm0
movsd 0xc0(%rsp), %xmm2
movq 0x128(%rsp), %rax
movl 0xf4(%rsp), %ecx
movl 0xfc(%rsp), %edx
imull 0xf0(%rsp), %edx
addl %edx, %ecx
movl 0xfc(%rsp), %edx
imull 0xf8(%rsp), %edx
imull $0x0, %edx, %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
cvtsi2sdl 0xe8(%rsp), %xmm0
movsd 0xc0(%rsp), %xmm2
movq 0x128(%rsp), %rax
movl 0xf4(%rsp), %ecx
movl 0xfc(%rsp), %edx
imull 0xf0(%rsp), %edx
addl %edx, %ecx
movl 0xfc(%rsp), %edx
imull 0xf8(%rsp), %edx
shll $0x0, %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl $0x0, 0xbc(%rsp)
movl 0xbc(%rsp), %eax
cmpl 0x104(%rsp), %eax
jge 0x47b48
movq 0x148(%rsp), %rax
movl 0xec(%rsp), %ecx
movl 0xfc(%rsp), %edx
imull 0xe8(%rsp), %edx
addl %edx, %ecx
movl 0xfc(%rsp), %edx
imull 0xf8(%rsp), %edx
imull 0xbc(%rsp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0xc0(%rsp), %xmm2
movq 0x128(%rsp), %rax
movl 0xf4(%rsp), %ecx
movl 0xfc(%rsp), %edx
imull 0xf0(%rsp), %edx
addl %edx, %ecx
movl 0xfc(%rsp), %edx
imull 0xf8(%rsp), %edx
movl 0xbc(%rsp), %esi
addl $0x2, %esi
imull %esi, %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl 0xbc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xbc(%rsp)
jmp 0x47a81
jmp 0x47b4a
jmp 0x47b4c
movl 0xec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xec(%rsp)
jmp 0x478ae
jmp 0x47b64
movl 0xe8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xe8(%rsp)
jmp 0x4788c
jmp 0x47b7c
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x47764
jmp 0x47b94
movl 0xf0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf0(%rsp)
jmp 0x47745
movq 0x150(%rsp), %rax
cmpl $0x0, 0x14(%rax)
je 0x480f8
movl $0x0, 0xf0(%rsp)
movl 0xf0(%rsp), %eax
cmpl 0xf8(%rsp), %eax
jge 0x480f3
movl $0x0, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
cmpl 0xfc(%rsp), %eax
jge 0x480db
xorps %xmm0, %xmm0
movsd %xmm0, 0xb0(%rsp)
cvtsi2sdl 0xf4(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
cvtsi2sdl 0xf0(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
movl 0xf4(%rsp), %eax
subl 0xe4(%rsp), %eax
cmpl $0x0, %eax
jle 0x47c51
movl 0xf4(%rsp), %eax
subl 0xe4(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0x47c59
xorl %eax, %eax
movl %eax, 0x34(%rsp)
jmp 0x47c59
movl 0x34(%rsp), %eax
movl %eax, 0x9c(%rsp)
movl 0xf4(%rsp), %eax
addl 0xe4(%rsp), %eax
movl 0xfc(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x47c94
movl 0xf4(%rsp), %eax
addl 0xe4(%rsp), %eax
movl %eax, 0x30(%rsp)
jmp 0x47ca2
movl 0xfc(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x30(%rsp)
movl 0x30(%rsp), %eax
movl %eax, 0x98(%rsp)
movl 0xf0(%rsp), %eax
subl 0xe4(%rsp), %eax
cmpl $0x0, %eax
jle 0x47cd4
movl 0xf0(%rsp), %eax
subl 0xe4(%rsp), %eax
movl %eax, 0x2c(%rsp)
jmp 0x47cdc
xorl %eax, %eax
movl %eax, 0x2c(%rsp)
jmp 0x47cdc
movl 0x2c(%rsp), %eax
movl %eax, 0x94(%rsp)
movl 0xf0(%rsp), %eax
addl 0xe4(%rsp), %eax
movl 0xf8(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x47d17
movl 0xf0(%rsp), %eax
addl 0xe4(%rsp), %eax
movl %eax, 0x28(%rsp)
jmp 0x47d25
movl 0xf8(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x28(%rsp)
movl 0x28(%rsp), %eax
movl %eax, 0x90(%rsp)
movl 0x94(%rsp), %eax
movl %eax, 0xe8(%rsp)
movl 0xe8(%rsp), %eax
cmpl 0x90(%rsp), %eax
jg 0x48047
movl 0x9c(%rsp), %eax
movl %eax, 0xec(%rsp)
movl 0xec(%rsp), %eax
cmpl 0x98(%rsp), %eax
jg 0x4802f
movq 0x120(%rsp), %rax
movl 0xec(%rsp), %ecx
movl 0xe8(%rsp), %edx
imull 0xfc(%rsp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq 0x138(%rsp), %rax
movl 0xf4(%rsp), %ecx
movl 0xf0(%rsp), %edx
imull 0xfc(%rsp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x88(%rsp)
movl 0xec(%rsp), %eax
shll %eax
cvtsi2sd %eax, %xmm0
movq 0x128(%rsp), %rax
movl 0xf4(%rsp), %ecx
movl 0xf0(%rsp), %edx
imull 0xfc(%rsp), %edx
addl %edx, %ecx
movl 0xfc(%rsp), %edx
imull 0xf8(%rsp), %edx
imull $0x0, %edx, %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm2
movsd 0x88(%rsp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x88(%rsp)
movl 0xe8(%rsp), %eax
shll %eax
cvtsi2sd %eax, %xmm0
movq 0x128(%rsp), %rax
movl 0xf4(%rsp), %ecx
movl 0xf0(%rsp), %edx
imull 0xfc(%rsp), %edx
addl %edx, %ecx
movl 0xfc(%rsp), %edx
imull 0xf8(%rsp), %edx
shll $0x0, %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm2
movsd 0x88(%rsp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x88(%rsp)
movl $0x0, 0x84(%rsp)
movl 0x84(%rsp), %eax
cmpl 0x104(%rsp), %eax
jge 0x47fcd
movq 0x148(%rsp), %rax
movl 0xec(%rsp), %ecx
movl 0xe8(%rsp), %edx
imull 0xfc(%rsp), %edx
addl %edx, %ecx
movl 0xfc(%rsp), %edx
imull 0xf8(%rsp), %edx
imull 0x84(%rsp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd 0x111a5(%rip), %xmm0    # 0x590e0
mulsd (%rax,%rcx,8), %xmm0
movq 0x128(%rsp), %rax
movl 0xf4(%rsp), %ecx
movl 0xf0(%rsp), %edx
imull 0xfc(%rsp), %edx
addl %edx, %ecx
movl 0xfc(%rsp), %edx
imull 0xf8(%rsp), %edx
movl 0x84(%rsp), %esi
addl $0x2, %esi
imull %esi, %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm2
movsd 0x88(%rsp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x88(%rsp)
movl 0x84(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x84(%rsp)
jmp 0x47ee3
movsd 0x88(%rsp), %xmm0
ucomisd 0xb0(%rsp), %xmm0
jbe 0x48017
movsd 0x88(%rsp), %xmm0
movsd %xmm0, 0xb0(%rsp)
cvtsi2sdl 0xec(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
cvtsi2sdl 0xe8(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
jmp 0x48019
movl 0xec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xec(%rsp)
jmp 0x47d60
jmp 0x48031
movl 0xe8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xe8(%rsp)
jmp 0x47d3e
movsd 0xa8(%rsp), %xmm1
cvtsi2sdl 0xfc(%rsp), %xmm0
movsd 0xa0(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %edx
movq 0x140(%rsp), %rax
movl 0xf4(%rsp), %ecx
movl 0xfc(%rsp), %esi
imull 0xf0(%rsp), %esi
addl %esi, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movsd 0xb0(%rsp), %xmm0
movq 0x130(%rsp), %rax
movl 0xf4(%rsp), %ecx
movl 0xfc(%rsp), %edx
imull 0xf0(%rsp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x47be6
jmp 0x480dd
movl 0xf0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf0(%rsp)
jmp 0x47bc7
jmp 0x48472
movl $0x0, 0xf0(%rsp)
movl 0xf0(%rsp), %eax
cmpl 0xf8(%rsp), %eax
jge 0x48470
movl $0x0, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
cmpl 0xfc(%rsp), %eax
jge 0x48458
movq 0x138(%rsp), %rax
movl 0xf4(%rsp), %ecx
movl 0xfc(%rsp), %edx
imull 0xf0(%rsp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x78(%rsp)
movsd 0x11fb4(%rip), %xmm0    # 0x5a120
movsd %xmm0, 0x70(%rsp)
cvtsi2sdl 0xf4(%rsp), %xmm0
movsd %xmm0, 0x68(%rsp)
cvtsi2sdl 0xf0(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
movl 0xf4(%rsp), %eax
subl 0xe0(%rsp), %eax
cmpl $0x0, %eax
jle 0x481b7
movl 0xf4(%rsp), %eax
subl 0xe0(%rsp), %eax
movl %eax, 0x24(%rsp)
jmp 0x481bf
xorl %eax, %eax
movl %eax, 0x24(%rsp)
jmp 0x481bf
movl 0x24(%rsp), %eax
movl %eax, 0x5c(%rsp)
movl 0xf4(%rsp), %eax
addl 0xe0(%rsp), %eax
movl 0xfc(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x481f7
movl 0xf4(%rsp), %eax
addl 0xe0(%rsp), %eax
movl %eax, 0x20(%rsp)
jmp 0x48205
movl 0xfc(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x20(%rsp)
movl 0x20(%rsp), %eax
movl %eax, 0x58(%rsp)
movl 0xf0(%rsp), %eax
subl 0xe0(%rsp), %eax
cmpl $0x0, %eax
jle 0x48234
movl 0xf0(%rsp), %eax
subl 0xe0(%rsp), %eax
movl %eax, 0x1c(%rsp)
jmp 0x4823c
xorl %eax, %eax
movl %eax, 0x1c(%rsp)
jmp 0x4823c
movl 0x1c(%rsp), %eax
movl %eax, 0x54(%rsp)
movl 0xf0(%rsp), %eax
addl 0xe0(%rsp), %eax
movl 0xf8(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x48274
movl 0xf0(%rsp), %eax
addl 0xe0(%rsp), %eax
movl %eax, 0x18(%rsp)
jmp 0x48282
movl 0xf8(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x18(%rsp)
movl 0x18(%rsp), %eax
movl %eax, 0x50(%rsp)
movl 0x54(%rsp), %eax
movl %eax, 0xe8(%rsp)
movl 0xe8(%rsp), %eax
cmpl 0x50(%rsp), %eax
jg 0x483c8
movl 0x5c(%rsp), %eax
movl %eax, 0xec(%rsp)
movl 0xec(%rsp), %eax
cmpl 0x58(%rsp), %eax
jg 0x483b0
movq 0x138(%rsp), %rax
movl 0xec(%rsp), %ecx
movl 0xfc(%rsp), %edx
imull 0xe8(%rsp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd 0x78(%rsp), %xmm0
jbe 0x48398
movq 0x148(%rsp), %rdi
movl 0xfc(%rsp), %esi
movl 0xf8(%rsp), %edx
movl 0x104(%rsp), %ecx
movl 0xf4(%rsp), %r8d
movl 0xf0(%rsp), %r9d
movl 0xec(%rsp), %r10d
movl 0xe8(%rsp), %eax
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x485a0
movsd %xmm0, 0x48(%rsp)
movsd 0x48(%rsp), %xmm1
movsd 0x108(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x48396
movsd 0x48(%rsp), %xmm1
movsd 0x70(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x48396
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x70(%rsp)
cvtsi2sdl 0xec(%rsp), %xmm0
movsd %xmm0, 0x68(%rsp)
cvtsi2sdl 0xe8(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
jmp 0x48398
jmp 0x4839a
movl 0xec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xec(%rsp)
jmp 0x482b1
jmp 0x483b2
movl 0xe8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xe8(%rsp)
jmp 0x48295
movsd 0x68(%rsp), %xmm1
cvtsi2sdl 0xfc(%rsp), %xmm0
movsd 0x60(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %edx
movq 0x140(%rsp), %rax
movl 0xf4(%rsp), %ecx
movl 0xfc(%rsp), %esi
imull 0xf0(%rsp), %esi
addl %esi, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movsd 0x70(%rsp), %xmm0
callq 0x9b20
movq 0x130(%rsp), %rax
movl 0xf4(%rsp), %ecx
movl 0xfc(%rsp), %edx
imull 0xf0(%rsp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x48122
jmp 0x4845a
movl 0xf0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf0(%rsp)
jmp 0x48103
jmp 0x48472
cmpq $0x0, 0x128(%rsp)
je 0x4848a
movq 0x128(%rsp), %rdi
callq 0x9620
cmpq $0x0, 0x120(%rsp)
je 0x484a2
movq 0x120(%rsp), %rdi
callq 0x9620
addq $0x158, %rsp            # imm = 0x158
retq
nopw (%rax,%rax)