// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/sift.c
// Function: vl_sift_new
VL_EXPORT
VlSiftFilt *
vl_sift_new (int width, int height,
             int noctaves, int nlevels,
             int o_min)
{
  VlSiftFilt *f = vl_malloc (sizeof(VlSiftFilt)) ;

  int w   = VL_SHIFT_LEFT (width,  -o_min) ;
  int h   = VL_SHIFT_LEFT (height, -o_min) ;
  int nel = w * h ;

  /* negative value O => calculate max. value */
  if (noctaves < 0) {
    noctaves = VL_MAX (floor (log2 (VL_MIN(width, height))) - o_min - 3, 1) ;
  }

  f-> width   = width ;
  f-> height  = height ;
  f-> O       = noctaves ;
  f-> S       = nlevels ;
  f-> o_min   = o_min ;
  f-> s_min   = -1 ;
  f-> s_max   = nlevels + 1 ;
  f-> o_cur   = o_min ;

  f-> temp    = vl_malloc (sizeof(vl_sift_pix) * nel    ) ;
  f-> octave  = vl_malloc (sizeof(vl_sift_pix) * nel
                        * (f->s_max - f->s_min + 1)  ) ;
  f-> dog     = vl_malloc (sizeof(vl_sift_pix) * nel
                        * (f->s_max - f->s_min    )  ) ;
  f-> grad    = vl_malloc (sizeof(vl_sift_pix) * nel * 2
                        * (f->s_max - f->s_min    )  ) ;

  f-> sigman  = 0.5 ;
  f-> sigmak  = pow (2.0, 1.0 / nlevels) ;
  f-> sigma0  = 1.6 * f->sigmak ;
  f-> dsigma0 = f->sigma0 * sqrt (1.0 - 1.0 / (f->sigmak*f->sigmak)) ;

  f-> gaussFilter = NULL ;
  f-> gaussFilterSigma = 0 ;
  f-> gaussFilterWidth = 0 ;

  f-> octave_width  = 0 ;
  f-> octave_height = 0 ;

  f-> keys     = 0 ;
  f-> nkeys    = 0 ;
  f-> keys_res = 0 ;

  f-> peak_thresh = 0.0 ;
  f-> edge_thresh = 10.0 ;
  f-> norm_thresh = 0.0 ;
  f-> magnif      = 3.0 ;
  f-> windowSize  = NBP / 2 ;

  f-> grad_o  = o_min - 1 ;

  /* initialize fast_expn stuff */
  fast_expn_init () ;

  return f ;
}

