// File: /workspace/github_cpp_makefile_star2_O2/iPapatsoris[P]Maximum-Independent-Set/src/Graph.cpp
// Function: Graph::checkSeparation(std::unordered_set<unsigned int, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<unsigned int>> const&, std::vector<unsigned int, std::allocator<unsigned int>>&, std::vector<unsigned int, std::allocator<unsigned int>>&, bool&) const
bool Graph::checkSeparation(const unordered_set<uint32_t> &cut, vector<uint32_t> &component1, vector<uint32_t> &component2, bool &actualComponent1) const {
    if (!buildCC(cut, component1, component2) || !component1.size() || !component2.size()) {
        //cout << "more than 2 cc" << endl;
        component1.clear();
        component2.clear();
        return false;
    }
    if (cut.size() < 3) {
        uint32_t degreeSum1 = 0;
        for (auto node: component1) {
            uint32_t degree = getNodeDegree(node);
            for (auto z: cut) {
                if (edgeExists(z, node)) {
                    degree--;
                }
            }
            if (degree >= 3) {
                degreeSum1 += degree;
            }
        }

        uint32_t degreeSum2 = 0;
        for (auto node: component2) {
            uint32_t degree = getNodeDegree(node);
            for (auto z: cut) {
                if (edgeExists(z, node)) {
                    degree--;
                }
            }
            if (degree >= 3) {
                degreeSum2 += degree;
                if (degreeSum2 >= degreeSum1) {
                    break;
                }
            }
        }
        if (degreeSum1 <= degreeSum2) {
            actualComponent1 = true;
        } else {
            actualComponent1 = false;
        }
        return true;
    } else {
        if (component1.size() <= 24) {
            actualComponent1 = true;
        } else if (component2.size() <= 24) {
            actualComponent1 = false;
        } else {
            return false;
        }
        vector<uint32_t> *c = (actualComponent1 ? &component1 : &component2);
        uint32_t degreeSum = 0;
        for (auto node: *c) {
            degreeSum += getNodeDegree(node);
            if (degreeSum >= 17) {
                return true;
            }
        }
        return false;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r14
movq %rcx, %rbp
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %rbx
callq 0x8c50
movq (%r13), %r12
movq 0x8(%r13), %rdx
testb %al, %al
je 0x6cd2
movq %rdx, %rcx
subq %r12, %rcx
je 0x6cdb
movq 0x8(%rbp), %rax
subq (%rbp), %rax
je 0x6cd2
movq %rbp, 0x18(%rsp)
cmpq $0x2, 0x18(%r15)
ja 0x6cfc
movq %r14, 0x30(%rsp)
addq $0x10, %r15
leaq 0xc(%rsp), %r13
leaq 0x14(%rsp), %rbp
movl $0x0, 0x10(%rsp)
movq %r15, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
cmpq %rdx, %r12
je 0x6d55
movl (%r12), %eax
movl %eax, 0xc(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xa5ce
movl %eax, %r14d
movq (%r15), %r15
testq %r15, %r15
je 0x6cb0
movl 0x8(%r15), %eax
movl %eax, 0x14(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x9e3a
movzbl %al, %eax
subl %eax, %r14d
jmp 0x6c8a
cmpl $0x3, %r14d
movl $0x0, %eax
cmovbl %eax, %r14d
addl %r14d, 0x10(%rsp)
addq $0x4, %r12
movq 0x28(%rsp), %r15
movq 0x20(%rsp), %rdx
jmp 0x6c6b
cmpq %r12, %rdx
je 0x6cdb
movq %r12, 0x8(%r13)
movq (%rbp), %rax
cmpq %rax, 0x8(%rbp)
je 0x6ce9
movq %rax, 0x8(%rbp)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %bpl
cmpq $0x64, %rcx
jb 0x6d0d
xorl %ebp, %ebp
cmpq $0x63, %rax
ja 0x6ceb
movb %bpl, (%r14)
testb %bpl, %bpl
movq 0x18(%rsp), %rax
cmovneq %r13, %rax
movq (%rax), %r15
movq 0x8(%rax), %r12
xorl %r13d, %r13d
leaq 0xc(%rsp), %r14
cmpq %r12, %r15
setne %bpl
je 0x6ceb
movl (%r15), %eax
movl %eax, 0xc(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa5ce
addl %eax, %r13d
addq $0x4, %r15
cmpl $0x11, %r13d
jb 0x6d2b
jmp 0x6ceb
movq 0x18(%rsp), %rax
movq (%rax), %r15
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
xorl %ecx, %ecx
leaq 0xc(%rsp), %r12
leaq 0x14(%rsp), %r13
cmpq 0x18(%rsp), %r15
je 0x6dd6
movq %rcx, 0x20(%rsp)
movl (%r15), %eax
movl %eax, 0xc(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xa5ce
movl %eax, %ebp
movq 0x28(%rsp), %r14
movq (%r14), %r14
testq %r14, %r14
je 0x6dbc
movl 0x8(%r14), %eax
movl %eax, 0x14(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x9e3a
movzbl %al, %eax
subl %eax, %ebp
jmp 0x6d97
movq 0x20(%rsp), %rcx
leal (%rcx,%rbp), %eax
addq $0x4, %r15
cmpl $0x3, %ebp
cmovael %eax, %ecx
jb 0x6d72
cmpl 0x10(%rsp), %eax
jb 0x6d72
cmpl %ecx, 0x10(%rsp)
movq 0x30(%rsp), %rax
setbe (%rax)
movb $0x1, %bpl
jmp 0x6ceb