// File: /workspace/github_cpp_makefile_star2_O1/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 %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x4d34
movq %rax, 0x8(%rbx)
leaq 0x18(%rsp), %r15
movq $-0x1, (%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0xc034
cmpl $-0x1, (%r15)
je 0x5136
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
movq %r14, 0x58(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movl $0xffffffff, 0x40(%rsp) # imm = 0xFFFFFFFF
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
leaq 0x20(%rsp), %rdx
xorl %ecx, %ecx
leaq 0x40(%rsp), %r8
callq 0xc714
xorl %eax, %eax
movl %eax, %r15d
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
sarq $0x2, %rax
cmpq %r15, %rax
movq %rax, 0x60(%rsp)
jbe 0x50fe
leal 0x1(%r15), %edx
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rdx, %rcx
seta %sil
movq %rdx, 0x68(%rsp)
jbe 0x50ef
movq %rdx, %rcx
movl %edx, %edi
movq %r15, 0x70(%rsp)
movq %rdi, 0x78(%rsp)
movb %sil, 0xb(%rsp)
movl (%rax,%r15,4), %edx
movl %edx, 0x10(%rsp)
movl (%rax,%rcx,4), %eax
movl %eax, 0xc(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movl $0x0, 0x4(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
leaq 0xc(%rsp), %rdx
leaq 0x40(%rsp), %rcx
leaq 0x4(%rsp), %r8
callq 0x4bae
movq 0x40(%rsp), %r13
movq 0x48(%rsp), %rax
movq %rax, 0x80(%rsp)
cmpq %rax, %r13
je 0x5097
movl (%r13), %eax
movl %eax, 0x4(%rsp)
movl $0xb, %ebp
cmpl 0x18(%rsp), %eax
je 0x5077
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
callq 0xc98e
movl %eax, %r15d
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0xc98e
movl %eax, %ebp
movq %r14, %rdi
leaq 0x4(%rsp), %rsi
callq 0xc98e
movl %eax, %r12d
movq %r14, %rdi
leaq 0xc(%rsp), %rsi
callq 0xc98e
movl %r15d, %ecx
xorl $0x3, %ecx
movl %r12d, %edx
xorl $0x3, %edx
orl %ecx, %edx
je 0x4ec4
movl %ebp, %ecx
xorl $0x3, %ecx
movl %eax, %edx
xorl $0x3, %edx
orl %ecx, %edx
jne 0x4f7f
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x4ed1
movq %rax, 0x8(%rbx)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4eeb
movl 0x18(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x4ef8
movq %rbx, %rdi
leaq 0x18(%rsp), %rdx
callq 0xdeac
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4f12
movl 0x10(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x4f1f
movq %rbx, %rdi
leaq 0x10(%rsp), %rdx
callq 0xdeac
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4f39
movl 0x4(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x4f46
movq %rbx, %rdi
leaq 0x4(%rsp), %rdx
callq 0xdeac
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4f68
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
movl $0x1, %ebp
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x5077
movl $0x1, %ebp
movq %rbx, %rdi
leaq 0xc(%rsp), %rdx
callq 0xdeac
jmp 0x5077
xorl %r14d, %r14d
cmpl $0x3, %eax
sete %r14b
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, %r14d
addl %edx, %r14d
movl 0x14(%rsp), %ecx
cmpl $-0x1, %ecx
sete %al
cmpl %ecx, %r14d
seta %cl
orb %al, %cl
xorl %ebp, %ebp
cmpb $0x1, %cl
jne 0x5077
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x4fd4
movq %rax, 0x8(%rbx)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4fee
movl 0x18(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x4ffb
movq %rbx, %rdi
leaq 0x18(%rsp), %rdx
callq 0xdeac
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x5015
movl 0x10(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x5022
movq %rbx, %rdi
leaq 0x10(%rsp), %rdx
callq 0xdeac
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x503c
movl 0x4(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x5049
movq %rbx, %rdi
leaq 0x4(%rsp), %rdx
callq 0xdeac
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x5065
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
xorl %ebp, %ebp
movl %r14d, 0x14(%rsp)
jmp 0x4f5b
movq %rbx, %rdi
leaq 0xc(%rsp), %rdx
callq 0xdeac
movl %r14d, 0x14(%rsp)
cmpl $0xb, %ebp
je 0x5080
testl %ebp, %ebp
jne 0x509e
addq $0x4, %r13
cmpq 0x80(%rsp), %r13
movq 0x58(%rsp), %r14
jne 0x4e4f
movl $0xa, %ebp
jmp 0x50a3
movq 0x58(%rsp), %r14
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
movq 0x70(%rsp), %r15
je 0x50b7
callq 0x21a0
cmpl $0xa, %ebp
movq 0x78(%rsp), %rdi
je 0x50c5
testl %ebp, %ebp
jne 0x50ea
incl %edi
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
movq %rdi, %rcx
cmpq %rdi, %rdx
seta %sil
ja 0x4de6
jmp 0x50ef
movb 0xb(%rsp), %sil
testb $0x1, %sil
movq 0x68(%rsp), %rax
je 0x4d96
cmpq %r15, 0x60(%rsp)
ja 0x513a
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
callq 0xc034
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x5121
callq 0x21a0
cmpl $-0x1, 0x18(%rsp)
jne 0x4d62
cmpl $-0x1, 0x14(%rsp)
setne %al
jmp 0x514b
xorl %eax, %eax
jmp 0x514b
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x5149
callq 0x21a0
movb $0x1, %al
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x515f
movq %rax, %rbx
jmp 0x5180
jmp 0x516e
jmp 0x516e
jmp 0x516e
jmp 0x516e
jmp 0x516e
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x5180
callq 0x21a0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x518f
callq 0x21a0
movq %rbx, %rdi
callq 0x2320
nop