// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/lbp.c
// Function: vl_lbp_process
VL_EXPORT void
vl_lbp_process (VlLbp * self,
                float * features,
                float * image, vl_size width, vl_size height,
                vl_size cellSize)
{
  vl_size cwidth = width / cellSize;
  vl_size cheight = height / cellSize ;
  vl_size cstride = cwidth * cheight ;
  vl_size cdimension = vl_lbp_get_dimension(self) ;
  vl_index x,y,cx,cy,k,bin ;

#define at(u,v) (*(image + width * (v) + (u)))
#define to(u,v,w) (*(features + cstride * (w) + cwidth * (v) + (u)))

  /* clear the output buffer */
  memset(features, 0, sizeof(float)*cdimension*cstride) ;

  /* accumulate pixel-level measurements into cells */
  for (y = 1 ; y < (signed)height - 1 ; ++y) {
    float wy1 = (y + 0.5f) / (float)cellSize - 0.5f ;
    int cy1 = (int) vl_floor_f(wy1) ;
    int cy2 = cy1 + 1 ;
    float wy2 = wy1 - (float)cy1 ;
    wy1 = 1.0f - wy2 ;
    if (cy1 >= (signed)cheight) continue ;

    for (x = 1 ; x < (signed)width - 1; ++x) {
      float wx1 = (x + 0.5f) / (float)cellSize - 0.5f ;
      int cx1 = (int) vl_floor_f(wx1) ;
      int cx2 = cx1 + 1 ;
      float wx2 = wx1 - (float)cx1 ;
      wx1 = 1.0f - wx2 ;
      if (cx1 >= (signed)cwidth) continue ;

      {
        int unsigned bitString = 0 ;
        float center = at(x,y) ;
        if(at(x+1,y+0) > center) bitString |= 0x1 << 0; /*  E */
        if(at(x+1,y+1) > center) bitString |= 0x1 << 1; /* SE */
        if(at(x+0,y+1) > center) bitString |= 0x1 << 2; /* S  */
        if(at(x-1,y+1) > center) bitString |= 0x1 << 3; /* SW */
        if(at(x-1,y+0) > center) bitString |= 0x1 << 4; /*  W */
        if(at(x-1,y-1) > center) bitString |= 0x1 << 5; /* NW */
        if(at(x+0,y-1) > center) bitString |= 0x1 << 6; /* N  */
        if(at(x+1,y-1) > center) bitString |= 0x1 << 7; /* NE */
        bin = self->mapping[bitString] ;
      }

      if ((cx1 >= 0) & (cy1 >=0)) {
        to(cx1,cy1,bin) += wx1 * wy1;
      }
      if ((cx2 < (signed)cwidth)  & (cy1 >=0)) {
        to(cx2,cy1,bin) += wx2 * wy1 ;
      }
      if ((cx1 >= 0) & (cy2 < (signed)cheight)) {
        to(cx1,cy2,bin) += wx1 * wy2 ;
      }
      if ((cx2 < (signed)cwidth) & (cy2 < (signed)cheight)) {
        to(cx2,cy2,bin) += wx2 * wy2 ;
      }
    } /* x */
  } /* y */

  /* normalize cells */
  for (cy = 0 ; cy < (signed)cheight ; ++cy) {
    for (cx = 0 ; cx < (signed)cwidth ; ++ cx) {
      float norm = 0 ;
      for (k = 0 ; k < (signed)cdimension ; ++k) {
        norm += features[k * cstride] ;
      }
      norm = sqrtf(norm) + 1e-10f; ;
      for (k = 0 ; k < (signed)cdimension ; ++k) {
        features[k * cstride] = sqrtf(features[k * cstride]) / norm  ;
      }
      features += 1 ;
    }
  } /* next cell to normalize */
}

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xc0(%rsp)
movq %rsi, 0xb8(%rsp)
movq %rdx, 0xb0(%rsp)
movq %rcx, 0xa8(%rsp)
movq %r8, 0xa0(%rsp)
movq %r9, 0x98(%rsp)
movq 0xa8(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq 0x98(%rsp)
movq %rax, 0x90(%rsp)
movq 0xa0(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq 0x98(%rsp)
movq %rax, 0x88(%rsp)
movq 0x90(%rsp), %rax
imulq 0x88(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0xc0(%rsp), %rdi
callq 0x9080
movq %rax, 0x78(%rsp)
movq 0xb8(%rsp), %rdi
movq 0x78(%rsp), %rdx
shlq $0x2, %rdx
imulq 0x80(%rsp), %rdx
xorl %esi, %esi
callq 0x9480
movq $0x1, 0x68(%rsp)
movq 0x68(%rsp), %rax
movq 0xa0(%rsp), %rcx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x38161
cvtsi2ssq 0x68(%rsp), %xmm0
movss 0x216e1(%rip), %xmm1    # 0x591f0
addss %xmm1, %xmm0
movss %xmm0, 0x10(%rsp)
movq 0x98(%rsp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x14(%rsp)
testq %rax, %rax
movss %xmm0, 0x18(%rsp)
js 0x37b5a
movss 0x14(%rsp), %xmm0
movss %xmm0, 0x18(%rsp)
movss 0x10(%rsp), %xmm0
movss 0x18(%rsp), %xmm1
divss %xmm1, %xmm0
movss 0x2167e(%rip), %xmm1    # 0x591f0
subss %xmm1, %xmm0
movss %xmm0, 0x44(%rsp)
movss 0x44(%rsp), %xmm0
callq 0x382d0
movl %eax, 0x40(%rsp)
movl 0x40(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
movss 0x44(%rsp), %xmm0
cvtsi2ssl 0x40(%rsp), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x38(%rsp)
movss 0x215dc(%rip), %xmm0    # 0x59190
subss 0x38(%rsp), %xmm0
movss %xmm0, 0x44(%rsp)
movl 0x40(%rsp), %eax
movq 0x88(%rsp), %rcx
cmpl %ecx, %eax
jl 0x37bd5
jmp 0x3814e
movq $0x1, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq 0xa8(%rsp), %rcx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x3814c
cvtsi2ssq 0x70(%rsp), %xmm0
movss 0x215e7(%rip), %xmm1    # 0x591f0
addss %xmm1, %xmm0
movss %xmm0, 0x4(%rsp)
movq 0x98(%rsp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x8(%rsp)
testq %rax, %rax
movss %xmm0, 0xc(%rsp)
js 0x37c54
movss 0x8(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
movss 0x4(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
divss %xmm1, %xmm0
movss 0x21584(%rip), %xmm1    # 0x591f0
subss %xmm1, %xmm0
movss %xmm0, 0x34(%rsp)
movss 0x34(%rsp), %xmm0
callq 0x382d0
movl %eax, 0x30(%rsp)
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
movss 0x34(%rsp), %xmm0
cvtsi2ssl 0x30(%rsp), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x28(%rsp)
movss 0x214e2(%rip), %xmm0    # 0x59190
subss 0x28(%rsp), %xmm0
movss %xmm0, 0x34(%rsp)
movl 0x30(%rsp), %eax
movq 0x90(%rsp), %rcx
cmpl %ecx, %eax
jl 0x37ccf
jmp 0x38139
movl $0x0, 0x24(%rsp)
movq 0xb0(%rsp), %rax
movq 0xa8(%rsp), %rcx
imulq 0x68(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0x70(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x20(%rsp)
movq 0xb0(%rsp), %rax
movq 0xa8(%rsp), %rcx
movq 0x68(%rsp), %rdx
addq $0x0, %rdx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0x70(%rsp), %rcx
movss 0x4(%rax,%rcx,4), %xmm0
ucomiss 0x20(%rsp), %xmm0
jbe 0x37d45
movl 0x24(%rsp), %eax
orl $0x1, %eax
movl %eax, 0x24(%rsp)
movq 0xb0(%rsp), %rax
movq 0xa8(%rsp), %rcx
movq 0x68(%rsp), %rdx
addq $0x1, %rdx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0x70(%rsp), %rcx
movss 0x4(%rax,%rcx,4), %xmm0
ucomiss 0x20(%rsp), %xmm0
jbe 0x37d86
movl 0x24(%rsp), %eax
orl $0x2, %eax
movl %eax, 0x24(%rsp)
movq 0xb0(%rsp), %rax
movq 0xa8(%rsp), %rcx
movq 0x68(%rsp), %rdx
addq $0x1, %rdx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0x70(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
ucomiss 0x20(%rsp), %xmm0
jbe 0x37dc6
movl 0x24(%rsp), %eax
orl $0x4, %eax
movl %eax, 0x24(%rsp)
movq 0xb0(%rsp), %rax
movq 0xa8(%rsp), %rcx
movq 0x68(%rsp), %rdx
addq $0x1, %rdx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0x70(%rsp), %rcx
subq $0x1, %rcx
movss (%rax,%rcx,4), %xmm0
ucomiss 0x20(%rsp), %xmm0
jbe 0x37e0a
movl 0x24(%rsp), %eax
orl $0x8, %eax
movl %eax, 0x24(%rsp)
movq 0xb0(%rsp), %rax
movq 0xa8(%rsp), %rcx
movq 0x68(%rsp), %rdx
addq $0x0, %rdx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0x70(%rsp), %rcx
subq $0x1, %rcx
movss (%rax,%rcx,4), %xmm0
ucomiss 0x20(%rsp), %xmm0
jbe 0x37e4e
movl 0x24(%rsp), %eax
orl $0x10, %eax
movl %eax, 0x24(%rsp)
movq 0xb0(%rsp), %rax
movq 0xa8(%rsp), %rcx
movq 0x68(%rsp), %rdx
subq $0x1, %rdx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0x70(%rsp), %rcx
subq $0x1, %rcx
movss (%rax,%rcx,4), %xmm0
ucomiss 0x20(%rsp), %xmm0
jbe 0x37e92
movl 0x24(%rsp), %eax
orl $0x20, %eax
movl %eax, 0x24(%rsp)
movq 0xb0(%rsp), %rax
movq 0xa8(%rsp), %rcx
movq 0x68(%rsp), %rdx
subq $0x1, %rdx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0x70(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
ucomiss 0x20(%rsp), %xmm0
jbe 0x37ed2
movl 0x24(%rsp), %eax
orl $0x40, %eax
movl %eax, 0x24(%rsp)
movq 0xb0(%rsp), %rax
movq 0xa8(%rsp), %rcx
movq 0x68(%rsp), %rdx
subq $0x1, %rdx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0x70(%rsp), %rcx
movss 0x4(%rax,%rcx,4), %xmm0
ucomiss 0x20(%rsp), %xmm0
jbe 0x37f15
movl 0x24(%rsp), %eax
orl $0x80, %eax
movl %eax, 0x24(%rsp)
movq 0xc0(%rsp), %rax
movl 0x24(%rsp), %ecx
movzbl 0x8(%rax,%rcx), %eax
movq %rax, 0x48(%rsp)
cmpl $0x0, 0x30(%rsp)
setge %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, 0x40(%rsp)
setge %cl
andb $0x1, %cl
movzbl %cl, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x37fa5
movss 0x34(%rsp), %xmm0
movss 0x44(%rsp), %xmm2
movq 0xb8(%rsp), %rax
movq 0x80(%rsp), %rcx
imulq 0x48(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0x90(%rsp), %rcx
movslq 0x40(%rsp), %rdx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq 0x30(%rsp), %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
movl 0x2c(%rsp), %eax
movq 0x90(%rsp), %rcx
cmpl %ecx, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, 0x40(%rsp)
setge %cl
andb $0x1, %cl
movzbl %cl, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x38028
movss 0x28(%rsp), %xmm0
movss 0x44(%rsp), %xmm2
movq 0xb8(%rsp), %rax
movq 0x80(%rsp), %rcx
imulq 0x48(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0x90(%rsp), %rcx
movslq 0x40(%rsp), %rdx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq 0x2c(%rsp), %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
cmpl $0x0, 0x30(%rsp)
setge %al
andb $0x1, %al
movzbl %al, %eax
movl 0x3c(%rsp), %ecx
movq 0x88(%rsp), %rdx
cmpl %edx, %ecx
setl %cl
andb $0x1, %cl
movzbl %cl, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x380ab
movss 0x34(%rsp), %xmm0
movss 0x38(%rsp), %xmm2
movq 0xb8(%rsp), %rax
movq 0x80(%rsp), %rcx
imulq 0x48(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0x90(%rsp), %rcx
movslq 0x3c(%rsp), %rdx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq 0x30(%rsp), %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
movl 0x2c(%rsp), %eax
movq 0x90(%rsp), %rcx
cmpl %ecx, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
movl 0x3c(%rsp), %ecx
movq 0x88(%rsp), %rdx
cmpl %edx, %ecx
setl %cl
andb $0x1, %cl
movzbl %cl, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x38137
movss 0x28(%rsp), %xmm0
movss 0x38(%rsp), %xmm2
movq 0xb8(%rsp), %rax
movq 0x80(%rsp), %rcx
imulq 0x48(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0x90(%rsp), %rcx
movslq 0x3c(%rsp), %rdx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq 0x2c(%rsp), %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
jmp 0x38139
movq 0x70(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x70(%rsp)
jmp 0x37bde
jmp 0x3814e
movq 0x68(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x68(%rsp)
jmp 0x37ae4
movq $0x0, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq 0x88(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x382c5
movq $0x0, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq 0x90(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x382b0
xorps %xmm0, %xmm0
movss %xmm0, 0x1c(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq 0x78(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x38200
movq 0xb8(%rsp), %rax
movq 0x50(%rsp), %rcx
imulq 0x80(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
addss 0x1c(%rsp), %xmm0
movss %xmm0, 0x1c(%rsp)
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x381b7
movss 0x1c(%rsp), %xmm0
callq 0x96a0
movss 0x21d69(%rip), %xmm1    # 0x59f7c
addss %xmm1, %xmm0
movss %xmm0, 0x1c(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq 0x78(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x38289
movq 0xb8(%rsp), %rax
movq 0x50(%rsp), %rcx
imulq 0x80(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
callq 0x96a0
divss 0x1c(%rsp), %xmm0
movq 0xb8(%rsp), %rax
movq 0x50(%rsp), %rcx
imulq 0x80(%rsp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x38226
movq 0xb8(%rsp), %rax
addq $0x4, %rax
movq %rax, 0xb8(%rsp)
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
jmp 0x3818c
jmp 0x382b2
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x3816a
addq $0xc8, %rsp
retq
nopl (%rax)