// File: iPapatsoris[P]Maximum-Independent-Set/src/Alg.hpp
// Function: Alg::branchLeft(Alg::BranchingRule const&, Alg::SearchNode*, Mis&) const
void branchLeft(const BranchingRule &branchingRule, SearchNode *searchNode, Mis &parentMis) const {
        switch (branchingRule.type) {
            case BranchingRule::Type::MAX_DEGREE:
            case BranchingRule::Type::OPTNODE:
            case BranchingRule::Type::OPT4NODE:
            case BranchingRule::Type::EFFECTIVE_NODE: {
                searchNode->graph.remove(branchingRule.node1, searchNode->reductions->getReduceInfo());
                break;
            }
            case BranchingRule::Type::SHORT_EDGE: {
                std::vector<uint32_t> shortEdge;
                shortEdge.push_back(branchingRule.node1);
                shortEdge.push_back(branchingRule.node2);
                searchNode->graph.remove(shortEdge, searchNode->reductions->getReduceInfo());
                break;
            }
            case BranchingRule::Type::GOOD_FUNNEL: {
                branchOnExtendedGranchildren(branchingRule, searchNode);
                break;
            }
            case BranchingRule::Type::GOOD_PAIR: {
                std::vector<uint32_t> goodPair;
                goodPair.push_back(branchingRule.node1);
                goodPair.push_back(branchingRule.node2);
                searchNode->graph.remove(goodPair, searchNode->reductions->getReduceInfo());
                break;
            }
            case BranchingRule::Type::FOUR_CYCLE: {
                std::vector<uint32_t> nonAdjacent;
                nonAdjacent.push_back(branchingRule.container[0]);
                nonAdjacent.push_back(branchingRule.container[2]);
                searchNode->graph.remove(nonAdjacent, searchNode->reductions->getReduceInfo());
                break;
            }
            case BranchingRule::Type::CUT: {
                //std::cout << "left cut" << std::endl;
                std::vector<uint32_t> *component1 = (searchNode->actualComponent1 ? &(searchNode->c1) : &(searchNode->c2));
                std::vector<uint32_t> *component2 = (searchNode->actualComponent1 ? &(searchNode->c2) : &(searchNode->c1));
                component2->insert(component2->end(), searchNode->cut.begin(), searchNode->cut.end());
                searchNode->graph.remove(*component2, searchNode->reductions->getReduceInfo());
                for (auto c: searchNode->cut) {
                    component2->pop_back();
                }
                std::unordered_set<uint32_t> nodesInComponent;
                nodesInComponent.insert(component1->begin(), component1->end());
                searchNode->graph.rebuildFromNodes(nodesInComponent);
                searchNode->mis.getMis().clear();
                searchNode->mis.removeSubsequentNodes(nodesInComponent);
                parentMis.removeHypernodes(searchNode->mis.getHypernodeToInnerNode());
                break;
            }
            default:
                assert(false);
        }
        uint32_t dummy, maxDegree;
        uint32_t oldTheta = searchNode->theta;
        searchNode->graph.getMaxNodeDegree(dummy, maxDegree, oldTheta);
        if (maxDegree < oldTheta) {
            if (maxDegree >= 3) {
                searchNode->theta = maxDegree;
            } else {
                searchNode->theta = 3;
            }
        }
    }

