// File: /workspace/github_c_makefile_star2_O2/zpole[P]IICV/vl/covdet.c
// Function: vl_covdet_extract_laplacian_scales
void
vl_covdet_extract_laplacian_scales (VlCovDet * self)
{
  vl_index i, j  ;
  vl_bool dropFeaturesWithoutScale = VL_TRUE ;
  vl_size numFeatures = vl_covdet_get_num_features(self) ;
  memset(self->numFeaturesWithNumScales, 0,
         sizeof(self->numFeaturesWithNumScales)) ;

  for (i = 0 ; i < (signed)numFeatures ; ++i) {
    vl_size numScales ;
    VlCovDetFeature feature = self->features[i] ;
    VlCovDetFeatureLaplacianScale const * scales =
    vl_covdet_extract_laplacian_scales_for_frame(self, &numScales, feature.frame) ;

    self->numFeaturesWithNumScales[numScales] ++ ;

    if (numScales == 0 && dropFeaturesWithoutScale) {
      self->features[i].peakScore = 0 ;
    }

    for (j = 0 ; j < (signed)numScales ; ++j) {
      VlCovDetFeature * scaled ;

      if (j == 0) {
        scaled = & self->features[i] ;
      } else {
        vl_covdet_append_feature(self, &feature) ;
        scaled = & self->features[self->numFeatures -1] ;
      }

      scaled->laplacianScaleScore = scales[j].score ;
      scaled->frame.a11 *= scales[j].scale ;
      scaled->frame.a21 *= scales[j].scale ;
      scaled->frame.a12 *= scales[j].scale ;
      scaled->frame.a22 *= scales[j].scale ;
    }
  }
  if (dropFeaturesWithoutScale) {
    j = 0 ;
    for (i = 0 ; i < (signed)self->numFeatures ; ++i) {
      VlCovDetFeature feature = self->features[i] ;
      if (feature.peakScore) {
        self->features[j++] = feature ;
      }
    }
    self->numFeatures = j ;
  }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movslq 0x58(%rdi), %rax
xorpd %xmm0, %xmm0
movupd %xmm0, 0x12540(%rdi)
andq $0x0, 0x12560(%rdi)
xorl %ecx, %ecx
testq %rax, %rax
cmovleq %rcx, %rax
movq %rax, 0x18(%rsp)
movupd %xmm0, 0x12550(%rdi)
leaq 0x30(%rsp), %r15
xorl %ecx, %ecx
cmpq 0x18(%rsp), %rcx
je 0xc8d9
movq 0x50(%rbx), %rax
movq %rcx, 0x20(%rsp)
imulq $0x28, %rcx, %r14
movq 0x20(%rax,%r14), %rcx
movq %rcx, 0x50(%rsp)
movups (%rax,%r14), %xmm0
movupd 0x10(%rax,%r14), %xmm1
movapd %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movapd 0x30(%rsp), %xmm0
movupd %xmm0, (%rsp)
movq %rbx, %rdi
leaq 0x28(%rsp), %rsi
callq 0x95f0
movq %rax, %r12
movq 0x28(%rsp), %rax
incq 0x12540(%rbx,%rax,8)
testq %rax, %rax
jne 0xc84c
movq 0x50(%rbx), %rcx
andl $0x0, 0x18(%rcx,%r14)
movslq %eax, %r13
testq %r13, %r13
movl $0x0, %eax
cmovleq %rax, %r13
shlq $0x4, %r13
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0xc8cc
testq %rbp, %rbp
je 0xc888
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9510
movq 0x50(%rbx), %rax
imulq $0x28, 0x58(%rbx), %rcx
addq %rcx, %rax
addq $-0x28, %rax
jmp 0xc88f
movq 0x50(%rbx), %rax
addq %r14, %rax
cvtsd2ss 0x8(%r12,%rbp), %xmm0
movss %xmm0, 0x24(%rax)
cvtps2pd 0x10(%rax), %xmm0
cvtps2pd 0x8(%rax), %xmm1
movsd (%r12,%rbp), %xmm2
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm2, %xmm1
mulpd %xmm0, %xmm2
cvtpd2ps %xmm2, %xmm0
cvtpd2ps %xmm1, %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
movupd %xmm1, 0x8(%rax)
addq $0x10, %rbp
jmp 0xc861
movq 0x20(%rsp), %rcx
incq %rcx
jmp 0xc7d2
pushq $0x1c
popq %rcx
xorl %eax, %eax
xorpd %xmm0, %xmm0
xorl %edx, %edx
movslq 0x58(%rbx), %rsi
cmpq %rsi, %rdx
jge 0xc93f
movq 0x50(%rbx), %rsi
movss -0x4(%rsi,%rcx), %xmm1
ucomiss %xmm0, %xmm1
jne 0xc8fe
jnp 0xc936
leaq (%rsi,%rcx), %rdi
addq $-0x1c, %rdi
imulq $0x28, %rax, %r8
incq %rax
movups (%rdi), %xmm2
movq 0x10(%rdi), %r9
movq %r9, 0x10(%rsi,%r8)
movups %xmm2, (%rsi,%r8)
movss %xmm1, 0x18(%rsi,%r8)
movq 0x1c(%rdi), %r9
movl 0x24(%rdi), %edi
movl %edi, 0x24(%rsi,%r8)
movq %r9, 0x1c(%rsi,%r8)
incq %rdx
addq $0x28, %rcx
jmp 0xc8e4
movq %rax, 0x58(%rbx)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq