// File: sebastienmeyer2[P]mst-clustering/src/kmeans.cpp
// Function: Cloud::Cloud(int, int, int)
Cloud::Cloud(int _d, int _nmax, int _k)	
{
    /*!
     * @brief Builds an empty cloud
     * 
     * @param _d The dimension of the points
	 * @param _nmax The maximal number of points in this cloud
	 * @param _k The number of clusters to be drawn
     */

	d = _d;
	Point::d = _d;
	n = 0;
	k = _k;

	nmax = _nmax;

	points = new Point[nmax];
	centers = new Point[k];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movl -0xc(%rbp), %ecx
movl %ecx, (%rax)
movl -0xc(%rbp), %edx
leaq 0x1e279(%rip), %rcx     # 0x507f8
movl %edx, (%rcx)
movl $0x0, 0x4(%rax)
movl -0x14(%rbp), %ecx
movl %ecx, 0x8(%rax)
movl -0x10(%rbp), %ecx
movl %ecx, 0xc(%rax)
movslq 0xc(%rax), %rax
movq %rax, -0x40(%rbp)
movl $0x10, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x48(%rbp)
callq 0xa030
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x38(%rbp)
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x30(%rbp)
cmpq $0x0, %rax
je 0x32624
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rdx
shlq $0x4, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x60(%rbp)
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0xb520
jmp 0x3260f
movq -0x60(%rbp), %rcx
movq -0x68(%rbp), %rax
addq $0x10, %rax
cmpq %rcx, %rax
movq %rax, -0x58(%rbp)
jne 0x32600
movq -0x50(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, 0x10(%rax)
movslq 0x8(%rax), %rax
movq %rax, -0x80(%rbp)
movl $0x10, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x88(%rbp)
callq 0xa030
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, -0x78(%rbp)
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x70(%rbp)
cmpq $0x0, %rax
je 0x326d8
movq -0x70(%rbp), %rax
movq -0x80(%rbp), %rdx
shlq $0x4, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x98(%rbp)
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0xb520
jmp 0x326ba
movq -0x98(%rbp), %rcx
movq -0xa0(%rbp), %rax
addq $0x10, %rax
cmpq %rcx, %rax
movq %rax, -0x90(%rbp)
jne 0x326a5
movq -0x50(%rbp), %rax
movq -0x70(%rbp), %rcx
movq %rcx, 0x18(%rax)
addq $0xc0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rcx
movq %rax, %rsi
movq -0x68(%rbp), %rax
movq %rsi, -0x20(%rbp)
movl %edx, -0x24(%rbp)
cmpq %rax, %rcx
movq %rax, -0xa8(%rbp)
je 0x32739
movq -0xa8(%rbp), %rdi
addq $-0x10, %rdi
movq %rdi, -0xb0(%rbp)
callq 0xb590
movq -0x30(%rbp), %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0xa8(%rbp)
jne 0x3270b
movq -0x48(%rbp), %rsi
movq -0x38(%rbp), %rdi
callq 0xaf60
jmp 0x327a7
movq -0x70(%rbp), %rcx
movq %rax, %rsi
movq -0xa0(%rbp), %rax
movq %rsi, -0x20(%rbp)
movl %edx, -0x24(%rbp)
cmpq %rax, %rcx
movq %rax, -0xb8(%rbp)
je 0x32797
movq -0xb8(%rbp), %rdi
addq $-0x10, %rdi
movq %rdi, -0xc0(%rbp)
callq 0xb590
movq -0x70(%rbp), %rcx
movq -0xc0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0xb8(%rbp)
jne 0x32769
movq -0x88(%rbp), %rsi
movq -0x78(%rbp), %rdi
callq 0xaf60
movq -0x20(%rbp), %rdi
callq 0xade0