// File: /workspace/github_cpp_makefile_star2_O3/GAStudyGroup[P]GPX2/src/cross/gpx/sources/GPX2Support.cpp
// Function: GPX2Support::checkPartition(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*>>>&, 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*>>>&)
bool GPX2Support::checkPartition(Partition* partition, GPX2Structs::NodeMap &red, GPX2Structs::NodeMap &blue)
{
    unsigned size = partition->getAccessNodes().size();
    vector<string> redNodes, blueNodes;
    redNodes = blueNodes = partition->getNodes();
    if (!(size % 2 == 0)) {
        //It's not feasible because the number of entries and exits it's different
        return (false);
    } else {
        vector<string> nodesInPartition = partition->getNodes();

        //Don't have the same entries an exits in both parents
        if (partition->getEntryAndExits().empty()) {
            return (false);
        } else {
            for (pair<string, string> nodes : partition->getEntryAndExits()) {
                pair<GPX2Structs::SearchResult, vector<string>> resultRed = DFS_inside(nodes.first, nodes.second, red, partition);
                pair<GPX2Structs::SearchResult, vector<string>> resultBlue = DFS_inside(nodes.first, nodes.second, blue, partition);
                eraseSubVector(redNodes, resultRed.second);
                eraseSubVector(blueNodes, resultBlue.second);
            }
            if (redNodes.empty() && blueNodes.empty()) {
                return (true);
            } else {
                return (false);
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdx, 0xf8(%rsp)
movq %rsi, 0x100(%rsp)
movq %rdi, %r15
callq 0x2a8d6
movq 0x8(%rax), %rbx
subq (%rax), %rbx
xorl %eax, %eax
movq %rax, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq %rax, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq %r15, %rdi
callq 0x2a8d0
movq %rsp, %rdi
movq %rax, %rsi
callq 0x213f2
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x213f2
testb $0x20, %bl
jne 0x2b805
movq %r15, %rdi
callq 0x2a8d0
leaq 0x140(%rsp), %rdi
movq %rax, %rsi
callq 0x17d42
leaq 0xb8(%rsp), %rdi
movq %r15, %rsi
callq 0x2a8e2
leaq 0xb8(%rsp), %rdi
movq (%rdi), %rbx
movq 0x8(%rdi), %r14
callq 0x181f0
cmpq %r14, %rbx
je 0x2b7f4
leaq 0x108(%rsp), %rdi
movq %r15, %rsi
callq 0x2a8e2
movq 0x108(%rsp), %r13
movq 0x110(%rsp), %rbp
cmpq %rbp, %r13
je 0x2b7d0
leaq 0x1a8(%rsp), %r14
leaq 0x178(%rsp), %rbx
leaq 0xb8(%rsp), %rdi
movq %r13, %rsi
callq 0x18a66
leaq 0xa8(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0xb8(%rsp), %rsi
movq 0xc0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x98(%rsp), %rdi
callq 0x82fa
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %rdi
callq 0x82fa
movq %r14, %rdi
movq 0x100(%rsp), %rsi
callq 0x29098
leaq 0x120(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x78(%rsp), %rdx
movq %r14, %rcx
movq %r15, %r8
callq 0x2b96e
movq %r14, %rdi
callq 0x29084
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x2b65f
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x53b0
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x2b684
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x53b0
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0xb8(%rsp), %rsi
movq 0xc0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rdi
callq 0x82fa
leaq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %rdi
callq 0x82fa
movq %rbx, %rdi
movq 0xf8(%rsp), %rsi
callq 0x29098
leaq 0x158(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x38(%rsp), %rdx
movq %rbx, %rcx
movq %r15, %r8
callq 0x2b96e
movq %rbx, %rdi
callq 0x29084
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2b723
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x53b0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x2b73f
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x53b0
leaq 0x20(%rsp), %rdi
leaq 0x128(%rsp), %rsi
leaq 0x160(%rsp), %r12
callq 0x2bd24
movq %rsp, %rdi
movq %r12, %rsi
callq 0x2bd24
movq %r12, %rdi
callq 0x8206
leaq 0x128(%rsp), %rdi
callq 0x8206
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x2b79e
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x53b0
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x2b7c3
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x53b0
addq $0x40, %r13
cmpq %rbp, %r13
jne 0x2b59b
leaq 0x108(%rsp), %rdi
callq 0x181f0
movq 0x20(%rsp), %rax
cmpq 0x28(%rsp), %rax
jne 0x2b7f4
movq (%rsp), %rax
cmpq 0x8(%rsp), %rax
je 0x2b82d
xorl %ebx, %ebx
leaq 0x140(%rsp), %rdi
callq 0x8206
jmp 0x2b807
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x8206
leaq 0x20(%rsp), %rdi
callq 0x8206
movl %ebx, %eax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %bl
jmp 0x2b7f6
jmp 0x2b833
movq %rax, %rbx
jmp 0x2b947
jmp 0x2b83d
movq %rax, %rbx
jmp 0x2b954
movq %rax, %rbx
jmp 0x2b93a
movq %rax, %rbx
jmp 0x2b92d
movq %rax, %rbx
jmp 0x2b891
movq %rax, %rbx
jmp 0x2b86f
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
callq 0x29084
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x2b891
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x53b0
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x2b92d
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x53b0
jmp 0x2b92d
movq %rax, %rbx
jmp 0x2b920
movq %rax, %rbx
jmp 0x2b8f7
movq %rax, %rbx
jmp 0x2b8db
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
callq 0x29084
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2b8f7
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x53b0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x2b920
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x53b0
jmp 0x2b920
movq %rax, %rbx
movq %r12, %rdi
callq 0x8206
leaq 0x128(%rsp), %rdi
callq 0x8206
leaq 0xb8(%rsp), %rdi
callq 0x18278
leaq 0x108(%rsp), %rdi
callq 0x181f0
leaq 0x140(%rsp), %rdi
callq 0x8206
movq %rsp, %rdi
callq 0x8206
leaq 0x20(%rsp), %rdi
callq 0x8206
movq %rbx, %rdi
callq 0x5660