// File: /workspace/github_cpp_makefile_star2_O1/GAStudyGroup[P]GPX2/src/cross/gpx/sources/GPX2Support.cpp
// Function: GPX2Support::DFS_outside(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::map<int, Partition*, std::less<int>, std::allocator<std::pair<int const, Partition*>>>&, 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*>>>&)
pair<GPX2Structs::SearchResult, vector<string>> GPX2Support::DFS_outside(string id, GPX2Structs::PartitionMap &partitions, GPX2Structs::NodeMap &unitedGraph)
{
    string now;
    int idPartition = whichPartition(id, partitions);
    vector<string> partition = partitions[idPartition]->getNodes();
    vector<string> alreadyVisited;
    deque<string> nextToVisit;
    int partitionConnected{ -1 };
    bool notAlreadyVisited{ false };
    bool notToVisit{ false };
    bool cutEdge{ false };

    nextToVisit.push_back(id);
    
    while (!nextToVisit.empty()) {
        now = nextToVisit.back();
        nextToVisit.pop_back();

        alreadyVisited.push_back(now);

        bool endNode{false};

        vector<Node::node> edges = unitedGraph[now]->getEdges();
        for (Node::node cn : edges) {
            notAlreadyVisited = (find(alreadyVisited.begin(), alreadyVisited.end(), cn.first) == alreadyVisited.end());
            notToVisit = (find(nextToVisit.begin(), nextToVisit.end(), cn.first) == nextToVisit.end());
            cutEdge = (cn.second == 0);
            if (notAlreadyVisited && notToVisit && cutEdge) {
                nextToVisit.push_back(cn.first);
            }
            //if the node has a edge that was not cut, it must be a endNode
            if(!cutEdge){
                endNode = true;
            }
        }

        if(endNode){
            partitionConnected = whichPartition(now, partitions);
            if(idPartition != partitionConnected){
                return make_pair(GPX2Structs::SearchResult::CONNECTED_TO_PARTITION, alreadyVisited);
            }
        }
    }
    
    unitedGraph[id]->setAccess(false);
    unitedGraph[alreadyVisited.back()]->setAccess(false);
    return make_pair(GPX2Structs::SearchResult::CONNECTED_TO_SELF, alreadyVisited);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rcx, (%rsp)
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xe0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsi), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0xd0(%rsp), %rdi
callq 0x82cc
leaq 0x1a8(%rsp), %rdi
movq %rbx, 0x38(%rsp)
movq %rbx, %rsi
callq 0x25282
leaq 0xd0(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x2c7c8
movl %eax, %ebx
leaq 0x1a8(%rsp), %rdi
callq 0x25456
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x2c167
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x53c0
leaq 0xc(%rsp), %rsi
movl %ebx, (%rsi)
movq 0x38(%rsp), %rdi
callq 0x25076
movq (%rax), %rdi
callq 0x2a6bc
leaq 0x148(%rsp), %rdi
movq %rax, %rsi
callq 0x17d56
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
leaq 0xf0(%rsp), %rdi
movapd %xmm0, 0x40(%rdi)
movapd %xmm0, 0x30(%rdi)
movapd %xmm0, 0x20(%rdi)
movapd %xmm0, 0x10(%rdi)
movapd %xmm0, (%rdi)
xorl %esi, %esi
callq 0x2f88c
movq %r15, 0x30(%rsp)
leaq 0xf0(%rsp), %rdi
movq %r12, 0xb0(%rsp)
movq %r12, %rsi
callq 0x2f798
movq 0x120(%rsp), %rsi
cmpq 0x100(%rsp), %rsi
je 0x2c47a
leaq 0x48(%rsp), %rbx
leaq 0xb8(%rsp), %rbp
leaq 0x88(%rsp), %r12
cmpq 0x128(%rsp), %rsi
jne 0x2c230
movq 0x138(%rsp), %rax
movq -0x8(%rax), %rsi
movl $0x200, %eax            # imm = 0x200
addq %rax, %rsi
addq $-0x20, %rsi
movq %rbx, %rdi
callq 0x5210
leaq 0xf0(%rsp), %rdi
callq 0x2f7d6
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x1a992
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x28bca
movq (%rax), %rdi
callq 0x29d64
movq %rbp, %rdi
movq %rax, %rsi
callq 0x28d04
movq 0xb8(%rsp), %r14
movq 0xc0(%rsp), %r15
cmpq %r15, %r14
je 0x2c45c
xorl %ebp, %ebp
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x82cc
movsd 0x20(%r14), %xmm0
movsd %xmm0, 0xa8(%rsp)
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq %r12, %rdx
callq 0x218f9
movq %rax, %r13
movq 0x18(%rsp), %rbx
movapd 0x100(%rsp), %xmm0
movaps 0x110(%rsp), %xmm1
movaps 0x120(%rsp), %xmm2
movaps 0x130(%rsp), %xmm3
movapd %xmm0, 0x180(%rsp)
movaps %xmm1, 0x190(%rsp)
movaps %xmm2, 0x160(%rsp)
movaps %xmm3, 0x170(%rsp)
leaq 0x1d8(%rsp), %rdi
leaq 0x180(%rsp), %rsi
leaq 0x160(%rsp), %rdx
movq %r12, %rcx
callq 0x2fe74
movsd 0xa8(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
cmpq %rbx, %r13
jne 0x2c385
movq 0x120(%rsp), %rax
cmpq %rax, 0x1d8(%rsp)
jne 0x2c385
movsd 0x40(%rsp), %xmm0
ucomisd 0x4fb7(%rip), %xmm0     # 0x31328
jne 0x2c385
jp 0x2c385
leaq 0xf0(%rsp), %rdi
movq %r12, %rsi
callq 0x2f798
movsd 0x40(%rsp), %xmm0
ucomisd 0x4f95(%rip), %xmm0     # 0x31328
movzbl %bpl, %ebp
movl $0x1, %eax
cmovnel %eax, %ebp
cmovpl %eax, %ebp
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x2c3c7
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x53c0
addq $0x28, %r14
cmpq %r15, %r14
jne 0x2c290
testb $0x1, %bpl
leaq 0x48(%rsp), %rbx
leaq 0xb8(%rsp), %rbp
je 0x2c45c
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x82cc
leaq 0x1f8(%rsp), %r14
movq %r14, %rdi
movq 0x38(%rsp), %rsi
callq 0x25282
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
callq 0x2c7c8
movl %eax, %r13d
movq %r14, %rdi
callq 0x25456
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2c451
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x53c0
cmpl %r13d, 0xc(%rsp)
jne 0x2c51f
movq %rbp, %rdi
callq 0x28d9e
movq 0x120(%rsp), %rsi
cmpq 0x100(%rsp), %rsi
jne 0x2c212
movq (%rsp), %rdi
movq 0xb0(%rsp), %rsi
callq 0x28bca
movq (%rax), %rdi
xorl %esi, %esi
callq 0x29d7e
movq 0x18(%rsp), %rsi
addq $-0x20, %rsi
movq (%rsp), %rdi
callq 0x28bca
movq (%rax), %rdi
xorl %esi, %esi
callq 0x29d7e
movq 0x30(%rsp), %rbx
movl $0x1, (%rbx)
leaq 0x8(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0x17d56
leaq 0xf0(%rsp), %rdi
callq 0x2f806
leaq 0x10(%rsp), %rdi
callq 0x81e0
leaq 0x148(%rsp), %rdi
callq 0x81e0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2c50a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x53c0
movq %rbx, %rax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30(%rsp), %rbx
movl $0x0, (%rbx)
leaq 0x8(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0x17d56
leaq 0xb8(%rsp), %rdi
callq 0x28d9e
jmp 0x2c4ca
jmp 0x2c5d5
jmp 0x2c5cc
movq %rax, %rbx
jmp 0x2c61c
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
callq 0x25456
jmp 0x2c56b
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x2c633
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x53c0
jmp 0x2c633
jmp 0x2c593
movq %rax, %rbx
jmp 0x2c633
jmp 0x2c5cc
movq %rax, %rbx
leaq 0x1f8(%rsp), %rdi
callq 0x25456
jmp 0x2c5b2
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2c602
movq 0x78(%rsp), %rsi
jmp 0x2c5fa
jmp 0x2c5d5
jmp 0x2c5cc
movq %rax, %rbx
jmp 0x2c60f
jmp 0x2c5da
jmp 0x2c5da
movq %rax, %rbx
jmp 0x2c602
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x2c602
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x53c0
leaq 0xb8(%rsp), %rdi
callq 0x28d9e
leaq 0xf0(%rsp), %rdi
callq 0x2f806
leaq 0x10(%rsp), %rdi
callq 0x81e0
leaq 0x148(%rsp), %rdi
callq 0x81e0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2c64f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x53c0
movq %rbx, %rdi
callq 0x5670