// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/rule.c
// Function: count_exceptions_for_ruleset
void count_exceptions_for_ruleset(Ruleset r, Instanceptr instances, int* C, int* U, int* fp, int* fn)
{
	/*!Last Changed 02.02.2004 added safemalloc*/
	/*!Last Changed 19.12.2003*/
	Instanceptr tmp = instances;
	Decisionruleptr rule;
	int iscovered, covered2 = *C, uncovered2 = *U, fp2 = *fp, fn2 = *fn, *classcoverings, i, classno, instanceclassno;
	classcoverings = (int *) safemalloc(current_dataset->classno * sizeof(int), "count_exceptions_for_ruleset", 4);
 while (tmp)
	 {
		 rule = r.start;
			iscovered = 0;
			for (i = 0; i < current_dataset->classno; i++)
				 classcoverings[i] = 0;
			instanceclassno = give_classno(tmp);
			while (rule)
			 {
				 if (rule_cover_instance(tmp, *rule))
					 {
						 iscovered = 1;
							classcoverings[rule->classno]++;
					 }
				 rule = rule->next;
			 }
			if (!iscovered)
			 {
				 uncovered2++;
				 if (instanceclassno != r.defaultclass)
						 fn2++;
			 }
			else
			 {
				 covered2++;
     classno = find_max_in_list(classcoverings, current_dataset->classno);
					if (instanceclassno != classno)
						 fp2++;
			 }
		 tmp = tmp -> next;
	 }
	safe_free(classcoverings);
	*C = covered2;
	*U = uncovered2;
	*fp = fp2;
	*fn = fn2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4c(%rbp)
leaq 0x58676(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq 0x10(%rax), %rdi
shlq $0x2, %rdi
leaq 0x3f2d7(%rip), %rsi     # 0xec4b3
movl $0x4, %edx
callq 0x52d70
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xad315
movq -0x70(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
leaq 0x58628(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0xad23a
movq -0x58(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0xad20e
movq -0x30(%rbp), %rdi
callq 0x43530
movl %eax, -0x64(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0xad2a9
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rcx
movq 0x30(%rcx), %rdx
movq %rsp, %rax
movq %rdx, 0x30(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0xacfd0
cmpl $0x0, %eax
je 0xad29b
movl $0x1, -0x3c(%rbp)
movq -0x58(%rbp), %rax
movq -0x38(%rbp), %rcx
movslq (%rcx), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0xad246
cmpl $0x0, -0x3c(%rbp)
jne 0xad2cf
movq -0x70(%rbp), %rcx
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x64(%rbp), %eax
cmpl 0x14(%rcx), %eax
je 0xad2cd
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0xad304
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movq -0x58(%rbp), %rdi
leaq 0x5855d(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %esi
callq 0x50070
movl %eax, -0x60(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x60(%rbp), %eax
je 0xad302
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xad304
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0xad1ea
movq -0x58(%rbp), %rdi
callq 0x52e80
movl -0x40(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl -0x44(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x48(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl -0x4c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax,%rax)