// Assembly:
subq $0x58, %rsp
movl %edi, 0x54(%rsp)
movl %esi, 0x50(%rsp)
movl %edx, 0x4c(%rsp)
movl %ecx, 0x48(%rsp)
movl %r8d, 0x44(%rsp)
movl $0xc0, %edi
callq 0x9660
movq %rax, 0x38(%rsp)
xorl %eax, %eax
subl 0x44(%rsp), %eax
cmpl $0x0, %eax
jl 0x4be75
movl 0x54(%rsp), %eax
xorl %ecx, %ecx
subl 0x44(%rsp), %ecx
shll %cl, %eax
movl %eax, 0x28(%rsp)
jmp 0x4be89
movl 0x54(%rsp), %eax
xorl %edx, %edx
subl 0x44(%rsp), %edx
xorl %ecx, %ecx
subl %edx, %ecx
sarl %cl, %eax
movl %eax, 0x28(%rsp)
movl 0x28(%rsp), %eax
movl %eax, 0x34(%rsp)
xorl %eax, %eax
subl 0x44(%rsp), %eax
cmpl $0x0, %eax
jl 0x4beae
movl 0x50(%rsp), %eax
xorl %ecx, %ecx
subl 0x44(%rsp), %ecx
shll %cl, %eax
movl %eax, 0x24(%rsp)
jmp 0x4bec2
movl 0x50(%rsp), %eax
xorl %edx, %edx
subl 0x44(%rsp), %edx
xorl %ecx, %ecx
subl %edx, %ecx
sarl %cl, %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
movl %eax, 0x30(%rsp)
movl 0x34(%rsp), %eax
imull 0x30(%rsp), %eax
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x4c(%rsp)
jge 0x4bfb6
movl 0x54(%rsp), %eax
cmpl 0x50(%rsp), %eax
jge 0x4bef6
movl 0x54(%rsp), %eax
movl %eax, 0x20(%rsp)
jmp 0x4befe
movl 0x50(%rsp), %eax
movl %eax, 0x20(%rsp)
movl 0x20(%rsp), %eax
cvtsi2sd %eax, %xmm0
callq 0x94c0
movsd 0xe235(%rip), %xmm1     # 0x5a148
divsd %xmm1, %xmm0
callq 0x9a00
cvtsi2sdl 0x44(%rsp), %xmm1
subsd %xmm1, %xmm0
movsd 0xd19a(%rip), %xmm1     # 0x590c8
subsd %xmm1, %xmm0
movsd 0xd19e(%rip), %xmm1     # 0x590d8
ucomisd %xmm1, %xmm0
jbe 0x4bf98
movl 0x54(%rsp), %eax
cmpl 0x50(%rsp), %eax
jge 0x4bf54
movl 0x54(%rsp), %eax
movl %eax, 0x1c(%rsp)
jmp 0x4bf5c
movl 0x50(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cvtsi2sd %eax, %xmm0
callq 0x94c0
movsd 0xe1d7(%rip), %xmm1     # 0x5a148
divsd %xmm1, %xmm0
callq 0x9a00
cvtsi2sdl 0x44(%rsp), %xmm1
subsd %xmm1, %xmm0
movsd 0xd13c(%rip), %xmm1     # 0x590c8
subsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
jmp 0x4bfa8
movsd 0xd138(%rip), %xmm0     # 0x590d8
movsd %xmm0, 0x10(%rsp)
jmp 0x4bfa8
movsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x4c(%rsp)
movl 0x54(%rsp), %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x20(%rax)
movl 0x50(%rsp), %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x24(%rax)
movl 0x4c(%rsp), %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x28(%rax)
movl 0x48(%rsp), %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x2c(%rax)
movl 0x44(%rsp), %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x30(%rax)
movq 0x38(%rsp), %rax
movl $0xffffffff, 0x34(%rax) # imm = 0xFFFFFFFF
movl 0x48(%rsp), %ecx
addl $0x1, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x38(%rax)
movl 0x44(%rsp), %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x3c(%rax)
movslq 0x2c(%rsp), %rdi
shlq $0x2, %rdi
callq 0x9660
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x40(%rax)
movslq 0x2c(%rsp), %rdi
shlq $0x2, %rdi
movq 0x38(%rsp), %rax
movl 0x38(%rax), %eax
movq 0x38(%rsp), %rcx
subl 0x34(%rcx), %eax
addl $0x1, %eax
cltq
imulq %rax, %rdi
callq 0x9660
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x48(%rax)
movslq 0x2c(%rsp), %rdi
shlq $0x2, %rdi
movq 0x38(%rsp), %rax
movl 0x38(%rax), %eax
movq 0x38(%rsp), %rcx
subl 0x34(%rcx), %eax
cltq
imulq %rax, %rdi
callq 0x9660
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x50(%rax)
movslq 0x2c(%rsp), %rdi
shlq $0x2, %rdi
shlq %rdi
movq 0x38(%rsp), %rax
movl 0x38(%rax), %eax
movq 0x38(%rsp), %rcx
subl 0x34(%rcx), %eax
cltq
imulq %rax, %rdi
callq 0x9660
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0xb0(%rax)
movq 0x38(%rsp), %rax
movsd 0xcfa7(%rip), %xmm0     # 0x59080
movsd %xmm0, (%rax)
cvtsi2sdl 0x48(%rsp), %xmm0
movsd 0xcfed(%rip), %xmm1     # 0x590d8
divsd %xmm0, %xmm1
movsd 0xcfe9(%rip), %xmm0     # 0x590e0
callq 0x92b0
movq 0x38(%rsp), %rax
movsd %xmm0, 0x10(%rax)
movq 0x38(%rsp), %rax
movsd 0xe025(%rip), %xmm0     # 0x5a138
mulsd 0x10(%rax), %xmm0
movq 0x38(%rsp), %rax
movsd %xmm0, 0x8(%rax)
movq 0x38(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x38(%rsp), %rax
movsd 0x10(%rax), %xmm0
movq 0x38(%rsp), %rax
mulsd 0x10(%rax), %xmm0
movsd 0xcf8a(%rip), %xmm1     # 0x590d8
divsd %xmm0, %xmm1
movsd 0xcf7e(%rip), %xmm0     # 0x590d8
subsd %xmm1, %xmm0
callq 0x9b20
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
movq 0x38(%rsp), %rax
movsd %xmm0, 0x18(%rax)
movq 0x38(%rsp), %rax
movq $0x0, 0x60(%rax)
movq 0x38(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x68(%rax)
movq 0x38(%rsp), %rax
movq $0x0, 0x70(%rax)
movq 0x38(%rsp), %rax
movl $0x0, 0x58(%rax)
movq 0x38(%rsp), %rax
movl $0x0, 0x5c(%rax)
movq 0x38(%rsp), %rax
movq $0x0, 0x78(%rax)
movq 0x38(%rsp), %rax
movl $0x0, 0x80(%rax)
movq 0x38(%rsp), %rax
movl $0x0, 0x84(%rax)
movq 0x38(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x88(%rax)
movq 0x38(%rsp), %rax
movsd 0xceaf(%rip), %xmm0     # 0x590b0
movsd %xmm0, 0x90(%rax)
movq 0x38(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x98(%rax)
movq 0x38(%rsp), %rax
movsd 0xcea2(%rip), %xmm0     # 0x590c8
movsd %xmm0, 0xa0(%rax)
movq 0x38(%rsp), %rax
movsd 0xcea5(%rip), %xmm0     # 0x590e0
movsd %xmm0, 0xa8(%rax)
movl 0x44(%rsp), %ecx
subl $0x1, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0xb8(%rax)
callq 0x52250
movq 0x38(%rsp), %rax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)