// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/sift.c
// Function: vl_sift_calc_keypoint_descriptor
VL_EXPORT
void
vl_sift_calc_keypoint_descriptor (VlSiftFilt *f,
                                  vl_sift_pix *descr,
                                  VlSiftKeypoint const* k,
                                  double angle0)
{
  /*
     The SIFT descriptor is a three dimensional histogram of the
     position and orientation of the gradient.  There are NBP bins for
     each spatial dimension and NBO bins for the orientation dimension,
     for a total of NBP x NBP x NBO bins.

     The support of each spatial bin has an extension of SBP = 3sigma
     pixels, where sigma is the scale of the keypoint.  Thus all the
     bins together have a support SBP x NBP pixels wide. Since
     weighting and interpolation of pixel is used, the support extends
     by another half bin. Therefore, the support is a square window of
     SBP x (NBP + 1) pixels. Finally, since the patch can be
     arbitrarily rotated, we need to consider a window 2W += sqrt(2) x
     SBP x (NBP + 1) pixels wide.
  */

  double const magnif      = f-> magnif ;

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

  int          w           = f-> octave_width ;
  int          h           = f-> octave_height ;
  int const    xo          = 2 ;         /* x-stride */
  int const    yo          = 2 * w ;     /* y-stride */
  int const    so          = 2 * w * h ; /* s-stride */
  double       x           = k-> x     / xper ;
  double       y           = k-> y     / xper ;
  double       sigma       = k-> sigma / xper ;

  int          xi          = (int) (x + 0.5) ;
  int          yi          = (int) (y + 0.5) ;
  int          si          = k-> is ;

  double const st0         = sin (angle0) ;
  double const ct0         = cos (angle0) ;
  double const SBP         = magnif * sigma + VL_EPSILON_D ;
  int    const W           = floor
    (sqrt(2.0) * SBP * (NBP + 1) / 2.0 + 0.5) ;

  int const binto = 1 ;          /* bin theta-stride */
  int const binyo = NBO * NBP ;  /* bin y-stride */
  int const binxo = NBO ;        /* bin x-stride */

  int bin, dxi, dyi ;
  vl_sift_pix const *pt ;
  vl_sift_pix       *dpt ;

  /* check bounds */
  if(k->o  != f->o_cur        ||
     xi    <  0               ||
     xi    >= w               ||
     yi    <  0               ||
     yi    >= h -    1        ||
     si    <  f->s_min + 1    ||
     si    >  f->s_max - 2     )
    return ;

  /* synchronize gradient buffer */
  update_gradient (f) ;

  /* VL_PRINTF("W = %d ; magnif = %g ; SBP = %g\n", W,magnif,SBP) ; */

  /* clear descriptor */
  memset (descr, 0, sizeof(vl_sift_pix) * NBO*NBP*NBP) ;

  /* Center the scale space and the descriptor on the current keypoint.
   * Note that dpt is pointing to the bin of center (SBP/2,SBP/2,0).
   */
  pt  = f->grad + xi*xo + yi*yo + (si - f->s_min - 1)*so ;
  dpt = descr + (NBP/2) * binyo + (NBP/2) * binxo ;

#undef atd
#define atd(dbinx,dbiny,dbint) *(dpt + (dbint)*binto + (dbiny)*binyo + (dbinx)*binxo)

  /*
   * Process pixels in the intersection of the image rectangle
   * (1,1)-(M-1,N-1) and the keypoint bounding box.
   */
  for(dyi =  VL_MAX (- W, 1 - yi    ) ;
      dyi <= VL_MIN (+ W, h - yi - 2) ; ++ dyi) {

    for(dxi =  VL_MAX (- W, 1 - xi    ) ;
        dxi <= VL_MIN (+ W, w - xi - 2) ; ++ dxi) {

      /* retrieve */
      vl_sift_pix mod   = *( pt + dxi*xo + dyi*yo + 0 ) ;
      vl_sift_pix angle = *( pt + dxi*xo + dyi*yo + 1 ) ;
      vl_sift_pix theta = vl_mod_2pi_f (angle - angle0) ;

      /* fractional displacement */
      vl_sift_pix dx = xi + dxi - x;
      vl_sift_pix dy = yi + dyi - y;

      /* get the displacement normalized w.r.t. the keypoint
         orientation and extension */
      vl_sift_pix nx = ( ct0 * dx + st0 * dy) / SBP ;
      vl_sift_pix ny = (-st0 * dx + ct0 * dy) / SBP ;
      vl_sift_pix nt = NBO * theta / (2 * VL_PI) ;

      /* Get the Gaussian weight of the sample. The Gaussian window
       * has a standard deviation equal to NBP/2. Note that dx and dy
       * are in the normalized frame, so that -NBP/2 <= dx <=
       * NBP/2. */
      vl_sift_pix const wsigma = f->windowSize ;
      vl_sift_pix win = fast_expn
        ((nx*nx + ny*ny)/(2.0 * wsigma * wsigma)) ;

      /* The sample will be distributed in 8 adjacent bins.
         We start from the ``lower-left'' bin. */
      int         binx = (int)vl_floor_f (nx - 0.5) ;
      int         biny = (int)vl_floor_f (ny - 0.5) ;
      int         bint = (int)vl_floor_f (nt) ;
      vl_sift_pix rbinx = nx - (binx + 0.5) ;
      vl_sift_pix rbiny = ny - (biny + 0.5) ;
      vl_sift_pix rbint = nt - bint ;
      int         dbinx ;
      int         dbiny ;
      int         dbint ;

      /* Distribute the current sample into the 8 adjacent bins*/
      for(dbinx = 0 ; dbinx < 2 ; ++dbinx) {
        for(dbiny = 0 ; dbiny < 2 ; ++dbiny) {
          for(dbint = 0 ; dbint < 2 ; ++dbint) {

            if (binx + dbinx >= - (NBP/2) &&
                binx + dbinx <    (NBP/2) &&
                biny + dbiny >= - (NBP/2) &&
                biny + dbiny <    (NBP/2) ) {
              vl_sift_pix weight = win
                * mod
                * vl_abs_f (1 - dbinx - rbinx)
                * vl_abs_f (1 - dbiny - rbiny)
                * vl_abs_f (1 - dbint - rbint) ;

              atd(binx+dbinx, biny+dbiny, (bint+dbint) % NBO) += weight ;
            }
          }
        }
      }
    }
  }

  /* Standard SIFT descriptors are normalized, truncated and normalized again */
  if(1) {

    /* Normalize the histogram to L2 unit length. */
    vl_sift_pix norm = normalize_histogram (descr, descr + NBO*NBP*NBP) ;

    /* Set the descriptor to zero if it is lower than our norm_threshold */
    if(f-> norm_thresh && norm < f-> norm_thresh) {
        for(bin = 0; bin < NBO*NBP*NBP ; ++ bin)
            descr [bin] = 0;
    }
    else {

      /* Truncate at 0.2. */
      for(bin = 0; bin < NBO*NBP*NBP ; ++ bin) {
        if (descr [bin] > 0.2) descr [bin] = 0.2;
      }

      /* Normalize again. */
      normalize_histogram (descr, descr + NBO*NBP*NBP) ;
    }
  }

}

// Assembly:
subq $0x148, %rsp            # imm = 0x148
movq %rdi, 0x140(%rsp)
movq %rsi, 0x138(%rsp)
movq %rdx, 0x130(%rsp)
movsd %xmm0, 0x128(%rsp)
movq 0x140(%rsp), %rax
movsd 0xa0(%rax), %xmm0
movsd %xmm0, 0x120(%rsp)
movq 0x140(%rsp), %rax
cvtsi2sdl 0x3c(%rax), %xmm1
movsd 0x7b5a(%rip), %xmm0     # 0x590e0
callq 0x92b0
movsd %xmm0, 0x118(%rsp)
movq 0x140(%rsp), %rax
movl 0x58(%rax), %eax
movl %eax, 0x114(%rsp)
movq 0x140(%rsp), %rax
movl 0x5c(%rax), %eax
movl %eax, 0x110(%rsp)
movl $0x2, 0x10c(%rsp)
movl 0x114(%rsp), %eax
shll %eax
movl %eax, 0x108(%rsp)
movl 0x114(%rsp), %eax
shll %eax
imull 0x110(%rsp), %eax
movl %eax, 0x104(%rsp)
movq 0x130(%rsp), %rax
movss 0x10(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
divsd 0x118(%rsp), %xmm0
movsd %xmm0, 0xf8(%rsp)
movq 0x130(%rsp), %rax
movss 0x14(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
divsd 0x118(%rsp), %xmm0
movsd %xmm0, 0xf0(%rsp)
movq 0x130(%rsp), %rax
movss 0x1c(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
divsd 0x118(%rsp), %xmm0
movsd %xmm0, 0xe8(%rsp)
movsd 0x7a24(%rip), %xmm0     # 0x59080
addsd 0xf8(%rsp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0xe4(%rsp)
movsd 0x7a08(%rip), %xmm0     # 0x59080
addsd 0xf0(%rsp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0xe0(%rsp)
movq 0x130(%rsp), %rax
movl 0xc(%rax), %eax
movl %eax, 0xdc(%rsp)
movsd 0x128(%rsp), %xmm0
callq 0x99e0
movsd %xmm0, 0xd0(%rsp)
movsd 0x128(%rsp), %xmm0
callq 0x94e0
movsd %xmm0, 0xc8(%rsp)
movsd 0x120(%rsp), %xmm0
movsd 0xe8(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x82de(%rip), %xmm1     # 0x599c8
addsd %xmm1, %xmm0
movsd %xmm0, 0xc0(%rsp)
movsd 0x79e1(%rip), %xmm0     # 0x590e0
callq 0x9b20
mulsd 0xc0(%rsp), %xmm0
movsd 0x7a0b(%rip), %xmm1     # 0x59120
mulsd %xmm1, %xmm0
movsd 0x79bf(%rip), %xmm1     # 0x590e0
divsd %xmm1, %xmm0
movsd 0x7953(%rip), %xmm1     # 0x59080
addsd %xmm1, %xmm0
callq 0x9a00
cvttsd2si %xmm0, %eax
movl %eax, 0xbc(%rsp)
movl $0x1, 0xb8(%rsp)
movl $0x20, 0xb4(%rsp)
movl $0x8, 0xb0(%rsp)
movq 0x130(%rsp), %rax
movl (%rax), %eax
movq 0x140(%rsp), %rcx
cmpl 0x3c(%rcx), %eax
jne 0x517e4
cmpl $0x0, 0xe4(%rsp)
jl 0x517e4
movl 0xe4(%rsp), %eax
cmpl 0x114(%rsp), %eax
jge 0x517e4
cmpl $0x0, 0xe0(%rsp)
jl 0x517e4
movl 0xe0(%rsp), %eax
movl 0x110(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x517e4
movl 0xdc(%rsp), %eax
movq 0x140(%rsp), %rcx
movl 0x34(%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jl 0x517e4
movl 0xdc(%rsp), %eax
movq 0x140(%rsp), %rcx
movl 0x38(%rcx), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jle 0x517e9
jmp 0x51fc7
movq 0x140(%rsp), %rdi
callq 0x4fe70
movq 0x138(%rsp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x9480
movq 0x140(%rsp), %rax
movq 0xb0(%rax), %rax
movl 0xe4(%rsp), %ecx
shll %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl 0xe0(%rsp), %ecx
imull 0x108(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl 0xdc(%rsp), %ecx
movq 0x140(%rsp), %rdx
subl 0x34(%rdx), %ecx
subl $0x1, %ecx
imull 0x104(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x98(%rsp)
movq 0x138(%rsp), %rax
addq $0x100, %rax            # imm = 0x100
addq $0x40, %rax
movq %rax, 0x90(%rsp)
xorl %eax, %eax
subl 0xbc(%rsp), %eax
movl $0x1, %ecx
subl 0xe0(%rsp), %ecx
cmpl %ecx, %eax
jle 0x518b6
xorl %eax, %eax
subl 0xbc(%rsp), %eax
movl %eax, 0x38(%rsp)
jmp 0x518c6
movl $0x1, %eax
subl 0xe0(%rsp), %eax
movl %eax, 0x38(%rsp)
movl 0x38(%rsp), %eax
movl %eax, 0xa4(%rsp)
movl 0xa4(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0xbc(%rsp), %eax
movl 0x110(%rsp), %ecx
subl 0xe0(%rsp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x51905
movl 0xbc(%rsp), %eax
movl %eax, 0x30(%rsp)
jmp 0x5191a
movl 0x110(%rsp), %eax
subl 0xe0(%rsp), %eax
subl $0x2, %eax
movl %eax, 0x30(%rsp)
movl 0x34(%rsp), %eax
movl 0x30(%rsp), %ecx
cmpl %ecx, %eax
jg 0x51e93
xorl %eax, %eax
subl 0xbc(%rsp), %eax
movl $0x1, %ecx
subl 0xe4(%rsp), %ecx
cmpl %ecx, %eax
jle 0x51952
xorl %eax, %eax
subl 0xbc(%rsp), %eax
movl %eax, 0x2c(%rsp)
jmp 0x51962
movl $0x1, %eax
subl 0xe4(%rsp), %eax
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, 0xa8(%rsp)
movl 0xa8(%rsp), %eax
movl %eax, 0x28(%rsp)
movl 0xbc(%rsp), %eax
movl 0x114(%rsp), %ecx
subl 0xe4(%rsp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x519a1
movl 0xbc(%rsp), %eax
movl %eax, 0x24(%rsp)
jmp 0x519b6
movl 0x114(%rsp), %eax
subl 0xe4(%rsp), %eax
subl $0x2, %eax
movl %eax, 0x24(%rsp)
movl 0x28(%rsp), %eax
movl 0x24(%rsp), %ecx
cmpl %ecx, %eax
jg 0x51e7b
movq 0x98(%rsp), %rax
movl 0xa8(%rsp), %ecx
shll %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl 0xa4(%rsp), %ecx
imull 0x108(%rsp), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x8c(%rsp)
movq 0x98(%rsp), %rax
movl 0xa8(%rsp), %ecx
shll %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl 0xa4(%rsp), %ecx
imull 0x108(%rsp), %ecx
movslq %ecx, %rcx
movss 0x4(%rax,%rcx,4), %xmm0
movss %xmm0, 0x88(%rsp)
movss 0x88(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
subsd 0x128(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x51390
movss %xmm0, 0x84(%rsp)
movl 0xe4(%rsp), %eax
addl 0xa8(%rsp), %eax
cvtsi2sd %eax, %xmm0
subsd 0xf8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x80(%rsp)
movl 0xe0(%rsp), %eax
addl 0xa4(%rsp), %eax
cvtsi2sd %eax, %xmm0
subsd 0xf0(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x7c(%rsp)
movsd 0xc8(%rsp), %xmm0
movss 0x80(%rsp), %xmm1
cvtss2sd %xmm1, %xmm2
movsd 0xd0(%rsp), %xmm1
movss 0x7c(%rsp), %xmm3
cvtss2sd %xmm3, %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
divsd 0xc0(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x78(%rsp)
movsd 0xd0(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movss 0x80(%rsp), %xmm1
cvtss2sd %xmm1, %xmm2
movsd 0xc8(%rsp), %xmm1
movss 0x7c(%rsp), %xmm3
cvtss2sd %xmm3, %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
divsd 0xc0(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x74(%rsp)
movss 0x861f(%rip), %xmm0     # 0x5a180
mulss 0x84(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x76ba(%rip), %xmm1     # 0x59230
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x70(%rsp)
movq 0x140(%rsp), %rax
movsd 0xa8(%rax), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x6c(%rsp)
movss 0x78(%rsp), %xmm0
movss 0x78(%rsp), %xmm2
movss 0x74(%rsp), %xmm1
mulss 0x74(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movss 0x6c(%rsp), %xmm1
cvtss2sd %xmm1, %xmm2
movsd 0x750c(%rip), %xmm1     # 0x590e0
mulsd %xmm2, %xmm1
movss 0x6c(%rsp), %xmm2
cvtss2sd %xmm2, %xmm2
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x50790
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x68(%rsp)
movss 0x78(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x7475(%rip), %xmm1     # 0x59080
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x513f0
movl %eax, 0x64(%rsp)
movss 0x74(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x7452(%rip), %xmm1     # 0x59080
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x513f0
movl %eax, 0x60(%rsp)
movss 0x70(%rsp), %xmm0
callq 0x513f0
movl %eax, 0x5c(%rsp)
movss 0x78(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
cvtsi2sdl 0x64(%rsp), %xmm1
movsd 0x741a(%rip), %xmm2     # 0x59080
addsd %xmm2, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x58(%rsp)
movss 0x74(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
cvtsi2sdl 0x60(%rsp), %xmm1
movsd 0x73f0(%rip), %xmm2     # 0x59080
addsd %xmm2, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x54(%rsp)
movss 0x70(%rsp), %xmm0
cvtsi2ssl 0x5c(%rsp), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x50(%rsp)
movl $0x0, 0x4c(%rsp)
cmpl $0x2, 0x4c(%rsp)
jge 0x51e63
movl $0x0, 0x48(%rsp)
cmpl $0x2, 0x48(%rsp)
jge 0x51e51
movl $0x0, 0x44(%rsp)
cmpl $0x2, 0x44(%rsp)
jge 0x51e3f
movl 0x64(%rsp), %eax
addl 0x4c(%rsp), %eax
cmpl $-0x2, %eax
jl 0x51e2d
movl 0x64(%rsp), %eax
addl 0x4c(%rsp), %eax
cmpl $0x2, %eax
jge 0x51e2d
movl 0x60(%rsp), %eax
addl 0x48(%rsp), %eax
cmpl $-0x2, %eax
jl 0x51e2d
movl 0x60(%rsp), %eax
addl 0x48(%rsp), %eax
cmpl $0x2, %eax
jge 0x51e2d
movss 0x68(%rsp), %xmm0
mulss 0x8c(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
movl $0x1, %eax
subl 0x4c(%rsp), %eax
cvtsi2ss %eax, %xmm0
subss 0x58(%rsp), %xmm0
callq 0x51440
movaps %xmm0, %xmm1
movss 0xc(%rsp), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x10(%rsp)
movl $0x1, %eax
subl 0x48(%rsp), %eax
cvtsi2ss %eax, %xmm0
subss 0x54(%rsp), %xmm0
callq 0x51440
movaps %xmm0, %xmm1
movss 0x10(%rsp), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x14(%rsp)
movl $0x1, %eax
subl 0x44(%rsp), %eax
cvtsi2ss %eax, %xmm0
subss 0x50(%rsp), %xmm0
callq 0x51440
movaps %xmm0, %xmm1
movss 0x14(%rsp), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x40(%rsp)
movss 0x40(%rsp), %xmm0
movq 0x90(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x5c(%rsp), %eax
addl 0x44(%rsp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movq 0x18(%rsp), %rax
shll $0x0, %edx
movslq %edx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl 0x60(%rsp), %ecx
addl 0x48(%rsp), %ecx
shll $0x5, %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl 0x64(%rsp), %ecx
addl 0x4c(%rsp), %ecx
shll $0x3, %ecx
movslq %ecx, %rcx
addss (%rax,%rcx,4), %xmm0
movss %xmm0, (%rax,%rcx,4)
jmp 0x51e2f
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x51ce6
jmp 0x51e41
movl 0x48(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x48(%rsp)
jmp 0x51cd3
jmp 0x51e53
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x51cc0
jmp 0x51e65
movl 0xa8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa8(%rsp)
jmp 0x5196d
jmp 0x51e7d
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x518d1
movq 0x138(%rsp), %rdi
movq 0x138(%rsp), %rsi
addq $0x200, %rsi            # imm = 0x200
callq 0x51460
movss %xmm0, 0x3c(%rsp)
movq 0x140(%rsp), %rax
movsd 0x98(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x51ed2
jp 0x51ed2
jmp 0x51f3a
movss 0x3c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
movq 0x140(%rsp), %rax
movsd 0x98(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x51f3a
movl $0x0, 0xac(%rsp)
cmpl $0x80, 0xac(%rsp)
jge 0x51f35
movq 0x138(%rsp), %rax
movslq 0xac(%rsp), %rcx
xorps %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
movl 0xac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xac(%rsp)
jmp 0x51efd
jmp 0x51fc7
movl $0x0, 0xac(%rsp)
cmpl $0x80, 0xac(%rsp)
jge 0x51fab
movq 0x138(%rsp), %rax
movslq 0xac(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x7895(%rip), %xmm1     # 0x59808
ucomisd %xmm1, %xmm0
jbe 0x51f96
movq 0x138(%rsp), %rax
movslq 0xac(%rsp), %rcx
movss 0x7263(%rip), %xmm0     # 0x591f4
movss %xmm0, (%rax,%rcx,4)
jmp 0x51f98
movl 0xac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xac(%rsp)
jmp 0x51f45
movq 0x138(%rsp), %rdi
movq 0x138(%rsp), %rsi
addq $0x200, %rsi            # imm = 0x200
callq 0x51460
addq $0x148, %rsp            # imm = 0x148
retq
nop