// File: /workspace/github_c_makefile_star2_O0/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:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movl $0x1, 0x8c(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x9390
movq %rax, 0x80(%rsp)
movq 0xa0(%rsp), %rdi
addq $0x12540, %rdi          # imm = 0x12540
xorl %esi, %esi
movl $0x28, %edx
callq 0x9480
movq $0x0, 0x98(%rsp)
movq 0x98(%rsp), %rax
movq 0x80(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0xfce1
movq 0xa0(%rsp), %rax
movq 0x50(%rax), %rsi
imulq $0x28, 0x98(%rsp), %rax
addq %rax, %rsi
leaq 0x50(%rsp), %rdi
movl $0x28, %edx
callq 0x9640
movq 0xa0(%rsp), %rdi
leaq 0x50(%rsp), %rax
leaq 0x78(%rsp), %rsi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x9670
movq %rax, 0x48(%rsp)
movq 0xa0(%rsp), %rax
movq 0x78(%rsp), %rcx
movq 0x12540(%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, 0x12540(%rax,%rcx,8)
cmpq $0x0, 0x78(%rsp)
jne 0xfb31
cmpl $0x0, 0x8c(%rsp)
je 0xfb31
movq 0xa0(%rsp), %rax
movq 0x50(%rax), %rax
imulq $0x28, 0x98(%rsp), %rcx
addq %rcx, %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x18(%rax)
movq $0x0, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq 0x78(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0xfcc6
cmpq $0x0, 0x90(%rsp)
jne 0xfb80
movq 0xa0(%rsp), %rax
movq 0x50(%rax), %rax
imulq $0x28, 0x98(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x40(%rsp)
jmp 0xfbba
movq 0xa0(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x9580
movq 0xa0(%rsp), %rax
movq 0x50(%rax), %rax
movq 0xa0(%rsp), %rcx
movq 0x58(%rcx), %rcx
subq $0x1, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rax
movq 0x90(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
cvtsd2ss %xmm0, %xmm0
movq 0x40(%rsp), %rax
movss %xmm0, 0x24(%rax)
movq 0x48(%rsp), %rax
movq 0x90(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movq 0x40(%rsp), %rax
movss 0x8(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8(%rax)
movq 0x48(%rsp), %rax
movq 0x90(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movq 0x40(%rsp), %rax
movss 0x10(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x10(%rax)
movq 0x48(%rsp), %rax
movq 0x90(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movq 0x40(%rsp), %rax
movss 0xc(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xc(%rax)
movq 0x48(%rsp), %rax
movq 0x90(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movq 0x40(%rsp), %rax
movss 0x14(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x14(%rax)
movq 0x90(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x90(%rsp)
jmp 0xfb3d
jmp 0xfcc8
movq 0x98(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x98(%rsp)
jmp 0xfa66
cmpl $0x0, 0x8c(%rsp)
je 0xfdc8
movq $0x0, 0x90(%rsp)
movq $0x0, 0x98(%rsp)
movq 0x98(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq 0x58(%rcx), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0xfdb4
movq 0xa0(%rsp), %rax
movq 0x50(%rax), %rsi
imulq $0x28, 0x98(%rsp), %rax
addq %rax, %rsi
leaq 0x18(%rsp), %rdi
movl $0x28, %edx
callq 0x9640
movss 0x30(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0xfd60
jp 0xfd60
jmp 0xfd99
movq 0xa0(%rsp), %rax
movq 0x50(%rax), %rdi
movq 0x90(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x90(%rsp)
imulq $0x28, %rax, %rax
addq %rax, %rdi
leaq 0x18(%rsp), %rsi
movl $0x28, %edx
callq 0x9640
jmp 0xfd9b
movq 0x98(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x98(%rsp)
jmp 0xfd07
movq 0x90(%rsp), %rcx
movq 0xa0(%rsp), %rax
movq %rcx, 0x58(%rax)
addq $0xa8, %rsp
retq