// File: /workspace/github_c_makefile_star2_O2/zpole[P]IICV/vl/sift.c
// Function: vl_sift_process_next_octave
VL_EXPORT
int
vl_sift_process_next_octave (VlSiftFilt *f)
{

  int s, h, w, s_best ;
  double sa, sb ;
  vl_sift_pix *octave, *pt ;

  /* shortcuts */
  vl_sift_pix *temp   = f-> temp ;
  int O               = f-> O ;
  int S               = f-> S ;
  int o_min           = f-> o_min ;
  int s_min           = f-> s_min ;
  int s_max           = f-> s_max ;
  double sigma0       = f-> sigma0 ;
  double sigmak       = f-> sigmak ;
  double dsigma0      = f-> dsigma0 ;

  /* is there another octave ? */
  if (f->o_cur == o_min + O - 1)
    return VL_ERR_EOF ;

  /* retrieve base */
  s_best = VL_MIN(s_min + S, s_max) ;
  w      = vl_sift_get_octave_width  (f) ;
  h      = vl_sift_get_octave_height (f) ;
  pt     = vl_sift_get_octave        (f, s_best) ;
  octave = vl_sift_get_octave        (f, s_min) ;

  /* next octave */
  copy_and_downsample (octave, pt, w, h, 1) ;

  f-> o_cur            += 1 ;
  f-> nkeys             = 0 ;
  w = f-> octave_width  = VL_SHIFT_LEFT(f->width,  - f->o_cur) ;
  h = f-> octave_height = VL_SHIFT_LEFT(f->height, - f->o_cur) ;

  sa = sigma0 * powf (sigmak, s_min     ) ;
  sb = sigma0 * powf (sigmak, s_best - S) ;

  if (sa > sb) {
    double sd = sqrt (sa*sa - sb*sb) ;
    _vl_sift_smooth (f, octave, temp, octave, w, h, sd) ;
  }

  /* ------------------------------------------------------------------
   *                                                        Fill octave
   * --------------------------------------------------------------- */

  for(s = s_min + 1 ; s <= s_max ; ++s) {
    double sd = dsigma0 * pow (sigmak, s) ;
    _vl_sift_smooth (f, vl_sift_get_octave(f, s), temp,
                     vl_sift_get_octave(f, s - 1), w, h, sd) ;
  }

  return VL_ERR_OK ;
}

// Assembly:
movl 0x28(%rdi), %eax
movl 0x30(%rdi), %ecx
addl %ecx, %eax
decl %eax
cmpl %eax, 0x3c(%rdi)
jne 0x26e7f
pushq $0x5
popq %rax
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq %rax, 0x18(%rsp)
movl 0x2c(%rdi), %eax
movl 0x34(%rdi), %r15d
movl 0x38(%rdi), %ebp
movsd 0x8(%rdi), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rdi), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x18(%rdi), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %rax, 0x38(%rsp)
leal (%r15,%rax), %r13d
cmpl %ebp, %r13d
cmovgel %ebp, %r13d
movl 0x58(%rdi), %edx
movl 0x5c(%rdi), %ecx
movq 0x48(%rdi), %rdi
movl %r13d, %eax
subl %r15d, %eax
movl %edx, %esi
imull %ecx, %esi
imull %eax, %esi
movslq %esi, %rax
leaq (%rdi,%rax,4), %rsi
pushq $0x1
popq %r8
movq %rdi, 0x28(%rsp)
callq 0x26c49
movl 0x3c(%rbx), %ecx
leal 0x1(%rcx), %eax
movl %eax, 0x3c(%rbx)
andl $0x0, 0x80(%rbx)
testl %ecx, %ecx
js 0x26f27
movl 0x20(%rbx), %r12d
movl 0x24(%rbx), %r14d
movl %eax, %ecx
sarl %cl, %r12d
sarl %cl, %r14d
jmp 0x26f37
notb %cl
movl 0x20(%rbx), %r12d
movl 0x24(%rbx), %r14d
shll %cl, %r12d
shll %cl, %r14d
movl %r12d, 0x58(%rbx)
cvtsd2ss 0x20(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
movl %r14d, 0x5c(%rbx)
cvtsi2ss %r15d, %xmm1
callq 0x9780
cvtss2sd %xmm0, %xmm0
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
subl 0x38(%rsp), %r13d
cvtsi2ss %r13d, %xmm1
movss 0xc(%rsp), %xmm0
callq 0x9780
movsd 0x30(%rsp), %xmm1
cvtss2sd %xmm0, %xmm0
mulsd 0x10(%rsp), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x26fac
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
subsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jb 0x26fb7
sqrtsd %xmm1, %xmm0
jmp 0x26fc0
movslq %r12d, %r12
movslq %r14d, %r13
jmp 0x2703b
movapd %xmm1, %xmm0
callq 0x9a00
movslq %r12d, %r12
movslq %r14d, %r13
movq %rbx, %rdi
movq 0x28(%rsp), %rcx
movq %rcx, %rsi
movq 0x18(%rsp), %rdx
movq %r12, %r8
movq %r13, %r9
callq 0x26c96
jmp 0x2703b
leal 0x1(%r15), %r14d
cvtsi2sd %r14d, %xmm1
movsd 0x20(%rsp), %xmm0
callq 0x9280
mulsd 0x40(%rsp), %xmm0
movl 0x5c(%rbx), %eax
imull 0x58(%rbx), %eax
subl 0x34(%rbx), %r15d
movq 0x48(%rbx), %rcx
leal 0x1(%r15), %edx
imull %eax, %edx
movslq %edx, %rdx
leaq (%rcx,%rdx,4), %rsi
imull %eax, %r15d
movslq %r15d, %rax
leaq (%rcx,%rax,4), %rcx
movq %rbx, %rdi
movq 0x18(%rsp), %rdx
movq %r12, %r8
movq %r13, %r9
callq 0x26c96
movl %r14d, %r15d
cmpl %ebp, %r15d
jl 0x26fe3
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq