// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/rise.c
// Function: update_nearest_rule
void update_nearest_rule(Model_riseptr m, Decisionruleptr* nearestrule, Instanceptr instances, int operation, Decisionruleptr rule)
{
 int i = 0;
 Instanceptr tmp;
 tmp = instances;
 while (tmp)
  {
   if (operation == 0 && nearestrule[i] == rule)
     nearestrule[i] = nearest_rule(m, tmp, YES);
   else
     if (operation == 1 && rule->falsepositives + rule->covered > 1)
      {
       if (!nearestrule[i])
         nearestrule[i] = rule;
       else
        {
         if (distance_to_rule(m, tmp, rule) < distance_to_rule(m, tmp, nearestrule[i]))
           nearestrule[i] = rule;
         else 
           if (distance_to_rule(m, tmp, rule) == distance_to_rule(m, tmp, nearestrule[i]))
            {
             if (laplace_estimate_of_rule_kclass(*rule) < laplace_estimate_of_rule_kclass(*(nearestrule[i])))
               nearestrule[i] = rule;
             else
               if (laplace_estimate_of_rule_kclass(*rule) == laplace_estimate_of_rule_kclass(*(nearestrule[i])))
                {
                 if (m->counts[rule->classno] > m->counts[nearestrule[i]->classno])
                   nearestrule[i] = rule;
                }
            }
        }
      }
   i++;
   tmp = tmp->next;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0xab4f9
cmpl $0x0, -0x1c(%rbp)
jne 0xab2c6
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x28(%rbp), %rax
jne 0xab2c6
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl $0x1, %edx
callq 0xaaca0
movq %rax, %rdx
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0xab4df
cmpl $0x1, -0x1c(%rbp)
jne 0xab4dd
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x28(%rbp), %rcx
addl 0x4(%rcx), %eax
cmpl $0x1, %eax
jle 0xab4dd
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0xab30b
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0xab4db
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0xaa970
movsd %xmm0, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0xaa970
movsd -0x40(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0xab35a
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0xab4d9
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0xaa970
movsd %xmm0, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0xaa970
movaps %xmm0, %xmm1
movsd -0x48(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jne 0xab4d7
jp 0xab4d7
movq -0x28(%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 0xaee70
movsd %xmm0, -0x50(%rbp)
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %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 0xaee70
movsd -0x50(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0xab422
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0xab4d5
movq -0x28(%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 0xaee70
movsd %xmm0, -0x58(%rbp)
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %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 0xaee70
movaps %xmm0, %xmm1
movsd -0x58(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jne 0xab4d3
jp 0xab4d3
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x28(%rbp), %rcx
movslq (%rcx), %rcx
movl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movq 0x30(%rcx), %rcx
movq -0x10(%rbp), %rdx
movslq -0x2c(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
movslq (%rdx), %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0xab4d1
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0xab4d3
jmp 0xab4d5
jmp 0xab4d7
jmp 0xab4d9
jmp 0xab4db
jmp 0xab4dd
jmp 0xab4df
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0xab27d
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)