// File: /workspace/github_c_makefile_star2_O2/zpole[P]IICV/vl/ikmeans.c
// Function: vl_ikm_train
int
vl_ikm_train (VlIKMFilt *f, vl_uint8 const *data, vl_size N)
{
  int err ;

  if (f-> verb) {
    VL_PRINTF ("ikm: training with %d data\n",  N) ;
    VL_PRINTF ("ikm: %d clusters\n",  f -> K) ;
  }

  switch (f -> method) {
  case VL_IKM_LLOYD : err = vl_ikm_train_lloyd (f, data, N) ; break ;
  case VL_IKM_ELKAN : err = vl_ikm_train_elkan (f, data, N) ; break ;
  default :
    abort() ;
  }
  return err ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %r13
movq %rsi, 0x38(%rsp)
movq %rdi, %rbx
cmpl $0x0, 0x1c(%rdi)
je 0x15d21
callq 0x9180
movq %rax, %rcx
leaq 0x17df1(%rip), %rdi     # 0x2daf4
movq %r13, %rsi
xorl %eax, %eax
callq *%rcx
callq 0x9180
movq %rax, %rcx
movq 0x8(%rbx), %rsi
leaq 0x17df3(%rip), %rdi     # 0x2db10
xorl %eax, %eax
callq *%rcx
movl 0x18(%rbx), %eax
cmpl $0x1, %eax
movq %r13, 0x28(%rsp)
je 0x15f06
testl %eax, %eax
jne 0x166bd
leaq (,%r13,4), %r12
movq %r12, %rdi
callq 0x95e0
movq %rax, %r15
movq %r12, %rdi
callq 0x95e0
movq %rax, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movl $0x0, (%rsp)
xorl %r13d, %r13d
pushq $0x1
popq %rax
movl %eax, 0x8(%rsp)
cmpq 0x28(%rsp), %r13
je 0x15e0a
movq 0x8(%rbx), %rsi
xorl %edi, %edi
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $-0x1
popq %rdx
cmpq %rsi, %r8
je 0x15ded
movq (%rbx), %r11
movq %r11, %r14
imulq %rdi, %r14
movq %r13, %rax
imulq %r11, %rax
addq 0x38(%rsp), %rax
xorl %r10d, %r10d
xorl %ecx, %ecx
cmpq %rcx, %r11
je 0x15dcd
movzbl (%rax,%rcx), %ebp
movq 0x20(%rbx), %r12
addq %r14, %r12
subl (%r12,%rcx,4), %ebp
imull %ebp, %ebp
addl %ebp, %r10d
incq %rcx
jmp 0x15dae
cmpq $-0x1, %rdx
sete %al
cmpl %r9d, %r10d
setl %cl
orb %al, %cl
cmovnel %r10d, %r9d
cmovneq %r8, %rdx
incq %r8
addq $0x4, %rdi
jmp 0x15d8e
movl (%r15,%r13,4), %eax
cmpq %rax, %rdx
je 0x15e02
movl %edx, (%r15,%r13,4)
movl $0x0, 0x8(%rsp)
incq %r13
jmp 0x15d74
cmpl $0x0, 0x8(%rsp)
movq 0x18(%rsp), %r13
jne 0x160be
cmpq 0x10(%rbx), %r13
je 0x160be
movq (%rbx), %rdx
movq 0x20(%rbx), %rdi
imulq 0x8(%rbx), %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x9420
movq 0x8(%rbx), %rdx
shlq $0x2, %rdx
movq 0x20(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x9420
xorl %eax, %eax
movq 0x28(%rsp), %r10
movl (%rsp), %ebp
pushq $0x1
popq %r14
cmpq %r10, %rax
je 0x15ea5
movl (%r15,%rax,4), %ecx
incl (%r12,%rcx,4)
movq (%rbx), %rdx
movq %rdx, %rsi
imulq %rax, %rsi
addq 0x38(%rsp), %rsi
imulq %rdx, %rcx
shlq $0x2, %rcx
xorl %edi, %edi
cmpq %rdi, %rdx
je 0x15ea0
movzbl (%rsi,%rdi), %r8d
movq 0x20(%rbx), %r9
addq %rcx, %r9
addl %r8d, (%r9,%rdi,4)
incq %rdi
jmp 0x15e86
incq %rax
jmp 0x15e60
movq 0x8(%rbx), %rcx
xorl %esi, %esi
xorl %edi, %edi
cmpq %rcx, %rdi
je 0x15ef6
movl (%r12,%rdi,4), %r8d
cmpq $0x1000000, %r8         # imm = 0x1000000
cmovael %r14d, %ebp
testq %r8, %r8
je 0x15eed
movq (%rbx), %r9
movq %r9, %r10
imulq %rsi, %r10
subq $0x1, %r9
jb 0x15eed
movq 0x20(%rbx), %r11
movslq (%r11,%r10), %rax
cqto
idivq %r8
movl %eax, (%r11,%r10)
addq $0x4, %r10
jmp 0x15ed0
incq %rdi
addq $0x4, %rsi
jmp 0x15ead
movl %ebp, (%rsp)
incq %r13
movq %r13, 0x18(%rsp)
jmp 0x15d6a
movq (%rbx), %rdi
imulq 0x8(%rbx), %rdi
shlq $0x2, %rdi
callq 0x95e0
movq %rax, (%rsp)
leaq (,%r13,4), %r12
movq %r12, %rdi
callq 0x95e0
movq %rax, %r14
movq %r13, %rdi
callq 0x95e0
movq %rax, %r15
movq 0x8(%rbx), %rdi
shlq $0x2, %rdi
callq 0x95e0
movq %rax, 0x78(%rsp)
movq 0x8(%rbx), %rdi
imulq %r12, %rdi
callq 0x95e0
movq %r13, %rbp
movq %rax, %r13
movq 0x28(%rbx), %rax
movq %rax, 0x60(%rsp)
movq %r12, %rdi
callq 0x95e0
movq %rax, 0x8(%rsp)
movq %r12, %rdi
callq 0x95e0
movq %rax, 0x58(%rsp)
movq %rbx, %rdi
callq 0x16b71
movq 0x8(%rbx), %rdx
imulq %r12, %rdx
movq $0x0, 0x10(%rsp)
movq %r13, 0x48(%rsp)
movq %r13, %rdi
movq %rbp, %r13
xorl %esi, %esi
callq 0x9420
movq %r14, 0x30(%rsp)
movq %r14, %rdi
xorl %esi, %esi
movq %r12, 0x80(%rsp)
movq %r12, %rdx
callq 0x9420
movq %r15, 0x68(%rsp)
movq %r15, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x9420
xorl %ecx, %ecx
cmpq %r13, %rcx
je 0x160d8
movq (%rbx), %rdx
movq %rdx, %rsi
imulq %rcx, %rsi
addq 0x38(%rsp), %rsi
xorl %edi, %edi
xorl %r8d, %r8d
cmpq %r8, %rdx
je 0x16015
movzbl (%rsi,%r8), %r9d
movq 0x20(%rbx), %r10
subl (%r10,%r8,4), %r9d
imull %r9d, %r9d
addl %r9d, %edi
incq %r8
jmp 0x15ff7
incq 0x10(%rsp)
movq 0x48(%rsp), %rax
leaq (%rax,%rcx,4), %r8
movl %edi, (%rax,%rcx,4)
movq 0x8(%rbx), %r9
leaq (,%rdx,4), %r10
movq %r10, %r11
xorl %r14d, %r14d
pushq $0x1
popq %r15
cmpq %r9, %r15
jae 0x160a5
movq %r14, %r12
imulq %r9, %r12
movq 0x60(%rsp), %rax
leaq (%rax,%r12,4), %r12
cmpl %edi, (%r12,%r15,4)
jge 0x1609d
xorl %r12d, %r12d
xorl %r13d, %r13d
cmpq %r13, %rdx
je 0x1607d
movzbl (%rsi,%r13), %ebp
movq 0x20(%rbx), %rax
addq %r11, %rax
subl (%rax,%r13,4), %ebp
imull %ebp, %ebp
addl %ebp, %r12d
incq %r13
jmp 0x1605d
incq 0x10(%rsp)
movq %r15, %rax
movq 0x28(%rsp), %r13
imulq %r13, %rax
movl %r12d, (%r8,%rax,4)
cmpl %edi, %r12d
cmovll %r12d, %edi
cmovlq %r15, %r14
incq %r15
addq %r10, %r11
jmp 0x1603c
movq 0x8(%rsp), %rax
movl %r14d, (%rax,%rcx,4)
movq 0x30(%rsp), %rax
movl %edi, (%rax,%rcx,4)
incq %rcx
jmp 0x15fda
movq 0x20(%rsp), %rdi
callq 0x95b0
movq %r15, %rdi
callq 0x95b0
movl (%rsp), %ebx
jmp 0x166a9
movq 0x8(%rbx), %rdx
movq $0x0, 0x40(%rsp)
imulq (%rbx), %rdx
shlq $0x2, %rdx
movq (%rsp), %rdi
xorl %esi, %esi
callq 0x9420
movq 0x8(%rbx), %rdx
shlq $0x2, %rdx
movq 0x58(%rsp), %rdi
xorl %esi, %esi
callq 0x9420
xorl %eax, %eax
cmpq %r13, %rax
je 0x16159
movq 0x8(%rsp), %rcx
movslq (%rcx,%rax,4), %rsi
movq 0x58(%rsp), %rcx
incl (%rcx,%rsi,4)
movq (%rbx), %rcx
movq %rcx, %rdx
imulq %rax, %rdx
addq 0x38(%rsp), %rdx
imulq %rcx, %rsi
movq (%rsp), %rdi
leaq (%rdi,%rsi,4), %rsi
xorl %edi, %edi
cmpq %rdi, %rcx
je 0x16154
movzbl (%rdx,%rdi), %r8d
addl %r8d, (%rsi,%rdi,4)
incq %rdi
jmp 0x16141
incq %rax
jmp 0x1610e
movq 0x8(%rbx), %rcx
xorl %esi, %esi
xorl %edi, %edi
cmpq %rcx, %rdi
je 0x161a4
movq 0x58(%rsp), %rax
movl (%rax,%rdi,4), %r8d
testl %r8d, %r8d
jle 0x1619b
movq (%rbx), %r9
movq %r9, %r10
imulq %rsi, %r10
addq (%rsp), %r10
xorl %r11d, %r11d
cmpq %r11, %r9
je 0x1619b
movl (%r10,%r11,4), %eax
cltd
idivl %r8d
movl %eax, (%r10,%r11,4)
incq %r11
jmp 0x16185
incq %rdi
addq $0x4, %rsi
jmp 0x16161
movq 0x48(%rsp), %r8
xorl %edx, %edx
xorl %r9d, %r9d
cmpq %rcx, %r9
jae 0x162d1
movq (%rbx), %rax
movq %rax, %rcx
movq %rdx, 0x50(%rsp)
imulq %rdx, %rcx
xorl %r15d, %r15d
subq $0x1, %rax
jb 0x161ee
movq (%rsp), %rdx
movl (%rdx,%rcx), %edx
movq 0x20(%rbx), %rsi
movl %edx, %edi
subl (%rsi,%rcx), %edi
movl %edx, (%rsi,%rcx)
imull %edi, %edi
addl %edi, %r15d
addq $0x4, %rcx
jmp 0x161c9
movl %r15d, %eax
movq %rax, 0x70(%rsp)
xorl %r12d, %r12d
movq %r8, 0x18(%rsp)
movq %r9, 0x20(%rsp)
cmpq %r12, %r13
je 0x162af
movslq (%r8,%r12,4), %rdi
movq 0x8(%rsp), %rax
movslq (%rax,%r12,4), %rbp
xorl %eax, %eax
cmpl %edi, %r15d
jge 0x16253
leal (%rdi,%r15), %r13d
callq 0x16c17
leal 0x2(,%rax,2), %r14d
movq 0x70(%rsp), %rdi
callq 0x16c17
movq 0x20(%rsp), %r9
movq 0x18(%rsp), %r8
notl %eax
imull %r14d, %eax
addl %r13d, %eax
movq 0x28(%rsp), %r13
movl %eax, (%r8,%r12,4)
cmpq %rbp, %r9
jne 0x162a7
movq 0x30(%rsp), %r13
movslq (%r13,%r12,4), %rdi
leal (%rdi,%r15), %ebp
callq 0x16c17
leal 0x2(,%rax,2), %r14d
movq 0x70(%rsp), %rdi
callq 0x16c17
movq 0x20(%rsp), %r9
movq 0x18(%rsp), %r8
incl %eax
imull %r14d, %eax
addl %ebp, %eax
movl %eax, (%r13,%r12,4)
movq 0x28(%rsp), %r13
movq 0x68(%rsp), %rax
movb $0x1, (%rax,%r12)
incq %r12
jmp 0x16203
incq 0x10(%rsp)
incq %r9
movq 0x8(%rbx), %rcx
movq 0x50(%rsp), %rdx
addq $0x4, %rdx
addq 0x80(%rsp), %r8
jmp 0x161ae
xorl %eax, %eax
xorl %edx, %edx
cmpq %rcx, %rdx
je 0x16368
movq 0x60(%rsp), %r8
leaq (%r8,%rdx,4), %rsi
movq %rdx, %rdi
imulq %rcx, %rdi
leaq (%r8,%rdi,4), %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
cmpq %rcx, %r9
je 0x1635c
xorl %r10d, %r10d
cmpq %r9, %rdx
je 0x16344
movq (%rbx), %r11
movq %rax, %r14
imulq %r11, %r14
movq %r11, %r15
imulq %r8, %r15
xorl %r10d, %r10d
subq $0x1, %r11
jb 0x1633b
movq 0x20(%rbx), %r12
movl (%r12,%r15), %ebp
subl (%r12,%r14), %ebp
imull %ebp, %ebp
addl %ebp, %r10d
addq $0x4, %r14
addq $0x4, %r15
jmp 0x16319
incq 0x10(%rsp)
shrl $0x2, %r10d
movq %r9, %r11
imulq %rcx, %r11
movl %r10d, (%rsi,%r11,4)
movl %r10d, (%rdi,%r9,4)
incq %r9
addq $0x4, %r8
jmp 0x162f8
incq %rdx
addq $0x4, %rax
jmp 0x162d5
leaq (,%rcx,4), %rax
movq 0x60(%rsp), %rdx
xorl %esi, %esi
cmpq %rcx, %rsi
je 0x163b4
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
xorl %r8d, %r8d
cmpq %r8, %rcx
je 0x163a0
movl (%rdx,%r8,4), %r9d
cmpl %edi, %r9d
cmovgel %edi, %r9d
cmpq %r8, %rsi
cmovnel %r9d, %edi
incq %r8
jmp 0x16384
sarl $0x2, %edi
movq 0x78(%rsp), %r8
movl %edi, (%r8,%rsi,4)
incq %rsi
addq %rax, %rdx
jmp 0x16377
movq %rcx, %rdx
pushq $0x1
popq %rax
movl %eax, 0x50(%rsp)
xorl %eax, %eax
cmpq %r13, %rax
je 0x1655a
movq 0x8(%rsp), %rsi
movl (%rsi,%rax,4), %edi
movq 0x30(%rsp), %rsi
movl (%rsi,%rax,4), %esi
movq 0x78(%rsp), %r8
cmpl (%r8,%rdi,4), %esi
jle 0x16552
movq 0x48(%rsp), %r8
leaq (%r8,%rax,4), %r9
movq 0x60(%rsp), %r8
leaq (%r8,%rdi,4), %r8
leaq (,%rdi,4), %r10
movq %r10, 0x20(%rsp)
xorl %r11d, %r11d
xorl %r13d, %r13d
movq %r9, 0x18(%rsp)
movq %r8, 0x70(%rsp)
cmpq %rdx, %r13
jae 0x1654d
cmpq %rdi, %r13
je 0x16538
movq %r13, %r14
imulq 0x28(%rsp), %r14
cmpl (%r9,%r14,4), %esi
jle 0x16538
imulq %r13, %rdx
cmpl (%r8,%rdx,4), %esi
jle 0x16538
movq 0x68(%rsp), %rdx
cmpb $0x0, (%rdx,%rax)
movq (%rbx), %rdx
je 0x164c9
movq 0x20(%rsp), %rcx
imulq %rdx, %rcx
movq %rax, %r15
imulq %rdx, %r15
addq 0x38(%rsp), %r15
xorl %esi, %esi
xorl %r12d, %r12d
cmpq %r12, %rdx
je 0x16494
movzbl (%r15,%r12), %r10d
movq 0x20(%rbx), %rbp
addq %rcx, %rbp
subl (%rbp,%r12,4), %r10d
imull %r10d, %r10d
addl %r10d, %esi
incq %r12
jmp 0x16472
incq 0x10(%rsp)
movq 0x30(%rsp), %rcx
movl %esi, (%rcx,%rax,4)
movq 0x68(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movq 0x8(%rbx), %rcx
movq 0x18(%rsp), %r9
cmpl (%r9,%r14,4), %esi
jle 0x16538
movq %rcx, %rdx
imulq %r13, %rdx
cmpl (%r8,%rdx,4), %esi
jle 0x16538
movq (%rbx), %rdx
movq %rdx, %r12
imulq %r11, %r12
movq %rax, %rbp
imulq %rdx, %rbp
addq 0x38(%rsp), %rbp
xorl %r15d, %r15d
xorl %r10d, %r10d
cmpq %r10, %rdx
je 0x16504
movzbl (%rbp,%r10), %r9d
movq 0x20(%rbx), %r8
addq %r12, %r8
subl (%r8,%r10,4), %r9d
imull %r9d, %r9d
addl %r9d, %r15d
incq %r10
jmp 0x164e2
incq 0x10(%rsp)
movq 0x18(%rsp), %r9
movl %r15d, (%r9,%r14,4)
cmpl %esi, %r15d
movq 0x70(%rsp), %r8
jge 0x16538
movq 0x30(%rsp), %rdx
movl %r15d, (%rdx,%rax,4)
movq 0x8(%rsp), %rdx
movl %r13d, (%rdx,%rax,4)
movl $0x0, 0x50(%rsp)
jmp 0x1653b
movl %esi, %r15d
incq %r13
addq $0x4, %r11
movq %rcx, %rdx
movl %r15d, %esi
jmp 0x16417
movq 0x28(%rsp), %r13
incq %rax
jmp 0x163c0
cmpl $0x0, 0x50(%rsp)
movq 0x40(%rsp), %rax
jne 0x16579
cmpq 0x10(%rbx), %rax
je 0x16579
incq %rax
movq %rax, 0x40(%rsp)
jmp 0x160e5
movq 0x58(%rsp), %rdi
callq 0x95b0
movq 0x8(%rsp), %rdi
callq 0x95b0
movq 0x48(%rsp), %rdi
callq 0x95b0
movq 0x78(%rsp), %rdi
callq 0x95b0
movq 0x68(%rsp), %rdi
callq 0x95b0
movq 0x30(%rsp), %rdi
callq 0x95b0
movq (%rsp), %rdi
callq 0x95b0
cmpl $0x0, 0x1c(%rbx)
je 0x165f0
callq 0x9180
movq %rax, %rcx
leaq 0x1754f(%rip), %rdi     # 0x2db22
movq 0x40(%rsp), %rsi
xorl %eax, %eax
callq *%rcx
callq 0x9180
movq %rax, %rcx
testq %r13, %r13
js 0x165f7
cvtsi2ss %r13, %xmm0
jmp 0x1660d
xorl %ebx, %ebx
jmp 0x166a9
movq %r13, %rax
shrq %rax
andl $0x1, %r13d
orq %rax, %r13
cvtsi2ss %r13, %xmm0
addss %xmm0, %xmm0
movq 0x8(%rbx), %rax
testq %rax, %rax
movl $0x0, %ebx
js 0x16622
cvtsi2ss %rax, %xmm1
jmp 0x16637
movq %rax, %rdx
shrq %rdx
andl $0x1, %eax
orq %rdx, %rax
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
movq 0x10(%rsp), %rsi
mulss %xmm1, %xmm0
movq 0x40(%rsp), %rdx
addq $0x2, %rdx
js 0x16652
cvtsi2ss %rdx, %xmm1
jmp 0x16667
movq %rdx, %rax
shrq %rax
andl $0x1, %edx
orq %rax, %rdx
cvtsi2ss %rdx, %xmm1
addss %xmm1, %xmm1
mulss %xmm1, %xmm0
testq %rsi, %rsi
js 0x16677
cvtsi2ss %rsi, %xmm1
jmp 0x1668e
movq %rsi, %rax
shrq %rax
movl %esi, %edx
andl $0x1, %edx
orq %rax, %rdx
cvtsi2ss %rdx, %xmm1
addss %xmm1, %xmm1
divss %xmm1, %xmm0
addss 0x16d0e(%rip), %xmm0    # 0x2d3a8
cvtss2sd %xmm0, %xmm0
leaq 0x174a9(%rip), %rdi     # 0x2db4e
movb $0x1, %al
callq *%rcx
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x90b0