// File: /workspace/github_cpp_makefile_star2_O3/GAStudyGroup[P]GPX2/src/cross/gpx/sources/GPX2Support.cpp
// Function: GPX2Support::printMap(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, Node*, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, Node*>>>&, std::ostream&)
void GPX2Support::printMap(GPX2Structs::NodeMap& graph, std::ostream& stream)
{
    stream << "size: " << graph.size() << "\n";
    for (map<string, Node*>::iterator it = graph.begin(); it != graph.end(); it++) {
        stream << " " << it->first << " | " << graph[it->first]->getId() <<  "\n";
        if (it->second->getAccess()) {
            stream << "Access: " << true <<  "\n";
        } else {
            stream << "Access: " << false <<  "\n";
        }
        stream << "==================================\n";

        stream << "connections: " << it->second->getEdges().size() <<  "\n";
        for (unsigned i = 0; i < it->second->getEdges().size(); i++) {
            stream << "Edge " << i << ": " << graph[it->second->getEdges()[i].first]->getId();
            stream << "\t#\t";
            stream << "Distance: " << it->second->getEdges()[i].second << "\n";
        }
        stream << "----------------------------------\n";
    }

    stream << "______________________________________________________________THE DIVISION______________________________________________________________\n";

    deque<string> nextToVisit;
    vector<string> isAlreadyVisited;
    bool notAlreadyVisited{ false };
    bool notToVisit{ false };

    Node* city = graph.begin()->second; // Reduzir chamadas (Node dentro do map)

    isAlreadyVisited.push_back(graph.begin()->first);
    stream << graph.begin()->first << "\n";
    nextToVisit.push_back(city->getEdges()[0].first);

    while (!nextToVisit.empty()) {

        stream << nextToVisit.front() << "\n";
        isAlreadyVisited.push_back(nextToVisit.front());
        city = graph[nextToVisit.front()];
        nextToVisit.pop_front();

        for (Node::node n : city->getEdges()) {

            notAlreadyVisited = find(isAlreadyVisited.begin(), isAlreadyVisited.end(), n.first) == isAlreadyVisited.end();
            notToVisit = find(nextToVisit.begin(), nextToVisit.end(), n.first) == nextToVisit.end();

            if (notAlreadyVisited && notToVisit) {
                nextToVisit.push_back(n.first);
            }
        }
    }
    stream << "size " << isAlreadyVisited.size() << "\n";
    stream << "map size " << graph.size() << "\n";
    stream.flush();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x48ad(%rip), %rsi      # 0x3288d
movl $0x6, %edx
movq %rbx, %rdi
callq 0x5430
movq 0x28(%r12), %rsi
movq %rbx, %rdi
callq 0x5280
leaq 0x4802(%rip), %rsi      # 0x32803
movl $0x1, %edx
movq %rax, %rdi
callq 0x5430
movq 0x18(%r12), %r15
leaq 0x8(%r12), %rax
movq %rax, 0x8(%rsp)
cmpq %rax, %r15
je 0x2e2c6
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x3363(%rip), %rsi      # 0x31398
callq 0x5430
leaq 0x20(%r15), %r14
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
movq %rbx, %rdi
callq 0x5430
movq %rax, %r13
movl $0x3, %edx
movq %rax, %rdi
leaq 0x48cb(%rip), %rsi      # 0x3292b
callq 0x5430
movq %r12, %rdi
movq %r14, %rsi
callq 0x28dba
movq (%rax), %rsi
leaq 0x10(%rsp), %rdi
callq 0x29f56
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r13, %rdi
callq 0x5430
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4765(%rip), %rsi      # 0x32803
callq 0x5430
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x2e0bf
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x53b0
movq 0x40(%r15), %rdi
callq 0x29f7e
movl %eax, %ebp
movl $0x8, %edx
movq %rbx, %rdi
leaq 0x4856(%rip), %rsi      # 0x3292f
callq 0x5430
movzbl %bpl, %esi
movq %rbx, %rdi
callq 0x55f0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x470a(%rip), %r14      # 0x32803
movq %r14, %rsi
callq 0x5430
movl $0x23, %edx
movq %rbx, %rdi
leaq 0x4828(%rip), %rsi      # 0x32938
callq 0x5430
movl $0xd, %edx
movq %rbx, %rdi
leaq 0x4838(%rip), %rsi      # 0x3295c
callq 0x5430
movq 0x40(%r15), %rdi
callq 0x29f78
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x3, %rsi
movabsq $-0x3333333333333333, %rax # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rsi
movq %rbx, %rdi
callq 0x5280
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x5430
movq 0x40(%r15), %rdi
callq 0x29f78
movq 0x8(%rax), %rcx
cmpq (%rax), %rcx
je 0x2e29c
movl $0x1, %r14d
xorl %r13d, %r13d
movl $0x5, %edx
movq %rbx, %rdi
leaq 0x47d9(%rip), %rsi      # 0x3296a
callq 0x5430
movq %rbx, %rdi
movq %r13, %rsi
callq 0x5280
movq %rax, %rbp
movl $0x2, %edx
movq %rax, %rdi
leaq 0x31e4(%rip), %rsi      # 0x31397
callq 0x5430
movq 0x40(%r15), %rdi
callq 0x29f78
leaq (%r13,%r13,4), %r13
leaq (,%r13,8), %rsi
addq (%rax), %rsi
movq %r12, %rdi
callq 0x28dba
movq (%rax), %rsi
leaq 0x10(%rsp), %rdi
callq 0x29f56
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %rbp, %rdi
callq 0x5430
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x2e214
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x53b0
movl $0x3, %edx
movq %rbx, %rdi
leaq 0x474d(%rip), %rsi      # 0x32970
callq 0x5430
movl $0xa, %edx
movq %rbx, %rdi
leaq 0x473d(%rip), %rsi      # 0x32974
callq 0x5430
movq 0x40(%r15), %rdi
callq 0x29f78
movq (%rax), %rax
movsd 0x20(%rax,%r13,8), %xmm0
movq %rbx, %rdi
callq 0x55b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x459d(%rip), %rsi      # 0x32803
callq 0x5430
movl %r14d, %r13d
movq 0x40(%r15), %rdi
callq 0x29f78
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
movabsq $-0x3333333333333333, %rax # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rcx
incl %r14d
cmpq %r13, %rcx
ja 0x2e182
movl $0x23, %edx
movq %rbx, %rdi
leaq 0x46d4(%rip), %rsi      # 0x3297f
callq 0x5430
movq %r15, %rdi
callq 0x52a0
movq %rax, %r15
cmpq 0x8(%rsp), %rax
jne 0x2e026
leaq 0x46d6(%rip), %rsi      # 0x329a3
movl $0x89, %edx
movq %rbx, %rdi
callq 0x5430
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0x2fae6
leaq 0x60(%rsp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x18(%r12), %rsi
movq 0x40(%rsi), %r15
addq $0x20, %rsi
callq 0x1aa0a
movq 0x18(%r12), %rax
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
movq %rbx, %rdi
callq 0x5430
leaq 0x44c6(%rip), %rsi      # 0x32803
movl $0x1, %edx
movq %rax, %rdi
callq 0x5430
movq %r12, 0x8(%rsp)
movq %r15, %rdi
callq 0x29f78
movq (%rax), %rsi
leaq 0x10(%rsp), %rdi
callq 0x2f9ea
movq 0x20(%rsp), %rax
cmpq %rax, 0x40(%rsp)
je 0x2e4e7
leaq 0x88(%rsp), %r15
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x5430
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4469(%rip), %rsi      # 0x32803
callq 0x5430
movq 0x20(%rsp), %rsi
leaq 0x60(%rsp), %rdi
callq 0x1aa0a
movq 0x20(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x28dba
movq (%rax), %r14
leaq 0x10(%rsp), %rdi
callq 0x2faa2
movq %r14, %rdi
callq 0x29f78
movq (%rax), %r12
movq 0x8(%rax), %r13
cmpq %r13, %r12
leaq 0x78(%rsp), %r14
je 0x2e4d7
movq %r15, 0x78(%rsp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x82fa
movsd 0x20(%r12), %xmm0
movsd %xmm0, 0x98(%rsp)
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq %r14, %rdx
callq 0x219d3
movq %r14, %rcx
movq %rax, %r14
movq %rbx, %rbp
movq %r15, %rbx
movq 0x68(%rsp), %r15
movaps 0x20(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
movaps 0x40(%rsp), %xmm2
movaps 0x50(%rsp), %xmm3
movaps %xmm0, 0xc0(%rsp)
movaps %xmm1, 0xd0(%rsp)
movaps %xmm2, 0xa0(%rsp)
movaps %xmm3, 0xb0(%rsp)
leaq 0xe8(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
callq 0x300dc
cmpq %r15, %r14
leaq 0x78(%rsp), %r14
jne 0x2e4aa
movq 0x40(%rsp), %rax
cmpq %rax, 0xe8(%rsp)
jne 0x2e4aa
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x2f9ea
movq 0x78(%rsp), %rdi
movq %rbx, %r15
cmpq %rbx, %rdi
je 0x2e4c7
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x53b0
addq $0x28, %r12
cmpq %r13, %r12
movq %rbp, %rbx
jne 0x2e3e7
movq 0x20(%rsp), %rax
cmpq %rax, 0x40(%rsp)
jne 0x2e37c
leaq 0x2fbc(%rip), %rsi      # 0x314aa
movl $0x5, %edx
movq %rbx, %rdi
callq 0x5430
movq 0x68(%rsp), %rsi
subq 0x60(%rsp), %rsi
sarq $0x5, %rsi
movq %rbx, %rdi
callq 0x5280
leaq 0x42eb(%rip), %rsi      # 0x32803
movl $0x1, %edx
movq %rax, %rdi
callq 0x5430
leaq 0x4501(%rip), %rsi      # 0x32a2d
movl $0x9, %edx
movq %rbx, %rdi
callq 0x5430
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rsi
movq %rbx, %rdi
callq 0x5280
leaq 0x42b2(%rip), %rsi      # 0x32803
movl $0x1, %edx
movq %rax, %rdi
callq 0x5430
movq %rbx, %rdi
callq 0x5290
leaq 0x60(%rsp), %rdi
callq 0x8206
leaq 0x10(%rsp), %rdi
callq 0x2fa58
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2e5c1
jmp 0x2e5c1
jmp 0x2e5c1
jmp 0x2e5c1
jmp 0x2e5e0
jmp 0x2e5c1
jmp 0x2e59f
movq %rax, %r14
jmp 0x2e5a5
movq %rax, %r14
movq %rbx, %r15
movq 0x78(%rsp), %rdi
cmpq %r15, %rdi
je 0x2e5c4
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x53b0
jmp 0x2e5c4
movq %rax, %r14
leaq 0x60(%rsp), %rdi
callq 0x8206
leaq 0x10(%rsp), %rdi
callq 0x2fa58
movq %r14, %rdi
callq 0x5660
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x2e5d8
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x53b0
jmp 0x2e5d8