// File: /workspace/github_cpp_makefile_star2_O2/GAStudyGroup[P]GPX2/src/base/sources/ImportData.cpp
// Function: ImportData::importFirstPopulation(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int)
Population ImportData::importFirstPopulation(string name, unsigned popSize)
{
    ifstream file;
    string word{ "" };
    Population pop;
    for (unsigned i = 1; i <= popSize; i++) {
        string fileName{ name + "_exec_1_sol_" + to_string(i) + "_" + to_string(popSize) + ".dat" };
        /* string fileName{ name + to_string(i) + ".dat2" }; */
        file.open(fileName);
        if (!file.is_open()) {
            cout << "error reading file" << endl;
            exit(EXIT_FAILURE);
        }

        vector<int> newT;
        newT.reserve(popSize);
        auto ss = ostringstream{};
        ss <<file.rdbuf();
        auto cities = explode(ss.str(),'\n');
        //while (file >> word) {
        for(auto wordaux : cities){
            newT.push_back(stoi(wordaux));
        }
        //}
        file.close();
        pop.getPopulation().push_back(newT);
    }
    return (pop);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x488, %rsp            # imm = 0x488
movl %ecx, (%rsp)
movq %rdx, 0x38(%rsp)
movq %rdi, %rbx
leaq 0x280(%rsp), %rdi
callq 0x53f0
leaq 0x1b492(%rip), %rsi     # 0x28946
leaq 0xe8(%rsp), %rdi
leaq 0x108(%rsp), %rdx
callq 0x6cfa
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
callq 0xb97c
movl (%rsp), %eax
movq %rax, 0x30(%rsp)
pushq $0x1
popq %rax
leaq 0xa8(%rsp), %rbx
leaq 0x40(%rsp), %r14
leaq 0x68(%rsp), %r12
pushq $0xa
popq %r13
movl %eax, 0x4(%rsp)
cmpl (%rsp), %eax
ja 0xd6ed
leaq 0x10(%rsp), %rdi
movq 0x38(%rsp), %rsi
leaq 0x1a46a(%rip), %rdx     # 0x2797f
callq 0xb764
movq %rbx, %rdi
movl 0x4(%rsp), %esi
callq 0xb68c
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xb5e2
movq %r12, %rdi
movq %r14, %rsi
leaq 0x19ece(%rip), %rdx     # 0x27411
callq 0xb5c3
leaq 0x88(%rsp), %r15
movq %r15, %rdi
movl (%rsp), %esi
callq 0xb68c
leaq 0x108(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xb5e2
leaq 0xc8(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rsi
leaq 0x1a406(%rip), %rdx     # 0x2798c
callq 0xb5c3
movq %rbp, %rdi
callq 0x56f8
leaq 0x88(%rsp), %rdi
callq 0x56f8
movq %r12, %rdi
callq 0x56f8
movq %r14, %rdi
callq 0x56f8
movq %rbx, %rdi
callq 0x56f8
leaq 0x10(%rsp), %rdi
callq 0x56f8
leaq 0x280(%rsp), %rdi
movq %r15, %rsi
pushq $0x8
popq %rdx
callq 0x5310
leaq 0x2f8(%rsp), %rdi
callq 0x50c0
testb %al, %al
je 0xd71e
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
andq $0x0, 0x50(%rsp)
movq %r14, %rdi
movq 0x30(%rsp), %rsi
callq 0xda82
leaq 0x108(%rsp), %r15
movq %r15, %rdi
callq 0x5490
movq %r15, %rdi
leaq 0x290(%rsp), %rsi
callq 0x50a0
movq %r12, %rdi
leaq 0x110(%rsp), %rsi
callq 0x5540
leaq 0x10(%rsp), %rdi
movq %r12, %rdx
movl %r13d, %ecx
callq 0xd850
movq %r12, %rdi
callq 0x56f8
movq 0x10(%rsp), %rbp
movq 0x18(%rsp), %r15
cmpq %r15, %rbp
je 0xd694
movq %r12, %rdi
movq %rbp, %rsi
callq 0x54a0
movq %r12, %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x6d40
movl %eax, 0xa8(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0xbea4
movq %r12, %rdi
callq 0x56f8
addq $0x20, %rbp
jmp 0xd657
leaq 0x280(%rsp), %rdi
callq 0x5090
movq 0x8(%rsp), %rdi
callq 0xb988
movq %rax, %rdi
movq %r14, %rsi
callq 0x938a
leaq 0x10(%rsp), %rdi
callq 0x709c
leaq 0x108(%rsp), %rdi
callq 0x50d0
movq %r14, %rdi
callq 0x6e4c
leaq 0xc8(%rsp), %rdi
callq 0x56f8
movl 0x4(%rsp), %eax
incl %eax
jmp 0xd4f7
leaq 0xe8(%rsp), %rdi
callq 0x56f8
leaq 0x280(%rsp), %rdi
callq 0x50f0
movq 0x8(%rsp), %rax
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2e87b(%rip), %rdi     # 0x3bfa0
leaq 0x1a265(%rip), %rsi     # 0x27991
callq 0x5370
movq %rax, %rdi
callq 0x51c0
pushq $0x1
popq %rdi
callq 0x5430
movq %rax, %rbx
jmp 0xd82d
movq %rax, %rbx
jmp 0xd83a
jmp 0xd777
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x56f8
jmp 0xd7ff
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x56f8
jmp 0xd7ac
movq %rax, %rbx
jmp 0xd816
movq %rax, %rbx
jmp 0xd823
movq %rax, %rbx
jmp 0xd7da
jmp 0xd793
movq %rax, %rbx
jmp 0xd7cd
movq %rax, %rbx
jmp 0xd80c
movq %rax, %rbx
jmp 0xd7c3
jmp 0xd7a4
movq %rax, %rbx
jmp 0xd7b9
movq %rax, %rbx
jmp 0xd7ff
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x56f8
leaq 0x68(%rsp), %rdi
callq 0x56f8
leaq 0x40(%rsp), %rdi
callq 0x56f8
leaq 0xa8(%rsp), %rdi
callq 0x56f8
leaq 0x10(%rsp), %rdi
jmp 0xd81e
jmp 0xd7e3
movq %rax, %rbx
jmp 0xd7f5
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x56f8
leaq 0x10(%rsp), %rdi
callq 0x709c
leaq 0x108(%rsp), %rdi
callq 0x50d0
leaq 0x40(%rsp), %rdi
callq 0x6e4c
leaq 0xc8(%rsp), %rdi
callq 0x56f8
movq 0x8(%rsp), %rdi
callq 0x6dde
leaq 0xe8(%rsp), %rdi
callq 0x56f8
leaq 0x280(%rsp), %rdi
callq 0x50f0
movq %rbx, %rdi
callq 0x5610
nop