// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/covdet.c
// Function: vl_det_hessian_response
static void
_vl_det_hessian_response (float * hessian,
                          float const * image,
                          vl_size width, vl_size height,
                          double step, double sigma)
{
  float factor = (float) pow(sigma/step, 4.0) ;
  vl_index const xo = 1 ; /* x-stride */
  vl_index const yo = width;  /* y-stride */
  vl_size r, c;

  float p11, p12, p13, p21, p22, p23, p31, p32, p33;

  /* setup input pointer to be centered at 0,1 */
  float const *in = image + yo ;

  /* setup output pointer to be centered at 1,1 */
  float *out = hessian + xo + yo;

  /* move 3x3 window and convolve */
  for (r = 1; r < height - 1; ++r)
  {
    /* fill in shift registers at the beginning of the row */
    p11 = in[-yo]; p12 = in[xo - yo];
    p21 = in[  0]; p22 = in[xo     ];
    p31 = in[+yo]; p32 = in[xo + yo];
    /* setup input pointer to (2,1) of the 3x3 square */
    in += 2;
    for (c = 1; c < width - 1; ++c)
    {
      float Lxx, Lyy, Lxy;
      /* fetch remaining values (last column) */
      p13 = in[-yo]; p23 = *in; p33 = in[+yo];

      /* Compute 3x3 Hessian values from pixel differences. */
      Lxx = (-p21 + 2*p22 - p23);
      Lyy = (-p12 + 2*p22 - p32);
      Lxy = ((p11 - p31 - p13 + p33)/4.0f);

      /* normalize and write out */
      *out = (Lxx * Lyy - Lxy * Lxy) * factor ;

      /* move window */
      p11=p12; p12=p13;
      p21=p22; p22=p23;
      p31=p32; p32=p33;

      /* move input/output pointers */
      in++; out++;
    }
    out += 2;
  }

  /* Copy the computed values to borders */
  in = hessian + yo + xo ;
  out = hessian + xo ;

  /* Top row without corners */
  memcpy(out, in, (width - 2)*sizeof(float));
  out--;
  in -= yo;

  /* Left border columns without last row */
  for (r = 0; r < height - 1; r++){
    *out = *in;
    *(out + yo - 1) = *(in + yo - 3);
    in += yo;
    out += yo;
  }

  /* Bottom corners */
  in -= yo;
  *out = *in;
  *(out + yo - 1) = *(in + yo - 3);

  /* Bottom row without corners */
  out++;
  memcpy(out, in, (width - 2)*sizeof(float));
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdx, 0x90(%rsp)
movq %rcx, 0x88(%rsp)
movsd %xmm0, 0x80(%rsp)
movsd %xmm1, 0x78(%rsp)
movsd 0x78(%rsp), %xmm0
divsd 0x80(%rsp), %xmm0
movsd 0x49b4b(%rip), %xmm1    # 0x59118
callq 0x92b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x74(%rsp)
movq $0x1, 0x68(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x98(%rsp), %rax
movq 0x60(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0xa0(%rsp), %rax
addq $0x4, %rax
movq 0x60(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movq $0x1, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq 0x88(%rsp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0xf88d
movq 0x20(%rsp), %rax
xorl %ecx, %ecx
subq 0x60(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x4c(%rsp)
movq 0x20(%rsp), %rax
movl $0x1, %ecx
subq 0x60(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x48(%rsp)
movq 0x20(%rsp), %rax
movss (%rax), %xmm0
movss %xmm0, 0x40(%rsp)
movq 0x20(%rsp), %rax
movss 0x4(%rax), %xmm0
movss %xmm0, 0x3c(%rsp)
movq 0x20(%rsp), %rax
movq 0x60(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x34(%rsp)
movq 0x20(%rsp), %rax
movq 0x60(%rsp), %rcx
addq $0x1, %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x30(%rsp)
movq 0x20(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x20(%rsp)
movq $0x1, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq 0x90(%rsp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0xf86c
movq 0x20(%rsp), %rax
xorl %ecx, %ecx
subq 0x60(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x44(%rsp)
movq 0x20(%rsp), %rax
movss (%rax), %xmm0
movss %xmm0, 0x38(%rsp)
movq 0x20(%rsp), %rax
movq 0x60(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x2c(%rsp)
movss 0x40(%rsp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
movss 0x3c(%rsp), %xmm0
addss %xmm0, %xmm0
addss %xmm1, %xmm0
subss 0x38(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
movss 0x48(%rsp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
movss 0x3c(%rsp), %xmm0
addss %xmm0, %xmm0
addss %xmm1, %xmm0
subss 0x30(%rsp), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x4c(%rsp), %xmm0
subss 0x34(%rsp), %xmm0
subss 0x44(%rsp), %xmm0
addss 0x2c(%rsp), %xmm0
movss 0x499e9(%rip), %xmm1    # 0x59198
divss %xmm1, %xmm0
movss %xmm0, 0xc(%rsp)
movss 0x14(%rsp), %xmm0
movss 0x10(%rsp), %xmm2
movss 0xc(%rsp), %xmm1
mulss 0xc(%rsp), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
mulss 0x74(%rsp), %xmm0
movq 0x18(%rsp), %rax
movss %xmm0, (%rax)
movss 0x48(%rsp), %xmm0
movss %xmm0, 0x4c(%rsp)
movss 0x44(%rsp), %xmm0
movss %xmm0, 0x48(%rsp)
movss 0x3c(%rsp), %xmm0
movss %xmm0, 0x40(%rsp)
movss 0x38(%rsp), %xmm0
movss %xmm0, 0x3c(%rsp)
movss 0x30(%rsp), %xmm0
movss %xmm0, 0x34(%rsp)
movss 0x2c(%rsp), %xmm0
movss %xmm0, 0x30(%rsp)
movq 0x20(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x20(%rsp)
movq 0x18(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x18(%rsp)
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0xf6e0
movq 0x18(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0xf631
movq 0xa0(%rsp), %rax
movq 0x60(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
addq $0x4, %rax
movq %rax, 0x20(%rsp)
movq 0xa0(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x90(%rsp), %rdx
subq $0x2, %rdx
shlq $0x2, %rdx
callq 0x9640
movq 0x18(%rsp), %rax
addq $-0x4, %rax
movq %rax, 0x18(%rsp)
movq 0x60(%rsp), %rdx
movq 0x20(%rsp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x20(%rsp)
movq $0x0, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq 0x88(%rsp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0xf98a
movq 0x20(%rsp), %rax
movss (%rax), %xmm0
movq 0x18(%rsp), %rax
movss %xmm0, (%rax)
movq 0x20(%rsp), %rax
movq 0x60(%rsp), %rcx
movss -0xc(%rax,%rcx,4), %xmm0
movq 0x18(%rsp), %rax
movq 0x60(%rsp), %rcx
movss %xmm0, -0x4(%rax,%rcx,4)
movq 0x60(%rsp), %rax
shlq $0x2, %rax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x60(%rsp), %rax
shlq $0x2, %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0xf90c
movq 0x60(%rsp), %rdx
movq 0x20(%rsp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movss (%rax), %xmm0
movq 0x18(%rsp), %rax
movss %xmm0, (%rax)
movq 0x20(%rsp), %rax
movq 0x60(%rsp), %rcx
movss -0xc(%rax,%rcx,4), %xmm0
movq 0x18(%rsp), %rax
movq 0x60(%rsp), %rcx
movss %xmm0, -0x4(%rax,%rcx,4)
movq 0x18(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x90(%rsp), %rdx
subq $0x2, %rdx
shlq $0x2, %rdx
callq 0x9640
addq $0xa8, %rsp
retq
nopl (%rax)