// File: /workspace/github_cpp_makefile_star2_O1/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 %edi, %edi
callq 0x21f0
movl %eax, %edi
callq 0x2200
movq 0x8(%rbx), %rsi
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x58a8
cmpq $0x0, 0x8(%rbx)
je 0x597f
movq 0x10(%rsp), %rax
xorl %ecx, %ecx
movq %rcx, (%rax,%rcx,8)
incq %rcx
cmpq %rcx, 0x8(%rbx)
ja 0x5972
movq 0x10(%rsp), %r14
movq 0x18(%rsp), %r15
cmpq %r15, %r14
je 0x59e5
leaq 0x8(%r14), %rax
cmpq %r15, %rax
je 0x59e5
movl $0x8, %r12d
callq 0x20a0
cltq
movq %r12, %rcx
sarq $0x3, %rcx
incq %rcx
cqto
idivq %rcx
leaq (,%rdx,8), %rax
cmpq %rax, %r12
je 0x59d4
leaq (%r14,%r12), %rax
leaq (%r14,%rdx,8), %rcx
movq (%rax), %rdx
movq (%rcx), %rsi
movq %rsi, (%rax)
movq %rdx, (%rcx)
leaq (%r14,%r12), %rax
addq $0x8, %rax
addq $0x8, %r12
cmpq %r15, %rax
jne 0x599d
cmpq $0x0, 0x8(%rbx)
je 0x5b5c
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), %rax
leaq (%rax,%r12), %rsi
movq (%rax,%r12), %rax
cmpq %r14, (%rbx)
jbe 0x5ad2
movq 0x60(%rbx), %rcx
movq %r14, (%rcx,%rax,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 0x5e00
leaq (%r15,%rbp), %rdi
addq $0x18, %rdi
leaq 0x18(%r13), %rsi
callq 0x5e00
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 0x5e00
movq %r14, 0x8(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x5cba
movq 0x10(%rsp), %rsi
addq %r12, %rsi
movq %rax, %rdi
callq 0x611a
movq 0x10(%rsp), %rsi
addq %r12, %rsi
movq 0x28(%rsp), %rdi
callq 0x5d20
movq %r14, (%rax)
xorps %xmm0, %xmm0
jmp 0x5b32
movq 0x60(%rbx), %rcx
movq $0x0, (%rcx,%rax,8)
movq 0x28(%rsp), %rdi
callq 0x5d20
xorl %ecx, %ecx
movq %rcx, (%rax)
movq %rcx, 0x8(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x5cba
movq 0x10(%rsp), %rsi
addq %r12, %rsi
movq %rax, %rdi
callq 0x611a
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 0x7474
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 0x5a0d
movq %rbx, %rdi
callq 0x5d86
leaq 0x468e(%rip), %rdi      # 0xa1f9
movb $0x1, %al
callq 0x2050
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5b89
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 0x5b9e
jmp 0x5b9e
jmp 0x5b9e
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5bb8
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x2370