// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/srm.c
// Function: can_ruleset_classify
BOOLEAN can_ruleset_classify(int* featurelist, int* ruleset, int rulecount, int* datacombination, int* classcombination, int size, int positiveclass)
{
 /*Last Changed 26.02.2008*/
 int pow2[16] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768};
 int i, j, k, fno, value, p, control, last_positive = -1, last_negative = rulecount;
 BOOLEAN covered_by_rule, covered_by_ruleset;
 for (p = 0; p < size; p++)
  {
   j = 0;
   covered_by_ruleset = BOOLEAN_FALSE;
   for (i = 0; i < rulecount; i++)
    {
     covered_by_rule = BOOLEAN_TRUE;
     for (k = 0; k < ruleset[i]; k++)
      {
       fno = featurelist[j + k] / 10;
       value = featurelist[j + k] % 2;
       control = datacombination[p] & pow2[fno];
       if ((control > 0 && value == 0) || (control == 0 && value != 0))
        {
         covered_by_rule = BOOLEAN_FALSE;
         break;
        } 
      }
     if (covered_by_rule)
      {
       if (classcombination[p] != positiveclass)
        {
         if (i < last_negative)
          {
           last_negative = i;
           if (last_positive >= last_negative)
             return BOOLEAN_FALSE;
          }
        }
       else
        {
         if (i > last_positive)
          {
           last_positive = i;
           if (last_positive >= last_negative)
             return BOOLEAN_FALSE;
          }
         covered_by_ruleset = BOOLEAN_TRUE;
        }
       break;
      }
     j += ruleset[i];
    }
   if (!covered_by_ruleset && classcombination[p] == positiveclass)
     return BOOLEAN_FALSE;
  }
 return BOOLEAN_TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
leaq -0x80(%rbp), %rdi
leaq 0x2bd80(%rip), %rsi     # 0xedb50
movl $0x40, %edx
callq 0x42b0
movl $0xffffffff, -0xa0(%rbp) # imm = 0xFFFFFFFF
movl -0x1c(%rbp), %eax
movl %eax, -0xa4(%rbp)
movl $0x0, -0x98(%rbp)
movl -0x98(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0xc200e
movl $0x0, -0x88(%rbp)
movl $0x0, -0xac(%rbp)
movl $0x0, -0x84(%rbp)
movl -0x84(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xc1fd3
movl $0x1, -0xa8(%rbp)
movl $0x0, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
movq -0x18(%rbp), %rcx
movslq -0x84(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0xc1f0e
movq -0x10(%rbp), %rax
movl -0x88(%rbp), %ecx
addl -0x8c(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, -0x90(%rbp)
movq -0x10(%rbp), %rax
movl -0x88(%rbp), %ecx
addl -0x8c(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %edx, -0x94(%rbp)
movq -0x28(%rbp), %rax
movslq -0x98(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movslq -0x90(%rbp), %rcx
andl -0x80(%rbp,%rcx,4), %eax
movl %eax, -0x9c(%rbp)
cmpl $0x0, -0x9c(%rbp)
jle 0xc1eda
cmpl $0x0, -0x94(%rbp)
je 0xc1eec
cmpl $0x0, -0x9c(%rbp)
jne 0xc1ef8
cmpl $0x0, -0x94(%rbp)
je 0xc1ef8
movl $0x0, -0xa8(%rbp)
jmp 0xc1f0e
jmp 0xc1efa
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0xc1e47
cmpl $0x0, -0xa8(%rbp)
je 0xc1fa5
movq -0x30(%rbp), %rax
movslq -0x98(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl 0x10(%rbp), %eax
je 0xc1f66
movl -0x84(%rbp), %eax
cmpl -0xa4(%rbp), %eax
jge 0xc1f64
movl -0x84(%rbp), %eax
movl %eax, -0xa4(%rbp)
movl -0xa0(%rbp), %eax
cmpl -0xa4(%rbp), %eax
jl 0xc1f62
movl $0x0, -0x4(%rbp)
jmp 0xc2015
jmp 0xc1f64
jmp 0xc1fa3
movl -0x84(%rbp), %eax
cmpl -0xa0(%rbp), %eax
jle 0xc1f99
movl -0x84(%rbp), %eax
movl %eax, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
cmpl -0xa4(%rbp), %eax
jl 0xc1f97
movl $0x0, -0x4(%rbp)
jmp 0xc2015
jmp 0xc1f99
movl $0x1, -0xac(%rbp)
jmp 0xc1fd3
movq -0x18(%rbp), %rax
movslq -0x84(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl -0x88(%rbp), %eax
movl %eax, -0x88(%rbp)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0xc1e24
cmpl $0x0, -0xac(%rbp)
jne 0xc1ff8
movq -0x30(%rbp), %rax
movslq -0x98(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl 0x10(%rbp), %eax
jne 0xc1ff8
movl $0x0, -0x4(%rbp)
jmp 0xc2015
jmp 0xc1ffa
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0xc1df7
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)