// File: /workspace/github_cpp_makefile_star2_O2/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 $0x118, %rsp            # imm = 0x118
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x3c63(%rip), %rsi      # 0x28860
movq %rbx, %rdi
callq 0x5370
movq 0x28(%r14), %rsi
movq %rax, %rdi
callq 0x5280
leaq 0x3bbe(%rip), %r15      # 0x287d6
movq %rax, %rdi
movq %r15, %rsi
callq 0x5370
movq 0x18(%r14), %r12
movq %r14, 0x8(%rsp)
leaq 0x8(%r14), %rax
movq %rax, 0x38(%rsp)
movq %rbx, 0x30(%rsp)
cmpq 0x38(%rsp), %r12
je 0x24e4f
movq %rbx, %rdi
leaq 0x2719(%rip), %rsi      # 0x27368
callq 0x5370
leaq 0x20(%r12), %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x5330
movq %rax, %rdi
leaq 0x3c90(%rip), %rsi      # 0x288fe
callq 0x5370
movq %rax, %rbp
movq 0x8(%rsp), %rdi
movq %r14, %rsi
leaq 0x40(%rsp), %r14
callq 0x20910
movq (%rax), %rsi
movq %r14, %rdi
callq 0x21bf4
movq %rbp, %rdi
movq %r14, %rsi
callq 0x5330
movq %rax, %rdi
movq %r15, %rsi
callq 0x5370
movq %r14, %rdi
callq 0x56f8
movq 0x40(%r12), %rdi
callq 0x21c08
movl %eax, %ebp
movq %rbx, %rdi
leaq 0x3c3b(%rip), %rsi      # 0x28902
callq 0x5370
movzbl %bpl, %esi
movq %rax, %rdi
callq 0x55a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x5370
movq %rbx, %rdi
leaq 0x3c1e(%rip), %rsi      # 0x2890b
callq 0x5370
movq %rbx, %rdi
leaq 0x3c33(%rip), %rsi      # 0x2892f
callq 0x5370
movq %rax, %r14
movq 0x40(%r12), %rdi
callq 0x21c02
movq 0x8(%rax), %rcx
subq (%rax), %rcx
movq %rcx, %rax
cqto
pushq $0x28
popq %rcx
idivq %rcx
movq %r14, %rdi
movq %rax, %rsi
callq 0x5280
movq %rax, %rdi
movq %r15, %rsi
callq 0x5370
xorl %ebp, %ebp
movl %ebp, %ebp
movq 0x40(%r12), %rdi
callq 0x21c02
movq 0x8(%rax), %rcx
subq (%rax), %rcx
movq %rcx, %rax
cqto
pushq $0x28
popq %rcx
idivq %rcx
cmpq %rbp, %rax
jbe 0x24e2b
movq %r12, %rbx
movq 0x30(%rsp), %r12
movq %r12, %rdi
leaq 0x3bcc(%rip), %rsi      # 0x2893d
callq 0x5370
movq %rax, %rdi
movq %rbp, %rsi
callq 0x5280
movq %rax, %rdi
leaq 0x25dc(%rip), %rsi      # 0x27367
callq 0x5370
movq %rax, %r13
movq 0x40(%rbx), %rdi
callq 0x21c02
imulq $0x28, %rbp, %r15
movq (%rax), %rsi
addq %r15, %rsi
movq 0x8(%rsp), %rdi
callq 0x20910
movq (%rax), %rsi
leaq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x21bf4
movq %r13, %rdi
movq %r14, %rsi
callq 0x5330
movq %r14, %rdi
callq 0x56f8
movq %r12, %rdi
leaq 0x3b66(%rip), %rsi      # 0x28943
callq 0x5370
movq %r12, %rdi
leaq 0x3b5b(%rip), %rsi      # 0x28947
callq 0x5370
movq %rax, %r14
movq 0x40(%rbx), %rdi
callq 0x21c02
movq (%rax), %rax
movsd 0x20(%rax,%r15), %xmm0
movq %r14, %rdi
callq 0x5560
movq %rax, %rdi
leaq 0x39bd(%rip), %r15      # 0x287d6
movq %r15, %rsi
callq 0x5370
incl %ebp
movq %rbx, %r12
jmp 0x24d38
movq 0x30(%rsp), %rbx
movq %rbx, %rdi
leaq 0x3b18(%rip), %rsi      # 0x28952
callq 0x5370
movq %r12, %rdi
callq 0x52a0
movq %rax, %r12
jmp 0x24c3a
leaq 0x3b20(%rip), %rsi      # 0x28976
movq %rbx, %rdi
callq 0x5370
leaq 0x40(%rsp), %rdi
callq 0x25e64
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
andq $0x0, 0x10(%rdi)
movaps %xmm0, (%rdi)
movq 0x8(%rsp), %r15
movq 0x18(%r15), %rsi
movq 0x40(%rsi), %r14
addq $0x20, %rsi
callq 0x14efa
movq 0x18(%r15), %rsi
addq $0x20, %rsi
movq %rbx, %rdi
callq 0x5330
leaq 0x3931(%rip), %rsi      # 0x287d6
movq %rax, %rdi
callq 0x5370
movq %r14, %rdi
callq 0x21c02
movq (%rax), %rsi
leaq 0x40(%rsp), %rdi
callq 0x25ce4
leaq 0xf0(%rsp), %rbp
movq 0x50(%rsp), %rsi
cmpq %rsi, 0x70(%rsp)
je 0x24fe1
movq %rbx, %rdi
callq 0x5330
movq %rax, %rdi
leaq 0x38ea(%rip), %rsi      # 0x287d6
callq 0x5370
movq 0x50(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x14efa
movq 0x50(%rsp), %rsi
movq %r15, %rdi
callq 0x20910
movq (%rax), %r14
leaq 0x40(%rsp), %rdi
callq 0x25dba
movq %r14, %rdi
callq 0x21c02
movq (%rax), %r14
movq 0x8(%rax), %r12
cmpq %r12, %r14
je 0x24eca
movq %rbp, %rdi
movq %r14, %rsi
callq 0x209fc
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq %rbp, %rdx
callq 0x1abd1
movq %rax, %r15
movq 0x18(%rsp), %r13
movups 0x50(%rsp), %xmm0
movups 0x60(%rsp), %xmm1
movups 0x70(%rsp), %xmm2
movups 0x80(%rsp), %xmm3
movaps %xmm0, 0xb0(%rsp)
movaps %xmm1, 0xc0(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x90(%rsp), %rdx
movq %rbp, %rcx
callq 0x25d2c
cmpq %r13, %r15
jne 0x24fcb
movq 0x70(%rsp), %rax
cmpq %rax, 0xd0(%rsp)
jne 0x24fcb
leaq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x25ce4
movq %rbp, %rdi
callq 0x56f8
addq $0x28, %r14
movq 0x8(%rsp), %r15
jmp 0x24f29
leaq 0x2492(%rip), %rsi      # 0x2747a
movq %rbx, %rdi
callq 0x5370
movq 0x18(%rsp), %rsi
subq 0x10(%rsp), %rsi
sarq $0x5, %rsi
movq %rax, %rdi
callq 0x5280
leaq 0x37c9(%rip), %rsi      # 0x287d6
movq %rax, %rdi
callq 0x5370
leaq 0x39e4(%rip), %rsi      # 0x28a00
movq %rbx, %rdi
callq 0x5370
movq 0x28(%r15), %rsi
movq %rax, %rdi
callq 0x5280
leaq 0x379f(%rip), %rsi      # 0x287d6
movq %rax, %rdi
callq 0x5370
movq %rbx, %rdi
callq 0x5290
leaq 0x10(%rsp), %rdi
callq 0x709c
leaq 0x40(%rsp), %rdi
callq 0x25d6e
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2507b
jmp 0x2507b
jmp 0x2507b
jmp 0x2507b
jmp 0x250a8
jmp 0x2507b
jmp 0x25082
movq %rax, %rbx
jmp 0x25092
jmp 0x25082
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0x56f8
leaq 0x10(%rsp), %rdi
callq 0x709c
leaq 0x40(%rsp), %rdi
callq 0x25d6e
jmp 0x250b5
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x56f8
movq %rbx, %rdi
callq 0x5610