// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/scalespace.c
// Function: vl_scalespace_new_with_geometry
VlScaleSpace *
vl_scalespace_new_with_geometry (VlScaleSpaceGeometry geom)
{

  vl_index o ;
  vl_size numSublevels = geom.octaveLastSubdivision - geom.octaveFirstSubdivision + 1 ;
  vl_size numOctaves = geom.lastOctave - geom.firstOctave + 1 ;
  VlScaleSpace *self ;

  assert(is_valid_geometry(geom)) ;
  numOctaves = geom.lastOctave - geom.firstOctave + 1 ;
  numSublevels = geom.octaveLastSubdivision - geom.octaveFirstSubdivision + 1 ;

  self = vl_calloc(1, sizeof(VlScaleSpace)) ;
  if (self == NULL) goto err_alloc_self ;
  self->geom = geom ;
  self->octaves = vl_calloc(numOctaves, sizeof(float*)) ;
  if (self->octaves == NULL) goto err_alloc_octave_list ;
  for (o = self->geom.firstOctave ; o <= self->geom.lastOctave ; ++o) {
    VlScaleSpaceOctaveGeometry ogeom = vl_scalespace_get_octave_geometry(self,o) ;
    vl_size octaveSize = ogeom.width * ogeom.height * numSublevels ;
    self->octaves[o - self->geom.firstOctave] = vl_malloc(octaveSize * sizeof(float)) ;
    if (self->octaves[o - self->geom.firstOctave] == NULL) goto err_alloc_octaves;
  }
  return self ;

err_alloc_octaves:
  for (o = self->geom.firstOctave ; o <= self->geom.lastOctave ; ++o) {
    if (self->octaves[o - self->geom.firstOctave]) {
      vl_free(self->octaves[o - self->geom.firstOctave]) ;
    }
  }
err_alloc_octave_list:
  vl_free(self) ;
err_alloc_self:
  return NULL ;
}

// Assembly:
subq $0x58, %rsp
leaq 0x60(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movq 0x30(%rcx), %rax
subq 0x28(%rcx), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
movq 0x18(%rcx), %rax
subq 0x10(%rcx), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
movq 0x18(%rcx), %rax
subq 0x10(%rcx), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
movq 0x30(%rcx), %rax
subq 0x28(%rcx), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
movl $0x1, %edi
movl $0x50, %esi
callq 0x9a70
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0x4b043
jmp 0x4b1b9
movq 0x8(%rsp), %rsi
movq 0x30(%rsp), %rdi
movl $0x48, %edx
callq 0x9640
movq 0x38(%rsp), %rdi
movl $0x8, %esi
callq 0x9a70
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x48(%rax)
movq 0x30(%rsp), %rax
cmpq $0x0, 0x48(%rax)
jne 0x4b083
jmp 0x4b1af
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jg 0x4b130
movq 0x30(%rsp), %rsi
movq 0x48(%rsp), %rdx
leaq 0x18(%rsp), %rdi
callq 0x96c0
movq 0x18(%rsp), %rax
imulq 0x20(%rsp), %rax
imulq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
shlq $0x2, %rdi
callq 0x9660
movq %rax, %rdx
movq 0x30(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x48(%rsp), %rcx
movq 0x30(%rsp), %rsi
subq 0x10(%rsi), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x30(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x48(%rsp), %rcx
movq 0x30(%rsp), %rdx
subq 0x10(%rdx), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x4b11b
jmp 0x4b13f
jmp 0x4b11d
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x4b091
movq 0x30(%rsp), %rax
movq %rax, 0x50(%rsp)
jmp 0x4b1c2
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jg 0x4b1ad
movq 0x30(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x48(%rsp), %rcx
movq 0x30(%rsp), %rdx
subq 0x10(%rdx), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x4b19b
movq 0x30(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x48(%rsp), %rcx
movq 0x30(%rsp), %rdx
subq 0x10(%rdx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x9620
jmp 0x4b19d
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x4b14d
jmp 0x4b1af
movq 0x30(%rsp), %rdi
callq 0x9620
movq $0x0, 0x50(%rsp)
movq 0x50(%rsp), %rax
addq $0x58, %rsp
retq
nopl (%rax)