// File: /workspace/github_cpp_makefile_star2_O1/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 0x2a6c2
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 0x2a6bc
movq %rsp, %rdi
movq %rax, %rsi
callq 0x2133c
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x2133c
testb $0x20, %bl
jne 0x2b5e9
movq %r15, %rdi
callq 0x2a6bc
leaq 0x140(%rsp), %rdi
movq %rax, %rsi
callq 0x17d56
leaq 0xb8(%rsp), %rdi
movq %r15, %rsi
callq 0x2a6ce
leaq 0xb8(%rsp), %rdi
movq (%rdi), %rbx
movq 0x8(%rdi), %r14
callq 0x181e0
cmpq %r14, %rbx
je 0x2b5d8
leaq 0x108(%rsp), %rdi
movq %r15, %rsi
callq 0x2a6ce
movq 0x108(%rsp), %r12
movq 0x110(%rsp), %rbp
cmpq %rbp, %r12
je 0x2b5b4
leaq 0x1a8(%rsp), %r13
leaq 0x178(%rsp), %r14
leaq 0xb8(%rsp), %rdi
movq %r12, %rsi
callq 0x18a3e
leaq 0xa8(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0xb8(%rsp), %rsi
movq 0xc0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x98(%rsp), %rdi
callq 0x82cc
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %rdi
callq 0x82cc
movq %r13, %rdi
movq 0x100(%rsp), %rsi
callq 0x28ea0
leaq 0x120(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x78(%rsp), %rdx
movq %r13, %rcx
movq %r15, %r8
callq 0x2b757
movq %r13, %rdi
callq 0x28e8c
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x2b443
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x2b468
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x53c0
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0xb8(%rsp), %rsi
movq 0xc0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rdi
callq 0x82cc
leaq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %rdi
callq 0x82cc
movq %r14, %rdi
movq 0xf8(%rsp), %rsi
callq 0x28ea0
leaq 0x158(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x38(%rsp), %rdx
movq %r14, %rcx
movq %r15, %r8
callq 0x2b757
movq %r14, %rdi
callq 0x28e8c
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2b507
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x2b523
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x53c0
leaq 0x20(%rsp), %rdi
leaq 0x128(%rsp), %rsi
callq 0x2bb15
leaq 0x160(%rsp), %rbx
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x2bb15
movq %rbx, %rdi
callq 0x81e0
leaq 0x128(%rsp), %rdi
callq 0x81e0
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x2b582
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x2b5a7
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x53c0
addq $0x40, %r12
cmpq %rbp, %r12
jne 0x2b37f
leaq 0x108(%rsp), %rdi
callq 0x181e0
movq 0x20(%rsp), %rax
cmpq 0x28(%rsp), %rax
jne 0x2b5d8
movq (%rsp), %rax
cmpq 0x8(%rsp), %rax
je 0x2b611
xorl %ebx, %ebx
leaq 0x140(%rsp), %rdi
callq 0x81e0
jmp 0x2b5eb
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x81e0
leaq 0x20(%rsp), %rdi
callq 0x81e0
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 0x2b5da
jmp 0x2b617
movq %rax, %rbx
jmp 0x2b730
jmp 0x2b621
movq %rax, %rbx
jmp 0x2b73d
movq %rax, %rbx
jmp 0x2b723
movq %rax, %rbx
jmp 0x2b716
movq %rax, %rbx
jmp 0x2b675
movq %rax, %rbx
jmp 0x2b653
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
callq 0x28e8c
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x2b675
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x2b716
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x53c0
jmp 0x2b716
movq %rax, %rbx
jmp 0x2b709
movq %rax, %rbx
jmp 0x2b6db
movq %rax, %rbx
jmp 0x2b6bf
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
callq 0x28e8c
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2b6db
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x2b709
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x53c0
jmp 0x2b709
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
callq 0x81e0
leaq 0x128(%rsp), %rdi
callq 0x81e0
leaq 0xb8(%rsp), %rdi
callq 0x18268
leaq 0x108(%rsp), %rdi
callq 0x181e0
leaq 0x140(%rsp), %rdi
callq 0x81e0
movq %rsp, %rdi
callq 0x81e0
leaq 0x20(%rsp), %rdi
callq 0x81e0
movq %rbx, %rdi
callq 0x5670