// Assembly:
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, 0x1f0(%rsp)
movq %rsi, 0x1e8(%rsp)
movq %rdx, 0x1e0(%rsp)
movq %rcx, 0x1d8(%rsp)
movq 0x1f0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0x1e8(%rsp), %rax
movl (%rax), %eax
movq %rax, 0xa8(%rsp)
subq $0x8, %rax
ja 0x3b885
movq 0xa8(%rsp), %rax
leaq 0xb81a(%rip), %rcx      # 0x46a0c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x1e0(%rsp), %rax
addq $0x30, %rax
movq %rax, 0x90(%rsp)
movq 0x1e8(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x98(%rsp)
movq 0x1e0(%rsp), %rax
movq 0x108(%rax), %rdi
callq 0x3f420
movq 0x90(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq %rax, %rdx
movb $0x0, 0x1d7(%rsp)
leaq 0x1d7(%rsp), %rcx
callq 0x32f0
jmp 0x3b8a4
leaq 0x1b8(%rsp), %rdi
movq %rdi, 0x88(%rsp)
callq 0x17e60
movq 0x88(%rsp), %rdi
movq 0x1e8(%rsp), %rsi
addq $0x4, %rsi
callq 0x19070
jmp 0x3b294
movq 0x1e8(%rsp), %rsi
addq $0x8, %rsi
leaq 0x1b8(%rsp), %rdi
callq 0x19070
jmp 0x3b2af
movq 0x1e0(%rsp), %rax
movq %rax, %rcx
addq $0x30, %rcx
movq %rcx, 0x78(%rsp)
movq 0x108(%rax), %rdi
callq 0x3f420
movq %rax, 0x80(%rsp)
jmp 0x3b2d9
movq 0x80(%rsp), %rdx
movq 0x78(%rsp), %rdi
movb $0x0, 0x1ab(%rsp)
movb $0x0, 0x1aa(%rsp)
xorl %eax, %eax
movl %eax, %r8d
leaq 0x1b8(%rsp), %rsi
leaq 0x1ab(%rsp), %rcx
leaq 0x1aa(%rsp), %r9
callq 0x189b0
jmp 0x3b31a
leaq 0x1b8(%rsp), %rdi
callq 0x18520
jmp 0x3b8a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
leaq 0x1b8(%rsp), %rdi
callq 0x18520
jmp 0x3b926
movq 0xa0(%rsp), %rdi
movq 0x1e8(%rsp), %rsi
movq 0x1e0(%rsp), %rdx
callq 0x3f430
jmp 0x3b8a4
leaq 0x190(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0x17e60
movq 0x70(%rsp), %rdi
movq 0x1e8(%rsp), %rsi
addq $0x4, %rsi
callq 0x19070
jmp 0x3b39e
movq 0x1e8(%rsp), %rsi
addq $0x8, %rsi
leaq 0x190(%rsp), %rdi
callq 0x19070
jmp 0x3b3b9
movq 0x1e0(%rsp), %rax
movq %rax, %rcx
addq $0x30, %rcx
movq %rcx, 0x60(%rsp)
movq 0x108(%rax), %rdi
callq 0x3f420
movq %rax, 0x68(%rsp)
jmp 0x3b3e0
movq 0x68(%rsp), %rdx
movq 0x60(%rsp), %rdi
movb $0x0, 0x18f(%rsp)
movb $0x0, 0x18e(%rsp)
xorl %eax, %eax
movl %eax, %r8d
leaq 0x190(%rsp), %rsi
leaq 0x18f(%rsp), %rcx
leaq 0x18e(%rsp), %r9
callq 0x189b0
jmp 0x3b41e
leaq 0x190(%rsp), %rdi
callq 0x18520
jmp 0x3b8a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x18520
jmp 0x3b926
leaq 0x170(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x17e60
movq 0x1e8(%rsp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b780
movq 0x58(%rsp), %rdi
movq %rax, %rsi
callq 0x19070
jmp 0x3b48c
movq 0x1e8(%rsp), %rdi
addq $0x10, %rdi
movl $0x2, %esi
callq 0x1b780
movq %rax, %rsi
leaq 0x170(%rsp), %rdi
callq 0x19070
jmp 0x3b4b4
movq 0x1e0(%rsp), %rax
movq %rax, %rcx
addq $0x30, %rcx
movq %rcx, 0x48(%rsp)
movq 0x108(%rax), %rdi
callq 0x3f420
movq %rax, 0x50(%rsp)
jmp 0x3b4db
movq 0x50(%rsp), %rdx
movq 0x48(%rsp), %rdi
movb $0x0, 0x16f(%rsp)
movb $0x0, 0x16e(%rsp)
xorl %eax, %eax
movl %eax, %r8d
leaq 0x170(%rsp), %rsi
leaq 0x16f(%rsp), %rcx
leaq 0x16e(%rsp), %r9
callq 0x189b0
jmp 0x3b519
leaq 0x170(%rsp), %rdi
callq 0x18520
jmp 0x3b8a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
leaq 0x170(%rsp), %rdi
callq 0x18520
jmp 0x3b926
movq 0x1e0(%rsp), %rax
testb $0x1, 0x198(%rax)
je 0x3b577
movq 0x1e0(%rsp), %rax
addq $0x168, %rax            # imm = 0x168
movq %rax, 0x40(%rsp)
jmp 0x3b58a
movq 0x1e0(%rsp), %rax
addq $0x180, %rax            # imm = 0x180
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x160(%rsp)
movq 0x1e0(%rsp), %rax
testb $0x1, 0x198(%rax)
je 0x3b5bd
movq 0x1e0(%rsp), %rax
addq $0x180, %rax            # imm = 0x180
movq %rax, 0x38(%rsp)
jmp 0x3b5d0
movq 0x1e0(%rsp), %rax
addq $0x168, %rax            # imm = 0x168
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x158(%rsp)
movq 0x158(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x158(%rsp), %rdi
callq 0x1a0e0
movq %rax, 0x148(%rsp)
leaq 0x150(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x1aa60
movq 0x1e0(%rsp), %rdi
addq $0x130, %rdi            # imm = 0x130
callq 0x19220
movq %rax, 0x140(%rsp)
movq 0x1e0(%rsp), %rdi
addq $0x130, %rdi            # imm = 0x130
callq 0x19250
movq 0x20(%rsp), %rdi
movq %rax, 0x138(%rsp)
movq 0x150(%rsp), %rsi
movq 0x140(%rsp), %rdx
movq 0x138(%rsp), %rcx
callq 0x3f830
movq %rax, 0x130(%rsp)
movq 0x1e0(%rsp), %rax
addq $0x30, %rax
movq %rax, 0x28(%rsp)
movq 0x158(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x1e0(%rsp), %rax
movq 0x108(%rax), %rdi
callq 0x3f420
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq %rax, %rdx
movb $0x0, 0x12f(%rsp)
movb $0x0, 0x12e(%rsp)
leaq 0x12f(%rsp), %rcx
xorl %eax, %eax
movl %eax, %r8d
leaq 0x12e(%rsp), %r9
callq 0x189b0
movq 0x1e0(%rsp), %rax
addq $0x130, %rax            # imm = 0x130
movq %rax, 0x120(%rsp)
movq 0x120(%rsp), %rdi
callq 0x19220
movq %rax, 0x118(%rsp)
movq 0x120(%rsp), %rdi
callq 0x19250
movq %rax, 0x110(%rsp)
leaq 0x118(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x19280
testb $0x1, %al
jne 0x3b73a
jmp 0x3b76c
leaq 0x118(%rsp), %rdi
callq 0x192a0
movl (%rax), %eax
movl %eax, 0x10c(%rsp)
movq 0x158(%rsp), %rdi
callq 0x1ad40
leaq 0x118(%rsp), %rdi
callq 0x192f0
jmp 0x3b71f
leaq 0xd0(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x1a020
movq 0x160(%rsp), %rdi
callq 0x19b50
movq %rax, 0xc8(%rsp)
movq 0x160(%rsp), %rdi
callq 0x1a0e0
movq 0x18(%rsp), %rdi
movq %rax, 0xc0(%rsp)
movq 0xc8(%rsp), %rsi
movq 0xc0(%rsp), %rdx
callq 0x3f8f0
jmp 0x3b7c4
movq 0x1e0(%rsp), %rdi
addq $0x30, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x3aa0
jmp 0x3b7df
movq 0x1e0(%rsp), %rdi
subq $-0x80, %rdi
callq 0x33930
movq %rax, 0x10(%rsp)
jmp 0x3b7f7
movq 0x10(%rsp), %rdi
callq 0x191c0
movq 0x1e0(%rsp), %rdi
subq $-0x80, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x41ef0
jmp 0x3b81c
movq 0x1d8(%rsp), %rax
movq %rax, (%rsp)
movq 0x1e0(%rsp), %rdi
subq $-0x80, %rdi
callq 0x3f930
movq %rax, 0x8(%rsp)
jmp 0x3b840
movq 0x8(%rsp), %rsi
movq (%rsp), %rdi
callq 0x41e20
jmp 0x3b850
leaq 0xd0(%rsp), %rdi
callq 0x1a030
jmp 0x3b8a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x1a030
jmp 0x3b926
leaq 0xa8fa(%rip), %rdi      # 0x46186
leaq 0xb27a(%rip), %rsi      # 0x46b0d
movl $0x1a0, %edx            # imm = 0x1A0
leaq 0xb3e9(%rip), %rcx      # 0x46c88
callq 0x2110
movq 0x1e0(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0xb4(%rsp)
movq 0x1e0(%rsp), %rdi
addq $0x30, %rdi
leaq 0xbc(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
leaq 0xb4(%rsp), %rcx
callq 0x2aa0
movl 0xb8(%rsp), %eax
cmpl 0xb4(%rsp), %eax
jae 0x3b91e
cmpl $0x3, 0xb8(%rsp)
jb 0x3b90d
movl 0xb8(%rsp), %ecx
movq 0x1e0(%rsp), %rax
movl %ecx, 0x4(%rax)
jmp 0x3b91c
movq 0x1e0(%rsp), %rax
movl $0x3, 0x4(%rax)
jmp 0x3b91e
addq $0x1f8, %rsp            # imm = 0x1F8
retq
movq 0x1b0(%rsp), %rdi
callq 0x2310
nopw %cs:(%rax,%rax)
nopl (%rax)