// File: /workspace/github_c_makefile_star2_O1/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)
movupd %xmm0, 0x12550(%rdi)
movq $0x0, 0x12560(%rdi)
movq %rax, 0x20(%rsp)
testq %rax, %rax
jle 0xd006
xorl %ebp, %ebp
movq 0x50(%rbx), %rax
leaq (,%rbp,4), %r14
addq %rbp, %r14
movq 0x20(%rax,%r14,8), %rcx
movq %rcx, 0x50(%rsp)
movups (%rax,%r14,8), %xmm0
movupd 0x10(%rax,%r14,8), %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 0x95c0
movq %rax, %r12
movq 0x28(%rsp), %rax
incq 0x12540(%rbx,%rax,8)
testq %rax, %rax
jne 0xcf6c
movq 0x50(%rbx), %rcx
movl $0x0, 0x18(%rcx,%r14,8)
movslq %eax, %r13
testq %r13, %r13
jle 0xcff8
addq $0x8, %r12
shlq $0x3, %r14
xorl %r15d, %r15d
testq %r15, %r15
je 0xcfab
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0x94e0
movq 0x50(%rbx), %rax
movq 0x58(%rbx), %rcx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %rax
addq $-0x28, %rax
jmp 0xcfb2
movq 0x50(%rbx), %rax
addq %r14, %rax
xorps %xmm0, %xmm0
cvtsd2ss (%r12), %xmm0
movss %xmm0, 0x24(%rax)
cvtps2pd 0x10(%rax), %xmm0
cvtps2pd 0x8(%rax), %xmm1
movsd -0x8(%r12), %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)
incq %r15
addq $0x10, %r12
cmpq %r15, %r13
jne 0xcf83
incq %rbp
cmpq 0x20(%rsp), %rbp
jne 0xcef8
cmpl $0x0, 0x58(%rbx)
jle 0xd076
movl $0x1c, %eax
xorl %edx, %edx
xorpd %xmm0, %xmm0
xorl %ecx, %ecx
movq 0x50(%rbx), %rsi
movss -0x4(%rsi,%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0xd02a
jnp 0xd064
leaq (%rsi,%rax), %rdi
addq $-0x1c, %rdi
leaq (%rcx,%rcx,4), %r8
incq %rcx
movupd (%rdi), %xmm2
movq 0x10(%rdi), %r9
movq %r9, 0x10(%rsi,%r8,8)
movupd %xmm2, (%rsi,%r8,8)
movss %xmm1, 0x18(%rsi,%r8,8)
movq 0x1c(%rdi), %r9
movl 0x24(%rdi), %edi
movl %edi, 0x24(%rsi,%r8,8)
movq %r9, 0x1c(%rsi,%r8,8)
incq %rdx
movslq 0x58(%rbx), %rsi
addq $0x28, %rax
cmpq %rsi, %rdx
jl 0xd019
jmp 0xd078
xorl %ecx, %ecx
movq %rcx, 0x58(%rbx)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq