// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl 0x28(%rdi), %ecx
movl 0x30(%rdi), %edx
movl 0x3c(%rdi), %r12d
addl %edx, %ecx
decl %ecx
movl $0x5, %eax
cmpl %ecx, %r12d
je 0x2bf8e
movq %rdi, %rbx
movq 0x40(%rdi), %r14
movl 0x2c(%rdi), %ecx
movl 0x34(%rdi), %ebp
movl 0x38(%rdi), %r15d
movsd 0x8(%rdi), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x10(%rdi), %xmm1
movq %rcx, 0x30(%rsp)
leal (%rcx,%rbp), %r13d
cmpl %r15d, %r13d
cmovgel %r15d, %r13d
movsd 0x18(%rdi), %xmm2
movslq 0x5c(%rdi), %rcx
movq 0x48(%rdi), %rax
testq %rcx, %rcx
jle 0x2be14
movslq 0x58(%rbx), %rdx
movl %r13d, %esi
subl %ebp, %esi
movl %ecx, %edi
imull %edx, %edi
imull %esi, %edi
movslq %edi, %rsi
leaq (%rax,%rsi,4), %rsi
leal -0x1(%rdx), %edi
xorl %r8d, %r8d
movq %rax, %r9
testl %edi, %edi
jle 0x2be0b
movq %r8, %r10
imulq %rdx, %r10
leaq (%rsi,%r10,4), %r10
xorl %r11d, %r11d
movss (%r10), %xmm0
movss %xmm0, (%r9)
addq $0x4, %r9
addq $0x8, %r10
addl $0x2, %r11d
cmpl %edi, %r11d
jl 0x2bdf0
addq $0x2, %r8
cmpq %rcx, %r8
jb 0x2bdde
movq %rax, 0x20(%rsp)
leal 0x1(%r12), %edx
movl %edx, 0x3c(%rbx)
movl $0x0, 0x80(%rbx)
testl %r12d, %r12d
js 0x2be39
movl 0x20(%rbx), %eax
movl %edx, %ecx
sarl %cl, %eax
jmp 0x2be43
movl 0x20(%rbx), %eax
movl %r12d, %ecx
notb %cl
shll %cl, %eax
movl %r13d, 0x14(%rsp)
movl %eax, 0x58(%rbx)
testl %r12d, %r12d
movsd %xmm2, 0x38(%rsp)
movl %eax, 0x10(%rsp)
js 0x2be65
movl 0x24(%rbx), %r13d
movl %edx, %ecx
sarl %cl, %r13d
jmp 0x2be72
movl 0x24(%rbx), %r13d
notb %r12b
movl %r12d, %ecx
shll %cl, %r13d
movsd %xmm1, 0x40(%rsp)
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0xc(%rsp)
movl %r13d, 0x5c(%rbx)
xorps %xmm1, %xmm1
cvtsi2ss %ebp, %xmm1
callq 0x9720
cvtss2sd %xmm0, %xmm0
mulsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movl 0x14(%rsp), %eax
subl 0x30(%rsp), %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
movss 0xc(%rsp), %xmm0
callq 0x9720
movsd 0x28(%rsp), %xmm1
cvtss2sd %xmm0, %xmm0
mulsd 0x18(%rsp), %xmm0
ucomisd %xmm0, %xmm1
movslq 0x10(%rsp), %r12
movslq %r13d, %r13
jbe 0x2bf1e
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
subsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jb 0x2befc
xorps %xmm0, %xmm0
sqrtsd %xmm1, %xmm0
jmp 0x2bf05
movapd %xmm1, %xmm0
callq 0x9990
movq %rbx, %rdi
movq 0x20(%rsp), %rcx
movq %rcx, %rsi
movq %r14, %rdx
movq %r12, %r8
movq %r13, %r9
callq 0x2bb64
xorl %eax, %eax
cmpl %r15d, %ebp
jge 0x2bf8e
negl %r15d
incl %ebp
xorps %xmm1, %xmm1
cvtsi2sd %ebp, %xmm1
movsd 0x40(%rsp), %xmm0
callq 0x9270
mulsd 0x38(%rsp), %xmm0
movl 0x5c(%rbx), %eax
imull 0x58(%rbx), %eax
movq 0x48(%rbx), %rcx
movl %ebp, %edx
subl 0x34(%rbx), %edx
movl %edx, %esi
imull %eax, %esi
movslq %esi, %rsi
leaq (%rcx,%rsi,4), %rsi
decl %edx
imull %eax, %edx
movslq %edx, %rax
leaq (%rcx,%rax,4), %rcx
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %r8
movq %r13, %r9
callq 0x2bb64
leal (%r15,%rbp), %eax
incl %eax
movl %ebp, %ecx
incl %ecx
movl %ecx, %ebp
cmpl $0x1, %eax
jne 0x2bf2a
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq