// File: 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
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc0(%rbp)
testb $0x1, (%rax)
jne 0x3df1
movq -0xc0(%rbp), %rdi
callq 0x3d70
movq -0xc0(%rbp), %rax
movb $0x0, (%rax)
movl -0xc(%rbp), %ecx
movl %ecx, 0x4(%rax)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x3ffc
leaq -0x30(%rbp), %rdi
callq 0x2b10
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x3e59
leaq -0x30(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x5130
jmp 0x3e3b
jmp 0x3e3d
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x3e24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3fee
leaq -0x30(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x3120
movq -0xc8(%rbp), %rdi
movq %rax, -0x50(%rbp)
callq 0x3150
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x51b0
jmp 0x3e8c
movq -0xc0(%rbp), %rax
addq $0x10, %rax
movq %rax, -0xd0(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x5300
jmp 0x3eb0
leaq -0x70(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x28e0
jmp 0x3ec2
movq -0xd0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x5280
jmp 0x3ed4
leaq -0x70(%rbp), %rdi
callq 0x1c30
leaq -0x88(%rbp), %rdi
callq 0x1c50
movq -0xc0(%rbp), %rax
addq $0x28, %rax
movq %rax, -0xe8(%rbp)
movslq -0xc(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq $0x0, -0xa8(%rbp)
leaq -0xa9(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x17d0
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rcx
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0x5470
jmp 0x3f47
movq -0xe8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x53f0
jmp 0x3f5c
leaq -0xa0(%rbp), %rdi
callq 0x16f0
leaq -0xa9(%rbp), %rdi
callq 0x20d0
leaq -0x30(%rbp), %rdi
callq 0x1c50
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3e08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3fae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x1c30
leaq -0x88(%rbp), %rdi
callq 0x1c50
jmp 0x3fee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3fe2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x16f0
leaq -0xa9(%rbp), %rdi
callq 0x20d0
leaq -0x30(%rbp), %rdi
callq 0x1c50
jmp 0x4110
movl $0x0, -0xb0(%rbp)
movl -0xb0(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x4107
movl -0xb0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x40f1
callq 0x1030
movq -0xc0(%rbp), %rdi
movl $0x186a0, %ecx          # imm = 0x186A0
cltd
idivl %ecx
addl $0x7a, %edx
movslq %edx, %rax
movq %rax, -0xf8(%rbp)
addq $0x28, %rdi
movslq -0xb0(%rbp), %rsi
callq 0x54f0
movq %rax, %rdi
movslq -0xb4(%rbp), %rsi
callq 0x16d0
movq -0xf8(%rbp), %rcx
movq -0xc0(%rbp), %rdi
movq %rcx, (%rax)
addq $0x28, %rdi
movslq -0xb0(%rbp), %rsi
callq 0x54f0
movq %rax, %rdi
movslq -0xb4(%rbp), %rsi
callq 0x16d0
movq -0xc0(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0xf0(%rbp)
addq $0x28, %rdi
movslq -0xb4(%rbp), %rsi
callq 0x54f0
movq %rax, %rdi
movslq -0xb0(%rbp), %rsi
callq 0x16d0
movq -0xf0(%rbp), %rcx
movq %rcx, (%rax)
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0x4024
jmp 0x40f3
movl -0xb0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb0(%rbp)
jmp 0x4006
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x1180
nopl (%rax)