// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/scalespace.c
// Function: vl_scalespace_start_octave_from_image
static void
_vl_scalespace_start_octave_from_image (VlScaleSpace *self,
                                        float const *image,
                                        vl_index o)
{
  float *level ;
  double sigma, imageSigma ;
  vl_index op ;

  assert(self) ;
  assert(image) ;
  assert(o >= self->geom.firstOctave) ;
  assert(o <= self->geom.lastOctave) ;

  /*
   * Copy the image to self->geom.octaveFirstSubdivision of octave o, upscaling or
   * downscaling as needed.
   */

  level = vl_scalespace_get_level(self, VL_MAX(0, o), self->geom.octaveFirstSubdivision) ;
  copy_and_downsample(level, image, self->geom.width, self->geom.height, VL_MAX(0, o)) ;

  for (op = -1 ; op >= o ; --op) {
    VlScaleSpaceOctaveGeometry ogeom = vl_scalespace_get_octave_geometry(self, op + 1) ;
    float *succLevel = vl_scalespace_get_level(self, op + 1, self->geom.octaveFirstSubdivision) ;
    level = vl_scalespace_get_level(self, op, self->geom.octaveFirstSubdivision) ;
    copy_and_upsample(level, succLevel, ogeom.width, ogeom.height) ;
  }

  /*
   * Adjust the smoothing of the first level just initialised, accounting
   * for the fact that the input image is assumed to be a nominal scale
   * level.
   */

  sigma = vl_scalespace_get_level_sigma(self, o, self->geom.octaveFirstSubdivision) ;
  imageSigma = self->geom.nominalScale ;

  if (sigma > imageSigma) {
    VlScaleSpaceOctaveGeometry ogeom = vl_scalespace_get_octave_geometry(self, o) ;
    double deltaSigma = sqrt (sigma*sigma - imageSigma*imageSigma) ;
    level = vl_scalespace_get_level (self, o, self->geom.octaveFirstSubdivision) ;
    vl_imsmooth_f (level, ogeom.width,
                   level, ogeom.width, ogeom.height, ogeom.width,
                   deltaSigma / ogeom.step, deltaSigma / ogeom.step) ;
  }
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
movq %rdx, 0xa0(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x38(%rsp)
xorl %eax, %eax
cmpq 0xa0(%rsp), %rax
jle 0x4b601
xorl %eax, %eax
movq %rax, 0x30(%rsp)
jmp 0x4b60e
movq 0xa0(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0xb0(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x9040
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xb0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0xb0(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x28(%rsp)
xorl %eax, %eax
cmpq 0xa0(%rsp), %rax
jle 0x4b681
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x4b68e
movq 0xa0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %r8
callq 0x4bb10
movq $-0x1, 0x80(%rsp)
movq 0x80(%rsp), %rax
cmpq 0xa0(%rsp), %rax
jl 0x4b774
movq 0xb0(%rsp), %rsi
movq 0x80(%rsp), %rdx
addq $0x1, %rdx
leaq 0x68(%rsp), %rdi
callq 0x96c0
movq 0xb0(%rsp), %rdi
movq 0x80(%rsp), %rsi
addq $0x1, %rsi
movq 0xb0(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x9040
movq %rax, 0x60(%rsp)
movq 0xb0(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0xb0(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x9040
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq 0x70(%rsp), %rcx
callq 0x4bc30
movq 0x80(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x80(%rsp)
jmp 0x4b6b8
movq 0xb0(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movq 0xb0(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x9950
movsd %xmm0, 0x90(%rsp)
movq 0xb0(%rsp), %rax
movsd 0x40(%rax), %xmm0
movsd %xmm0, 0x88(%rsp)
movsd 0x90(%rsp), %xmm0
ucomisd 0x88(%rsp), %xmm0
jbe 0x4b89e
movq 0xb0(%rsp), %rsi
movq 0xa0(%rsp), %rdx
leaq 0x48(%rsp), %rdi
callq 0x96c0
movsd 0x90(%rsp), %xmm0
movsd 0x90(%rsp), %xmm2
movsd 0x88(%rsp), %xmm1
mulsd 0x88(%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, 0x40(%rsp)
movq 0xb0(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movq 0xb0(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x9040
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x98(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %r8
movq 0x48(%rsp), %r9
movsd 0x40(%rsp), %xmm0
divsd 0x58(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
divsd 0x58(%rsp), %xmm1
callq 0x98e0
addq $0xb8, %rsp
retq
nopw %cs:(%rax,%rax)