// File: GAStudyGroup[P]GPX2/src/cross/gpx/sources/GPX2Support.cpp
// Function: GPX2Support::DFS_inside(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, 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*>>>, Partition*)
pair<GPX2Structs::SearchResult, vector<string>> GPX2Support::DFS_inside(string entry, string exit, GPX2Structs::NodeMap father, Partition* partitionPtr)
{
    //DFS inside the partition
    string now;
    vector<string> alreadyVisited;
    deque<string> nextToVisit;
    vector<string> partition = partitionPtr->getNodes();
    bool notAlreadyVisited{ false };
    bool notToVisit{ false };
    bool isInPartition{ false };

    nextToVisit.push_back(entry);

    while (!nextToVisit.empty()) {

        now = nextToVisit.back();
        nextToVisit.pop_back();
        alreadyVisited.push_back(now);
        vector<Node::node> edges = father[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());
            isInPartition = (find(partition.begin(), partition.end(), cn.first) != partition.end());

            if (notAlreadyVisited && notToVisit && isInPartition) {
                nextToVisit.push_back(cn.first);
            }
        }
    }
    return (make_pair((alreadyVisited.back() == exit ? GPX2Structs::SearchResult::IS_CONNECTED : GPX2Structs::SearchResult::IS_NOT_CONNECTED), alreadyVisited));
}

