// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/hog.c
// Function: vl_hog_render
void
vl_hog_render (VlHog const * self,
               float * image,
               float const * descriptor,
               vl_size width,
               vl_size height)
{
  vl_index x, y, k, cx, cy ;
  vl_size hogStride = width * height ;

  assert(self) ;
  assert(image) ;
  assert(descriptor) ;
  assert(width > 0) ;
  assert(height > 0) ;

  for (y = 0 ; y < (signed)height ; ++y) {
    for (x = 0 ; x < (signed)width ; ++x) {
      float minWeight = 0 ;
      float maxWeight = 0 ;

      for (k = 0 ; k < (signed)self->numOrientations ; ++k) {
        float weight ;
        float const * glyph = self->glyphs + k * (self->glyphSize*self->glyphSize) ;
        float * glyphImage = image + self->glyphSize * x + y * width * (self->glyphSize*self->glyphSize) ;

        switch (self->variant) {
          case VlHogVariantUoctti:
            weight =
            descriptor[k * hogStride] +
            descriptor[(k + self->numOrientations) * hogStride] +
            descriptor[(k + 2 * self->numOrientations) * hogStride] ;
            break ;
          case VlHogVariantDalalTriggs:
            weight =
            descriptor[k * hogStride] +
            descriptor[(k + self->numOrientations) * hogStride] +
            descriptor[(k + 2 * self->numOrientations) * hogStride] +
            descriptor[(k + 3 * self->numOrientations) * hogStride] ;
            break ;
          default:
            abort() ;
        }
        maxWeight = VL_MAX(weight, maxWeight) ;
        minWeight = VL_MIN(weight, minWeight);

        for (cy = 0 ; cy < (signed)self->glyphSize ; ++cy) {
          for (cx = 0 ; cx < (signed)self->glyphSize ; ++cx) {
            *glyphImage++ += weight * (*glyph++) ;
          }
          glyphImage += (width - 1) * self->glyphSize  ;
        }
      } /* next orientation */

      {
        float * glyphImage = image + self->glyphSize * x + y * width * (self->glyphSize*self->glyphSize) ;
        for (cy = 0 ; cy < (signed)self->glyphSize ; ++cy) {
          for (cx = 0 ; cx < (signed)self->glyphSize ; ++cx) {
            float value = *glyphImage ;
            *glyphImage++ = VL_MAX(minWeight, VL_MIN(maxWeight, value)) ;
          }
          glyphImage += (width - 1) * self->glyphSize  ;
        }
      }

      ++ descriptor ;
    } /* next column of cells (x) */
  } /* next row of cells (y) */
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdx, 0x90(%rsp)
movq %rcx, 0x88(%rsp)
movq %r8, 0x80(%rsp)
movq 0x88(%rsp), %rax
imulq 0x80(%rsp), %rax
movq %rax, 0x50(%rsp)
movq $0x0, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq 0x80(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x1f621
movq $0x0, 0x78(%rsp)
movq 0x78(%rsp), %rax
movq 0x88(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x1f60c
xorps %xmm0, %xmm0
movss %xmm0, 0x4c(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x48(%rsp)
movq $0x0, 0x68(%rsp)
movq 0x68(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq 0x10(%rcx), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x1f43d
movq 0xa0(%rsp), %rdx
movq 0x68(%rsp), %rcx
movq 0x28(%rdx), %rax
movq 0x30(%rdx), %rdx
imulq %rdx, %rdx
imulq %rdx, %rcx
leaq (%rax,%rcx,4), %rax
movq %rax, 0x38(%rsp)
movq 0x98(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq 0x30(%rcx), %rdx
movq 0x78(%rsp), %rsi
movq %rdx, %rcx
imulq %rsi, %rcx
leaq (%rax,%rcx,4), %rax
movq 0x70(%rsp), %rcx
movq 0x88(%rsp), %rsi
imulq %rsi, %rcx
imulq %rdx, %rdx
imulq %rdx, %rcx
leaq (%rax,%rcx,4), %rax
movq %rax, 0x30(%rsp)
movq 0xa0(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x20(%rsp)
testl %eax, %eax
je 0x1f255
jmp 0x1f1d5
movl 0x20(%rsp), %eax
subl $0x1, %eax
jne 0x1f2eb
jmp 0x1f1e4
movq 0x90(%rsp), %rax
movq 0x68(%rsp), %rcx
imulq 0x50(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x90(%rsp), %rax
movq 0x68(%rsp), %rcx
movq 0xa0(%rsp), %rdx
addq 0x10(%rdx), %rcx
imulq 0x50(%rsp), %rcx
addss (%rax,%rcx,4), %xmm0
movq 0x90(%rsp), %rax
movq 0x68(%rsp), %rcx
movq 0xa0(%rsp), %rdx
movq 0x10(%rdx), %rdx
shlq %rdx
addq %rdx, %rcx
imulq 0x50(%rsp), %rcx
addss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x44(%rsp)
jmp 0x1f2f0
movq 0x90(%rsp), %rax
movq 0x68(%rsp), %rcx
imulq 0x50(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x90(%rsp), %rax
movq 0x68(%rsp), %rcx
movq 0xa0(%rsp), %rdx
addq 0x10(%rdx), %rcx
imulq 0x50(%rsp), %rcx
addss (%rax,%rcx,4), %xmm0
movq 0x90(%rsp), %rax
movq 0x68(%rsp), %rcx
movq 0xa0(%rsp), %rdx
movq 0x10(%rdx), %rdx
shlq %rdx
addq %rdx, %rcx
imulq 0x50(%rsp), %rcx
addss (%rax,%rcx,4), %xmm0
movq 0x90(%rsp), %rax
movq 0x68(%rsp), %rcx
movq 0xa0(%rsp), %rdx
imulq $0x3, 0x10(%rdx), %rdx
addq %rdx, %rcx
imulq 0x50(%rsp), %rcx
addss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x44(%rsp)
jmp 0x1f2f0
callq 0x90b0
movss 0x44(%rsp), %xmm0
ucomiss 0x48(%rsp), %xmm0
jbe 0x1f30b
movss 0x44(%rsp), %xmm0
movss %xmm0, 0x1c(%rsp)
jmp 0x1f317
movss 0x48(%rsp), %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x1c(%rsp), %xmm0
movss %xmm0, 0x48(%rsp)
movss 0x44(%rsp), %xmm1
movss 0x4c(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x1f342
movss 0x44(%rsp), %xmm0
movss %xmm0, 0x18(%rsp)
jmp 0x1f34e
movss 0x4c(%rsp), %xmm0
movss %xmm0, 0x18(%rsp)
movss 0x18(%rsp), %xmm0
movss %xmm0, 0x4c(%rsp)
movq $0x0, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq 0x30(%rcx), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x1f428
movq $0x0, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq 0x30(%rcx), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x1f3ee
movss 0x44(%rsp), %xmm0
movq 0x38(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x38(%rsp)
movss (%rax), %xmm2
movq 0x30(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x30(%rsp)
movss (%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax)
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
jmp 0x1f389
movq 0x88(%rsp), %rax
subq $0x1, %rax
movq 0xa0(%rsp), %rcx
imulq 0x30(%rcx), %rax
shlq $0x2, %rax
addq 0x30(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x1f363
jmp 0x1f42a
movq 0x68(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x68(%rsp)
jmp 0x1f134
movq 0x98(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq 0x30(%rcx), %rcx
imulq 0x78(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0x70(%rsp), %rcx
imulq 0x88(%rsp), %rcx
movq 0xa0(%rsp), %rdx
movq 0x30(%rdx), %rdx
movq 0xa0(%rsp), %rsi
imulq 0x30(%rsi), %rdx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
movq $0x0, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq 0x30(%rcx), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x1f5e5
movq $0x0, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq 0x30(%rcx), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x1f5ab
movq 0x28(%rsp), %rax
movss (%rax), %xmm0
movss %xmm0, 0x24(%rsp)
movss 0x4c(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
movss 0x48(%rsp), %xmm1
movss 0x24(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x1f51b
movss 0x48(%rsp), %xmm0
movss %xmm0, 0x10(%rsp)
jmp 0x1f527
movss 0x24(%rsp), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x14(%rsp), %xmm0
movss 0x10(%rsp), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x1f546
movss 0x4c(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
jmp 0x1f57d
movss 0x48(%rsp), %xmm1
movss 0x24(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x1f565
movss 0x48(%rsp), %xmm0
movss %xmm0, 0x8(%rsp)
jmp 0x1f571
movss 0x24(%rsp), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0x8(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
movss 0xc(%rsp), %xmm0
movq 0x28(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x28(%rsp)
movss %xmm0, (%rax)
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
jmp 0x1f4c4
movq 0x88(%rsp), %rax
subq $0x1, %rax
movq 0xa0(%rsp), %rcx
imulq 0x30(%rcx), %rax
shlq $0x2, %rax
addq 0x28(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x1f49e
movq 0x90(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x90(%rsp)
movq 0x78(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x78(%rsp)
jmp 0x1f100
jmp 0x1f60e
movq 0x70(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x70(%rsp)
jmp 0x1f0de
addq $0xa8, %rsp
retq
nopl (%rax)