// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/dsift.c
// Function: vl_dsift_process
void vl_dsift_process (VlDsiftFilter* self, float const* im)
{
  int t, x, y ;

  /* update buffers */
  _vl_dsift_alloc_buffers (self) ;

  /* clear integral images */
  for (t = 0 ; t < self->geom.numBinT ; ++t)
    memset (self->grads[t], 0,
            sizeof(float) * self->imWidth * self->imHeight) ;

#undef at
#define at(x,y) (im[(y)*self->imWidth+(x)])

  /* Compute gradients, their norm, and their angle */

  for (y = 0 ; y < self->imHeight ; ++ y) {
    for (x = 0 ; x < self->imWidth ; ++ x) {
      float gx, gy ;
      float angle, mod, nt, rbint ;
      int bint ;

      /* y derivative */
      if (y == 0) {
        gy = at(x,y+1) - at(x,y) ;
      } else if (y == self->imHeight - 1) {
        gy = at(x,y) - at(x,y-1) ;
      } else {
        gy = 0.5F * (at(x,y+1) - at(x,y-1)) ;
      }

      /* x derivative */
      if (x == 0) {
        gx = at(x+1,y) - at(x,y) ;
      } else if (x == self->imWidth - 1) {
        gx = at(x,y) - at(x-1,y) ;
      } else {
        gx = 0.5F * (at(x+1,y) - at(x-1,y)) ;
      }

      /* angle and modulus */
      angle = vl_fast_atan2_f (gy,gx) ;
      mod = vl_fast_sqrt_f (gx*gx + gy*gy) ;

      /* quantize angle */
      nt = vl_mod_2pi_f (angle) * (self->geom.numBinT / (2*VL_PI)) ;
      bint = (int) vl_floor_f (nt) ;
      rbint = nt - bint ;

      /* write it back */
      self->grads [(bint    ) % self->geom.numBinT][x + y * self->imWidth] = (1 - rbint) * mod ;
      self->grads [(bint + 1) % self->geom.numBinT][x + y * self->imWidth] = (    rbint) * mod ;
    }
  }

  if (self->useFlatWindow) {
    _vl_dsift_with_flat_window(self) ;
  } else {
    _vl_dsift_with_gaussian_window(self) ;
  }

  {
    VlDsiftKeypoint* frameIter = self->frames ;
    float * descrIter = self->descrs ;
    int framex, framey, bint ;

    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) ;

    float deltaCenterX = 0.5F * self->geom.binSizeX * (self->geom.numBinX - 1) ;
    float deltaCenterY = 0.5F * self->geom.binSizeY * (self->geom.numBinY - 1) ;

    float normConstant = frameSizeX * frameSizeY ;

    for (framey  = self->boundMinY ;
         framey <= self->boundMaxY - frameSizeY + 1 ;
         framey += self->stepY) {

      for (framex  = self->boundMinX ;
           framex <= self->boundMaxX - frameSizeX + 1 ;
           framex += self->stepX) {

        frameIter->x    = framex + deltaCenterX ;
        frameIter->y    = framey + deltaCenterY ;

        /* mass */
        {
          float mass = 0 ;
          for (bint = 0 ; bint < descrSize ; ++ bint)
            mass += descrIter[bint] ;
          mass /= normConstant ;
          frameIter->norm = mass ;
        }

        /* L2 normalize */
        _vl_dsift_normalize_histogram (descrIter, descrIter + descrSize) ;

        /* clamp */
        for(bint = 0 ; bint < descrSize ; ++ bint)
          if (descrIter[bint] > 0.2F) descrIter[bint] = 0.2F ;

        /* L2 normalize */
        _vl_dsift_normalize_histogram (descrIter, descrIter + descrSize) ;

        frameIter ++ ;
        descrIter += descrSize ;
      } /* for framex */
    } /* for framey */
  }
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq 0x80(%rsp), %rdi
callq 0x14bb0
movl $0x0, 0x74(%rsp)
movl 0x74(%rsp), %eax
movq 0x80(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x144d2
movq 0x80(%rsp), %rax
movq 0x68(%rax), %rax
movslq 0x74(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x80(%rsp), %rax
movslq (%rax), %rdx
shlq $0x2, %rdx
movq 0x80(%rsp), %rax
movslq 0x4(%rax), %rax
imulq %rax, %rdx
xorl %esi, %esi
callq 0x9480
movl 0x74(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x74(%rsp)
jmp 0x14479
movl $0x0, 0x6c(%rsp)
movl 0x6c(%rsp), %eax
movq 0x80(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x148a8
movl $0x0, 0x70(%rsp)
movl 0x70(%rsp), %eax
movq 0x80(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x14896
cmpl $0x0, 0x6c(%rsp)
jne 0x14560
movq 0x78(%rsp), %rax
movl 0x6c(%rsp), %ecx
addl $0x1, %ecx
movq 0x80(%rsp), %rdx
imull (%rdx), %ecx
addl 0x70(%rsp), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x78(%rsp), %rax
movl 0x6c(%rsp), %ecx
movq 0x80(%rsp), %rdx
imull (%rdx), %ecx
addl 0x70(%rsp), %ecx
movslq %ecx, %rcx
subss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x64(%rsp)
jmp 0x1461b
movl 0x6c(%rsp), %eax
movq 0x80(%rsp), %rcx
movl 0x4(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x145c1
movq 0x78(%rsp), %rax
movl 0x6c(%rsp), %ecx
movq 0x80(%rsp), %rdx
imull (%rdx), %ecx
addl 0x70(%rsp), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x78(%rsp), %rax
movl 0x6c(%rsp), %ecx
subl $0x1, %ecx
movq 0x80(%rsp), %rdx
imull (%rdx), %ecx
addl 0x70(%rsp), %ecx
movslq %ecx, %rcx
subss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x64(%rsp)
jmp 0x14619
movq 0x78(%rsp), %rax
movl 0x6c(%rsp), %ecx
addl $0x1, %ecx
movq 0x80(%rsp), %rdx
imull (%rdx), %ecx
addl 0x70(%rsp), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm1
movq 0x78(%rsp), %rax
movl 0x6c(%rsp), %ecx
subl $0x1, %ecx
movq 0x80(%rsp), %rdx
imull (%rdx), %ecx
addl 0x70(%rsp), %ecx
movslq %ecx, %rcx
subss (%rax,%rcx,4), %xmm1
movss 0x44be1(%rip), %xmm0    # 0x591f0
mulss %xmm1, %xmm0
movss %xmm0, 0x64(%rsp)
jmp 0x1461b
cmpl $0x0, 0x70(%rsp)
jne 0x14672
movq 0x78(%rsp), %rax
movl 0x6c(%rsp), %ecx
movq 0x80(%rsp), %rdx
imull (%rdx), %ecx
movl 0x70(%rsp), %edx
addl $0x1, %edx
addl %edx, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x78(%rsp), %rax
movl 0x6c(%rsp), %ecx
movq 0x80(%rsp), %rdx
imull (%rdx), %ecx
addl 0x70(%rsp), %ecx
movslq %ecx, %rcx
subss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x68(%rsp)
jmp 0x14732
movl 0x70(%rsp), %eax
movq 0x80(%rsp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x146d4
movq 0x78(%rsp), %rax
movl 0x6c(%rsp), %ecx
movq 0x80(%rsp), %rdx
imull (%rdx), %ecx
addl 0x70(%rsp), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x78(%rsp), %rax
movl 0x6c(%rsp), %ecx
movq 0x80(%rsp), %rdx
imull (%rdx), %ecx
movl 0x70(%rsp), %edx
subl $0x1, %edx
addl %edx, %ecx
movslq %ecx, %rcx
subss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x68(%rsp)
jmp 0x14730
movq 0x78(%rsp), %rax
movl 0x6c(%rsp), %ecx
movq 0x80(%rsp), %rdx
imull (%rdx), %ecx
movl 0x70(%rsp), %edx
addl $0x1, %edx
addl %edx, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm1
movq 0x78(%rsp), %rax
movl 0x6c(%rsp), %ecx
movq 0x80(%rsp), %rdx
imull (%rdx), %ecx
movl 0x70(%rsp), %edx
subl $0x1, %edx
addl %edx, %ecx
movslq %ecx, %rcx
subss (%rax,%rcx,4), %xmm1
movss 0x44aca(%rip), %xmm0    # 0x591f0
mulss %xmm1, %xmm0
movss %xmm0, 0x68(%rsp)
jmp 0x14732
movss 0x64(%rsp), %xmm0
movss 0x68(%rsp), %xmm1
callq 0x14cf0
movss %xmm0, 0x60(%rsp)
movss 0x68(%rsp), %xmm0
movss 0x68(%rsp), %xmm2
movss 0x64(%rsp), %xmm1
mulss 0x64(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x14e30
movss %xmm0, 0x5c(%rsp)
movss 0x60(%rsp), %xmm0
callq 0x14ea0
cvtss2sd %xmm0, %xmm0
movq 0x80(%rsp), %rax
cvtsi2sdl 0x20(%rax), %xmm1
movsd 0x44a98(%rip), %xmm2    # 0x59230
divsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x58(%rsp)
movss 0x58(%rsp), %xmm0
callq 0x14f00
movl %eax, 0x50(%rsp)
movss 0x58(%rsp), %xmm0
cvtsi2ssl 0x50(%rsp), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x54(%rsp)
movss 0x449b9(%rip), %xmm0    # 0x59190
subss 0x54(%rsp), %xmm0
mulss 0x5c(%rsp), %xmm0
movq 0x80(%rsp), %rax
movq 0x68(%rax), %rax
movq %rax, 0x8(%rsp)
movl 0x50(%rsp), %eax
movq 0x80(%rsp), %rcx
cltd
idivl 0x20(%rcx)
movq 0x8(%rsp), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %rax
movl 0x70(%rsp), %ecx
movl 0x6c(%rsp), %edx
movq 0x80(%rsp), %rsi
imull (%rsi), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
movss 0x54(%rsp), %xmm0
mulss 0x5c(%rsp), %xmm0
movq 0x80(%rsp), %rax
movq 0x68(%rax), %rax
movq %rax, 0x10(%rsp)
movl 0x50(%rsp), %eax
addl $0x1, %eax
movq 0x80(%rsp), %rcx
cltd
idivl 0x20(%rcx)
movq 0x10(%rsp), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %rax
movl 0x70(%rsp), %ecx
movl 0x6c(%rsp), %edx
movq 0x80(%rsp), %rsi
imull (%rsi), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
movl 0x70(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x70(%rsp)
jmp 0x144f7
jmp 0x14898
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
jmp 0x144da
movq 0x80(%rsp), %rax
cmpl $0x0, 0x34(%rax)
je 0x148c5
movq 0x80(%rsp), %rdi
callq 0x14f50
jmp 0x148d2
movq 0x80(%rsp), %rdi
callq 0x152b0
movq 0x80(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x80(%rsp), %rax
movq 0x50(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x80(%rsp), %rax
movl 0x2c(%rax), %eax
movq 0x80(%rsp), %rcx
movl 0x24(%rcx), %ecx
subl $0x1, %ecx
imull %ecx, %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
movq 0x80(%rsp), %rax
movl 0x30(%rax), %eax
movq 0x80(%rsp), %rcx
movl 0x28(%rcx), %ecx
subl $0x1, %ecx
imull %ecx, %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
movq 0x80(%rsp), %rdi
callq 0x156b0
movl %eax, 0x28(%rsp)
movq 0x80(%rsp), %rax
cvtsi2ssl 0x2c(%rax), %xmm1
movss 0x44890(%rip), %xmm0    # 0x591f0
mulss %xmm1, %xmm0
movq 0x80(%rsp), %rax
movl 0x24(%rax), %eax
subl $0x1, %eax
cvtsi2ss %eax, %xmm1
mulss %xmm1, %xmm0
movss %xmm0, 0x24(%rsp)
movq 0x80(%rsp), %rax
cvtsi2ssl 0x30(%rax), %xmm1
movss 0x4485b(%rip), %xmm0    # 0x591f0
mulss %xmm1, %xmm0
movq 0x80(%rsp), %rax
movl 0x28(%rax), %eax
subl $0x1, %eax
cvtsi2ss %eax, %xmm1
mulss %xmm1, %xmm0
movss %xmm0, 0x20(%rsp)
movl 0x30(%rsp), %eax
imull 0x2c(%rsp), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x1c(%rsp)
movq 0x80(%rsp), %rax
movl 0x14(%rax), %eax
movl %eax, 0x38(%rsp)
movl 0x38(%rsp), %eax
movq 0x80(%rsp), %rcx
movl 0x1c(%rcx), %ecx
subl 0x2c(%rsp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0x14ba4
movq 0x80(%rsp), %rax
movl 0x10(%rax), %eax
movl %eax, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
movq 0x80(%rsp), %rcx
movl 0x18(%rcx), %ecx
subl 0x30(%rsp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0x14b8a
cvtsi2ssl 0x3c(%rsp), %xmm0
addss 0x24(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movq 0x48(%rsp), %rax
movsd %xmm0, (%rax)
cvtsi2ssl 0x38(%rsp), %xmm0
addss 0x20(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movq 0x48(%rsp), %rax
movsd %xmm0, 0x8(%rax)
xorps %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x28(%rsp), %eax
jge 0x14a98
movq 0x40(%rsp), %rax
movslq 0x34(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
addss 0x18(%rsp), %xmm0
movss %xmm0, 0x18(%rsp)
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x14a66
movss 0x1c(%rsp), %xmm1
movss 0x18(%rsp), %xmm0
divss %xmm1, %xmm0
movss %xmm0, 0x18(%rsp)
movss 0x18(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movq 0x48(%rsp), %rax
movsd %xmm0, 0x18(%rax)
movq 0x40(%rsp), %rdi
movq 0x40(%rsp), %rsi
movslq 0x28(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x156c0
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x28(%rsp), %eax
jge 0x14b31
movq 0x40(%rsp), %rax
movslq 0x34(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movss 0x446ee(%rip), %xmm1    # 0x591f4
ucomiss %xmm1, %xmm0
jbe 0x14b22
movq 0x40(%rsp), %rax
movslq 0x34(%rsp), %rcx
movss 0x446d7(%rip), %xmm0    # 0x591f4
movss %xmm0, (%rax,%rcx,4)
jmp 0x14b24
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x14ae5
movq 0x40(%rsp), %rdi
movq 0x40(%rsp), %rsi
movslq 0x28(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x156c0
movq 0x48(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x48(%rsp)
movl 0x28(%rsp), %ecx
movq 0x40(%rsp), %rax
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x40(%rsp)
movq 0x80(%rsp), %rax
movl 0x8(%rax), %eax
addl 0x3c(%rsp), %eax
movl %eax, 0x3c(%rsp)
jmp 0x14a04
jmp 0x14b8c
movq 0x80(%rsp), %rax
movl 0xc(%rax), %eax
addl 0x38(%rsp), %eax
movl %eax, 0x38(%rsp)
jmp 0x149d7
addq $0x88, %rsp
retq
nopl (%rax)