// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/mser.c
// Function: vl_mser_new
VL_EXPORT
VlMserFilt*
vl_mser_new (int ndims, int const* dims)
{
  VlMserFilt* f ;
  int *strides, k ;

  f = vl_calloc (sizeof(VlMserFilt), 1) ;

  f-> ndims   = ndims ;
  f-> dims    = vl_malloc (sizeof(int) * ndims) ;
  f-> subs    = vl_malloc (sizeof(int) * ndims) ;
  f-> dsubs   = vl_malloc (sizeof(int) * ndims) ;
  f-> strides = vl_malloc (sizeof(int) * ndims) ;

  /* shortcuts */
  strides = f-> strides ;

  /* copy dims to f->dims */
  for(k = 0 ; k < ndims ; ++k) {
    f-> dims [k] = dims [k] ;
  }

  /* compute strides to move into the N-dimensional image array */
  strides [0] = 1 ;
  for(k = 1 ; k < ndims ; ++k) {
    strides [k] = strides [k-1] * dims [k-1] ;
  }

  /* total number of pixels */
  f-> nel = strides [ndims-1] * dims [ndims-1] ;

  /* dof of ellipsoids */
  f-> dof = ndims * (ndims + 1) / 2 + ndims ;

  /* more buffers */
  f-> perm   = vl_malloc (sizeof(vl_uint)   * f-> nel) ;
  f-> joins  = vl_malloc (sizeof(vl_uint)   * f-> nel) ;
  f-> r      = vl_malloc (sizeof(VlMserReg) * f-> nel) ;

  f-> er     = 0 ;
  f-> rer    = 0 ;
  f-> mer    = 0 ;
  f-> rmer   = 0 ;
  f-> ell    = 0 ;
  f-> rell   = 0 ;

  /* other parameters */
  f-> delta         = 5 ;
  f-> max_area      = 0.75 ;
  f-> min_area      = 3.0 / f-> nel ;
  f-> max_variation = 0.25 ;
  f-> min_diversity = 0.2 ;

  return f ;
}

// Assembly:
subq $0x28, %rsp
movl %edi, 0x24(%rsp)
movq %rsi, 0x18(%rsp)
movl $0xd0, %edi
movl $0x1, %esi
callq 0x9a70
movq %rax, 0x10(%rsp)
movl 0x24(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, (%rax)
movslq 0x24(%rsp), %rdi
shlq $0x2, %rdi
callq 0x9660
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x8(%rax)
movslq 0x24(%rsp), %rdi
shlq $0x2, %rdi
callq 0x9660
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
movslq 0x24(%rsp), %rdi
shlq $0x2, %rdi
callq 0x9660
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x20(%rax)
movslq 0x24(%rsp), %rdi
shlq $0x2, %rdi
callq 0x9660
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
cmpl 0x24(%rsp), %eax
jge 0x448ef
movq 0x18(%rsp), %rax
movslq 0x4(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x4(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x448ba
movq 0x8(%rsp), %rax
movl $0x1, (%rax)
movl $0x1, 0x4(%rsp)
movl 0x4(%rsp), %eax
cmpl 0x24(%rsp), %eax
jge 0x4494b
movq 0x8(%rsp), %rax
movl 0x4(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq 0x18(%rsp), %rax
movl 0x4(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imull (%rax,%rcx,4), %edx
movq 0x8(%rsp), %rax
movslq 0x4(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x44902
movq 0x8(%rsp), %rax
movl 0x24(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %ecx
movq 0x18(%rsp), %rax
movl 0x24(%rsp), %edx
subl $0x1, %edx
movslq %edx, %rdx
imull (%rax,%rdx,4), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x10(%rax)
movl 0x24(%rsp), %eax
movl 0x24(%rsp), %ecx
addl $0x1, %ecx
imull %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
addl 0x24(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x88(%rax)
movq 0x10(%rsp), %rax
movslq 0x10(%rax), %rdi
shlq $0x2, %rdi
callq 0x9660
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x10(%rsp), %rax
movslq 0x10(%rax), %rdi
shlq $0x2, %rdi
callq 0x9660
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x10(%rsp), %rax
movslq 0x10(%rax), %rdi
shlq $0x4, %rdi
callq 0x9660
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x48(%rax)
movq 0x10(%rsp), %rax
movq $0x0, 0x50(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x68(%rax)
movq 0x10(%rsp), %rax
movq $0x0, 0x58(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x6c(%rax)
movq 0x10(%rsp), %rax
movq $0x0, 0x78(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x80(%rax)
movq 0x10(%rsp), %rax
movl $0x5, 0x90(%rax)
movq 0x10(%rsp), %rax
movsd 0x155c5(%rip), %xmm0    # 0x5a028
movsd %xmm0, 0x98(%rax)
movq 0x10(%rsp), %rax
cvtsi2sdl 0x10(%rax), %xmm1
movsd 0x1464b(%rip), %xmm0    # 0x590c8
divsd %xmm1, %xmm0
movq 0x10(%rsp), %rax
movsd %xmm0, 0xa0(%rax)
movq 0x10(%rsp), %rax
movsd 0x145dd(%rip), %xmm0    # 0x59078
movsd %xmm0, 0xa8(%rax)
movq 0x10(%rsp), %rax
movsd 0x14d58(%rip), %xmm0    # 0x59808
movsd %xmm0, 0xb0(%rax)
movq 0x10(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)