// File: yuanboli233[P]interdyck_graph_reduce/graphtest.cpp
// Function: findMatch(unsigned int, SummaryGraph&, unsigned int, std::unordered_set<unsigned int, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<unsigned int>>&, unsigned int, unsigned int)
void findMatch(unsigned nodeID, SummaryGraph& sGraph, unsigned eid, unordered_set<unsigned>& usedNodes, unsigned origFrom, unsigned origTo){
    SummaryNode* node = sGraph.nodes[nodeID];
    if(usedNodes.find(nodeID) != usedNodes.end()){
        return;
    }
    usedNodes.insert(nodeID);
    for(vector<NodewithEID>::iterator it = node->inBlueEdgeNodes.begin(); it != node->inBlueEdgeNodes.end(); it++){
        unsigned cureid = it->edgeID;
        unsigned nextnid = it->nodeID;
        if(eid == cureid && nodeID != origTo && nextnid != origFrom){
            cout << "    match " << nodeID << " <-" << cureid << "- " << nextnid;
        }
    }
    for(vector<NodewithEID>::iterator it = node->inRedEdgeNodes.begin(); it != node->inRedEdgeNodes.end(); it++){
        unsigned nextnid = it->nodeID;
        findMatch(nextnid, sGraph, eid, usedNodes, origFrom, origTo);
    }
    for(vector<NodewithEID>::iterator it = node->outRedEdgeNodes.begin(); it != node->outRedEdgeNodes.end(); it++){
        unsigned nextnid = it->nodeID;
        findMatch(nextnid, sGraph, eid, usedNodes, origFrom, origTo);
    }

    usedNodes.erase(nodeID);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movq -0x10(%rbp), %rdi
addq $0x70, %rdi
movl -0x4(%rbp), %eax
movl %eax, %esi
callq 0x4e30
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x4(%rbp), %rsi
callq 0x4f30
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x4f60
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x4f00
testb $0x1, %al
jne 0x36ab
jmp 0x36b0
jmp 0x38a8
movq -0x20(%rbp), %rdi
leaq -0x4(%rbp), %rsi
callq 0x4f90
movq %rax, -0x50(%rbp)
movb %dl, -0x48(%rbp)
movq -0x30(%rbp), %rdi
addq $0x38, %rdi
callq 0x4fd0
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rdi
addq $0x38, %rdi
callq 0x5040
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x5000
testb $0x1, %al
jne 0x36fc
jmp 0x3799
leaq -0x58(%rbp), %rdi
callq 0x5070
movl 0x4(%rax), %eax
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x5070
movl (%rax), %eax
movl %eax, -0x68(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x64(%rbp), %eax
jne 0x3783
movl -0x4(%rbp), %eax
cmpl -0x28(%rbp), %eax
je 0x3783
movl -0x68(%rbp), %eax
cmpl -0x24(%rbp), %eax
je 0x3783
movq 0x1a8a0(%rip), %rdi     # 0x1dfd8
leaq 0xf8eb(%rip), %rsi      # 0x1302a
callq 0x3200
movq %rax, %rdi
movl -0x4(%rbp), %esi
callq 0x3300
movq %rax, %rdi
leaq 0xf8dc(%rip), %rsi      # 0x13035
callq 0x3200
movq %rax, %rdi
movl -0x64(%rbp), %esi
callq 0x3300
movq %rax, %rdi
leaq 0xf8c6(%rip), %rsi      # 0x13039
callq 0x3200
movq %rax, %rdi
movl -0x68(%rbp), %esi
callq 0x3300
jmp 0x3785
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
callq 0x5090
movq %rax, -0x70(%rbp)
jmp 0x36d5
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
callq 0x4fd0
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
callq 0x5040
movq %rax, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x5000
testb $0x1, %al
jne 0x37ce
jmp 0x3811
leaq -0x78(%rbp), %rdi
callq 0x5070
movl (%rax), %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %edi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movl -0x28(%rbp), %r9d
callq 0x3640
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
callq 0x5090
movq %rax, -0x90(%rbp)
jmp 0x37aa
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
callq 0x4fd0
movq %rax, -0x98(%rbp)
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
callq 0x5040
movq %rax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x5000
testb $0x1, %al
jne 0x3852
jmp 0x389b
leaq -0x98(%rbp), %rdi
callq 0x5070
movl (%rax), %eax
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %edi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movl -0x28(%rbp), %r9d
callq 0x3640
leaq -0x98(%rbp), %rdi
xorl %esi, %esi
callq 0x5090
movq %rax, -0xb0(%rbp)
jmp 0x3825
movq -0x20(%rbp), %rdi
leaq -0x4(%rbp), %rsi
callq 0x50d0
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)