// File: /workspace/github_cpp_makefile_star2_O2/iPapatsoris[P]Maximum-Independent-Set/src/Graph.cpp
// Function: Graph::get4CycleTheta3(std::vector<unsigned int, std::allocator<unsigned int>>&) const
bool Graph::get4CycleTheta3(vector<uint32_t> &optimalCycle) const {
    optimalCycle.clear();
    uint32_t maxDegree3NodesCount = NONE;
    GraphTraversal graphTraversal(*this);
    while (graphTraversal.curNode != NONE) {
        vector<uint32_t> neighbors;
        gatherNeighbors(graphTraversal.curNode, neighbors);
        uint32_t b, d;
        for (uint32_t i = 0 ; i < neighbors.size() ; i++) {
            for (uint32_t j = i+1 ; j < neighbors.size() ; j++) {
                b = neighbors[i];
                d = neighbors[j];
                vector<uint32_t> commonNeighbors;
                getCommonNeighbors(b, d, commonNeighbors);
                for (auto c: commonNeighbors) {
                    if (c == graphTraversal.curNode) {
                        continue;
                    }
                    uint32_t degreeA = getNodeDegree(graphTraversal.curNode);
                    uint32_t degreeB = getNodeDegree(b);
                    uint32_t degreeC = getNodeDegree(c);
                    uint32_t degreeD = getNodeDegree(d);
                    if (degreeA == 3 && degreeC == 3 || degreeB == 3 && degreeD == 3) {
                        optimalCycle.clear();
                        optimalCycle.push_back(graphTraversal.curNode);
                        optimalCycle.push_back(b);
                        optimalCycle.push_back(c);
                        optimalCycle.push_back(d);
                        return true;
                    }
                    uint32_t degree3NodesCount = 0;
                    if (degreeA == 3) {
                        degree3NodesCount++;
                    }
                    if (degreeB == 3) {
                        degree3NodesCount++;
                    }
                    if (degreeC == 3) {
                        degree3NodesCount++;
                    }
                    if (degreeD == 3) {
                        degree3NodesCount++;
                    }
                    if (maxDegree3NodesCount == NONE || degree3NodesCount > maxDegree3NodesCount) {
                        maxDegree3NodesCount = degree3NodesCount;
                        optimalCycle.clear();
                        optimalCycle.push_back(graphTraversal.curNode);
                        optimalCycle.push_back(b);
                        optimalCycle.push_back(c);
                        optimalCycle.push_back(d);
                    }
                }
            }
        }
        getNextNode(graphTraversal);
    }
    return maxDegree3NodesCount != NONE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %r14
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x444d
movq %rax, 0x8(%rsi)
movq %rsi, 0x20(%rsp)
leaq 0x18(%rsp), %rdi
movq %r14, %rsi
callq 0x270e
pushq $-0x1
popq %rax
movl %eax, 0x14(%rsp)
leaq 0x50(%rsp), %rbx
cmpl $-0x1, 0x18(%rsp)
je 0x470a
andq $0x0, 0x40(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
orl $-0x1, 0x50(%rsp)
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
leaq 0x30(%rsp), %rdx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0xa3c8
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
xorl %edx, %edx
movl %edx, %esi
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rsi, %rdx
jbe 0x4680
leal 0x1(%rsi), %edx
movl %edx, 0x2c(%rsp)
movl %edx, %edi
movq %rsi, 0x70(%rsp)
movl %edi, %edi
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rdi, %rdx
jbe 0x4677
movl (%rax,%rsi,4), %ecx
movl %ecx, 0x10(%rsp)
movq %rdi, 0x78(%rsp)
movl (%rax,%rdi,4), %eax
movl %eax, 0xc(%rsp)
andq $0x0, 0x60(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
andl $0x0, 0x8(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
leaq 0xc(%rsp), %rdx
movq %rbx, %rcx
leaq 0x8(%rsp), %r8
callq 0x42fc
movq 0x50(%rsp), %rbx
movq 0x58(%rsp), %rax
movq %rax, 0x80(%rsp)
cmpq 0x80(%rsp), %rbx
je 0x464f
movl (%rbx), %eax
movl %eax, 0x8(%rsp)
cmpl 0x18(%rsp), %eax
je 0x4646
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
callq 0xa5ce
movl %eax, %r15d
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0xa5ce
movl %eax, %ebp
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0xa5ce
movl %eax, %r12d
movq %r14, %rdi
leaq 0xc(%rsp), %rsi
callq 0xa5ce
movl %r15d, %ecx
xorl $0x3, %ecx
movl %r12d, %edx
xorl $0x3, %edx
orl %ecx, %edx
je 0x469c
movl %ebp, %ecx
xorl $0x3, %ecx
movl %eax, %edx
xorl $0x3, %edx
orl %ecx, %edx
je 0x469c
xorl %r13d, %r13d
cmpl $0x3, %eax
sete %r13b
xorl %eax, %eax
cmpl $0x3, %r12d
sete %al
xorl %ecx, %ecx
cmpl $0x3, %r15d
sete %cl
leal 0x1(%rcx), %edx
cmpl $0x3, %ebp
cmovnel %ecx, %edx
addl %eax, %r13d
addl %edx, %r13d
movl 0x14(%rsp), %ecx
cmpl $-0x1, %ecx
sete %al
cmpl %ecx, %r13d
seta %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x4646
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
cmpq %rax, 0x8(%rdi)
je 0x460a
movq %rax, 0x8(%rdi)
leaq 0x18(%rsp), %rsi
callq 0xa1ac
movq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xa1ac
movq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xa1ac
movq 0x20(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0xa1ac
movl %r13d, 0x14(%rsp)
addq $0x4, %rbx
jmp 0x4536
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq 0xb872
movq 0x78(%rsp), %rdi
incl %edi
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movq 0x70(%rsp), %rsi
jmp 0x44cf
movl 0x2c(%rsp), %edx
jmp 0x44ac
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
callq 0x9cf8
leaq 0x30(%rsp), %rdi
callq 0xb872
jmp 0x446b
movq 0x20(%rsp), %rbx
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x46ae
movq %rax, 0x8(%rbx)
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0xa1ac
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0xa1ac
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xa1ac
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0xa1ac
leaq 0x50(%rsp), %rdi
callq 0xb872
leaq 0x30(%rsp), %rdi
callq 0xb872
movb $0x1, %al
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $-0x1, 0x14(%rsp)
setne %al
jmp 0x46f8
jmp 0x4716
movq %rax, %rbx
jmp 0x4734
jmp 0x4727
jmp 0x4727
jmp 0x4727
jmp 0x4727
jmp 0x4727
jmp 0x4727
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0xb872
leaq 0x30(%rsp), %rdi
callq 0xb872
movq %rbx, %rdi
callq 0x22c0