// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/scalespace.c
// Function: vl_scalespace_start_octave_from_previous_octave
static void
_vl_scalespace_start_octave_from_previous_octave (VlScaleSpace *self, vl_index o)
{
  double sigma, prevSigma ;
  float *level, *prevLevel ;
  vl_index prevLevelIndex ;
  VlScaleSpaceOctaveGeometry ogeom ;

  assert(self) ;
  assert(o > self->geom.firstOctave) ; /* must not be the first octave */
  assert(o <= self->geom.lastOctave) ;

  /*
   * From the previous octave pick the level which is closer to
   * self->geom.octaveFirstSubdivision in this octave.
   * The is self->geom.octaveFirstSubdivision + self->numLevels since there are
   * self->geom.octaveResolution levels in an octave, provided that
   * this value does not exceed self->geom.octaveLastSubdivision.
   */

  prevLevelIndex = VL_MIN(self->geom.octaveFirstSubdivision
                          + (signed)self->geom.octaveResolution,
                          self->geom.octaveLastSubdivision) ;
  prevLevel = vl_scalespace_get_level (self, o - 1, prevLevelIndex) ;
  level = vl_scalespace_get_level (self, o, self->geom.octaveFirstSubdivision) ;
  ogeom = vl_scalespace_get_octave_geometry(self, o - 1) ;

  copy_and_downsample (level, prevLevel, ogeom.width, ogeom.height, 1) ;

  /*
   * Add remaining smoothing, if any.
   */

  sigma = vl_scalespace_get_level_sigma(self, o, self->geom.octaveFirstSubdivision) ;
  prevSigma = vl_scalespace_get_level_sigma(self, o - 1, prevLevelIndex) ;

  if (sigma > prevSigma) {
    VlScaleSpaceOctaveGeometry ogeom = vl_scalespace_get_octave_geometry(self, o) ;
    double deltaSigma = sqrt (sigma*sigma - prevSigma*prevSigma) ;
    level = vl_scalespace_get_level (self, o, self->geom.octaveFirstSubdivision) ;

    /* todo: this may fail due to an out-of-memory condition */
    vl_imsmooth_f (level, ogeom.width,
                   level, ogeom.width, ogeom.height, ogeom.width,
                   deltaSigma / ogeom.step, deltaSigma / ogeom.step) ;
  }
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x90(%rsp), %rcx
movq 0x20(%rcx), %rcx
movslq %ecx, %rcx
addq %rcx, %rax
movq 0x90(%rsp), %rcx
cmpq 0x30(%rcx), %rax
jge 0x4b918
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x90(%rsp), %rcx
movq 0x20(%rcx), %rcx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
jmp 0x4b929
movq 0x90(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x90(%rsp), %rdi
movq 0x88(%rsp), %rsi
subq $0x1, %rsi
movq 0x60(%rsp), %rdx
callq 0x9040
movq %rax, 0x68(%rsp)
movq 0x90(%rsp), %rdi
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x9040
movq %rax, 0x70(%rsp)
movq 0x90(%rsp), %rsi
movq 0x88(%rsp), %rdx
subq $0x1, %rdx
leaq 0x30(%rsp), %rdi
callq 0x96c0
movq 0x30(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq 0x50(%rsp), %rcx
movl $0x1, %r8d
callq 0x4bb10
movq 0x90(%rsp), %rdi
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x9950
movsd %xmm0, 0x80(%rsp)
movq 0x90(%rsp), %rdi
movq 0x88(%rsp), %rsi
subq $0x1, %rsi
movq 0x60(%rsp), %rdx
callq 0x9950
movsd %xmm0, 0x78(%rsp)
movsd 0x80(%rsp), %xmm0
ucomisd 0x78(%rsp), %xmm0
jbe 0x4bafd
movq 0x90(%rsp), %rsi
movq 0x88(%rsp), %rdx
leaq 0x18(%rsp), %rdi
callq 0x96c0
movsd 0x80(%rsp), %xmm0
movsd 0x80(%rsp), %xmm2
movsd 0x78(%rsp), %xmm1
mulsd 0x78(%rsp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x9b20
movsd %xmm0, 0x10(%rsp)
movq 0x90(%rsp), %rdi
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x9040
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %r8
movq 0x18(%rsp), %r9
movsd 0x10(%rsp), %xmm0
divsd 0x28(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
divsd 0x28(%rsp), %xmm1
callq 0x98e0
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)