// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/regressionrule.c
// Function: simplify_regression_ruleset
void simplify_regression_ruleset(Regressionruleset* r, Instanceptr data, int modelselectionmethod)
{
	/*!Last Changed 06.03.2005*/
	Regressionruleptr firstrule, deleted, tmprule, deletedbefore;
	double minerror, error;
	minerror = generalization_error_of_regression_ruleset(*r, data, modelselectionmethod);
	firstrule = r->start;
	deleted = r->end;
	while (deleted && deleted->next != firstrule)
	 {
		 tmprule = r->start;
			if (tmprule != deleted)
			 {
			  while (tmprule->next != deleted)
				   tmprule = tmprule->next;
			  deletedbefore = tmprule;
			 }
			else
				 deletedbefore = NULL;
			remove_regression_rule_after(r, deletedbefore, deleted);
			error = generalization_error_of_regression_ruleset(*r, data, modelselectionmethod);
			if (error > minerror)
				 add_regression_rule_after(r, deletedbefore, deleted);
			else
			 {
				 free_regression_rule(*deleted);
					safe_free(deleted);
				 minerror = error;
			 }
			deleted = deletedbefore;
	 }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
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 0xa2f40
movsd %xmm0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x28(%rbp)
movb %al, -0x49(%rbp)
je 0xa2e21
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rax
cmpq -0x20(%rbp), %rax
setne %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0xa2e2d
jmp 0xa2f2a
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0xa2e6a
jmp 0xa2e44
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rax
cmpq -0x28(%rbp), %rax
je 0xa2e60
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0xa2e44
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0xa2e72
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0xa3040
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
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 0xa2f40
movsd %xmm0, -0x48(%rbp)
movsd -0x48(%rbp), %xmm0
ucomisd -0x40(%rbp), %xmm0
jbe 0xa2ed8
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0xa30d0
jmp 0xa2f1d
movq -0x28(%rbp), %rcx
movq 0x40(%rcx), %rdx
movq %rsp, %rax
movq %rdx, 0x40(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups 0x30(%rcx), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0xa3150
movq -0x28(%rbp), %rdi
callq 0x52e80
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0xa2e03
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)