// File: 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:
subq $0x248, %rsp            # imm = 0x248
movq %rdi, 0x238(%rsp)
movq %rsi, 0x230(%rsp)
movq %rdx, 0x228(%rsp)
movq 0x238(%rsp), %rdi
callq 0x67e80
movq %rax, %rdi
callq 0x30bb0
movl %eax, 0x224(%rsp)
leaq 0x208(%rsp), %rdi
callq 0x1e3e0
leaq 0x1f0(%rsp), %rdi
callq 0x1e3e0
movq 0x238(%rsp), %rdi
callq 0x67e70
movq %rax, 0x18(%rsp)
jmp 0x6aaf9
movq 0x18(%rsp), %rsi
leaq 0x1f0(%rsp), %rdi
callq 0x49fc0
movq %rax, 0x10(%rsp)
jmp 0x6ab12
movq 0x10(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x49fc0
jmp 0x6ab26
movl 0x224(%rsp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x6ab66
movb $0x0, 0x247(%rsp)
movl $0x1, 0x1e0(%rsp)
jmp 0x6aff3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e8(%rsp)
movl %eax, 0x1e4(%rsp)
jmp 0x6b01e
movq 0x238(%rsp), %rdi
callq 0x67e70
movq %rax, 0x8(%rsp)
jmp 0x6ab7a
movq 0x8(%rsp), %rsi
leaq 0x1c8(%rsp), %rdi
callq 0x305f0
jmp 0x6ab8e
movq 0x238(%rsp), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x67ea0
jmp 0x6aba5
leaq 0x1b0(%rsp), %rdi
callq 0x70630
movb %al, 0x7(%rsp)
leaq 0x1b0(%rsp), %rdi
callq 0x31b40
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x6abcd
jmp 0x6abfe
movb $0x0, 0x247(%rsp)
movl $0x1, 0x1e0(%rsp)
jmp 0x6afd5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e8(%rsp)
movl %eax, 0x1e4(%rsp)
jmp 0x6afe4
movq 0x238(%rsp), %rsi
leaq 0x190(%rsp), %rdi
callq 0x67ea0
jmp 0x6ac15
leaq 0x190(%rsp), %rax
movq %rax, 0x1a8(%rsp)
movq 0x1a8(%rsp), %rdi
callq 0x392b0
movq %rax, 0x188(%rsp)
movq 0x1a8(%rsp), %rdi
callq 0x390a0
movq %rax, 0x180(%rsp)
leaq 0x188(%rsp), %rdi
leaq 0x180(%rsp), %rsi
callq 0x61460
testb $0x1, %al
jne 0x6ac85
movl $0x2, 0x1e0(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x31b40
jmp 0x6af87
leaq 0x188(%rsp), %rdi
callq 0x395d0
movq %rax, %rsi
leaq 0x140(%rsp), %rdi
callq 0x33630
jmp 0x6aca4
leaq 0x100(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x6200
jmp 0x6acbb
leaq 0x160(%rsp), %rsi
leaq 0xe0(%rsp), %rdi
callq 0x6200
jmp 0x6acd2
movq 0x230(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x614a0
jmp 0x6ace9
movq 0x238(%rsp), %r8
leaq 0x120(%rsp), %rdi
leaq 0x100(%rsp), %rsi
leaq 0xe0(%rsp), %rdx
leaq 0xb0(%rsp), %rcx
callq 0x6b050
jmp 0x6ad18
leaq 0xb0(%rsp), %rdi
callq 0x60b90
leaq 0xe0(%rsp), %rdi
callq 0x6988
leaq 0x100(%rsp), %rdi
callq 0x6988
leaq 0x70(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x6200
jmp 0x6ad53
leaq 0x160(%rsp), %rsi
leaq 0x50(%rsp), %rdi
callq 0x6200
jmp 0x6ad67
movq 0x228(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x614a0
jmp 0x6ad7b
movq 0x238(%rsp), %r8
leaq 0x90(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x50(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x6b050
jmp 0x6ada1
leaq 0x20(%rsp), %rdi
callq 0x60b90
leaq 0x50(%rsp), %rdi
callq 0x6988
leaq 0x70(%rsp), %rdi
callq 0x6988
leaq 0x128(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x6b5b0
jmp 0x6add6
leaq 0x98(%rsp), %rsi
leaq 0x1f0(%rsp), %rdi
callq 0x6b5b0
jmp 0x6aded
leaq 0x90(%rsp), %rdi
callq 0x556d0
leaq 0x120(%rsp), %rdi
callq 0x556d0
leaq 0x140(%rsp), %rdi
callq 0x31d30
leaq 0x188(%rsp), %rdi
callq 0x614d0
jmp 0x6ac4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e8(%rsp)
movl %eax, 0x1e4(%rsp)
jmp 0x6af78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e8(%rsp)
movl %eax, 0x1e4(%rsp)
jmp 0x6af6b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e8(%rsp)
movl %eax, 0x1e4(%rsp)
jmp 0x6aeb2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e8(%rsp)
movl %eax, 0x1e4(%rsp)
jmp 0x6aea5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e8(%rsp)
movl %eax, 0x1e4(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x60b90
leaq 0xe0(%rsp), %rdi
callq 0x6988
leaq 0x100(%rsp), %rdi
callq 0x6988
jmp 0x6af6b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e8(%rsp)
movl %eax, 0x1e4(%rsp)
jmp 0x6af5e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e8(%rsp)
movl %eax, 0x1e4(%rsp)
jmp 0x6af31
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e8(%rsp)
movl %eax, 0x1e4(%rsp)
jmp 0x6af27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e8(%rsp)
movl %eax, 0x1e4(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x60b90
leaq 0x50(%rsp), %rdi
callq 0x6988
leaq 0x70(%rsp), %rdi
callq 0x6988
jmp 0x6af5e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e8(%rsp)
movl %eax, 0x1e4(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x556d0
leaq 0x120(%rsp), %rdi
callq 0x556d0
leaq 0x140(%rsp), %rdi
callq 0x31d30
leaq 0x190(%rsp), %rdi
callq 0x31b40
jmp 0x6afe4
leaq 0x208(%rsp), %rdi
callq 0x49f70
testb $0x1, %al
jne 0x6af9a
jmp 0x6afc2
leaq 0x1f0(%rsp), %rdi
callq 0x49f70
testb $0x1, %al
jne 0x6afad
jmp 0x6afc2
movb $0x1, 0x247(%rsp)
movl $0x1, 0x1e0(%rsp)
jmp 0x6afd5
movb $0x0, 0x247(%rsp)
movl $0x1, 0x1e0(%rsp)
leaq 0x1c8(%rsp), %rdi
callq 0xa2c0
jmp 0x6aff3
leaq 0x1c8(%rsp), %rdi
callq 0xa2c0
jmp 0x6b01e
leaq 0x1f0(%rsp), %rdi
callq 0xa2c0
leaq 0x208(%rsp), %rdi
callq 0xa2c0
movb 0x247(%rsp), %al
andb $0x1, %al
addq $0x248, %rsp            # imm = 0x248
retq
leaq 0x1f0(%rsp), %rdi
callq 0xa2c0
leaq 0x208(%rsp), %rdi
callq 0xa2c0
movq 0x1e8(%rsp), %rdi
callq 0x6850
nopw %cs:(%rax,%rax)