// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/covdet.c
// Function: vl_harris_response
static void
_vl_harris_response (float * harris,
                     float const * image,
                     vl_size width, vl_size height,
                     double step, double sigma,
                     double sigmaI, double alpha)
{
  float factor = (float) pow(sigma/step, 4.0) ;
  vl_index k ;

  float * LxLx ;
  float * LyLy ;
  float * LxLy ;

  LxLx = vl_malloc(sizeof(float) * width * height) ;
  LyLy = vl_malloc(sizeof(float) * width * height) ;
  LxLy = vl_malloc(sizeof(float) * width * height) ;

  vl_imgradient_f (LxLx, LyLy, 1, width, image, width, height, width) ;

  for (k = 0 ; k < (signed)(width * height) ; ++k) {
    float dx = LxLx[k] ;
    float dy = LyLy[k] ;
    LxLx[k] = dx*dx ;
    LyLy[k] = dy*dy ;
    LxLy[k] = dx*dy ;
  }

  vl_imsmooth_f(LxLx, width, LxLx, width, height, width,
                sigmaI / step, sigmaI / step) ;

  vl_imsmooth_f(LyLy, width, LyLy, width, height, width,
                sigmaI / step, sigmaI / step) ;

  vl_imsmooth_f(LxLy, width, LxLy, width, height, width,
                sigmaI / step, sigmaI / step) ;

  for (k = 0 ; k < (signed)(width * height) ; ++k) {
    float a = LxLx[k] ;
    float b = LyLy[k] ;
    float c = LxLy[k] ;

    float determinant = a * b - c * c ;
    float trace = a + b ;

    harris[k] = factor * (determinant - alpha * (trace * trace)) ;
  }

  vl_free(LxLy) ;
  vl_free(LyLy) ;
  vl_free(LxLx) ;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movq %rcx, 0x78(%rsp)
movsd %xmm0, 0x70(%rsp)
movsd %xmm1, 0x68(%rsp)
movsd %xmm2, 0x60(%rsp)
movsd %xmm3, 0x58(%rsp)
movsd 0x68(%rsp), %xmm0
divsd 0x70(%rsp), %xmm0
movsd 0x49f08(%rip), %xmm1    # 0x59118
callq 0x92b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x54(%rsp)
movq 0x80(%rsp), %rdi
shlq $0x2, %rdi
imulq 0x78(%rsp), %rdi
callq 0x9660
movq %rax, 0x40(%rsp)
movq 0x80(%rsp), %rdi
shlq $0x2, %rdi
imulq 0x78(%rsp), %rdi
callq 0x9660
movq %rax, 0x38(%rsp)
movq 0x80(%rsp), %rdi
shlq $0x2, %rdi
imulq 0x78(%rsp), %rdi
callq 0x9660
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x80(%rsp), %rcx
movq 0x88(%rsp), %r8
movq 0x80(%rsp), %r9
movq 0x78(%rsp), %r10
movq 0x80(%rsp), %rax
movl $0x1, %edx
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x9190
movq $0x0, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq 0x80(%rsp), %rcx
imulq 0x78(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0xf36b
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x2c(%rsp)
movq 0x38(%rsp), %rax
movq 0x48(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x28(%rsp)
movss 0x2c(%rsp), %xmm0
mulss 0x2c(%rsp), %xmm0
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
movss %xmm0, (%rax,%rcx,4)
movss 0x28(%rsp), %xmm0
mulss 0x28(%rsp), %xmm0
movq 0x38(%rsp), %rax
movq 0x48(%rsp), %rcx
movss %xmm0, (%rax,%rcx,4)
movss 0x2c(%rsp), %xmm0
mulss 0x28(%rsp), %xmm0
movq 0x30(%rsp), %rax
movq 0x48(%rsp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0xf2be
movq 0x40(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x80(%rsp), %rcx
movq 0x78(%rsp), %r8
movq 0x80(%rsp), %r9
movsd 0x60(%rsp), %xmm0
divsd 0x70(%rsp), %xmm0
movsd 0x60(%rsp), %xmm1
divsd 0x70(%rsp), %xmm1
callq 0x98e0
movq 0x38(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x80(%rsp), %rcx
movq 0x78(%rsp), %r8
movq 0x80(%rsp), %r9
movsd 0x60(%rsp), %xmm0
divsd 0x70(%rsp), %xmm0
movsd 0x60(%rsp), %xmm1
divsd 0x70(%rsp), %xmm1
callq 0x98e0
movq 0x30(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x80(%rsp), %rcx
movq 0x78(%rsp), %r8
movq 0x80(%rsp), %r9
movsd 0x60(%rsp), %xmm0
divsd 0x70(%rsp), %xmm0
movsd 0x60(%rsp), %xmm1
divsd 0x70(%rsp), %xmm1
callq 0x98e0
movq $0x0, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq 0x80(%rsp), %rcx
imulq 0x78(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0xf559
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x24(%rsp)
movq 0x38(%rsp), %rax
movq 0x48(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq 0x48(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x24(%rsp), %xmm0
movss 0x20(%rsp), %xmm2
movss 0x1c(%rsp), %xmm1
mulss 0x1c(%rsp), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x18(%rsp)
movss 0x24(%rsp), %xmm0
addss 0x20(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
movss 0x54(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0x18(%rsp), %xmm1
cvtss2sd %xmm1, %xmm2
movsd 0x58(%rsp), %xmm1
movss 0x14(%rsp), %xmm3
mulss 0x14(%rsp), %xmm3
cvtss2sd %xmm3, %xmm3
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq 0x90(%rsp), %rax
movq 0x48(%rsp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0xf440
movq 0x30(%rsp), %rdi
callq 0x9620
movq 0x38(%rsp), %rdi
callq 0x9620
movq 0x40(%rsp), %rdi
callq 0x9620
addq $0x98, %rsp
retq
nop