// File: /workspace/github_c_makefile_star2_O1/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 $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %rbx
movq 0x50(%rdi), %rax
movq %rax, 0xd8(%rsp)
movl 0x34(%rdi), %ebp
movl 0x3c(%rdi), %edi
movslq 0x38(%rbx), %r15
movq 0x58(%rbx), %rax
movq %rax, %xmm0
movdqa %xmm0, 0xe0(%rsp)
pshufd $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movd %xmm0, %ecx
movsd 0x90(%rbx), %xmm0
movsd %xmm0, 0x130(%rsp)
movsd 0x88(%rbx), %xmm0
movsd %xmm0, 0x88(%rsp)
movq %rcx, 0xc8(%rsp)
movl %ecx, %r14d
movq %rax, 0xb8(%rsp)
imull %eax, %r14d
movsd 0x723d(%rip), %xmm0     # 0x33260
callq 0x90c0
movq %r15, %r11
movq %rbx, %r10
movaps %xmm0, 0x150(%rsp)
movl $0x0, 0x80(%rbx)
movl %r14d, 0x3c(%rsp)
movslq %r14d, %rax
movq %rax, 0xb0(%rsp)
movl %ebp, 0x1c(%rsp)
cmpl %r11d, %ebp
jge 0x2c0e0
movslq 0x1c(%rsp), %rax
movq 0x48(%r10), %r8
movq 0x50(%r10), %rcx
movl 0x5c(%r10), %edx
imull 0x58(%r10), %edx
movslq 0x34(%r10), %rsi
movslq %edx, %rdx
movq %rax, %r9
subq %rsi, %r9
movq %r9, %rsi
imulq %rdx, %rsi
leaq (%r8,%rsi,4), %rsi
movq 0xb0(%rsp), %rdi
leaq (,%rdi,4), %rdi
incq %r9
imulq %rdx, %r9
shlq $0x2, %rdx
leaq (%r8,%r9,4), %r8
cmpl $0x0, 0x3c(%rsp)
je 0x2c0d2
xorl %r9d, %r9d
movss (%r8,%r9), %xmm0
subss (%rsi,%r9), %xmm0
movss %xmm0, (%rcx,%r9)
addq $0x4, %r9
cmpq %r9, %rdi
jne 0x2c0b4
addq %r9, %rcx
incq %rax
addq %rdx, %rsi
addq %rdx, %r8
cmpq %r11, %rax
jne 0x2c0aa
movslq 0xb8(%rsp), %rax
movq %rax, 0xd0(%rsp)
leal -0x2(%r11), %r8d
cmpl %r8d, 0x1c(%rsp)
movq %r10, 0x80(%rsp)
movdqa 0xe0(%rsp), %xmm11
movsd 0x88(%rsp), %xmm12
jge 0x2c737
movq 0xb0(%rsp), %rax
leaq (,%rax,4), %r9
movq 0xd0(%rsp), %rcx
leaq (%r9,%rcx,4), %rdx
pshufd $0x50, %xmm11, %xmm0    # xmm0 = xmm11[0,0,1,1]
pcmpgtd 0x82ab(%rip), %xmm0     # 0x343f0
movq 0xd8(%rsp), %rax
leaq (%rax,%rdx), %rbx
addq $0x4, %rbx
movmskpd %xmm0, %esi
movl %esi, %ebp
shrb %bpl
movsd 0x70f2(%rip), %xmm2     # 0x33258
mulsd %xmm12, %xmm2
movsd 0x8235(%rip), %xmm3     # 0x343a8
mulsd %xmm12, %xmm3
leal (%rcx,%rcx), %eax
cltq
movq %rax, 0x138(%rsp)
leal -0x2(%rcx), %r12d
movq 0xc8(%rsp), %rax
leal -0x2(%rax), %r14d
movq %r9, %rax
negq %rax
movq %rax, 0xa0(%rsp)
leaq (,%rcx,4), %r15
movl %ebp, %ecx
movq %r15, %rax
subq %r9, %rax
movq %rax, 0xf0(%rsp)
movq %r15, %r13
negq %r13
movq %r9, %rbp
movq %r15, 0x98(%rsp)
subq %r15, %rbp
movq %rbp, 0x148(%rsp)
movq %r13, 0x90(%rsp)
subq %r9, %r13
movq %r13, 0x140(%rsp)
movl 0x1c(%rsp), %eax
movl %r14d, 0xa8(%rsp)
incl %eax
testb %cl, %cl
movl %eax, 0x6c(%rsp)
je 0x2c71e
movl $0x1, %ebp
testb $0x1, %sil
je 0x2c70c
leaq (%rbx,%r9), %r14
movq 0xa0(%rsp), %rax
addq %rbx, %rax
movq %rax, 0x30(%rsp)
movq 0x98(%rsp), %rax
leaq (%rbx,%rax), %rax
movq %rax, 0x10(%rsp)
leaq (%rbx,%rdx), %rax
movq %rax, 0x20(%rsp)
movq 0xf0(%rsp), %rax
leaq (%rbx,%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x90(%rsp), %rax
addq %rbx, %rax
movq %rax, 0x70(%rsp)
movq 0x148(%rsp), %rax
addq %rbx, %rax
movq %rax, 0x28(%rsp)
movq 0x140(%rsp), %rax
addq %rbx, %rax
movq %rax, 0x40(%rsp)
xorl %r15d, %r15d
xorl %r13d, %r13d
movq %r13, %rax
incq %r13
movss (%rbx,%rax,4), %xmm0
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
ucomisd %xmm2, %xmm1
jb 0x2c3fe
ucomiss 0x4(%rbx,%rax,4), %xmm0
jbe 0x2c3fe
ucomiss -0x4(%rbx,%rax,4), %xmm0
jbe 0x2c3fe
ucomiss (%r14,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x30(%rsp), %rdi
ucomiss (%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x10(%rsp), %rdi
ucomiss (%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x70(%rsp), %rdi
ucomiss (%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x10(%rsp), %rdi
ucomiss 0x4(%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x10(%rsp), %rdi
ucomiss -0x4(%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x70(%rsp), %rdi
ucomiss 0x4(%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x70(%rsp), %rdi
ucomiss -0x4(%rdi,%rax,4), %xmm0
jbe 0x2c3fe
ucomiss 0x4(%r14,%rax,4), %xmm0
jbe 0x2c3fe
ucomiss -0x4(%r14,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x20(%rsp), %rdi
ucomiss (%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x28(%rsp), %rdi
ucomiss (%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x20(%rsp), %rdi
ucomiss 0x4(%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x20(%rsp), %rdi
ucomiss -0x4(%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x28(%rsp), %rdi
ucomiss 0x4(%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x28(%rsp), %rdi
ucomiss -0x4(%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x30(%rsp), %rdi
ucomiss 0x4(%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x30(%rsp), %rdi
ucomiss -0x4(%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x48(%rsp), %rdi
ucomiss (%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x40(%rsp), %rdi
ucomiss (%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x48(%rsp), %rdi
ucomiss 0x4(%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x48(%rsp), %rdi
ucomiss -0x4(%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x40(%rsp), %rdi
ucomiss 0x4(%rdi,%rax,4), %xmm0
jbe 0x2c3fe
movq 0x40(%rsp), %rdi
ucomiss -0x4(%rdi,%rax,4), %xmm0
ja 0x2c5f2
ucomisd %xmm1, %xmm3
jb 0x2c6f4
movss 0x4(%rbx,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movss -0x4(%rbx,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movss (%r14,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x30(%rsp), %rdi
movss (%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x10(%rsp), %rdi
movss (%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x70(%rsp), %rdi
movss (%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x10(%rsp), %rdi
movss 0x4(%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x10(%rsp), %rdi
movss -0x4(%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x70(%rsp), %rdi
movss 0x4(%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x70(%rsp), %rdi
movss -0x4(%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movss 0x4(%r14,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movss -0x4(%r14,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x20(%rsp), %rdi
movss (%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x28(%rsp), %rdi
movss (%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x20(%rsp), %rdi
movss 0x4(%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x20(%rsp), %rdi
movss -0x4(%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x28(%rsp), %rdi
movss 0x4(%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x28(%rsp), %rdi
movss -0x4(%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x30(%rsp), %rdi
movss 0x4(%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x30(%rsp), %rdi
movss -0x4(%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x48(%rsp), %rdi
movss (%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x40(%rsp), %rdi
movss (%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x48(%rsp), %rdi
movss 0x4(%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x48(%rsp), %rdi
movss -0x4(%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x40(%rsp), %rdi
movss 0x4(%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movq 0x40(%rsp), %rdi
movss -0x4(%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c6f4
movb %cl, 0xf(%rsp)
movl %esi, 0xc4(%rsp)
movq %rdx, 0x128(%rsp)
movslq 0x84(%r10), %rsi
cmpl %esi, 0x80(%r10)
jl 0x2c6b7
movsd %xmm3, 0x108(%rsp)
movsd %xmm2, 0x110(%rsp)
movq %r9, 0x118(%rsp)
movl %r8d, 0xc0(%rsp)
movq %r11, 0x120(%rsp)
addq $0x1f4, %rsi            # imm = 0x1F4
movl %esi, 0x84(%r10)
movq 0x78(%r10), %rdi
shlq $0x5, %rsi
testq %rdi, %rdi
je 0x2c665
callq 0x93e0
jmp 0x2c66d
movq %rsi, %rdi
callq 0x95b0
movq 0x80(%rsp), %r10
movq %rax, 0x78(%r10)
movdqa 0xe0(%rsp), %xmm11
movsd 0x88(%rsp), %xmm12
movq 0x120(%rsp), %r11
movl 0xc0(%rsp), %r8d
movq 0x118(%rsp), %r9
movsd 0x110(%rsp), %xmm2
movsd 0x108(%rsp), %xmm3
movq 0x78(%r10), %rax
movslq 0x80(%r10), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x80(%r10)
shlq $0x5, %rcx
movl %r13d, 0x4(%rax,%rcx)
movl %ebp, 0x8(%rax,%rcx)
movl 0x6c(%rsp), %edx
movl %edx, 0xc(%rax,%rcx)
movq 0x128(%rsp), %rdx
movl 0xc4(%rsp), %esi
movb 0xf(%rsp), %cl
addq $-0x4, %r15
cmpl %r13d, %r12d
jne 0x2c288
subq %r15, %rbx
movl 0xa8(%rsp), %r14d
addq $0x8, %rbx
leal 0x1(%rbp), %eax
cmpl %r14d, %ebp
movl %eax, %ebp
jne 0x2c209
movq 0x138(%rsp), %rax
leaq (%rbx,%rax,4), %rbx
movl 0x6c(%rsp), %eax
cmpl %r8d, %eax
jne 0x2c1f6
movq 0x78(%r10), %rax
movq %rax, 0x20(%rsp)
cmpl $0x0, 0x80(%r10)
jle 0x2cecb
movq 0xb8(%rsp), %rcx
movl %ecx, %eax
negl %eax
cltq
movq %rax, 0x30(%rsp)
movl 0x3c(%rsp), %eax
negl %eax
movslq %eax, %rbx
paddd 0x7c8d(%rip), %xmm11    # 0x34400
movsd 0x6ae4(%rip), %xmm14    # 0x33260
movsd 0x130(%rsp), %xmm0
addsd %xmm0, %xmm14
mulsd %xmm14, %xmm14
divsd %xmm0, %xmm14
leal -0x1(%rcx), %eax
cvtsi2sd %eax, %xmm15
movq 0xc8(%rsp), %rax
decl %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x28(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x1c(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %r11d, %xmm0
movsd %xmm0, 0xa0(%rsp)
movdqa 0x150(%rsp), %xmm0
punpcklqdq %xmm0, %xmm0    # xmm0 = xmm0[0,0]
movdqa %xmm0, 0xf0(%rsp)
xorl %ecx, %ecx
leaq 0x160(%rsp), %r14
movq 0x78(%r10), %rax
movq %rcx, 0x10(%rsp)
shlq $0x5, %rcx
movq 0x4(%rax,%rcx), %xmm1
movl 0xc(%rax,%rcx), %eax
movl %eax, 0x70(%rsp)
subl 0x1c(%rsp), %eax
imull 0x3c(%rsp), %eax
movslq %eax, %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, %eax
movd %xmm1, %esi
movslq %esi, %rsi
movq 0xd8(%rsp), %rdi
leaq (%rdi,%rsi,4), %rsi
imull 0xb8(%rsp), %eax
cltq
leaq (%rsi,%rax,4), %rax
leaq (%rax,%rcx,4), %rsi
movss -0x4(%rsi), %xmm0
movss 0x4(%rsi), %xmm6
movq 0xd0(%rsp), %rax
leaq (%rsi,%rax,4), %rdi
movss (%rdi), %xmm3
movq 0x30(%rsp), %rax
leaq (%rsi,%rax,4), %r8
movss (%r8), %xmm5
movq 0xb0(%rsp), %rax
movss (%rsi,%rax,4), %xmm4
movss (%rsi,%rbx,4), %xmm8
movaps %xmm4, %xmm7
subss %xmm8, %xmm7
movaps %xmm6, %xmm2
addss %xmm0, %xmm2
xorps %xmm9, %xmm9
cvtss2sd (%rsi), %xmm9
cvtss2sd %xmm2, %xmm2
mulsd 0x691b(%rip), %xmm9     # 0x331d8
addsd %xmm9, %xmm2
unpcklps %xmm3, %xmm6            # xmm6 = xmm6[0],xmm3[0],xmm6[1],xmm3[1]
addss %xmm5, %xmm3
cvtss2sd %xmm3, %xmm3
addsd %xmm9, %xmm3
addss %xmm8, %xmm4
cvtss2sd %xmm4, %xmm4
addsd %xmm9, %xmm4
movss 0x4(%rsi,%rax,4), %xmm8
movss 0x4(%rdi), %xmm9
unpcklps %xmm8, %xmm9            # xmm9 = xmm9[0],xmm8[0],xmm9[1],xmm8[1]
movss -0x4(%rsi,%rbx,4), %xmm8
movss -0x4(%r8), %xmm10
unpcklps %xmm8, %xmm10           # xmm10 = xmm10[0],xmm8[0],xmm10[1],xmm8[1]
addps %xmm9, %xmm10
movss -0x4(%rsi,%rax,4), %xmm8
movss -0x4(%rdi), %xmm9
unpcklps %xmm8, %xmm9            # xmm9 = xmm9[0],xmm8[0],xmm9[1],xmm8[1]
subps %xmm9, %xmm10
movss 0x4(%rsi,%rbx,4), %xmm8
movss 0x4(%r8), %xmm9
unpcklps %xmm8, %xmm9            # xmm9 = xmm9[0],xmm8[0],xmm9[1],xmm8[1]
movss (%rdi,%rax,4), %xmm8
addss (%r8,%rbx,4), %xmm8
subss (%r8,%rax,4), %xmm8
subss (%rdi,%rbx,4), %xmm8
subps %xmm9, %xmm10
movsd %xmm2, 0x160(%rsp)
movsd %xmm3, 0x180(%rsp)
movsd %xmm4, 0x1a0(%rsp)
cvtss2sd %xmm8, %xmm8
mulsd 0x686f(%rip), %xmm8     # 0x331e0
cvtps2pd %xmm10, %xmm4
movapd 0x6752(%rip), %xmm9     # 0x330d0
mulpd 0x675a(%rip), %xmm4     # 0x330e0
movlpd %xmm4, 0x178(%rsp)
movupd %xmm4, 0x168(%rsp)
movhpd %xmm4, 0x190(%rsp)
movsd %xmm8, 0x188(%rsp)
movsd %xmm8, 0x198(%rsp)
unpcklps %xmm5, %xmm0            # xmm0 = xmm0[0],xmm5[0],xmm0[1],xmm5[1]
xorps %xmm5, %xmm5
cvtss2sd %xmm7, %xmm5
mulsd 0x6809(%rip), %xmm5     # 0x331d0
subps %xmm0, %xmm6
cvtps2pd %xmm6, %xmm6
mulpd 0x671b(%rip), %xmm6     # 0x330f0
movapd %xmm6, %xmm0
xorpd %xmm9, %xmm0
movapd %xmm0, 0x50(%rsp)
movapd %xmm5, %xmm0
xorpd %xmm9, %xmm0
movlpd %xmm0, 0x60(%rsp)
movl $0x48, %edi
leaq 0x168(%rsp), %r8
movq %r14, %r9
movq %r14, %r10
xorl %r11d, %r11d
xorpd %xmm0, %xmm0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %r15d, %r15d
xorpd %xmm8, %xmm8
movapd 0x66dd(%rip), %xmm13    # 0x33100
movapd %xmm0, %xmm9
movsd (%r10,%r15,8), %xmm10
movapd %xmm10, %xmm0
andpd %xmm13, %xmm0
leal (%r11,%r15), %eax
ucomisd %xmm9, %xmm0
movapd %xmm9, %xmm7
cmpltsd %xmm0, %xmm7
andpd %xmm7, %xmm10
andnpd %xmm8, %xmm7
orpd %xmm10, %xmm7
maxsd %xmm9, %xmm0
cmoval %eax, %ebp
leaq (%r11,%r15), %rax
incq %rax
incq %r15
movapd %xmm7, %xmm8
cmpq $0x3, %rax
jne 0x2ca23
movsd 0x7930(%rip), %xmm8     # 0x343b0
ucomisd %xmm0, %xmm8
ja 0x2cb73
movslq %ebp, %rax
leaq (%r9,%rax,8), %r15
xorl %r13d, %r13d
movapd 0x6632(%rip), %xmm10    # 0x330d0
movsd (%r15,%r13), %xmm8
movsd (%r10,%r13), %xmm9
movsd %xmm9, (%r15,%r13)
divsd %xmm7, %xmm8
movsd %xmm8, (%r10,%r13)
addq $0x18, %r13
cmpq %r13, %rdi
jne 0x2ca9e
movsd 0x50(%rsp,%r11,8), %xmm8
movsd 0x50(%rsp,%rax,8), %xmm9
movsd %xmm9, 0x50(%rsp,%r11,8)
movsd %xmm8, 0x50(%rsp,%rax,8)
movsd 0x50(%rsp,%r11,8), %xmm8
divsd %xmm7, %xmm8
movsd %xmm8, 0x50(%rsp,%r11,8)
cmpq $0x1, %r11
ja 0x2cb8f
leaq (%r11,%r11,2), %r15
movq %r8, %r13
movq %r11, %rbp
leaq 0x1(%rbp), %rax
leaq (%r15,%rbp), %r12
incq %r12
movsd 0x160(%rsp,%r12,8), %xmm7
movapd %xmm7, %xmm8
xorpd %xmm10, %xmm8
xorl %r12d, %r12d
movsd (%r10,%r12), %xmm9
mulsd %xmm8, %xmm9
addsd (%r13,%r12), %xmm9
movsd %xmm9, (%r13,%r12)
addq $0x18, %r12
cmpq %r12, %rdi
jne 0x2cb29
movsd 0x50(%rsp,%rax,8), %xmm8
mulsd 0x50(%rsp,%r11,8), %xmm7
subsd %xmm7, %xmm8
movsd %xmm8, 0x50(%rsp,%rax,8)
addq $0x8, %r13
testq %rbp, %rbp
movq %rax, %rbp
je 0x2cb07
jmp 0x2cb8f
xorpd %xmm7, %xmm7
movapd %xmm7, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
movapd 0x6541(%rip), %xmm10    # 0x330d0
movsd 0x7819(%rip), %xmm7     # 0x343b0
ucomisd %xmm0, %xmm7
ja 0x2cbbe
leaq 0x1(%r11), %rax
addq $0x20, %r10
addq $0x18, %r9
addq $-0x18, %rdi
addq $0x20, %r8
cmpq $0x2, %r11
movq %rax, %r11
jb 0x2ca09
movl $0x2, %r9d
movl $0x3, %edi
leaq 0x198(%rsp), %r8
movsd 0x50(%rsp,%r9,8), %xmm0
xorpd %xmm10, %xmm0
movq %r8, %rax
movq %rdi, %r10
movsd (%rax), %xmm7
mulsd %xmm0, %xmm7
addsd 0x40(%rsp,%r10,8), %xmm7
movsd %xmm7, 0x40(%rsp,%r10,8)
decq %r10
addq $-0x8, %rax
cmpq $0x1, %r10
ja 0x2cbe3
leaq -0x1(%r9), %rax
decq %rdi
addq $-0x20, %r8
cmpq $0x1, %r9
movq %rax, %r9
ja 0x2cbd1
movdqa %xmm11, %xmm0
pcmpgtd %xmm1, %xmm0
pshufd $0x50, %xmm0, %xmm8     # xmm8 = xmm0[0,0,1,1]
pshufd $0x50, %xmm1, %xmm9     # xmm9 = xmm1[0,0,1,1]
pcmpgtd 0x75b8(%rip), %xmm9     # 0x341f0
movapd 0x50(%rsp), %xmm7
movapd 0x77ca(%rip), %xmm0     # 0x34410
cmpltpd %xmm7, %xmm0
andpd %xmm8, %xmm0
cmpltpd 0x77d7(%rip), %xmm7     # 0x34430
andpd %xmm9, %xmm7
movapd %xmm0, %xmm8
xorpd %xmm7, %xmm8
psllq $0x3f, %xmm8
movmskpd %xmm8, %eax
testl %eax, %eax
je 0x2cc96
andpd 0x77a1(%rip), %xmm0     # 0x34420
paddd %xmm7, %xmm0
pshufd $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3]
leal 0x1(%rdx), %eax
cmpl $0x4, %edx
movl %eax, %edx
jb 0x2c823
xorps %xmm8, %xmm8
cvtss2sd (%rsi), %xmm8
movapd 0x50(%rsp), %xmm7
movapd %xmm6, %xmm0
mulpd %xmm7, %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
mulsd %xmm7, %xmm6
addsd %xmm0, %xmm6
movsd 0x60(%rsp), %xmm0
mulsd %xmm0, %xmm5
addsd %xmm6, %xmm5
mulsd 0x6501(%rip), %xmm5     # 0x331d0
addsd %xmm8, %xmm5
movapd 0x6424(%rip), %xmm6     # 0x33100
andpd %xmm6, %xmm5
ucomisd %xmm12, %xmm5
jbe 0x2ceab
movapd %xmm2, %xmm5
addsd %xmm3, %xmm5
mulsd %xmm5, %xmm5
mulsd %xmm4, %xmm4
mulsd %xmm3, %xmm2
subsd %xmm4, %xmm2
divsd %xmm2, %xmm5
xorpd %xmm2, %xmm2
cmplepd %xmm5, %xmm2
cmpltpd %xmm14, %xmm5
andpd %xmm2, %xmm5
movd %xmm5, %eax
movapd %xmm7, %xmm2
andpd %xmm6, %xmm2
cmpltpd 0x7711(%rip), %xmm2     # 0x34440
movmskpd %xmm2, %ecx
andl %ecx, %eax
andb $0x2, %cl
shrb %cl
andb %cl, %al
cmpb $0x1, %al
movq 0x80(%rsp), %r10
jne 0x2ceb3
movapd %xmm0, %xmm2
andpd %xmm6, %xmm2
movsd 0x64a4(%rip), %xmm3     # 0x33200
ucomisd %xmm2, %xmm3
movq 0x10(%rsp), %rcx
jbe 0x2ceb8
cvtdq2pd %xmm1, %xmm2
addpd %xmm2, %xmm7
ucomisd 0x62b5(%rip), %xmm7     # 0x33030
jb 0x2ceb8
ucomisd %xmm7, %xmm15
jb 0x2ceb8
movapd %xmm7, %xmm2
unpckhpd %xmm7, %xmm2            # xmm2 = xmm2[1],xmm7[1]
ucomisd 0x6294(%rip), %xmm2     # 0x33030
jb 0x2ceb8
movsd 0x28(%rsp), %xmm3
ucomisd %xmm2, %xmm3
jb 0x2ceb8
movl 0x70(%rsp), %edx
xorps %xmm2, %xmm2
cvtsi2sd %edx, %xmm2
addsd %xmm2, %xmm0
ucomisd 0xa8(%rsp), %xmm0
jb 0x2ceb8
movsd 0xa0(%rsp), %xmm2
ucomisd %xmm0, %xmm2
jb 0x2ceb8
movl 0x3c(%r10), %eax
movq 0x20(%rsp), %r15
movl %eax, (%r15)
movq %xmm1, 0x4(%r15)
movl %edx, 0xc(%r15)
cvtsd2ss %xmm0, %xmm1
movss %xmm1, 0x18(%r15)
mulpd 0xf0(%rsp), %xmm7
cvtpd2ps %xmm7, %xmm1
movlpd %xmm1, 0x10(%r15)
movsd 0x8(%r10), %xmm1
movsd %xmm1, 0x90(%rsp)
xorps %xmm1, %xmm1
cvtsi2sdl 0x2c(%r10), %xmm1
divsd %xmm1, %xmm0
movdqa %xmm11, 0xe0(%rsp)
movapd %xmm14, 0x70(%rsp)
movsd %xmm15, 0x98(%rsp)
callq 0x9040
movq 0x10(%rsp), %rcx
movsd 0x98(%rsp), %xmm15
movapd 0x70(%rsp), %xmm14
movsd 0x88(%rsp), %xmm12
movdqa 0xe0(%rsp), %xmm11
movq 0x80(%rsp), %r10
mulsd 0x90(%rsp), %xmm0
mulsd 0x150(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1c(%r15)
addq $0x20, %r15
movq %r15, 0x20(%rsp)
jmp 0x2ceb8
movq 0x80(%rsp), %r10
movq 0x10(%rsp), %rcx
incq %rcx
movslq 0x80(%r10), %rax
cmpq %rax, %rcx
jl 0x2c7f6
movq 0x20(%rsp), %rax
subq 0x78(%r10), %rax
shrq $0x5, %rax
movl %eax, 0x80(%r10)
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq