// File: /workspace/github_cpp_makefile_star2_O3/gabrielfelipeg[P]TravellingSalesman-GeneticAlgo/src/population.cpp
// Function: Population::start(int, int)
void Population::start(int k, int size){
    if(!resetStatus)reset();
    resetStatus = false;
    tam = k;
    for(int i = 0; i < size; i++){
        std::vector<int> aux;
        for(int j = 0; j < k; j++){
            aux.emplace_back(j);
        }
        std::random_shuffle(aux.begin(), aux.end());
        population.emplace_back(Individual(aux));
        weight.emplace_back(std::vector<long long>(k, 0));
    }
    for(int i = 0; i < k; i++){
        for(int j = i + 1; j < k; j++){
            weight[i][j] = (rand() % 100000) + 122;
            weight[j][i] = weight[i][j];
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %edx, 0x18(%rsp)
movl %esi, %ebp
movq %rdi, %rbx
cmpb $0x0, (%rdi)
jne 0x1ccb
movq %rbx, %rdi
callq 0x1c6e
movb $0x0, (%rbx)
movq %rbx, 0x58(%rsp)
movl %ebp, 0x4(%rbx)
cmpl $0x0, 0x18(%rsp)
jle 0x1e8b
movq 0x58(%rsp), %rax
leaq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movslq %ebp, %rcx
movq %rcx, 0x8(%rsp)
addq $0x28, %rax
movq %rax, 0x60(%rsp)
xorl %r13d, %r13d
leaq 0x20(%rsp), %rbx
leaq 0x40(%rsp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movl $0x0, 0x40(%rsp)
testl %ebp, %ebp
jle 0x1dc4
xorl %eax, %eax
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x1d49
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x1d54
movq %rbx, %rdi
movq %r15, %rdx
callq 0x309c
movl 0x40(%rsp), %eax
incl %eax
movl %eax, 0x40(%rsp)
cmpl %ebp, %eax
jl 0x1d30
movq 0x20(%rsp), %r12
movq 0x28(%rsp), %r14
cmpq %r14, %r12
je 0x1dc4
leaq 0x4(%r12), %rax
cmpq %r14, %rax
je 0x1dc4
movl $0x4, %ebx
callq 0x1040
cltq
movq %rbx, %rcx
sarq $0x2, %rcx
incq %rcx
cqto
idivq %rcx
leaq (,%rdx,4), %rax
cmpq %rax, %rbx
je 0x1db3
leaq (%r12,%rbx), %rax
leaq (%r12,%rdx,4), %rcx
movl (%rax), %edx
movl (%rcx), %esi
movl %esi, (%rax)
movl %edx, (%rcx)
leaq (%r12,%rbx), %rax
addq $0x4, %rax
addq $0x4, %rbx
cmpq %r14, %rax
jne 0x1d80
leaq 0x70(%rsp), %r14
movq %r14, %rdi
leaq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x2af0
movq %r15, %rdi
movq %r14, %rsi
callq 0x1888
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x2aa2
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1e08
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1130
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1e22
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x1130
movq $0x0, 0x68(%rsp)
movq %r15, %rdi
movq 0x8(%rsp), %rsi
leaq 0x68(%rsp), %rdx
leaq 0x7(%rsp), %rcx
callq 0x2bbe
movq 0x60(%rsp), %rdi
movq %r15, %rsi
callq 0x2b70
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1e66
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1130
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1e7d
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x1130
incl %r13d
cmpl 0x18(%rsp), %r13d
jne 0x1d0d
testl %ebp, %ebp
jle 0x1f37
movl %ebp, %r14d
movl $0x1, %eax
movq %rax, 0x10(%rsp)
movl $0x3, %eax
movq %rax, 0x8(%rsp)
xorl %ebp, %ebp
movq 0x58(%rsp), %rbx
leaq 0x1(%rbp), %rax
movq %rax, 0x18(%rsp)
cmpq %r14, %rax
jae 0x1f1e
leaq (,%rbp,2), %r13
addq %rbp, %r13
movq 0x8(%rsp), %r12
movq 0x10(%rsp), %r15
callq 0x1040
cltq
imulq $0x14f8b589, %rax, %rcx # imm = 0x14F8B589
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x2d, %rcx
addl %edx, %ecx
imull $0x186a0, %ecx, %ecx    # imm = 0x186A0
negl %ecx
addl %ecx, %eax
addl $0x7a, %eax
cltq
movq 0x28(%rbx), %rcx
movq (%rcx,%r13,8), %rdx
movq %rax, (%rdx,%r15,8)
movq (%rcx,%r12,8), %rcx
movq %rax, (%rcx,%rbp,8)
incq %r15
addq $0x3, %r12
cmpq %r15, %r14
jne 0x1ed4
incq 0x10(%rsp)
addq $0x3, 0x8(%rsp)
movq 0x18(%rsp), %rbp
cmpq %r14, %rbp
jne 0x1eb1
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1f9c
movq %rax, %rbx
jmp 0x1f6a
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1f6a
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1130
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1f9f
movq 0x80(%rsp), %rsi
jmp 0x1f92
jmp 0x1f9c
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1f9f
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1130
jmp 0x1f9f
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1fb6
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x1130
movq %rbx, %rdi
callq 0x11c0