// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/statistics.c
// Function: find_cliques
void find_cliques(char** files, int filecount)
{
 BOOLEAN isclique, subset;
 char clique[MAXLENGTH];
 int *counts, **subsets, res, i, j, k, t, index, cliquecount = 0, *cliques = NULL, count = 0;
 Comparisonptr comparisons;
 comparisons = all_pairwise_comparisons(files, filecount, get_parameter_l("correctiontype"), get_parameter_l("testtype"));
 subsets = generate_subsets(filecount, &res, &counts);
 for (i = 0; i < res; i++)
   if (counts[i] > 1)
    {
     isclique = BOOLEAN_TRUE;
     for (j = 0; j < counts[i]; j++)
       for (k = j + 1; k < counts[i]; k++)
        {
         index = -1;
         for (t = 0; t < (filecount * (filecount - 1)) / 2; t++)
           if (comparisons[t].alg1 == subsets[i][j] && comparisons[t].alg2 == subsets[i][k])
            {
             index = t;
             break;
            }
         if (index == -1)
          {
           printf("Error in indexing\n");
           isclique = BOOLEAN_FALSE;
           break;           
          }
         if (!comparisons[index].accepted)
          {
           isclique = BOOLEAN_FALSE;
           break;
          }
        }
     if (isclique)
      {
       cliques = alloc(cliques, (cliquecount + 1) * sizeof(int), cliquecount + 1);
       cliques[cliquecount] = i;
       cliquecount++;
      }   
    }
 for (i = 0; i < cliquecount; i++)
  {
   subset = BOOLEAN_FALSE;
   for (j = 0; j < cliquecount; j++)
     if (i != j && is_subset(subsets[cliques[i]], subsets[cliques[j]], counts[cliques[i]], counts[cliques[j]]))
      {
       subset = BOOLEAN_TRUE;
       break;
      }
   if (!subset)
    {
     count++;
     sprintf(clique, "(");
     for (j = 0; j < counts[cliques[i]] - 1; j++)
       sprintf(clique, "%s%d ", clique, subsets[cliques[i]][j] + 1);
     sprintf(clique, "%s%d)", clique, subsets[cliques[i]][j] + 1);  
     write_array_variables("aout", count, 1, "s", clique);
    }
  }
 set_default_variable("out1", count + 0.0);
 for (i = 0; i < res; i++)
   if (counts[i] > 0)
     safe_free(subsets[i]);
 safe_free(subsets);
 safe_free(counts); 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7a158, %rsp          # imm = 0x7A158
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x16fea(%rip), %rdi     # 0xa5938
callq 0x54afc
movl %eax, %ebp
leaq 0x1bb45(%rip), %rdi     # 0xaa4a1
callq 0x54afc
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl %eax, %ecx
callq 0x8e6f8
movq %rax, %r15
leaq 0xc(%rsp), %r12
movq %rsp, %rdx
movl %r14d, %edi
movq %r12, %rsi
callq 0x3971c
movq %rax, %rbx
xorpd %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
cmpl $0x0, (%r12)
jle 0x8ebe7
leal -0x1(%r14), %eax
imull %r14d, %eax
movl %eax, %ebp
shrl $0x1f, %ebp
movl %eax, 0x10(%rsp)
addl %eax, %ebp
sarl %ebp
movq %r15, 0x20(%rsp)
addq $0x4, %r15
movq %r15, 0x18(%rsp)
xorl %r12d, %r12d
xorl %r14d, %r14d
movl $0x0, 0x8(%rsp)
movq (%rsp), %rax
movl (%rax,%r12,4), %edi
cmpl $0x2, %edi
jl 0x8eaa2
movl $0x1, %ecx
movl $0x1, %r15d
xorl %r13d, %r13d
movq %r13, %rsi
incq %r13
movslq %edi, %rdx
cmpq %rdx, %r13
jge 0x8ea64
cmpl $0x2, 0x10(%rsp)
jl 0x8ea52
movq (%rbx,%r12,8), %rdx
movl (%rdx,%rsi,4), %esi
movl %edi, %edi
movq %r15, %r8
movq 0x18(%rsp), %r10
xorl %r9d, %r9d
cmpl %esi, -0x4(%r10)
jne 0x8ea26
movl (%r10), %r11d
cmpl (%rdx,%r8,4), %r11d
je 0x8ea34
incq %r9
addq $0x18, %r10
cmpq %r9, %rbp
jne 0x8ea17
jmp 0x8ea52
movl %r9d, %r9d
leaq (%r9,%r9,2), %r9
movq 0x20(%rsp), %r10
cmpl $0x0, 0x10(%r10,%r9,8)
je 0x8ea76
incq %r8
cmpq %rdi, %r8
jne 0x8ea0f
jmp 0x8ea64
leaq 0x22db4(%rip), %rdi     # 0xb180d
callq 0x4090
xorl %ecx, %ecx
movq (%rsp), %rax
movslq (%rax,%r12,4), %rdi
incq %r15
cmpq %rdi, %r13
jl 0x8e9ee
jmp 0x8ea7a
xorl %ecx, %ecx
jmp 0x8ea64
testl %ecx, %ecx
je 0x8eaa2
movl 0x8(%rsp), %edx
movslq %edx, %r15
incl %edx
leaq 0x4(,%r15,4), %rsi
movq %r14, %rdi
movl %edx, 0x8(%rsp)
callq 0x3a0b4
movq %rax, %r14
movl %r12d, (%rax,%r15,4)
incq %r12
movslq 0xc(%rsp), %rax
cmpq %rax, %r12
jl 0x8e9cf
movl 0x8(%rsp), %eax
testl %eax, %eax
jle 0x8ebe7
movq %rbx, 0x10(%rsp)
movl %eax, %r13d
leaq 0x22cb5(%rip), %r12     # 0xb1783
leaq 0x30(%rsp), %rbx
xorl %ebp, %ebp
movl $0x0, 0x18(%rsp)
movq %r13, 0x20(%rsp)
xorl %r15d, %r15d
cmpq %r15, %rbp
je 0x8eb18
movslq (%r14,%rbp,4), %rax
movq 0x10(%rsp), %rdx
movq (%rdx,%rax,8), %rdi
movslq (%r14,%r15,4), %rcx
movq (%rdx,%rcx,8), %rsi
movq (%rsp), %r8
movl (%r8,%rax,4), %edx
movl (%r8,%rcx,4), %ecx
callq 0x396e5
testl %eax, %eax
jne 0x8ebc7
incq %r15
cmpq %r15, %r13
jne 0x8eae5
movw $0x28, 0x30(%rsp)
movq (%rsp), %rcx
movq %r14, %r13
movslq (%r14,%rbp,4), %rax
cmpl $0x2, (%rcx,%rax,4)
jl 0x8eb74
xorl %r15d, %r15d
movq 0x10(%rsp), %r14
movq (%r14,%rax,8), %rax
movl (%rax,%r15,4), %ecx
incl %ecx
movq %rbx, %rdi
movq %r12, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x41b0
incq %r15
movq (%rsp), %rcx
movslq (%r13,%rbp,4), %rax
movslq (%rcx,%rax,4), %rcx
decq %rcx
cmpq %rcx, %r15
jl 0x8eb40
jmp 0x8eb7c
xorl %r15d, %r15d
movq 0x10(%rsp), %r14
incl 0x18(%rsp)
movq (%r14,%rax,8), %rax
movl (%rax,%r15,4), %ecx
incl %ecx
movq %rbx, %rdi
leaq 0x22bf5(%rip), %rsi     # 0xb1789
movq %rbx, %rdx
xorl %eax, %eax
callq 0x41b0
leaq 0x16c0b(%rip), %rdi     # 0xa57b0
movl 0x18(%rsp), %esi
movl $0x1, %edx
leaq 0x1939c(%rip), %rcx     # 0xa7f51
movq %rbx, %r8
xorl %eax, %eax
callq 0x33644
movq %r13, %r14
movq 0x20(%rsp), %r13
incq %rbp
cmpq %r13, %rbp
jne 0x8eae2
xorps %xmm0, %xmm0
cvtsi2sdl 0x18(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0x10(%rsp), %rbx
leaq 0x1a3fa(%rip), %rdi     # 0xa8fe8
movsd 0x28(%rsp), %xmm0
callq 0x34a17
movl 0xc(%rsp), %eax
testl %eax, %eax
jle 0x8ec27
xorl %r14d, %r14d
movq (%rsp), %rcx
cmpl $0x0, (%rcx,%r14,4)
jle 0x8ec1c
movq (%rbx,%r14,8), %rdi
callq 0x3a180
movl 0xc(%rsp), %eax
incq %r14
movslq %eax, %rcx
cmpq %rcx, %r14
jl 0x8ec04
movq %rbx, %rdi
callq 0x3a180
movq (%rsp), %rdi
callq 0x3a180
addq $0x7a158, %rsp          # imm = 0x7A158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq