// File: /workspace/github_cpp_makefile_star2_O3/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, %r13
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x4de9
movq %rax, 0x8(%rsi)
movq %rsi, 0x10(%rsp)
leaq 0x20(%rsp), %r15
movq $-0x1, (%r15)
movq %r13, %rdi
movq %r15, %rsi
callq 0xb94a
cmpl $-0x1, (%r15)
je 0x522e
movl $0xffffffff, 0x1c(%rsp) # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rbx
leaq 0x30(%rsp), %r14
leaq 0x50(%rsp), %r15
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movl $0xffffffff, 0x50(%rsp) # imm = 0xFFFFFFFF
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
movq %r15, %r8
callq 0xc092
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
cmpq %rax, %rcx
je 0x51e4
xorl %esi, %esi
movq %rsi, 0x78(%rsp)
incl %esi
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
movq %rsi, %rdi
movl %edi, %r8d
movq %rsi, 0x70(%rsp)
cmpq %rsi, %rdx
jbe 0x51d6
movq %r8, 0x28(%rsp)
movq 0x78(%rsp), %rcx
movl (%rax,%rcx,4), %ecx
movl %ecx, 0xc(%rsp)
movl (%rax,%rsi,4), %eax
movl %eax, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
movl $0x0, 0x4(%rsp)
movq %r13, %rdi
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r15, %rcx
leaq 0x4(%rsp), %r8
callq 0x4c42
movq 0x50(%rsp), %r15
movq 0x58(%rsp), %rax
movq %rax, 0x80(%rsp)
cmpq %rax, %r15
je 0x50b8
movl (%r15), %eax
movl %eax, 0x4(%rsp)
cmpl 0x20(%rsp), %eax
je 0x5099
movq %r13, %rdi
movq %rbx, %rsi
callq 0xc2d2
movl %eax, %ebp
movq %r13, %rdi
leaq 0xc(%rsp), %rsi
callq 0xc2d2
movl %eax, %r12d
movq %r13, %rdi
leaq 0x4(%rsp), %rsi
callq 0xc2d2
movq %r13, %rdi
movl %eax, %r13d
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
callq 0xc2d2
movl %ebp, %ecx
xorl $0x3, %ecx
movl %r13d, %edx
xorl $0x3, %edx
orl %ecx, %edx
je 0x50c5
movl %r12d, %ecx
xorl $0x3, %ecx
movl %eax, %edx
xorl $0x3, %edx
orl %ecx, %edx
je 0x50c5
xorl %r14d, %r14d
cmpl $0x3, %eax
sete %r14b
xorl %eax, %eax
cmpl $0x3, %r13d
sete %al
xorl %ecx, %ecx
cmpl $0x3, %ebp
sete %cl
leal 0x1(%rcx), %edx
cmpl $0x3, %r12d
cmovnel %ecx, %edx
addl %eax, %r14d
addl %edx, %r14d
movl 0x1c(%rsp), %ecx
cmpl $-0x1, %ecx
sete %al
cmpl %ecx, %r14d
seta %cl
orb %al, %cl
cmpb $0x1, %cl
movq %rbx, %r13
leaq 0x20(%rsp), %rbx
jne 0x5099
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
movq 0x8(%rdi), %rsi
cmpq %rax, %rsi
je 0x4fcc
movq %rax, 0x8(%rdi)
movq %rax, %rsi
movq 0x10(%rdi), %rax
cmpq %rax, %rsi
je 0x4fe5
movl 0x20(%rsp), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x4ffa
movq %rbx, %rdx
callq 0xd7b4
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rax
cmpq %rax, %rsi
je 0x5014
movl 0xc(%rsp), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq 0x10(%rsp), %rcx
movq %rsi, 0x8(%rcx)
jmp 0x5030
movq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0xd7b4
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rax
cmpq %rax, %rsi
je 0x504a
movl 0x4(%rsp), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq 0x10(%rsp), %rcx
movq %rsi, 0x8(%rcx)
jmp 0x5066
movq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rdx
callq 0xd7b4
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rax
cmpq %rax, %rsi
je 0x5085
movl 0x8(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq 0x10(%rsp), %rax
movq %rsi, 0x8(%rax)
movl %r14d, 0x1c(%rsp)
jmp 0x5099
movq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xd7b4
movl %r14d, 0x1c(%rsp)
addq $0x4, %r15
cmpq 0x80(%rsp), %r15
jne 0x4ef2
movb $0x1, %bpl
movq 0x28(%rsp), %rbx
jmp 0x5190
movb $0x1, %bpl
movq 0x28(%rsp), %rbx
jmp 0x5195
movq 0x10(%rsp), %r14
movq (%r14), %rax
movq 0x8(%r14), %rsi
cmpq %rax, %rsi
je 0x50dd
movq %rax, 0x8(%r14)
movq %rax, %rsi
movq 0x10(%r14), %rax
cmpq %rax, %rsi
movq %rbx, %r13
leaq 0x20(%rsp), %rdx
je 0x5103
movl 0x20(%rsp), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
movq 0x28(%rsp), %rbx
jmp 0x5118
movq %r14, %rdi
callq 0xd7b4
movq 0x28(%rsp), %rbx
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rax
cmpq %rax, %rsi
je 0x512d
movl 0xc(%rsp), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x5142
movq %r14, %rdi
leaq 0xc(%rsp), %rdx
callq 0xd7b4
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rax
cmpq %rax, %rsi
je 0x5157
movl 0x4(%rsp), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x516c
movq %r14, %rdi
leaq 0x4(%rsp), %rdx
callq 0xd7b4
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rax
cmpq %rax, %rsi
je 0x5181
movl 0x8(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x518e
movq %r14, %rdi
leaq 0x8(%rsp), %rdx
callq 0xd7b4
xorl %ebp, %ebp
movq 0x50(%rsp), %r15
testq %r15, %r15
je 0x51a2
movq %r15, %rdi
callq 0x21a0
testb %bpl, %bpl
je 0x521b
incl %ebx
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
movq %rbx, %rsi
cmpq %rbx, %rdx
movq %rbx, %r8
leaq 0x20(%rsp), %rbx
leaq 0x50(%rsp), %r15
ja 0x4e8c
movq 0x70(%rsp), %rsi
cmpq %rsi, %rdx
ja 0x4e67
movq %r13, %rdi
movq %rbx, %rsi
callq 0xb94a
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
leaq 0x30(%rsp), %r14
je 0x5203
callq 0x21a0
cmpl $-0x1, 0x20(%rsp)
xorps %xmm0, %xmm0
jne 0x4e29
cmpl $-0x1, 0x1c(%rsp)
setne %al
jmp 0x5230
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x522a
callq 0x21a0
movb $0x1, %al
jmp 0x5230
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5244
movq %rax, %rbx
jmp 0x5267
jmp 0x5255
jmp 0x5255
jmp 0x5255
jmp 0x5255
jmp 0x5255
jmp 0x5255
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x5267
callq 0x21a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x5276
callq 0x21a0
movq %rbx, %rdi
callq 0x2320