// File: /workspace/github_c_makefile_star2_O3/zpole[P]IICV/vl/sift.c
// Function: vl_sift_detect
VL_EXPORT
void
vl_sift_detect (VlSiftFilt * f)
{
  vl_sift_pix* dog   = f-> dog ;
  int          s_min = f-> s_min ;
  int          s_max = f-> s_max ;
  int          w     = f-> octave_width ;
  int          h     = f-> octave_height ;
  double       te    = f-> edge_thresh ;
  double       tp    = f-> peak_thresh ;

  int const    xo    = 1 ;      /* x-stride */
  int const    yo    = w ;      /* y-stride */
  int const    so    = w * h ;  /* s-stride */

  double       xper  = pow (2.0, f->o_cur) ;

  int x, y, s, i, ii, jj ;
  vl_sift_pix *pt, v ;
  VlSiftKeypoint *k ;

  /* clear current list */
  f-> nkeys = 0 ;

  /* compute difference of gaussian (DoG) */
  pt = f-> dog ;
  for (s = s_min ; s <= s_max - 1 ; ++s) {
    vl_sift_pix* src_a = vl_sift_get_octave (f, s    ) ;
    vl_sift_pix* src_b = vl_sift_get_octave (f, s + 1) ;
    vl_sift_pix* end_a = src_a + w * h ;
    while (src_a != end_a) {
      *pt++ = *src_b++ - *src_a++ ;
    }
  }

  /* -----------------------------------------------------------------
   *                                          Find local maxima of DoG
   * -------------------------------------------------------------- */

  /* start from dog [1,1,s_min+1] */
  pt  = dog + xo + yo + so ;

  for(s = s_min + 1 ; s <= s_max - 2 ; ++s) {
    for(y = 1 ; y < h - 1 ; ++y) {
      for(x = 1 ; x < w - 1 ; ++x) {
        v = *pt ;

#define CHECK_NEIGHBORS(CMP,SGN)                    \
        ( v CMP ## = SGN 0.8 * tp &&                \
          v CMP *(pt + xo) &&                       \
          v CMP *(pt - xo) &&                       \
          v CMP *(pt + so) &&                       \
          v CMP *(pt - so) &&                       \
          v CMP *(pt + yo) &&                       \
          v CMP *(pt - yo) &&                       \
                                                    \
          v CMP *(pt + yo + xo) &&                  \
          v CMP *(pt + yo - xo) &&                  \
          v CMP *(pt - yo + xo) &&                  \
          v CMP *(pt - yo - xo) &&                  \
                                                    \
          v CMP *(pt + xo      + so) &&             \
          v CMP *(pt - xo      + so) &&             \
          v CMP *(pt + yo      + so) &&             \
          v CMP *(pt - yo      + so) &&             \
          v CMP *(pt + yo + xo + so) &&             \
          v CMP *(pt + yo - xo + so) &&             \
          v CMP *(pt - yo + xo + so) &&             \
          v CMP *(pt - yo - xo + so) &&             \
                                                    \
          v CMP *(pt + xo      - so) &&             \
          v CMP *(pt - xo      - so) &&             \
          v CMP *(pt + yo      - so) &&             \
          v CMP *(pt - yo      - so) &&             \
          v CMP *(pt + yo + xo - so) &&             \
          v CMP *(pt + yo - xo - so) &&             \
          v CMP *(pt - yo + xo - so) &&             \
          v CMP *(pt - yo - xo - so) )

        if (CHECK_NEIGHBORS(>,+) ||
            CHECK_NEIGHBORS(<,-) ) {

          /* make room for more keypoints */
          if (f->nkeys >= f->keys_res) {
            f->keys_res += 500 ;
            if (f->keys) {
              f->keys = vl_realloc (f->keys,
                                    f->keys_res *
                                    sizeof(VlSiftKeypoint)) ;
            } else {
              f->keys = vl_malloc (f->keys_res *
                                   sizeof(VlSiftKeypoint)) ;
            }
          }

          k = f->keys + (f->nkeys ++) ;

          k-> ix = x ;
          k-> iy = y ;
          k-> is = s ;
        }
        pt += 1 ;
      }
      pt += 2 ;
    }
    pt += 2 * yo ;
  }

  /* -----------------------------------------------------------------
   *                                               Refine local maxima
   * -------------------------------------------------------------- */

  /* this pointer is used to write the keypoints back */
  k = f->keys ;

  for (i = 0 ; i < f->nkeys ; ++i) {

    int x = f-> keys [i] .ix ;
    int y = f-> keys [i] .iy ;
    int s = f-> keys [i]. is ;

    double Dx=0,Dy=0,Ds=0,Dxx=0,Dyy=0,Dss=0,Dxy=0,Dxs=0,Dys=0 ;
    double A [3*3], b [3] ;

    int dx = 0 ;
    int dy = 0 ;

    int iter, i, j ;

    for (iter = 0 ; iter < 5 ; ++iter) {

      x += dx ;
      y += dy ;

      pt = dog
        + xo * x
        + yo * y
        + so * (s - s_min) ;

      /** @brief Index GSS @internal */
#define at(dx,dy,ds) (*( pt + (dx)*xo + (dy)*yo + (ds)*so))

      /** @brief Index matrix A @internal */
#define Aat(i,j)     (A[(i)+(j)*3])

      /* compute the gradient */
      Dx = 0.5 * (at(+1,0,0) - at(-1,0,0)) ;
      Dy = 0.5 * (at(0,+1,0) - at(0,-1,0));
      Ds = 0.5 * (at(0,0,+1) - at(0,0,-1)) ;

      /* compute the Hessian */
      Dxx = (at(+1,0,0) + at(-1,0,0) - 2.0 * at(0,0,0)) ;
      Dyy = (at(0,+1,0) + at(0,-1,0) - 2.0 * at(0,0,0)) ;
      Dss = (at(0,0,+1) + at(0,0,-1) - 2.0 * at(0,0,0)) ;

      Dxy = 0.25 * ( at(+1,+1,0) + at(-1,-1,0) - at(-1,+1,0) - at(+1,-1,0) ) ;
      Dxs = 0.25 * ( at(+1,0,+1) + at(-1,0,-1) - at(-1,0,+1) - at(+1,0,-1) ) ;
      Dys = 0.25 * ( at(0,+1,+1) + at(0,-1,-1) - at(0,-1,+1) - at(0,+1,-1) ) ;

      /* solve linear system ....................................... */
      Aat(0,0) = Dxx ;
      Aat(1,1) = Dyy ;
      Aat(2,2) = Dss ;
      Aat(0,1) = Aat(1,0) = Dxy ;
      Aat(0,2) = Aat(2,0) = Dxs ;
      Aat(1,2) = Aat(2,1) = Dys ;

      b[0] = - Dx ;
      b[1] = - Dy ;
      b[2] = - Ds ;

      /* Gauss elimination */
      for(j = 0 ; j < 3 ; ++j) {
        double maxa    = 0 ;
        double maxabsa = 0 ;
        int    maxi    = -1 ;
        double tmp ;

        /* look for the maximally stable pivot */
        for (i = j ; i < 3 ; ++i) {
          double a    = Aat (i,j) ;
          double absa = vl_abs_d (a) ;
          if (absa > maxabsa) {
            maxa    = a ;
            maxabsa = absa ;
            maxi    = i ;
          }
        }

        /* if singular give up */
        if (maxabsa < 1e-10f) {
          b[0] = 0 ;
          b[1] = 0 ;
          b[2] = 0 ;
          break ;
        }

        i = maxi ;

        /* swap j-th row with i-th row and normalize j-th row */
        for(jj = j ; jj < 3 ; ++jj) {
          tmp = Aat(i,jj) ; Aat(i,jj) = Aat(j,jj) ; Aat(j,jj) = tmp ;
          Aat(j,jj) /= maxa ;
        }
        tmp = b[j] ; b[j] = b[i] ; b[i] = tmp ;
        b[j] /= maxa ;

        /* elimination */
        for (ii = j+1 ; ii < 3 ; ++ii) {
          double x = Aat(ii,j) ;
          for (jj = j ; jj < 3 ; ++jj) {
            Aat(ii,jj) -= x * Aat(j,jj) ;
          }
          b[ii] -= x * b[j] ;
        }
      }

      /* backward substitution */
      for (i = 2 ; i > 0 ; --i) {
        double x = b[i] ;
        for (ii = i-1 ; ii >= 0 ; --ii) {
          b[ii] -= x * Aat(ii,i) ;
        }
      }

      /* .......................................................... */
      /* If the translation of the keypoint is big, move the keypoint
       * and re-iterate the computation. Otherwise we are all set.
       */

      dx= ((b[0] >  0.6 && x < w - 2) ?  1 : 0)
        + ((b[0] < -0.6 && x > 1    ) ? -1 : 0) ;

      dy= ((b[1] >  0.6 && y < h - 2) ?  1 : 0)
        + ((b[1] < -0.6 && y > 1    ) ? -1 : 0) ;

      if (dx == 0 && dy == 0) break ;
    }

    /* check threshold and other conditions */
    {
      double val   = at(0,0,0)
        + 0.5 * (Dx * b[0] + Dy * b[1] + Ds * b[2]) ;
      double score = (Dxx+Dyy)*(Dxx+Dyy) / (Dxx*Dyy - Dxy*Dxy) ;
      double xn = x + b[0] ;
      double yn = y + b[1] ;
      double sn = s + b[2] ;

      vl_bool good =
        vl_abs_d (val)  > tp                  &&
        score           < (te+1)*(te+1)/te    &&
        score           >= 0                  &&
        vl_abs_d (b[0]) <  1.5                &&
        vl_abs_d (b[1]) <  1.5                &&
        vl_abs_d (b[2]) <  1.5                &&
        xn              >= 0                  &&
        xn              <= w - 1              &&
        yn              >= 0                  &&
        yn              <= h - 1              &&
        sn              >= s_min              &&
        sn              <= s_max ;

      if (good) {
        k-> o     = f->o_cur ;
        k-> ix    = x ;
        k-> iy    = y ;
        k-> is    = s ;
        k-> s     = sn ;
        k-> x     = xn * xper ;
        k-> y     = yn * xper ;
        k-> sigma = f->sigma0 * pow (2.0, sn/f->S) * xper ;
        ++ k ;
      }

    } /* done checking */
  } /* next keypoint to refine */

  /* update keypoint count */
  f-> nkeys = (int)(k - f->keys) ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rdi, %rbx
movq 0x50(%rdi), %rax
movq %rax, 0xb8(%rsp)
movl 0x34(%rdi), %ebp
movl 0x3c(%rdi), %edi
movslq 0x38(%rbx), %r15
movq 0x58(%rbx), %rax
movq %rax, %xmm0
movdqa %xmm0, 0xa0(%rsp)
pshufd $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movd %xmm0, %ecx
movsd 0x90(%rbx), %xmm0
movsd %xmm0, 0x128(%rsp)
movsd 0x88(%rbx), %xmm0
movsd %xmm0, 0x58(%rsp)
movq %rcx, 0x78(%rsp)
movl %ecx, %r14d
movq %rax, 0x68(%rsp)
imull %eax, %r14d
movq 0x64fe(%rip), %xmm0     # 0x32270
callq 0x90c0
movq %rbx, %r10
movl $0x0, 0x80(%rbx)
cmpl %r15d, %ebp
jge 0x2be22
movslq %ebp, %rax
movq 0x48(%r10), %r8
movq 0x50(%r10), %rcx
movl 0x5c(%r10), %edx
imull 0x58(%r10), %edx
movslq 0x34(%r10), %rsi
movslq %r14d, %rdi
movslq %edx, %rdx
movq %rax, %r9
subq %rsi, %r9
movq %r9, %rsi
imulq %rdx, %rsi
leaq (%r8,%rsi,4), %rsi
movq %rdi, 0x90(%rsp)
leaq (,%rdi,4), %rdi
incq %r9
imulq %rdx, %r9
shlq $0x2, %rdx
leaq (%r8,%r9,4), %r8
movdqa 0xa0(%rsp), %xmm12
movsd 0x58(%rsp), %xmm13
testl %r14d, %r14d
je 0x2be12
xorl %r9d, %r9d
movss (%r8,%r9), %xmm1
subss (%rsi,%r9), %xmm1
movss %xmm1, (%rcx,%r9)
addq $0x4, %r9
cmpq %r9, %rdi
jne 0x2bdf4
addq %r9, %rcx
incq %rax
addq %rdx, %rsi
addq %rdx, %r8
cmpq %r15, %rax
jne 0x2bdec
jmp 0x2be3e
movslq %r14d, %rax
movq %rax, 0x90(%rsp)
movdqa 0xa0(%rsp), %xmm12
movsd 0x58(%rsp), %xmm13
leal -0x2(%r15), %eax
movl %eax, 0x9c(%rsp)
cmpl %eax, %ebp
movq 0x78(%rsp), %rsi
jge 0x2cba6
movq %r15, 0x120(%rsp)
movl %r14d, 0x4c(%rsp)
movslq 0x68(%rsp), %rdx
movq 0xb8(%rsp), %rax
leaq (%rax,%rdx,4), %rax
movq 0x90(%rsp), %rcx
leaq 0x4(%rax,%rcx,4), %r14
movsd 0x63df(%rip), %xmm3     # 0x32268
mulsd %xmm13, %xmm3
movsd 0x7502(%rip), %xmm4     # 0x33398
mulsd %xmm13, %xmm4
leal (%rdx,%rdx), %eax
cltq
movq %rax, 0x130(%rsp)
leal -0x2(%rdx), %r12d
leal -0x2(%rsi), %r9d
leaq (,%rcx,4), %r11
movq %r11, %rax
negq %rax
movq %rdx, 0x148(%rsp)
leaq (,%rdx,4), %rbx
movq %rax, %rdx
leaq (%rbx,%rcx,4), %rax
movq %rax, 0xe0(%rsp)
movq %rbx, %rax
subq %r11, %rax
movq %rax, 0xd0(%rsp)
movq %rbx, %rax
negq %rax
movq %rax, 0x80(%rsp)
movq %r11, %rax
subq %rbx, %rax
movq %rax, 0x140(%rsp)
movq %rdx, %rcx
movq %rbx, 0x88(%rsp)
subq %rbx, %rcx
movq %rcx, 0x138(%rsp)
movq $0x0, 0x70(%rsp)
movl %ebp, 0x50(%rsp)
movq %r10, 0x20(%rsp)
incl %ebp
movl %ebp, 0x54(%rsp)
cmpl $0x3, 0x78(%rsp)
jl 0x2c425
movl $0x1, %ebp
cmpl $0x3, 0x68(%rsp)
jl 0x2c413
leaq (%r14,%r11), %rax
movq %rax, (%rsp)
leaq (%r14,%rdx), %rax
movq %rax, 0x8(%rsp)
movq 0x88(%rsp), %rax
addq %r14, %rax
movq %rax, 0x60(%rsp)
movq 0xe0(%rsp), %rax
leaq (%r14,%rax), %rcx
movq 0xd0(%rsp), %rax
leaq (%r14,%rax), %r8
movq 0x80(%rsp), %rax
addq %r14, %rax
movq %rax, 0x18(%rsp)
movq 0x140(%rsp), %rax
leaq (%r14,%rax), %rsi
movq 0x138(%rsp), %rax
addq %r14, %rax
movq %rax, 0x28(%rsp)
xorl %r13d, %r13d
xorl %ebx, %ebx
movq %r8, 0x10(%rsp)
movq %rcx, %r15
movq %rbx, %rax
incq %rbx
movss (%r14,%rax,4), %xmm2
xorps %xmm1, %xmm1
cvtss2sd %xmm2, %xmm1
ucomisd %xmm3, %xmm1
jb 0x2c10d
ucomiss 0x4(%r14,%rax,4), %xmm2
jbe 0x2c10d
ucomiss -0x4(%r14,%rax,4), %xmm2
jbe 0x2c10d
movq (%rsp), %rcx
ucomiss (%rcx,%rax,4), %xmm2
jbe 0x2c10d
movq 0x8(%rsp), %rcx
ucomiss (%rcx,%rax,4), %xmm2
movq 0x60(%rsp), %rcx
jbe 0x2c10d
ucomiss (%rcx,%rax,4), %xmm2
jbe 0x2c10d
movq %rsi, %rdi
movq 0x18(%rsp), %rsi
ucomiss (%rsi,%rax,4), %xmm2
movq %rdi, %rsi
jbe 0x2c10d
ucomiss 0x4(%rcx,%rax,4), %xmm2
jbe 0x2c10d
ucomiss -0x4(%rcx,%rax,4), %xmm2
jbe 0x2c10d
movq 0x18(%rsp), %rcx
ucomiss 0x4(%rcx,%rax,4), %xmm2
jbe 0x2c10d
movq 0x18(%rsp), %rcx
ucomiss -0x4(%rcx,%rax,4), %xmm2
jbe 0x2c10d
movq (%rsp), %rcx
ucomiss 0x4(%rcx,%rax,4), %xmm2
jbe 0x2c10d
movq (%rsp), %rcx
ucomiss -0x4(%rcx,%rax,4), %xmm2
jbe 0x2c10d
ucomiss (%r15,%rax,4), %xmm2
jbe 0x2c10d
ucomiss (%rsi,%rax,4), %xmm2
jbe 0x2c10d
ucomiss 0x4(%r15,%rax,4), %xmm2
jbe 0x2c10d
ucomiss -0x4(%r15,%rax,4), %xmm2
jbe 0x2c10d
ucomiss 0x4(%rsi,%rax,4), %xmm2
jbe 0x2c10d
ucomiss -0x4(%rsi,%rax,4), %xmm2
jbe 0x2c10d
movq 0x8(%rsp), %rcx
ucomiss 0x4(%rcx,%rax,4), %xmm2
jbe 0x2c10d
movq 0x8(%rsp), %rcx
ucomiss -0x4(%rcx,%rax,4), %xmm2
jbe 0x2c10d
ucomiss (%r8,%rax,4), %xmm2
jbe 0x2c10d
movq 0x28(%rsp), %rcx
ucomiss (%rcx,%rax,4), %xmm2
jbe 0x2c10d
ucomiss 0x4(%r8,%rax,4), %xmm2
jbe 0x2c10d
ucomiss -0x4(%r8,%rax,4), %xmm2
jbe 0x2c10d
movq 0x28(%rsp), %rcx
ucomiss 0x4(%rcx,%rax,4), %xmm2
jbe 0x2c10d
movq 0x28(%rsp), %rcx
ucomiss -0x4(%rcx,%rax,4), %xmm2
ja 0x2c2e2
ucomisd %xmm1, %xmm4
jb 0x2c353
movss 0x4(%r14,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c353
movss -0x4(%r14,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
movq %r15, %rcx
jbe 0x2c356
movq (%rsp), %r8
movss (%r8,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c368
movq 0x8(%rsp), %rcx
movss (%rcx,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
movq 0x10(%rsp), %r8
jbe 0x2c353
movq 0x60(%rsp), %rcx
movss (%rcx,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c353
movq %rsi, %rdi
movq 0x18(%rsp), %rsi
movss (%rsi,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c36f
movss 0x4(%rcx,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
movq %rdi, %rsi
jbe 0x2c353
movss -0x4(%rcx,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c353
movq 0x18(%rsp), %rsi
movss 0x4(%rsi,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
movq %r15, %rcx
jbe 0x2c372
movss -0x4(%rsi,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c372
movq (%rsp), %r8
movss 0x4(%r8,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
movq %rdi, %rsi
jbe 0x2c368
movss -0x4(%r8,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c368
movss (%rcx,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
movq 0x10(%rsp), %r8
jbe 0x2c356
movss (%rsi,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c356
movss 0x4(%rcx,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c356
movss -0x4(%rcx,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c356
movss 0x4(%rsi,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c356
movss -0x4(%rsi,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c356
movq 0x8(%rsp), %rdi
movss 0x4(%rdi,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c356
movss -0x4(%rdi,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c356
movss (%r8,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c356
movq 0x28(%rsp), %rdi
movss (%rdi,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c356
movss 0x4(%r8,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c356
movss -0x4(%r8,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c356
movq 0x28(%rsp), %rcx
movss 0x4(%rcx,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c353
movq 0x28(%rsp), %rcx
movss -0x4(%rcx,%rax,4), %xmm1
ucomiss %xmm2, %xmm1
jbe 0x2c353
movq %rsi, 0xf8(%rsp)
movq %rdx, 0x100(%rsp)
movq %r11, 0x108(%rsp)
movl %r9d, 0x98(%rsp)
movsd %xmm4, 0x110(%rsp)
movsd %xmm3, 0x118(%rsp)
movdqa %xmm0, 0xc0(%rsp)
movslq 0x84(%r10), %rsi
movq 0x78(%r10), %rax
cmpl %esi, 0x70(%rsp)
jl 0x2c388
addq $0x1f4, %rsi            # imm = 0x1F4
movq 0x20(%rsp), %rcx
movl %esi, 0x84(%rcx)
shlq $0x5, %rsi
testq %rax, %rax
je 0x2c377
movq %rax, %rdi
callq 0x93e0
jmp 0x2c37f
movq %r15, %rcx
addq $-0x4, %r13
cmpl %ebx, %r12d
jne 0x2bfbf
jmp 0x2c410
movq 0x10(%rsp), %r8
jmp 0x2c356
movq %r15, %rcx
movq %rdi, %rsi
jmp 0x2c356
movq %rsi, %rdi
callq 0x95b0
movq 0x20(%rsp), %rcx
movq %rax, 0x78(%rcx)
movq 0x20(%rsp), %r10
movslq 0x80(%r10), %rdx
leal 0x1(%rdx), %ecx
movq %rcx, 0x70(%rsp)
movl %ecx, 0x80(%r10)
shlq $0x5, %rdx
movl %ebx, 0x4(%rax,%rdx)
movl %ebp, 0x8(%rax,%rdx)
movl 0x54(%rsp), %esi
movl %esi, 0xc(%rax,%rdx)
movdqa 0xa0(%rsp), %xmm12
movsd 0x58(%rsp), %xmm13
movdqa 0xc0(%rsp), %xmm0
movsd 0x118(%rsp), %xmm3
movsd 0x110(%rsp), %xmm4
movl 0x98(%rsp), %r9d
movq 0x108(%rsp), %r11
movq 0x100(%rsp), %rdx
movq %r15, %rcx
movq 0x10(%rsp), %r8
movq 0xf8(%rsp), %rsi
jmp 0x2c356
subq %r13, %r14
addq $0x8, %r14
leal 0x1(%rbp), %eax
cmpl %r9d, %ebp
movl %eax, %ebp
jne 0x2bf45
movq 0x130(%rsp), %rax
leaq (%r14,%rax,4), %r14
movl 0x54(%rsp), %ebp
cmpl 0x9c(%rsp), %ebp
jne 0x2bf2f
movq 0x78(%r10), %rdx
cmpl $0x0, 0x70(%rsp)
jle 0x2cbaf
movq %rdx, 0x8(%rsp)
movq 0x68(%rsp), %rcx
movl %ecx, %eax
negl %eax
movslq %eax, %rbx
movl 0x4c(%rsp), %eax
negl %eax
paddd 0x6f6f(%rip), %xmm12    # 0x333e0
movslq %eax, %r12
movdqa %xmm0, %xmm2
movsd 0x5def(%rip), %xmm15    # 0x32270
movsd 0x128(%rsp), %xmm0
addsd %xmm0, %xmm15
mulsd %xmm15, %xmm15
leal -0x1(%rcx), %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd %xmm1, 0x10(%rsp)
movq 0x78(%rsp), %rax
decl %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd %xmm1, 0x60(%rsp)
xorps %xmm1, %xmm1
cvtsi2sdl 0x50(%rsp), %xmm1
movsd %xmm1, 0x18(%rsp)
divsd %xmm0, %xmm15
xorps %xmm0, %xmm0
cvtsi2sdl 0x120(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movdqa %xmm2, 0xc0(%rsp)
movdqa %xmm2, %xmm0
punpcklqdq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0]
movdqa %xmm0, 0xd0(%rsp)
xorl %ecx, %ecx
leaq 0x150(%rsp), %r14
movq 0x78(%r10), %rax
movq %rcx, (%rsp)
shlq $0x5, %rcx
movq 0x4(%rax,%rcx), %xmm1
movl 0xc(%rax,%rcx), %eax
movl %eax, %ecx
subl 0x50(%rsp), %ecx
imull 0x4c(%rsp), %ecx
movslq %ecx, %rcx
xorl %edx, %edx
pxor %xmm0, %xmm0
movdqa %xmm1, %xmm2
movdqa %xmm0, %xmm1
paddd %xmm2, %xmm1
pshufd $0x55, %xmm1, %xmm0     # xmm0 = xmm1[1,1,1,1]
movd %xmm0, %esi
movd %xmm1, %edi
movslq %edi, %rdi
movq 0xb8(%rsp), %r8
leaq (%r8,%rdi,4), %rdi
imull 0x68(%rsp), %esi
movslq %esi, %rsi
leaq (%rdi,%rsi,4), %rsi
leaq (%rsi,%rcx,4), %rdi
movss -0x4(%rdi), %xmm0
movss 0x4(%rdi), %xmm7
movq 0x148(%rsp), %rsi
leaq (%rdi,%rsi,4), %rsi
movss (%rsi), %xmm4
leaq (%rdi,%rbx,4), %r8
movss (%r8), %xmm6
movq 0x90(%rsp), %r9
movss (%rdi,%r9,4), %xmm5
movss (%rdi,%r12,4), %xmm9
movaps %xmm5, %xmm8
subss %xmm9, %xmm8
movaps %xmm7, %xmm2
addss %xmm0, %xmm2
cvtss2sd %xmm2, %xmm2
xorps %xmm3, %xmm3
cvtss2sd (%rdi), %xmm3
movaps %xmm3, %xmm10
mulsd 0x5c22(%rip), %xmm10    # 0x321e8
addsd %xmm10, %xmm2
unpcklps %xmm4, %xmm7            # xmm7 = xmm7[0],xmm4[0],xmm7[1],xmm4[1]
addss %xmm6, %xmm4
cvtss2sd %xmm4, %xmm4
addsd %xmm10, %xmm4
addss %xmm9, %xmm5
cvtss2sd %xmm5, %xmm5
addsd %xmm10, %xmm5
movss 0x4(%rdi,%r9,4), %xmm9
movss 0x4(%rsi), %xmm10
unpcklps %xmm9, %xmm10           # xmm10 = xmm10[0],xmm9[0],xmm10[1],xmm9[1]
movss -0x4(%rdi,%r12,4), %xmm9
movss -0x4(%r8), %xmm11
unpcklps %xmm9, %xmm11           # xmm11 = xmm11[0],xmm9[0],xmm11[1],xmm9[1]
addps %xmm10, %xmm11
movss -0x4(%rdi,%r9,4), %xmm9
movss -0x4(%rsi), %xmm10
unpcklps %xmm9, %xmm10           # xmm10 = xmm10[0],xmm9[0],xmm10[1],xmm9[1]
subps %xmm10, %xmm11
movss 0x4(%rdi,%r12,4), %xmm9
movss 0x4(%r8), %xmm10
unpcklps %xmm9, %xmm10           # xmm10 = xmm10[0],xmm9[0],xmm10[1],xmm9[1]
movss (%rsi,%r9,4), %xmm9
addss (%r8,%r12,4), %xmm9
subss (%r8,%r9,4), %xmm9
subss (%rsi,%r12,4), %xmm9
subps %xmm10, %xmm11
movsd %xmm2, 0x150(%rsp)
movsd %xmm4, 0x170(%rsp)
movsd %xmm5, 0x190(%rsp)
cvtss2sd %xmm9, %xmm9
mulsd 0x5b76(%rip), %xmm9     # 0x321f0
cvtps2pd %xmm11, %xmm5
movapd 0x5a49(%rip), %xmm10    # 0x320d0
mulpd 0x5a51(%rip), %xmm5     # 0x320e0
movlpd %xmm5, 0x168(%rsp)
movupd %xmm5, 0x158(%rsp)
movhpd %xmm5, 0x180(%rsp)
movsd %xmm9, 0x178(%rsp)
movsd %xmm9, 0x188(%rsp)
unpcklps %xmm6, %xmm0            # xmm0 = xmm0[0],xmm6[0],xmm0[1],xmm6[1]
xorps %xmm6, %xmm6
cvtss2sd %xmm8, %xmm6
mulsd 0x5b0f(%rip), %xmm6     # 0x321e0
subps %xmm0, %xmm7
cvtps2pd %xmm7, %xmm7
mulpd 0x5a11(%rip), %xmm7     # 0x320f0
movapd %xmm7, %xmm0
xorpd %xmm10, %xmm0
movapd %xmm0, 0x30(%rsp)
movapd %xmm6, %xmm0
xorpd %xmm10, %xmm0
movlpd %xmm0, 0x40(%rsp)
movl $0x48, %esi
movl $0x1, %edi
movq %r14, %r8
movq %r14, %r9
xorl %r10d, %r10d
leaq (%r10,%r10,2), %r11
xorps %xmm8, %xmm8
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %r15d, %r15d
xorpd %xmm9, %xmm9
movapd 0x59d2(%rip), %xmm14    # 0x32100
movaps %xmm8, %xmm10
movsd (%r9,%r15,8), %xmm11
movapd %xmm11, %xmm8
andpd %xmm14, %xmm8
leal (%r10,%r15), %r13d
ucomisd %xmm10, %xmm8
movapd %xmm10, %xmm0
cmpltsd %xmm8, %xmm0
andpd %xmm0, %xmm11
andnpd %xmm9, %xmm0
orpd %xmm11, %xmm0
maxsd %xmm10, %xmm8
cmoval %r13d, %ebp
leaq (%r10,%r15), %r13
incq %r13
incq %r15
movapd %xmm0, %xmm9
cmpq $0x3, %r13
jne 0x2c72e
movsd 0x6c14(%rip), %xmm9     # 0x333a0
ucomisd %xmm8, %xmm9
ja 0x2c88e
movslq %ebp, %r15
leaq (%r8,%r15,8), %r13
xorl %ebp, %ebp
movapd 0x5927(%rip), %xmm10    # 0x320d0
movsd (%r13,%rbp), %xmm8
movsd (%r9,%rbp), %xmm9
movsd %xmm9, (%r13,%rbp)
divsd %xmm0, %xmm8
movsd %xmm8, (%r9,%rbp)
addq $0x18, %rbp
cmpq %rbp, %rsi
jne 0x2c7a9
movsd 0x30(%rsp,%r10,8), %xmm8
movsd 0x30(%rsp,%r15,8), %xmm9
movsd %xmm9, 0x30(%rsp,%r10,8)
movsd %xmm8, 0x30(%rsp,%r15,8)
movsd 0x30(%rsp,%r10,8), %xmm8
divsd %xmm0, %xmm8
movsd %xmm8, 0x30(%rsp,%r10,8)
cmpq $0x1, %r10
ja 0x2c86f
movq %r10, %r15
leaq (%r15,%r11), %r13
movsd 0x158(%rsp,%r13,8), %xmm0
xorpd %xmm10, %xmm0
leaq (%rdi,%r15), %r13
leaq (%rsp,%r13,8), %r13
addq $0x150, %r13            # imm = 0x150
xorl %ebp, %ebp
movsd (%r9,%rbp), %xmm8
mulsd %xmm0, %xmm8
addsd (%r13,%rbp), %xmm8
movsd %xmm8, (%r13,%rbp)
addq $0x18, %rbp
cmpq %rbp, %rsi
jne 0x2c82d
mulsd 0x30(%rsp,%r10,8), %xmm0
addsd 0x38(%rsp,%r15,8), %xmm0
movsd %xmm0, 0x38(%rsp,%r15,8)
testq %r15, %r15
movl $0x1, %r15d
je 0x2c809
incq %r10
addq $0x20, %r9
addq $0x18, %r8
addq $-0x18, %rsi
addq $0x3, %rdi
cmpq $0x3, %r10
jne 0x2c710
jmp 0x2c8aa
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movapd 0x5826(%rip), %xmm10    # 0x320d0
movl $0x2, %r8d
movl $0x3, %esi
leaq 0x188(%rsp), %rdi
movsd 0x30(%rsp,%r8,8), %xmm0
xorpd %xmm10, %xmm0
movq %rdi, %r9
movq %rsi, %r10
movsd (%r9), %xmm8
mulsd %xmm0, %xmm8
addsd 0x20(%rsp,%r10,8), %xmm8
movsd %xmm8, 0x20(%rsp,%r10,8)
decq %r10
addq $-0x8, %r9
cmpq $0x1, %r10
ja 0x2c8cf
leaq -0x1(%r8), %r9
decq %rsi
addq $-0x20, %rdi
cmpq $0x1, %r8
movq %r9, %r8
ja 0x2c8bd
movdqa %xmm12, %xmm0
pcmpgtd %xmm1, %xmm0
pshufd $0x50, %xmm0, %xmm9     # xmm9 = xmm0[0,0,1,1]
pshufd $0x50, %xmm1, %xmm10    # xmm10 = xmm1[0,0,1,1]
pcmpgtd 0x68ba(%rip), %xmm10    # 0x331e0
movapd 0x30(%rsp), %xmm8
movapd 0x6abb(%rip), %xmm0     # 0x333f0
cmpltpd %xmm8, %xmm0
andpd %xmm9, %xmm0
movapd %xmm8, %xmm9
cmpltpd 0x6ac1(%rip), %xmm9     # 0x33410
andpd %xmm10, %xmm9
movapd %xmm0, %xmm10
xorpd %xmm9, %xmm10
psllq $0x3f, %xmm10
movmskpd %xmm10, %esi
testl %esi, %esi
je 0x2c98d
andpd 0x6a8b(%rip), %xmm0     # 0x33400
paddd %xmm9, %xmm0
pshufd $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3]
leal 0x1(%rdx), %esi
cmpl $0x4, %edx
movl %esi, %edx
jb 0x2c52f
movapd %xmm7, %xmm0
mulpd %xmm8, %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
mulsd %xmm8, %xmm7
addsd %xmm0, %xmm7
movsd 0x40(%rsp), %xmm0
mulsd %xmm0, %xmm6
addsd %xmm7, %xmm6
mulsd 0x5827(%rip), %xmm6     # 0x321e0
addsd %xmm3, %xmm6
movapd 0x573b(%rip), %xmm7     # 0x32100
andpd %xmm7, %xmm6
ucomisd %xmm13, %xmm6
jbe 0x2cb7f
movapd %xmm2, %xmm3
addsd %xmm4, %xmm3
mulsd %xmm3, %xmm3
mulsd %xmm5, %xmm5
mulsd %xmm4, %xmm2
subsd %xmm5, %xmm2
divsd %xmm2, %xmm3
xorpd %xmm2, %xmm2
cmplepd %xmm3, %xmm2
cmpltpd %xmm15, %xmm3
andpd %xmm2, %xmm3
movd %xmm3, %ecx
movapd %xmm8, %xmm2
andpd %xmm7, %xmm2
cmpltpd 0x6a07(%rip), %xmm2     # 0x33420
movmskpd %xmm2, %edx
andl %edx, %ecx
shrb %dl
andb %dl, %cl
cmpb $0x1, %cl
movq 0x20(%rsp), %r10
jne 0x2cb84
movapd %xmm0, %xmm2
andpd %xmm7, %xmm2
movsd 0x57cf(%rip), %xmm3     # 0x32210
ucomisd %xmm2, %xmm3
movq (%rsp), %rcx
jbe 0x2cb88
cvtdq2pd %xmm1, %xmm2
addpd %xmm2, %xmm8
ucomisd 0x55cf(%rip), %xmm8     # 0x32030
jb 0x2cb88
movsd 0x10(%rsp), %xmm2
ucomisd %xmm8, %xmm2
jb 0x2cb88
movapd %xmm8, %xmm2
unpckhpd %xmm8, %xmm2            # xmm2 = xmm2[1],xmm8[1]
ucomisd 0x55a6(%rip), %xmm2     # 0x32030
jb 0x2cb88
movsd 0x60(%rsp), %xmm3
ucomisd %xmm2, %xmm3
jb 0x2cb88
xorps %xmm2, %xmm2
cvtsi2sd %eax, %xmm2
addsd %xmm2, %xmm0
ucomisd 0x18(%rsp), %xmm0
jb 0x2cb88
movsd 0x88(%rsp), %xmm2
ucomisd %xmm0, %xmm2
jb 0x2cb88
movl 0x3c(%r10), %ecx
movq 0x8(%rsp), %r15
movl %ecx, (%r15)
movq %xmm1, 0x4(%r15)
movl %eax, 0xc(%r15)
cvtsd2ss %xmm0, %xmm1
movss %xmm1, 0x18(%r15)
mulpd 0xd0(%rsp), %xmm8
cvtpd2ps %xmm8, %xmm1
movlpd %xmm1, 0x10(%r15)
movsd 0x8(%r10), %xmm1
movsd %xmm1, 0x80(%rsp)
xorps %xmm1, %xmm1
cvtsi2sdl 0x2c(%r10), %xmm1
divsd %xmm1, %xmm0
movdqa %xmm12, 0xa0(%rsp)
movapd %xmm15, 0xe0(%rsp)
callq 0x9040
movq (%rsp), %rcx
movapd 0xe0(%rsp), %xmm15
movsd 0x58(%rsp), %xmm13
movdqa 0xa0(%rsp), %xmm12
movq 0x20(%rsp), %r10
mulsd 0x80(%rsp), %xmm0
mulsd 0xc0(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1c(%r15)
addq $0x20, %r15
movq %r15, 0x8(%rsp)
jmp 0x2cb88
movq 0x20(%rsp), %r10
movq (%rsp), %rcx
incq %rcx
movslq 0x80(%r10), %rax
cmpq %rax, %rcx
jl 0x2c505
movq 0x78(%r10), %rax
movq 0x8(%rsp), %rdx
jmp 0x2cbb2
movq 0x78(%r10), %rax
movq %rax, %rdx
jmp 0x2cbb2
movq %rdx, %rax
subq %rax, %rdx
shrq $0x5, %rdx
movl %edx, 0x80(%r10)
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq