// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/dsift.c
// Function: vl_dsift_with_flat_window
VL_INLINE void
_vl_dsift_with_flat_window (VlDsiftFilter* self)
{
  int binx, biny, bint ;
  int framex, framey ;

  /* for each orientation bin */
  for (bint = 0 ; bint < self->geom.numBinT ; ++bint) {

    vl_imconvcoltri_f (self->convTmp1, self->imHeight,
                       self->grads [bint], self->imWidth, self->imHeight,
                       self->imWidth,
                       self->geom.binSizeY, /* filt size */
                       1, /* subsampling step */
                       VL_PAD_BY_CONTINUITY|VL_TRANSPOSE) ;

    vl_imconvcoltri_f (self->convTmp2, self->imWidth,
                       self->convTmp1, self->imHeight, self->imWidth,
                       self->imHeight,
                       self->geom.binSizeX,
                       1,
                       VL_PAD_BY_CONTINUITY|VL_TRANSPOSE) ;

    for (biny = 0 ; biny < self->geom.numBinY ; ++biny) {

      /*
      This fast version of DSIFT does not use a proper Gaussian
      weighting scheme for the gradiens that are accumulated on the
      spatial bins. Instead each spatial bins is accumulated based on
      the triangular kernel only, equivalent to bilinear interpolation
      plus a flat, rather than Gaussian, window. Eventually, however,
      the magnitude of the spatial bins in the SIFT descriptor is
      reweighted by the average of the Gaussian window on each bin.
      */

      float wy = _vl_dsift_get_bin_window_mean
        (self->geom.binSizeY, self->geom.numBinY, biny,
         self->windowSize) ;

      /* The convolution functions vl_imconvcoltri_* convolve by a
       * triangular kernel with unit integral. Instead for SIFT the
       * triangular kernel should have unit height. This is
       * compensated for by multiplying by the bin size:
       */

      wy *= self->geom.binSizeY ;

      for (binx = 0 ; binx < self->geom.numBinX ; ++binx) {
        float w ;
        float wx = _vl_dsift_get_bin_window_mean (self->geom.binSizeX,
                                                  self->geom.numBinX,
                                                  binx,
                                                  self->windowSize) ;

        float *dst = self->descrs
          + bint
          + binx * self->geom.numBinT
          + biny * (self->geom.numBinX * self->geom.numBinT)  ;

        float *src = self->convTmp2 ;

        int frameSizeX = self->geom.binSizeX * (self->geom.numBinX - 1) + 1 ;
        int frameSizeY = self->geom.binSizeY * (self->geom.numBinY - 1) + 1 ;
        int descrSize = vl_dsift_get_descriptor_size (self) ;

        wx *= self->geom.binSizeX ;
        w = wx * wy ;

        for (framey  = self->boundMinY ;
             framey <= self->boundMaxY - frameSizeY + 1 ;
             framey += self->stepY) {
          for (framex  = self->boundMinX ;
               framex <= self->boundMaxX - frameSizeX + 1 ;
               framex += self->stepX) {
            *dst = w * src [(framex + binx * self->geom.binSizeX) * 1 +
                            (framey + biny * self->geom.binSizeY) * self->imWidth]  ;
            dst += descrSize ;
          } /* framex */
        } /* framey */
      } /* binx */
    } /* biny */
  } /* bint */
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
movq 0x60(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x152aa
movq 0x60(%rsp), %rax
movq 0x70(%rax), %rdi
movq 0x60(%rsp), %rax
movslq 0x4(%rax), %rsi
movq 0x60(%rsp), %rax
movq 0x68(%rax), %rax
movslq 0x54(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x60(%rsp), %rax
movslq (%rax), %rcx
movq 0x60(%rsp), %rax
movslq 0x4(%rax), %r8
movq 0x60(%rsp), %rax
movslq (%rax), %r9
movq 0x60(%rsp), %rax
movslq 0x30(%rax), %rax
movq %rax, (%rsp)
movq $0x1, 0x8(%rsp)
movl $0x5, 0x10(%rsp)
callq 0x9690
movq 0x60(%rsp), %rax
movq 0x78(%rax), %rdi
movq 0x60(%rsp), %rax
movslq (%rax), %rsi
movq 0x60(%rsp), %rax
movq 0x70(%rax), %rdx
movq 0x60(%rsp), %rax
movslq 0x4(%rax), %rcx
movq 0x60(%rsp), %rax
movslq (%rax), %r8
movq 0x60(%rsp), %rax
movslq 0x4(%rax), %r9
movq 0x60(%rsp), %rax
movslq 0x2c(%rax), %rax
movq %rax, (%rsp)
movq $0x1, 0x8(%rsp)
movl $0x5, 0x10(%rsp)
callq 0x9690
movl $0x0, 0x58(%rsp)
movl 0x58(%rsp), %eax
movq 0x60(%rsp), %rcx
cmpl 0x28(%rcx), %eax
jge 0x15298
movq 0x60(%rsp), %rax
movl 0x30(%rax), %edi
movq 0x60(%rsp), %rax
movl 0x28(%rax), %esi
movl 0x58(%rsp), %edx
movq 0x60(%rsp), %rax
movsd 0x38(%rax), %xmm0
callq 0x15880
movss %xmm0, 0x48(%rsp)
movq 0x60(%rsp), %rax
cvtsi2ssl 0x30(%rax), %xmm0
mulss 0x48(%rsp), %xmm0
movss %xmm0, 0x48(%rsp)
movl $0x0, 0x5c(%rsp)
movl 0x5c(%rsp), %eax
movq 0x60(%rsp), %rcx
cmpl 0x24(%rcx), %eax
jge 0x15286
movq 0x60(%rsp), %rax
movl 0x2c(%rax), %edi
movq 0x60(%rsp), %rax
movl 0x24(%rax), %esi
movl 0x5c(%rsp), %edx
movq 0x60(%rsp), %rax
movsd 0x38(%rax), %xmm0
callq 0x15880
movss %xmm0, 0x40(%rsp)
movq 0x60(%rsp), %rax
movq 0x50(%rax), %rax
movslq 0x54(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl 0x5c(%rsp), %ecx
movq 0x60(%rsp), %rdx
imull 0x20(%rdx), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl 0x58(%rsp), %ecx
movq 0x60(%rsp), %rdx
movl 0x24(%rdx), %edx
movq 0x60(%rsp), %rsi
imull 0x20(%rsi), %edx
imull %edx, %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x38(%rsp)
movq 0x60(%rsp), %rax
movq 0x78(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x60(%rsp), %rax
movl 0x2c(%rax), %eax
movq 0x60(%rsp), %rcx
movl 0x24(%rcx), %ecx
subl $0x1, %ecx
imull %ecx, %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
movq 0x60(%rsp), %rax
movl 0x30(%rax), %eax
movq 0x60(%rsp), %rcx
movl 0x28(%rcx), %ecx
subl $0x1, %ecx
imull %ecx, %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
movq 0x60(%rsp), %rdi
callq 0x156b0
movl %eax, 0x24(%rsp)
movq 0x60(%rsp), %rax
cvtsi2ssl 0x2c(%rax), %xmm0
mulss 0x40(%rsp), %xmm0
movss %xmm0, 0x40(%rsp)
movss 0x40(%rsp), %xmm0
mulss 0x48(%rsp), %xmm0
movss %xmm0, 0x44(%rsp)
movq 0x60(%rsp), %rax
movl 0x14(%rax), %eax
movl %eax, 0x4c(%rsp)
movl 0x4c(%rsp), %eax
movq 0x60(%rsp), %rcx
movl 0x1c(%rcx), %ecx
subl 0x28(%rsp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0x15274
movq 0x60(%rsp), %rax
movl 0x10(%rax), %eax
movl %eax, 0x50(%rsp)
movl 0x50(%rsp), %eax
movq 0x60(%rsp), %rcx
movl 0x18(%rcx), %ecx
subl 0x2c(%rsp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0x1525d
movss 0x44(%rsp), %xmm0
movq 0x30(%rsp), %rax
movl 0x50(%rsp), %ecx
movl 0x5c(%rsp), %edx
movq 0x60(%rsp), %rsi
imull 0x2c(%rsi), %edx
addl %edx, %ecx
shll $0x0, %ecx
movl 0x4c(%rsp), %edx
movl 0x58(%rsp), %esi
movq 0x60(%rsp), %rdi
imull 0x30(%rdi), %esi
addl %esi, %edx
movq 0x60(%rsp), %rsi
imull (%rsi), %edx
addl %edx, %ecx
movslq %ecx, %rcx
mulss (%rax,%rcx,4), %xmm0
movq 0x38(%rsp), %rax
movss %xmm0, (%rax)
movl 0x24(%rsp), %ecx
movq 0x38(%rsp), %rax
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x38(%rsp)
movq 0x60(%rsp), %rax
movl 0x8(%rax), %eax
addl 0x50(%rsp), %eax
movl %eax, 0x50(%rsp)
jmp 0x151ca
jmp 0x1525f
movq 0x60(%rsp), %rax
movl 0xc(%rax), %eax
addl 0x4c(%rsp), %eax
movl %eax, 0x4c(%rsp)
jmp 0x151a3
jmp 0x15276
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x1508b
jmp 0x15288
movl 0x58(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x58(%rsp)
jmp 0x15032
jmp 0x1529a
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x14f61
addq $0x68, %rsp
retq
nop