// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/rise.c
// Function: most_specific_generalization
Decisionruleptr most_specific_generalization(Decisionruleptr rule, Instanceptr nearest)
{
 int fno;
 Decisionruleptr newrule;
 Decisionconditionptr current, before = NULL, next;
 newrule = create_copy_of_rule(rule);
 newrule->next = rule->next;
 current = newrule->start;
 while (current)
  {
   next = current->next;
   fno = current->featureindex;
   switch (current_dataset->features[fno].type)
    {
     case  STRING:if (nearest->values[fno].stringindex != current->value)
                    remove_condition_after(newrule, before, current);
                  else
                    before = current;
                  break;
     case INTEGER:if (nearest->values[fno].intvalue > current->upperlimit)
                    current->upperlimit = nearest->values[fno].intvalue;
                  else
                    if (nearest->values[fno].intvalue < current->lowerlimit)
                      current->lowerlimit = nearest->values[fno].intvalue;
                  before = current;
                  break;
     case    REAL:if (nearest->values[fno].floatvalue > current->upperlimit)
                    current->upperlimit = nearest->values[fno].floatvalue;
                  else
                    if (nearest->values[fno].floatvalue < current->lowerlimit)
                      current->lowerlimit = nearest->values[fno].floatvalue;
                  before = current;
                  break;
    }
   current = next;
  }
 return newrule;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0xad610
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xaa87f
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
leaq 0x5b138(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movl 0x30f08(%rax,%rcx), %eax
movl %eax, -0x3c(%rbp)
testl %eax, %eax
je 0xaa780
jmp 0xaa726
movl -0x3c(%rbp), %eax
subl $0x1, %eax
je 0xaa741
jmp 0xaa730
movl -0x3c(%rbp), %eax
subl $0x2, %eax
je 0xaa7fa
jmp 0xaa872
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,8), %xmm0
movq -0x28(%rbp), %rax
ucomisd 0x8(%rax), %xmm0
jne 0xaa760
jp 0xaa760
jmp 0xaa773
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0xae6b0
jmp 0xaa77b
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0xaa872
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,8), %xmm0
movq -0x28(%rbp), %rax
ucomisd 0x10(%rax), %xmm0
jbe 0xaa7b6
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,8), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x10(%rax)
jmp 0xaa7f0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,8), %xmm1
movq -0x28(%rbp), %rax
movsd 0x18(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xaa7ee
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,8), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x18(%rax)
jmp 0xaa7f0
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0xaa872
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x28(%rbp), %rax
ucomisd 0x10(%rax), %xmm0
jbe 0xaa830
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x10(%rax)
jmp 0xaa86a
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x28(%rbp), %rax
movsd 0x18(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xaa868
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x18(%rax)
jmp 0xaa86a
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0xaa6e1
movq -0x20(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)