// File: /workspace/github_cpp_makefile_star2_O1/iPapatsoris[P]Maximum-Independent-Set/src/Reductions.cpp
// Function: Reductions::removeLineGraphs(unsigned int const&)
void Reductions::removeLineGraphs(const uint32_t &theta) {
    //cout << "\n**Performing line graph reduction**" << endl;
    vector<unordered_map<uint32_t, vector<uint32_t>* >::iterator> removedCCs;
    for (auto it = ccToNodes.begin() ; it != ccToNodes.end() ; it++) {
        vector<uint32_t> *cc = it->second;
        vector<Graph::GraphTraversal> clique1;
        vector<Graph::GraphTraversal> clique2;
        clique1.reserve(5);
        clique2.reserve(5);
        uint32_t checks;
        if (theta >= 6) {
            checks = 3;
        } else {
            checks = 1;
        }
        for (uint32_t i = 0 ; i < checks ; i++) {
            uint32_t nodes, degree, clique1Size, clique2Size;
            if (theta >= 6) {
                switch (i) {
                    case 0:
                        nodes = 10;
                        degree = 6;
                        clique1Size = clique2Size = 4;
                        break;
                    case 1:
                        nodes = 15;
                        degree = 8;
                        clique1Size = clique2Size = 5;
                        break;
                    case 2:
                        nodes = 20;
                        degree = 7;
                        clique1Size = 5;
                        clique2Size = 4;
                        break;
                }
            } else if (theta == 5) {
                nodes = 12;
                degree = 5;
                clique1Size = 4;
                clique2Size = 3;
            } else if (theta <= 4) {
                nodes = 6;
                degree = 4;
                clique1Size = clique2Size = 3;
            }
            if (cc->size() == nodes && nodeDegreesEqualTo(*cc, degree, graph)) {
                bool foundCliques = true;
                for (auto node : *cc) {
                    clique1.clear();
                    clique2.clear();
                    clique1.push_back(Graph::GraphTraversal(graph, node));
                    if (!findClique(clique1, NULL, clique1Size)) {
                        foundCliques = false;
                        break;
                    }
                    clique2.push_back(Graph::GraphTraversal(graph, node));
                    if (!findClique(clique2, &clique1, clique2Size)) {
                        foundCliques = false;
                        break;
                    }
                }
                if (foundCliques) {
                    //cout << "Removing component " << it->first << "\n";
                    findMisInComponent(*cc);
                    graph.remove(*cc, reduceInfo, true);
                    removedCCs.push_back(it);
                    break;
                } else {
                    break;
                }
            }
        }
    }
    if (removedCCs.empty()) {
        //cout << "No nodes removed" << endl;
    } else {
        for (auto cc : removedCCs) {
            delete cc->second;
            ccToNodes.erase(cc);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movq $0x0, 0x70(%rsp)
movq 0x28(%rdi), %rax
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x107e5
movq %rsi, %r14
leaq 0x10(%rbx), %rcx
movq %rcx, 0x80(%rsp)
movl $0x5, %r12d
movq 0x10(%rax), %r13
xorl %eax, %eax
movq %rax, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq %rax, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movl $0x5, %esi
leaq 0x20(%rsp), %rdi
callq 0x12f18
movl $0x5, %esi
leaq 0x40(%rsp), %rdi
callq 0x12f18
movl (%r14), %ebp
xorl %r15d, %r15d
movl (%r14), %eax
cmpl $0x6, %eax
jb 0x10575
cmpl $0x2, %r15d
je 0x105b3
cmpl $0x1, %r15d
jne 0x105d1
movl $0x8, 0x8(%rsp)
movl %r12d, (%rsp)
movl %r12d, 0x4(%rsp)
movl $0xf, %eax
jmp 0x105ea
cmpl $0x5, %eax
jne 0x10598
movl $0x5, 0x8(%rsp)
movl $0x4, 0x4(%rsp)
movl $0x3, (%rsp)
movl $0xc, %eax
jmp 0x105ea
movl $0x4, 0x8(%rsp)
movl $0x3, %eax
movl %eax, (%rsp)
movl %eax, 0x4(%rsp)
movl $0x6, %eax
jmp 0x105ea
movl $0x7, 0x8(%rsp)
movl $0x5, 0x4(%rsp)
movl $0x4, (%rsp)
movl $0x14, %eax
jmp 0x105ea
movl $0x6, 0x8(%rsp)
movl $0x4, %eax
movl %eax, (%rsp)
movl %eax, 0x4(%rsp)
movl $0xa, %eax
movq 0x8(%r13), %rcx
subq (%r13), %rcx
sarq $0x2, %rcx
cmpq %rax, %rcx
jne 0x1060f
movq (%rbx), %rdx
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
callq 0x12fb2
testb %al, %al
jne 0x1062e
cmpl $0x6, %ebp
jb 0x107b1
leal 0x1(%r15), %eax
cmpl $0x2, %r15d
movl %eax, %r15d
jb 0x10549
jmp 0x107b1
movq (%r13), %r12
movq 0x8(%r13), %rbp
cmpq %rbp, %r12
je 0x1074b
addq $0x4, %r12
movb $0x1, %r15b
movl -0x4(%r12), %eax
movl %eax, 0xc(%rsp)
movq 0x20(%rsp), %rax
cmpq %rax, 0x28(%rsp)
je 0x10660
movq %rax, 0x28(%rsp)
movq 0x40(%rsp), %rax
cmpq %rax, 0x48(%rsp)
je 0x10671
movq %rax, 0x48(%rsp)
movq (%rbx), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x29ee
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x1069f
movq 0x10(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x28(%rsp)
jmp 0x106ae
leaq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x138e8
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
xorl %edx, %edx
leaq 0x4(%rsp), %rcx
callq 0x12610
testb %al, %al
je 0x106f4
movq (%rbx), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x29ee
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0x106fb
movq 0x10(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x48(%rsp)
jmp 0x1070a
movb $0x1, %al
xorl %r15d, %r15d
jmp 0x10730
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x138e8
movq %rbx, %rdi
leaq 0x40(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq %rsp, %rcx
callq 0x12610
movzbl %r15b, %r15d
testb %al, %al
movl $0x0, %ecx
cmovel %ecx, %r15d
xorb $0x1, %al
testb %al, %al
jne 0x10745
leaq 0x4(%r12), %rax
cmpq %rbp, %r12
movq %rax, %r12
jne 0x10646
testb $0x1, %r15b
je 0x107ab
movq %rbx, %rdi
movq %r13, %rsi
callq 0x12786
movq (%rbx), %rdi
movb $0x1, 0x10(%rsp)
movb $0x0, 0xc(%rsp)
movq %r13, %rsi
movq 0x80(%rsp), %rdx
leaq 0x10(%rsp), %rcx
xorl %r8d, %r8d
leaq 0xc(%rsp), %r9
callq 0xc16e
movq 0x68(%rsp), %rsi
cmpq 0x70(%rsp), %rsi
je 0x1079c
movq 0x18(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x68(%rsp)
jmp 0x107ab
leaq 0x60(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x133d8
movl $0x5, %r12d
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x107c0
callq 0x21a0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x107cf
callq 0x21a0
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
testq %rax, %rax
jne 0x10508
movq 0x60(%rsp), %r12
movq 0x68(%rsp), %r13
cmpq %r13, %r12
je 0x1082e
addq $0x18, %rbx
movq (%r12), %r14
movq 0x10(%r14), %r15
testq %r15, %r15
je 0x1081a
movq (%r15), %rdi
testq %rdi, %rdi
je 0x10812
callq 0x21a0
movq %r15, %rdi
callq 0x21a0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x13516
addq $0x8, %r12
cmpq %r13, %r12
jne 0x107f8
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1083d
callq 0x21a0
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x10860
jmp 0x10860
movq %rax, %rbx
jmp 0x10881
jmp 0x10860
jmp 0x10860
jmp 0x10860
jmp 0x10860
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x10872
callq 0x21a0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x10881
callq 0x21a0
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x10890
callq 0x21a0
movq %rbx, %rdi
callq 0x2320