// Assembly:
subq $0x288, %rsp            # imm = 0x288
movq %rcx, 0x60(%rsp)
movq %rdx, 0x68(%rsp)
movq %rsi, 0x70(%rsp)
movq %rdi, 0x78(%rsp)
movq %rdi, %rax
movq %rax, 0x80(%rsp)
movq %rdi, 0x280(%rsp)
movq %rsi, 0x278(%rsp)
movq %rdx, 0x270(%rsp)
movq %rcx, 0x268(%rsp)
movq %r8, 0x260(%rsp)
leaq 0x240(%rsp), %rdi
callq 0x6690
leaq 0x228(%rsp), %rdi
callq 0x1e3e0
leaq 0x1d8(%rsp), %rdi
callq 0x70690
jmp 0x6b0c7
movq 0x260(%rsp), %rdi
callq 0x67e70
movq %rax, 0x58(%rsp)
jmp 0x6b0db
movq 0x58(%rsp), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x305f0
jmp 0x6b0ef
movq 0x70(%rsp), %rsi
movb $0x0, 0x1af(%rsp)
movb $0x0, 0x1ae(%rsp)
movb $0x0, 0x1ad(%rsp)
leaq 0x1d8(%rsp), %rdi
callq 0x706a0
jmp 0x6b11b
jmp 0x6b11d
leaq 0x1d8(%rsp), %rdi
callq 0x70700
xorb $-0x1, %al
testb $0x1, %al
jne 0x6b135
jmp 0x6b4e5
leaq 0x1d8(%rsp), %rdi
callq 0x70720
movq %rax, %rsi
leaq 0x240(%rsp), %rdi
callq 0x6070
jmp 0x6b154
leaq 0x1d8(%rsp), %rdi
callq 0x70750
leaq 0x228(%rsp), %rdi
leaq 0x240(%rsp), %rsi
callq 0x37210
jmp 0x6b178
movq 0x60(%rsp), %rdi
leaq 0x240(%rsp), %rsi
callq 0x60c60
movq %rax, 0x50(%rsp)
jmp 0x6b191
movq 0x50(%rsp), %rax
movq (%rax), %rdi
callq 0x661c0
movq %rax, 0x48(%rsp)
jmp 0x6b1a5
movq 0x48(%rsp), %rsi
leaq 0x190(%rsp), %rdi
callq 0x615a0
jmp 0x6b1b9
leaq 0x190(%rsp), %rax
movq %rax, 0x188(%rsp)
movq 0x188(%rsp), %rdi
callq 0x60f80
movq %rax, 0x180(%rsp)
movq 0x188(%rsp), %rdi
callq 0x60fb0
movq %rax, 0x178(%rsp)
leaq 0x180(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0x60fe0
testb $0x1, %al
jne 0x6b211
jmp 0x6b4c1
leaq 0x180(%rsp), %rdi
callq 0x61020
movq %rax, %rsi
leaq 0x150(%rsp), %rdi
callq 0x61030
jmp 0x6b230
leaq 0x228(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x1e310
movq 0x38(%rsp), %rdi
movq %rax, 0x140(%rsp)
callq 0x1e340
movq %rax, 0x138(%rsp)
movq 0x140(%rsp), %rdi
movq 0x138(%rsp), %rsi
leaq 0x150(%rsp), %rdx
callq 0x49c90
movq %rax, 0x40(%rsp)
jmp 0x6b280
movq 0x40(%rsp), %rax
movq %rax, 0x148(%rsp)
leaq 0x228(%rsp), %rdi
callq 0x1e340
movq %rax, 0x130(%rsp)
leaq 0x148(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x55c20
movb %al, 0x1af(%rsp)
leaq 0xf0(%rsp), %rdi
movq %rdi, 0x28(%rsp)
leaq 0x1d8(%rsp), %rsi
movq %rsi, 0x20(%rsp)
callq 0x70860
movq 0x20(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x70890
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x110(%rsp), %rdi
leaq 0x150(%rsp), %rcx
callq 0x707e0
jmp 0x6b315
leaq 0xb0(%rsp), %rdi
movq %rdi, 0x8(%rsp)
leaq 0x1d8(%rsp), %rsi
callq 0x70890
movq 0x8(%rsp), %rsi
leaq 0x110(%rsp), %rdi
callq 0x707c0
movb %al, 0x1ae(%rsp)
leaq 0x1b0(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x1e310
movq 0x10(%rsp), %rdi
movq %rax, 0xa0(%rsp)
callq 0x1e340
movq %rax, 0x98(%rsp)
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rsi
leaq 0x150(%rsp), %rdx
callq 0x49c90
movq %rax, 0x18(%rsp)
jmp 0x6b398
movq 0x18(%rsp), %rax
movq %rax, 0xa8(%rsp)
leaq 0x1b0(%rsp), %rdi
callq 0x1e340
movq %rax, 0x90(%rsp)
leaq 0xa8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x1e370
andb $0x1, %al
movb %al, 0x1ad(%rsp)
testb $0x1, 0x1af(%rsp)
je 0x6b4a2
testb $0x1, 0x1ae(%rsp)
je 0x6b4a2
testb $0x1, 0x1ad(%rsp)
je 0x6b4a2
leaq 0x1d8(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0x706a0
jmp 0x6b419
jmp 0x6b4a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d0(%rsp)
movl %eax, 0x1cc(%rsp)
jmp 0x6b586
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d0(%rsp)
movl %eax, 0x1cc(%rsp)
jmp 0x6b579
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d0(%rsp)
movl %eax, 0x1cc(%rsp)
jmp 0x6b56c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d0(%rsp)
movl %eax, 0x1cc(%rsp)
jmp 0x6b4d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d0(%rsp)
movl %eax, 0x1cc(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x610b0
jmp 0x6b4d3
leaq 0x150(%rsp), %rdi
callq 0x610b0
leaq 0x180(%rsp), %rdi
callq 0x610c0
jmp 0x6b1f3
leaq 0x190(%rsp), %rdi
callq 0x616a0
jmp 0x6b11d
leaq 0x190(%rsp), %rdi
callq 0x616a0
jmp 0x6b56c
leaq 0x228(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x47710
movq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0x2f090
movq 0x78(%rsp), %rdi
movq (%rsp), %rdx
movzbl %al, %eax
xorl $0x3, %eax
movl %eax, 0x8c(%rsp)
leaq 0x8c(%rsp), %rsi
callq 0x708c0
jmp 0x6b528
leaq 0x1b0(%rsp), %rdi
callq 0xa2c0
leaq 0x1d8(%rsp), %rdi
callq 0x70900
leaq 0x228(%rsp), %rdi
callq 0xa2c0
leaq 0x240(%rsp), %rdi
callq 0x6988
movq 0x80(%rsp), %rax
addq $0x288, %rsp            # imm = 0x288
retq
leaq 0x1b0(%rsp), %rdi
callq 0xa2c0
leaq 0x1d8(%rsp), %rdi
callq 0x70900
leaq 0x228(%rsp), %rdi
callq 0xa2c0
leaq 0x240(%rsp), %rdi
callq 0x6988
movq 0x1d0(%rsp), %rdi
callq 0x6850
nopl (%rax)