// File: /workspace/github_cpp_makefile_star2_O2/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 $0x1f8, %rsp            # imm = 0x1F8
movq %rdx, 0x50(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdi, %r14
callq 0x223ae
movq 0x8(%rax), %rbx
subq (%rax), %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
movq %r14, 0x8(%rsp)
movq %r14, %rdi
callq 0x223a8
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x1a6ea
leaq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0x1a6ea
testb $0x20, %bl
jne 0x22f68
movq 0x8(%rsp), %rdi
callq 0x223a8
leaq 0xe0(%rsp), %rdi
movq %rax, %rsi
callq 0x12b1e
leaq 0xa0(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x223ba
leaq 0xa0(%rsp), %rdi
movq (%rdi), %rbx
movq 0x8(%rdi), %r14
callq 0x12eaa
cmpq %r14, %rbx
je 0x22f8e
leaq 0x68(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x223ba
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x178(%rsp), %r14
leaq 0x1c8(%rsp), %r15
leaq 0x198(%rsp), %rbp
cmpq 0x48(%rsp), %rsi
je 0x22f6c
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
movq %rsi, 0x60(%rsp)
callq 0x1363a
leaq 0x138(%rsp), %rdi
movq %rbx, %rsi
callq 0x54a0
movq %r14, %rdi
leaq 0xc0(%rsp), %rsi
callq 0x54a0
movq %r15, %rdi
movq 0x58(%rsp), %rsi
callq 0x20c16
leaq 0x80(%rsp), %rdi
leaq 0x138(%rsp), %r13
movq %r13, %rsi
movq %r14, %rbx
movq %r14, %rdx
movq %r15, %rcx
movq 0x8(%rsp), %r8
callq 0x230b0
movq %r15, %r12
movq %r15, %rdi
callq 0x20be0
movq %rbx, %rdi
callq 0x56f8
movq %r13, %rdi
callq 0x56f8
leaq 0x118(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x54a0
leaq 0xf8(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x54a0
movq %rbp, %rdi
movq 0x50(%rsp), %rsi
callq 0x20c16
movq %r12, %r15
leaq 0x158(%rsp), %rdi
leaq 0x118(%rsp), %rbx
movq %rbx, %rsi
leaq 0xf8(%rsp), %r12
movq %r12, %rdx
movq %rbp, %rcx
movq 0x8(%rsp), %r8
callq 0x230b0
movq %rbp, %rdi
callq 0x20be0
movq %r12, %rdi
callq 0x56f8
movq %rbx, %rdi
callq 0x56f8
leaq 0x30(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0x160(%rsp), %r12
callq 0x23394
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x23394
movq %r12, %rdi
callq 0x709c
leaq 0x88(%rsp), %rdi
callq 0x709c
leaq 0xa0(%rsp), %rdi
callq 0x12f10
movq 0x60(%rsp), %rsi
addq $0x40, %rsi
jmp 0x22e06
xorl %ebx, %ebx
jmp 0x22f9d
leaq 0x68(%rsp), %rdi
callq 0x12eaa
movq 0x30(%rsp), %rax
cmpq 0x38(%rsp), %rax
jne 0x22f8e
movq 0x10(%rsp), %rax
cmpq 0x18(%rsp), %rax
je 0x22fc5
xorl %ebx, %ebx
leaq 0xe0(%rsp), %rdi
callq 0x709c
leaq 0x10(%rsp), %rdi
callq 0x709c
leaq 0x30(%rsp), %rdi
callq 0x709c
movl %ebx, %eax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %bl
jmp 0x22f90
jmp 0x22fcb
movq %rax, %rbx
jmp 0x23087
jmp 0x22fd5
movq %rax, %rbx
jmp 0x23094
movq %rax, %rbx
jmp 0x22ff2
movq %rax, %rbx
leaq 0x198(%rsp), %rdi
callq 0x20be0
leaq 0xf8(%rsp), %rdi
callq 0x56f8
jmp 0x23049
movq %rax, %rbx
jmp 0x2307d
movq %rax, %rbx
jmp 0x23070
movq %rax, %rbx
jmp 0x23032
movq %rax, %rbx
jmp 0x23025
movq %rax, %rbx
leaq 0x1c8(%rsp), %rdi
callq 0x20be0
leaq 0x178(%rsp), %rdi
callq 0x56f8
leaq 0x138(%rsp), %rdi
callq 0x56f8
jmp 0x23070
movq %rax, %rbx
jmp 0x23063
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x56f8
jmp 0x23063
movq %rax, %rbx
movq %r12, %rdi
callq 0x709c
leaq 0x88(%rsp), %rdi
callq 0x709c
leaq 0xa0(%rsp), %rdi
callq 0x12f10
leaq 0x68(%rsp), %rdi
callq 0x12eaa
leaq 0xe0(%rsp), %rdi
callq 0x709c
leaq 0x10(%rsp), %rdi
callq 0x709c
leaq 0x30(%rsp), %rdi
callq 0x709c
movq %rbx, %rdi
callq 0x5610