// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, 0x8(%rsp)
movq %rdi, %rbx
callq 0x97f0
movl 0x20(%rbx), %r14d
movl 0x40(%rbx), %eax
movl 0x44(%rbx), %r13d
cmpl 0x58(%rbx), %r13d
jne 0xe94f
cmpl 0x60(%rbx), %r14d
jne 0xe94f
cmpl 0x5c(%rbx), %eax
je 0xe9dd
movl %eax, 0x40(%rsp)
movslq %eax, %rbp
movslq %r13d, %r15
movslq %r14d, %r12
movq %rbx, %rdi
callq 0xe89f
movq %rbp, %rdi
shlq $0x5, %rdi
callq 0x95e0
movq %rax, 0x48(%rbx)
imulq %rbp, %r15
shlq $0x2, %r15
movq %r15, %rdi
callq 0x95e0
movq %rax, 0x50(%rbx)
shlq $0x3, %r12
movq %r12, %rdi
callq 0x95e0
movq %rax, 0x68(%rbx)
xorl %r15d, %r15d
testl %r14d, %r14d
movl $0x0, %r12d
cmovgl %r14d, %r12d
cmpq %r15, %r12
je 0xe9ce
movslq (%rbx), %rax
movslq 0x4(%rbx), %rdi
imulq %rax, %rdi
shlq $0x2, %rdi
callq 0x95e0
movq 0x68(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
jmp 0xe9a8
movl %r13d, 0x58(%rbx)
movl %r14d, 0x60(%rbx)
movl 0x40(%rsp), %eax
movl %eax, 0x5c(%rbx)
xorl %r14d, %r14d
movslq 0x20(%rbx), %r15
cmpq %r15, %r14
jge 0xea0c
movq 0x68(%rbx), %rax
movq (%rax,%r14,8), %rdi
movslq (%rbx), %rax
movslq 0x4(%rbx), %rdx
imulq %rax, %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x9420
incq %r14
jmp 0xe9e0
movl 0x4(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x38(%rsp)
cvtsi2sd %r15d, %xmm0
divsd 0x1e95d(%rip), %xmm0    # 0x2d380
movsd %xmm0, 0x20(%rsp)
xorl %r13d, %r13d
testl %eax, %eax
cmovlel %r13d, %eax
movq %rax, 0x78(%rsp)
movq 0x8(%rsp), %rax
leaq 0x4(%rax), %rcx
movq %rcx, 0x70(%rsp)
addq $-0x4, %rax
movq %rax, 0x68(%rsp)
movss 0x1e8ee(%rip), %xmm6    # 0x2d344
cmpl 0x78(%rsp), %r13d
je 0xecf3
movslq (%rbx), %rax
leal 0x1(%r13), %edx
movl %eax, %ecx
movl %edx, 0x64(%rsp)
imull %edx, %ecx
leal -0x1(%r13), %edx
imull %eax, %edx
movl %eax, %esi
imull %r13d, %esi
leal -0x1(%rax), %r14d
movslq %esi, %rbp
movslq %edx, %rdx
movslq %ecx, %rcx
testl %eax, %eax
movl $0x0, %esi
cmovgl %eax, %esi
movq %rsi, 0x18(%rsp)
movq 0x8(%rsp), %rsi
leaq (%rsi,%rcx,4), %rcx
movq %rcx, 0x58(%rsp)
leaq (%rsi,%rdx,4), %rcx
movq %rcx, 0x10(%rsp)
leaq (%rsi,%rbp,4), %rcx
movq %rcx, 0x28(%rsp)
leaq (%rsi,%rax,4), %rax
movq %rax, 0x30(%rsp)
movq 0x70(%rsp), %rax
leaq (%rax,%rbp,4), %rax
movq %rax, 0x90(%rsp)
movq 0x68(%rsp), %rax
leaq (%rax,%rbp,4), %rcx
movq %rcx, 0x88(%rsp)
leaq (%rax,%r14,4), %rax
movq %rax, 0x80(%rsp)
xorl %r12d, %r12d
cmpq 0x18(%rsp), %r12
je 0xece7
testl %r13d, %r13d
xorps %xmm5, %xmm5
je 0xeb20
cmpl 0x38(%rsp), %r13d
jne 0xeb38
movq 0x28(%rsp), %rax
movss (%rax,%r12,4), %xmm1
movq 0x10(%rsp), %rax
jmp 0xeb30
movq 0x30(%rsp), %rax
movss (%rax,%r12,4), %xmm1
movq 0x8(%rsp), %rax
subss (%rax,%r12,4), %xmm1
jmp 0xeb56
movq 0x58(%rsp), %rax
movss (%rax,%r12,4), %xmm1
movq 0x10(%rsp), %rax
subss (%rax,%r12,4), %xmm1
mulss 0x1e7d2(%rip), %xmm1    # 0x2d328
testq %r12, %r12
je 0xeb75
cmpq %r14, %r12
jne 0xeb87
movq 0x28(%rsp), %rax
movss (%rax,%r14,4), %xmm0
movq 0x80(%rsp), %rax
jmp 0xeb80
movq 0x8(%rsp), %rax
movss 0x4(%rax,%rbp,4), %xmm0
subss (%rax,%rbp,4), %xmm0
jmp 0xebab
movq 0x90(%rsp), %rax
movss (%rax,%r12,4), %xmm0
movq 0x88(%rsp), %rax
subss (%rax,%r12,4), %xmm0
mulss 0x1e77d(%rip), %xmm0    # 0x2d328
movaps %xmm1, %xmm3
andps 0x1e59b(%rip), %xmm3    # 0x2d150
addss 0x1e76f(%rip), %xmm3    # 0x2d32c
ucomiss %xmm5, %xmm0
movaps %xmm3, %xmm4
addss %xmm0, %xmm4
jae 0xebde
subss %xmm0, %xmm3
divss %xmm3, %xmm4
movaps %xmm4, %xmm2
movss 0x1e758(%rip), %xmm3    # 0x2d334
jmp 0xebf1
movaps %xmm0, %xmm2
subss %xmm3, %xmm2
divss %xmm4, %xmm2
movss 0x1e73f(%rip), %xmm3    # 0x2d330
movaps %xmm2, %xmm4
mulss 0x1e73c(%rip), %xmm4    # 0x2d338
mulss %xmm2, %xmm4
addss 0x1e734(%rip), %xmm4    # 0x2d33c
mulss %xmm2, %xmm4
addss %xmm3, %xmm4
movaps %xmm1, %xmm2
cmpltss %xmm5, %xmm2
movaps %xmm2, %xmm3
andnps %xmm4, %xmm3
xorps 0x1e74b(%rip), %xmm4    # 0x2d370
andps %xmm2, %xmm4
orps %xmm3, %xmm4
mulss %xmm1, %xmm1
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
movss 0x1e701(%rip), %xmm1    # 0x2d340
ucomiss %xmm1, %xmm4
jbe 0xec4e
addss %xmm6, %xmm4
jmp 0xec3f
addss %xmm1, %xmm4
ucomiss %xmm4, %xmm5
ja 0xec4a
movaps %xmm4, 0x40(%rsp)
callq 0xf21b
movss 0x1e6df(%rip), %xmm6    # 0x2d344
cvtss2sd 0x40(%rsp), %xmm1
mulsd 0x20(%rsp), %xmm1
cvtsd2ss %xmm1, %xmm1
cvttss2si %xmm1, %rcx
cvtsi2ss %rcx, %xmm2
cmpneqps %xmm1, %xmm2
xorps %xmm3, %xmm3
cmpnleps %xmm1, %xmm3
andps %xmm2, %xmm3
movd %xmm3, %esi
leal (%rcx,%rsi), %eax
cvtsi2ss %eax, %xmm2
subss %xmm2, %xmm1
movss 0x1e680(%rip), %xmm2    # 0x2d324
subss %xmm1, %xmm2
mulss %xmm0, %xmm2
movq 0x68(%rbx), %rdi
cltd
idivl %r15d
movslq %edx, %rax
movq (%rdi,%rax,8), %rax
leaq (%r12,%rbp), %r8
movss %xmm2, (%rax,%r8,4)
mulss %xmm0, %xmm1
leal (%rcx,%rsi), %eax
incl %eax
cltd
idivl %r15d
movslq %edx, %rax
movq (%rdi,%rax,8), %rax
movss %xmm1, (%rax,%r8,4)
incq %r12
jmp 0xeaf4
movl 0x64(%rsp), %eax
movl %eax, %r13d
jmp 0xea56
cmpl $0x0, 0x34(%rbx)
je 0xf038
xorl %r14d, %r14d
movslq %r15d, %rax
cmpq %rax, %r14
jge 0xeeb5
movq 0x68(%rbx), %rax
movq 0x70(%rbx), %rdi
movslq 0x4(%rbx), %rsi
movq (%rax,%r14,8), %rdx
movslq (%rbx), %rcx
movslq 0x30(%rbx), %rax
subq $0x8, %rsp
movq %rsi, %r8
movq %rcx, %r9
pushq $0x5
popq %r10
movq %r10, %r15
pushq %r10
pushq $0x1
popq %r12
pushq %r12
pushq %rax
callq 0x9600
addq $0x20, %rsp
movq 0x70(%rbx), %rdx
movq 0x78(%rbx), %rdi
movslq (%rbx), %rsi
movslq 0x4(%rbx), %rcx
movslq 0x2c(%rbx), %rax
subq $0x8, %rsp
movq %rsi, %r8
movq %rcx, %r9
pushq %r15
pushq %r12
pushq %rax
callq 0x9600
addq $0x20, %rsp
xorl %edx, %edx
movq %r14, 0x10(%rsp)
leaq (,%r14,4), %rax
movq %rax, 0x8(%rsp)
movl 0x28(%rbx), %esi
cmpl %esi, %edx
jge 0xeea4
movl 0x30(%rbx), %edi
movsd 0x38(%rbx), %xmm0
movl %edx, 0x18(%rsp)
callq 0xf2d5
cvtsi2ssl 0x30(%rbx), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, 0x20(%rsp)
movl 0x24(%rbx), %esi
xorl %r14d, %r14d
cmpl %esi, %r14d
jge 0xee99
movl 0x2c(%rbx), %edi
movsd 0x38(%rbx), %xmm0
movl %r14d, %edx
callq 0xf2d5
movq 0x50(%rbx), %rax
addq 0x8(%rsp), %rax
movl 0x20(%rbx), %ecx
movl %ecx, %edx
imull %r14d, %edx
movslq %edx, %rdx
leaq (%rax,%rdx,4), %rax
movl 0x24(%rbx), %esi
movl 0x18(%rsp), %ebp
imull %ebp, %ecx
imull %esi, %ecx
movslq %ecx, %rcx
leaq (%rax,%rcx,4), %rax
movq 0x78(%rbx), %rcx
movl 0x2c(%rbx), %edx
leal -0x1(%rsi), %edi
imull %edx, %edi
movl 0x30(%rbx), %r8d
movl 0x28(%rbx), %r15d
decl %r15d
imull %r8d, %r15d
movslq 0x44(%rbx), %r9
cvtsi2ss %edx, %xmm1
mulss %xmm0, %xmm1
mulss 0x20(%rsp), %xmm1
movl 0x14(%rbx), %r10d
movl 0x1c(%rbx), %r11d
subl %r15d, %r11d
movl %r14d, 0x40(%rsp)
imull %r14d, %edx
imull %ebp, %r8d
shlq $0x2, %r9
cmpl %r11d, %r10d
jg 0xee8c
movl 0x10(%rbx), %r13d
movl 0x18(%rbx), %r12d
subl %edi, %r12d
leal (%r10,%r8), %r15d
cmpl %r12d, %r13d
jg 0xee86
movl (%rbx), %r14d
imull %r15d, %r14d
addl %r13d, %r14d
addl %edx, %r14d
movslq %r14d, %r14
movss (%rcx,%r14,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, (%rax)
addl 0x8(%rbx), %r13d
addq %r9, %rax
jmp 0xee5a
addl 0xc(%rbx), %r10d
jmp 0xee46
movl 0x40(%rsp), %r14d
incl %r14d
jmp 0xedb6
movl 0x18(%rsp), %edx
incl %edx
jmp 0xed85
movq 0x10(%rsp), %r14
incq %r14
movl 0x20(%rbx), %r15d
jmp 0xed00
movl 0x28(%rbx), %esi
movq 0x48(%rbx), %r13
movq 0x50(%rbx), %r14
movl 0x24(%rbx), %ecx
decl %ecx
cvtsi2ss %ecx, %xmm0
movl 0x2c(%rbx), %eax
movl 0x14(%rbx), %r8d
imull %eax, %ecx
movq %rcx, 0x40(%rsp)
incl %ecx
decl %esi
cvtsi2ss %esi, %xmm1
movl 0x30(%rbx), %edx
imull %edx, %esi
leal 0x1(%rsi), %edi
imull %ecx, %edi
cvtsi2ss %eax, %xmm3
movss 0x1e430(%rip), %xmm2    # 0x2d328
mulss %xmm2, %xmm3
mulss %xmm0, %xmm3
movss %xmm3, 0x20(%rsp)
cvtsi2ss %edx, %xmm0
mulss %xmm2, %xmm0
cvtsi2ss %edi, %xmm2
movss %xmm2, 0x8(%rsp)
movslq 0x44(%rbx), %rax
mulss %xmm1, %xmm0
movss %xmm0, 0x30(%rsp)
xorl %ebp, %ebp
testl %eax, %eax
cmovgl %eax, %ebp
shlq $0x2, %rax
movq %rax, 0x10(%rsp)
movq %rsi, 0x38(%rsp)
movl 0x1c(%rbx), %eax
subl %esi, %eax
cmpl %eax, %r8d
jg 0xf026
movl %r8d, 0x28(%rsp)
cvtsi2ss %r8d, %xmm0
movl 0x10(%rbx), %r15d
addss 0x30(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
movl 0x18(%rbx), %eax
subl 0x40(%rsp), %eax
cmpl %eax, %r15d
jg 0xf013
cvtsi2ss %r15d, %xmm0
addss 0x20(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, (%r13)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x8(%r13)
xorps %xmm0, %xmm0
xorl %eax, %eax
cmpq %rax, %rbp
je 0xefad
addss (%r14,%rax,4), %xmm0
incq %rax
jmp 0xef9d
divss 0x8(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x18(%r13)
movq 0x10(%rsp), %rax
leaq (%r14,%rax), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0xf280
xorl %eax, %eax
movss 0x1e36d(%rip), %xmm1    # 0x2d348
cmpq %rax, %rbp
je 0xeff8
movss (%r14,%rax,4), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xeff3
movl $0x3e4ccccd, (%r14,%rax,4) # imm = 0x3E4CCCCD
incq %rax
jmp 0xefdb
movq %r14, %rdi
movq %r12, %rsi
callq 0xf280
addq $0x20, %r13
addl 0x8(%rbx), %r15d
movq %r12, %r14
jmp 0xef67
movl 0x28(%rsp), %r8d
addl 0xc(%rbx), %r8d
movq 0x38(%rsp), %rsi
jmp 0xef3b
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movslq 0x2c(%rbx), %rax
movslq 0x30(%rbx), %rcx
pushq $0x1
popq %rdx
movq %rdx, %rsi
subq %rcx, %rsi
movq %rsi, 0x58(%rsp)
decq %rcx
movq %rcx, 0x38(%rsp)
subq %rax, %rdx
movq %rdx, 0x30(%rsp)
decq %rax
movq %rax, 0x28(%rsp)
xorl %edx, %edx
movl 0x28(%rbx), %esi
cmpl %esi, %edx
jge 0xeeb8
movl 0x30(%rbx), %edi
movsd 0x38(%rbx), %xmm0
movq %rdx, 0x8(%rsp)
callq 0xe62c
movq %rax, 0x10(%rsp)
xorl %edx, %edx
movl 0x24(%rbx), %esi
cmpl %esi, %edx
jge 0xf205
movl 0x2c(%rbx), %edi
movsd 0x38(%rbx), %xmm0
movl %edx, 0x18(%rsp)
callq 0xe62c
movq %rax, 0x20(%rsp)
movl 0x20(%rbx), %eax
xorl %r12d, %r12d
cltq
cmpq %rax, %r12
jge 0xf1f0
movq 0x68(%rbx), %rax
movq 0x70(%rbx), %rdi
movslq 0x4(%rbx), %rsi
movq (%rax,%r12,8), %rdx
movslq (%rbx), %rcx
subq $0x8, %rsp
movq %rsi, %r8
movq %rcx, %r9
pushq $0x5
popq %rax
movq %rax, %r14
pushq %rax
pushq $0x1
popq %rax
movq %rax, %r15
pushq %rax
pushq 0x50(%rsp)
pushq 0x78(%rsp)
pushq 0x38(%rsp)
callq 0x92c0
addq $0x30, %rsp
movq 0x70(%rbx), %rdx
movq 0x78(%rbx), %rdi
movslq (%rbx), %rsi
movslq 0x4(%rbx), %rcx
subq $0x8, %rsp
movq %rsi, %r8
movq %rcx, %r9
pushq %r14
pushq %r15
pushq 0x40(%rsp)
pushq 0x50(%rsp)
pushq 0x48(%rsp)
callq 0x92c0
addq $0x30, %rsp
movq %r12, 0x40(%rsp)
leaq (,%r12,4), %rcx
addq 0x50(%rbx), %rcx
movl 0x20(%rbx), %eax
movl %eax, %edx
movl 0x18(%rsp), %ebp
imull %ebp, %edx
movslq %edx, %rdx
leaq (%rcx,%rdx,4), %rdx
movl 0x24(%rbx), %ecx
movl %eax, %esi
movq 0x8(%rsp), %r15
imull %r15d, %esi
imull %ecx, %esi
movslq %esi, %rsi
leaq (%rdx,%rsi,4), %rdx
movq 0x78(%rbx), %rsi
movl 0x2c(%rbx), %edi
decl %ecx
imull %edi, %ecx
movl 0x30(%rbx), %r8d
movl 0x28(%rbx), %r14d
decl %r14d
imull %r8d, %r14d
movslq 0x44(%rbx), %r9
movl 0x14(%rbx), %r10d
movl 0x1c(%rbx), %r11d
subl %r14d, %r11d
imull %ebp, %edi
imull %r15d, %r8d
shlq $0x2, %r9
cmpl %r11d, %r10d
jg 0xf1e3
movl 0x10(%rbx), %r15d
movl 0x18(%rbx), %r12d
subl %ecx, %r12d
leal (%r10,%r8), %r14d
cmpl %r12d, %r15d
jg 0xf1dd
movl (%rbx), %r13d
imull %r14d, %r13d
addl %r15d, %r13d
addl %edi, %r13d
movslq %r13d, %r13
movss (%rsi,%r13,4), %xmm0
movss %xmm0, (%rdx)
addl 0x8(%rbx), %r15d
addq %r9, %rdx
jmp 0xf1b5
addl 0xc(%rbx), %r10d
jmp 0xf1a1
movq 0x40(%rsp), %r12
incq %r12
jmp 0xf0b3
movq 0x20(%rsp), %rdi
callq 0x95b0
movl 0x18(%rsp), %edx
incl %edx
jmp 0xf08c
movq 0x10(%rsp), %rdi
callq 0x95b0
movq 0x8(%rsp), %rdx
incl %edx
jmp 0xf068