// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x21f0
movl %eax, %edi
callq 0x2200
movq 0x8(%rbx), %rsi
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x5854
cmpq $0x0, 0x8(%rbx)
je 0x5935
movq 0x10(%rsp), %rax
xorl %ecx, %ecx
movq %rcx, (%rax,%rcx,8)
incq %rcx
movq 0x8(%rbx), %r14
cmpq %rcx, %r14
ja 0x5925
movq 0x10(%rsp), %r15
movq 0x18(%rsp), %r12
cmpq %r12, %r15
je 0x599f
leaq 0x8(%r15), %rax
cmpq %r12, %rax
je 0x599f
movl $0x8, %r14d
callq 0x20a0
cltq
movq %r14, %rcx
sarq $0x3, %rcx
incq %rcx
cqto
idivq %rcx
leaq (,%rdx,8), %rax
cmpq %rax, %r14
je 0x598a
leaq (%r15,%r14), %rax
leaq (%r15,%rdx,8), %rcx
movq (%rax), %rdx
movq (%rcx), %rsi
movq %rsi, (%rax)
movq %rdx, (%rcx)
leaq (%r15,%r14), %rax
addq $0x8, %rax
addq $0x8, %r14
cmpq %r12, %rax
jne 0x5953
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x5b10
leaq 0x78(%rbx), %rax
movq %rax, 0x28(%rsp)
leaq 0xa8(%rbx), %rax
movq %rax, 0x30(%rsp)
xorl %ebp, %ebp
xorl %r12d, %r12d
xorl %r14d, %r14d
movq 0x10(%rsp), %rcx
leaq (%rcx,%r12), %rsi
movq 0x60(%rbx), %rax
movq (%rcx,%r12), %rcx
cmpq %r14, (%rbx)
jbe 0x5a8a
movq %r14, (%rax,%rcx,8)
movq (%rsi), %rax
movq %rax, %rcx
shlq $0x7, %rcx
leaq (%rcx,%rax,8), %r13
addq 0x18(%rbx), %r13
movq 0x30(%rbx), %r15
leaq (%r15,%rbp), %rdi
movq %r13, %rsi
callq 0x5db4
leaq (%r15,%rbp), %rdi
addq $0x18, %rdi
leaq 0x18(%r13), %rsi
callq 0x5db4
leaq (%r15,%rbp), %rdi
addq $0x30, %rdi
leaq 0x30(%r13), %rsi
callq 0x2120
leaq (%r15,%rbp), %rdi
addq $0x50, %rdi
leaq 0x50(%r13), %rsi
callq 0x2120
leaq (%r15,%rbp), %rdi
addq $0x70, %rdi
addq $0x70, %r13
movq %r13, %rsi
callq 0x5db4
movq %r14, 0x8(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x5c6e
movq 0x10(%rsp), %rsi
addq %r12, %rsi
movq %rax, %rdi
callq 0x60d6
movq 0x10(%rsp), %rsi
addq %r12, %rsi
movq 0x28(%rsp), %rdi
callq 0x5cd4
movq %r14, (%rax)
xorps %xmm0, %xmm0
jmp 0x5ae6
movq $0x0, (%rax,%rcx,8)
movq 0x28(%rsp), %rdi
callq 0x5cd4
xorl %ecx, %ecx
movq %rcx, (%rax)
movq %rcx, 0x8(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x5c6e
movq 0x10(%rsp), %rsi
addq %r12, %rsi
movq %rax, %rdi
callq 0x60d6
movq 0x30(%rbx), %rdi
movq 0x10(%rsp), %rax
movq (%rax,%r12), %rax
movq %rax, %rcx
shlq $0x7, %rcx
leaq (%rcx,%rax,8), %rsi
addq 0x18(%rbx), %rsi
callq 0x747c
movq 0x10(%rsp), %rax
movq (%rax,%r12), %rax
movq 0x48(%rbx), %rcx
movsd %xmm0, (%rcx,%rax,8)
incq %r14
addq $0x8, %r12
addq $0x88, %rbp
cmpq %r14, 0x8(%rbx)
ja 0x59c5
movq %rbx, %rdi
callq 0x5d3a
leaq 0x46da(%rip), %rdi      # 0xa1f9
movb $0x1, %al
callq 0x2050
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5b3d
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5b52
jmp 0x5b52
jmp 0x5b52
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5b6c
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x2370