// File: cooljacket[P]Dormitory-distribution/./KMeans.h
// Function: KMeans<Student>::Init()
void Init() {
		srand(time(0));
		vector<size_t> ranks(size);
		for (int i = 0; i < size; ++i) {
			ranks[i] = i;
		}
		random_shuffle(ranks.begin(), ranks.end());
		for (int i = 0; i < size; ++i) {
			if (i < K) {
				my_centroids[ranks[i]] = i;
				centroids[i] = elements[ranks[i]];
				my_points_map[i].insert(ranks[i]);
				my_centroids_map[ranks[i]] = i;
				dist[ranks[i]] = 0.0;
				// printf("At first, i=%d, ranks[i]=%d\n", i, int(ranks[i]));
				// centroids[i].output();
			} else {
				// default centroid is 0
				my_centroids[ranks[i]] = 0;
				my_centroids_map[ranks[i]] = 0;
				my_points_map[0].insert(ranks[i]);
				dist[ranks[i]] = centroids[0].dist(elements[ranks[i]]);
			}
		}

		printf("After initialization, SSE=%lf\n", SSE());
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x98(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x3250
movl %eax, %edi
callq 0x3260
movq -0x98(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x90(%rbp)
leaq -0x21(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0xb6b0
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
leaq -0x20(%rbp), %rdi
callq 0xb6d0
jmp 0xb805
leaq -0x21(%rbp), %rdi
callq 0xb740
movl $0x0, -0x38(%rbp)
movq -0x98(%rbp), %rcx
movslq -0x38(%rbp), %rax
cmpq 0x8(%rcx), %rax
jae 0xb86d
movslq -0x38(%rbp), %rax
movq %rax, -0xa0(%rbp)
movslq -0x38(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x71e0
movq -0xa0(%rbp), %rcx
movq %rcx, (%rax)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xb815
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x21(%rbp), %rdi
callq 0xb740
jmp 0xbc5d
leaq -0x20(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0xcf90
movq -0xa8(%rbp), %rdi
movq %rax, -0x40(%rbp)
callq 0xcfc0
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0xcec0
jmp 0xb8a0
movl $0x0, -0x4c(%rbp)
movq -0x98(%rbp), %rcx
movslq -0x4c(%rbp), %rax
cmpq 0x8(%rcx), %rax
jae 0xbc1d
movq -0x98(%rbp), %rcx
movslq -0x4c(%rbp), %rax
cmpq (%rcx), %rax
jae 0xba80
movq -0x98(%rbp), %rax
movslq -0x4c(%rbp), %rsi
movq %rsi, -0xc8(%rbp)
addq $0x60, %rax
movq %rax, -0xd0(%rbp)
leaq -0x20(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x71e0
movq -0xd0(%rbp), %rdi
movq (%rax), %rsi
callq 0x71e0
movq -0xc8(%rbp), %rdx
movq -0xc0(%rbp), %rdi
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rdx, (%rcx)
addq $0x18, %rax
movq %rax, -0xb8(%rbp)
movslq -0x4c(%rbp), %rsi
callq 0x71e0
movq -0xb8(%rbp), %rdi
movq (%rax), %rsi
callq 0x6930
movq -0x98(%rbp), %rdi
movq %rax, -0xb0(%rbp)
addq $0x30, %rdi
movslq -0x4c(%rbp), %rsi
callq 0x6930
movq -0xb0(%rbp), %rsi
movq %rax, %rdi
callq 0xcff0
jmp 0xb976
movq -0x98(%rbp), %rdi
addq $0xa8, %rdi
movslq -0x4c(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x58(%rbp), %rsi
callq 0xd060
movq %rax, -0xd8(%rbp)
jmp 0xb99e
movslq -0x4c(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x71e0
movq -0xd8(%rbp), %rdi
movq %rax, %rsi
callq 0xd140
movb %dl, -0xe1(%rbp)
movq %rax, -0xe0(%rbp)
jmp 0xb9c9
movq -0x98(%rbp), %rax
movb -0xe1(%rbp), %cl
movq -0xe0(%rbp), %rdx
movq %rdx, -0x68(%rbp)
movb %cl, -0x60(%rbp)
movslq -0x4c(%rbp), %rsi
movq %rsi, -0x100(%rbp)
addq $0x78, %rax
movq %rax, -0xf8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x71e0
movq -0xf8(%rbp), %rdi
movq %rax, %rsi
callq 0xd190
movq %rax, -0xf0(%rbp)
jmp 0xba1b
movq -0x98(%rbp), %rax
movq -0xf0(%rbp), %rcx
movq -0x100(%rbp), %rdx
movq %rdx, (%rcx)
addq $0x48, %rax
movq %rax, -0x108(%rbp)
movslq -0x4c(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x71e0
movq -0x108(%rbp), %rdi
movq (%rax), %rsi
callq 0xd270
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
jmp 0xbc0d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x7280
jmp 0xbc5d
movq -0x98(%rbp), %rax
addq $0x60, %rax
movq %rax, -0x128(%rbp)
movslq -0x4c(%rbp), %rsi
leaq -0x20(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x71e0
movq -0x128(%rbp), %rdi
movq (%rax), %rsi
callq 0x71e0
movq -0x120(%rbp), %rdi
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq $0x0, (%rcx)
addq $0x78, %rax
movq %rax, -0x118(%rbp)
movslq -0x4c(%rbp), %rsi
callq 0x71e0
movq -0x118(%rbp), %rdi
movq %rax, %rsi
callq 0xd190
movq %rax, -0x110(%rbp)
jmp 0xbaf9
movq -0x98(%rbp), %rdi
movq -0x110(%rbp), %rax
movq $0x0, (%rax)
addq $0xa8, %rdi
movq $0x0, -0x70(%rbp)
leaq -0x70(%rbp), %rsi
callq 0xd060
movq %rax, -0x130(%rbp)
jmp 0xbb2f
movslq -0x4c(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x71e0
movq -0x130(%rbp), %rdi
movq %rax, %rsi
callq 0xd140
movb %dl, -0x139(%rbp)
movq %rax, -0x138(%rbp)
jmp 0xbb5a
movq -0x98(%rbp), %rdi
movb -0x139(%rbp), %al
movq -0x138(%rbp), %rcx
movq %rcx, -0x80(%rbp)
movb %al, -0x78(%rbp)
addq $0x30, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x6930
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, -0x150(%rbp)
addq $0x18, %rax
movq %rax, -0x158(%rbp)
movslq -0x4c(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x71e0
movq -0x158(%rbp), %rdi
movq (%rax), %rsi
callq 0x6930
movq -0x150(%rbp), %rdi
movq %rax, %rsi
callq 0x14020
movsd %xmm0, -0x148(%rbp)
jmp 0xbbd3
movq -0x98(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x160(%rbp)
movslq -0x4c(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x71e0
movq -0x160(%rbp), %rdi
movq (%rax), %rsi
callq 0xd270
movsd -0x148(%rbp), %xmm0
movsd %xmm0, (%rax)
jmp 0xbc0f
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0xb8a7
movq -0x98(%rbp), %rdi
callq 0xd290
movsd %xmm0, -0x168(%rbp)
jmp 0xbc33
movsd -0x168(%rbp), %xmm0
leaq 0x1057d(%rip), %rdi     # 0x1c1bf
movb $0x1, %al
callq 0x3050
jmp 0xbc4b
leaq -0x20(%rbp), %rdi
callq 0x7280
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x3440
nopw %cs:(%rax,%rax)