// File: /workspace/github_cpp_makefile_star2_O1/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 0x1b8b
movq %rbx, %rdi
callq 0x1b2e
movb $0x0, (%rbx)
movq %rbx, 0x58(%rsp)
movl %ebp, 0x4(%rbx)
cmpl $0x0, 0x18(%rsp)
jle 0x1d4c
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), %r14
leaq 0x70(%rsp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movl $0x0, 0x40(%rsp)
testl %ebp, %ebp
jle 0x1c23
xorl %eax, %eax
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x1c0a
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x1c15
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2ec6
movl 0x40(%rsp), %eax
incl %eax
movl %eax, 0x40(%rsp)
cmpl %ebp, %eax
jl 0x1bf1
movq 0x20(%rsp), %r12
movq 0x28(%rsp), %r14
cmpq %r14, %r12
je 0x1c85
leaq 0x4(%r12), %rax
cmpq %r14, %rax
je 0x1c85
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 0x1c74
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 0x1c41
movq %r15, %rdi
leaq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x29f6
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x185c
movq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x29a8
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1cc9
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1130
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1ce3
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x1130
movq $0x0, 0x68(%rsp)
movq %r14, %rdi
movq 0x8(%rsp), %rsi
leaq 0x68(%rsp), %rdx
leaq 0x7(%rsp), %rcx
callq 0x2ac4
movq 0x60(%rsp), %rdi
movq %r14, %rsi
callq 0x2a76
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1d27
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1130
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1d3e
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x1130
incl %r13d
cmpl 0x18(%rsp), %r13d
jne 0x1bd2
testl %ebp, %ebp
jle 0x1df8
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 0x1ddf
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 0x1d95
incq 0x10(%rsp)
addq $0x3, 0x8(%rsp)
movq 0x18(%rsp), %rbp
cmpq %r14, %rbp
jne 0x1d72
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1e5d
movq %rax, %rbx
jmp 0x1e2b
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1e2b
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1130
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1e60
movq 0x80(%rsp), %rsi
jmp 0x1e53
jmp 0x1e5d
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1e60
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1130
jmp 0x1e60
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1e77
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x1130
movq %rbx, %rdi
callq 0x11c0
nop