// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/savecode.c
// Function: generate_test_code_c45rules
void generate_test_code_c45rules(FILE* testcodefile, PROGRAMMING_LANGUAGE_TYPE language, Datasetptr d, Rulesetptr m)
{
 /*!Last Changed 15.06.2006*/
 char st[MAXLENGTH];
 Decisionruleptr rule;
 int i, classno = -1, rulecount = 0;
 code_function_header(testcodefile, "c45rules", d->featurecount, language);
 code_variable_start(testcodefile, language); 
 code_add_variable(testcodefile, language, INTEGER_VARIABLE, 1, "bestclass");
 code_add_variable(testcodefile, language, REAL_VARIABLE, 2, "bestestimate", "laplaceestimate");
 code_start(testcodefile, language);
 code_set_variable(testcodefile, language, "bestestimate", "1.5"); 
 rule = m->start;
 while (rule)
  {
   if (rule->classno != classno)
    {
     if (classno != -1)
      {
       for (i = 0; i < rulecount; i++)
         code_endif(testcodefile, language);
      }
     classno = rule->classno;     
     rulecount = 0;
    }
   code_rule(testcodefile, language, d, "c45rules", rule);
   sprintf(st, "(%d + 1.0) / (%d + %d + 2.0)", rule->falsepositives, rule->covered, rule->falsepositives);
   code_set_variable(testcodefile, language, "laplaceestimate", st);
   code_if(testcodefile, language, "<", "laplaceestimate", "bestestimate");
   code_set_variable(testcodefile, language, "bestestimate", "laplaceestimate");
   sprintf(st, "%d", rule->classno);
   code_set_variable(testcodefile, language, "bestclass", st);
   code_endif(testcodefile, language);
   if (rule->next && rule->next->classno == rule->classno)
     code_else(testcodefile, language);
   rulecount++;
   rule = rule->next;
  }
 for (i = 0; i < rulecount; i++)
   code_endif(testcodefile, language);
 code_if(testcodefile, language, "!=", "bestestimate", "1.5");
 code_function_return_string(testcodefile, "c45rules", language, "bestclass");   
 code_else(testcodefile, language);
 code_function_return_classification(testcodefile, "c45rules", language, m->defaultclass);
 code_endif(testcodefile, language);
 code_function_end(testcodefile, language);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf4268, %rsp          # imm = 0xF4268
movq %rcx, %r12
movl %esi, %ebx
movq %rdi, %r14
movq %rdx, 0x18(%rsp)
movl 0x1bc(%rdx), %edx
leaq 0x22a99(%rip), %rsi     # 0xa5f55
movl %ebx, %ecx
callq 0x7ce21
cmpl $0x2, %ebx
jne 0x83540
leaq 0x2ce31(%rip), %rdi     # 0xb0300
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
leaq 0x2d6cb(%rip), %r8      # 0xb0bb3
movq %r14, %rdi
movl $0x2, %esi
xorl %edx, %edx
movl $0x1, %ecx
xorl %eax, %eax
callq 0x7d617
leaq 0x2d6b8(%rip), %r8      # 0xb0bbd
leaq 0x229af(%rip), %r9      # 0xa5ebb
movq %r14, %rdi
movl $0x2, %esi
movl $0x1, %edx
movl $0x2, %ecx
xorl %eax, %eax
callq 0x7d617
leaq 0x2cbe4(%rip), %rdi     # 0xb0110
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
jmp 0x8357e
leaq 0x2d66c(%rip), %r8      # 0xb0bb3
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl $0x1, %ecx
xorl %eax, %eax
callq 0x7d617
leaq 0x2d65c(%rip), %r8      # 0xb0bbd
leaq 0x22953(%rip), %r9      # 0xa5ebb
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x2, %ecx
xorl %eax, %eax
callq 0x7d617
incl 0x32ec64(%rip)          # 0x3b21e8
leaq 0x2d632(%rip), %rdx     # 0xb0bbd
leaq 0x2d638(%rip), %rcx     # 0xb0bca
movq %r14, %rdi
movl %ebx, %esi
callq 0x7d316
movq (%r12), %rbp
testq %rbp, %rbp
je 0x83707
movq %r12, 0x10(%rsp)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %r12d, %r12d
movl (%rbp), %eax
cmpl %ecx, %eax
jne 0x835c6
movl %ecx, 0xc(%rsp)
movl %r12d, %r15d
jmp 0x835f2
cmpl $-0x1, %ecx
setne %cl
testl %r12d, %r12d
setg %dl
andb %cl, %dl
xorl %r15d, %r15d
cmpb $0x1, %dl
jne 0x835ee
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e23a
decl %r12d
jne 0x835dc
movl (%rbp), %eax
movl %eax, 0xc(%rsp)
movq %r14, %rdi
movl %ebx, %esi
movq 0x18(%rsp), %rdx
movq %rbp, %r8
callq 0x7fde8
movl 0x4(%rbp), %ecx
movl 0x8(%rbp), %edx
leaq 0x20(%rsp), %r12
movq %r12, %rdi
leaq 0x2d5b5(%rip), %rsi     # 0xb0bce
movl %edx, %r8d
xorl %eax, %eax
callq 0x41b0
movq %r14, %rdi
movl %ebx, %esi
leaq 0x2288c(%rip), %r13     # 0xa5ebb
movq %r13, %rdx
movq %r12, %rcx
callq 0x7d316
movl %ebx, %edi
leaq 0x258dd(%rip), %rsi     # 0xa8f20
movq %r13, %rdx
leaq 0x2d570(%rip), %rcx     # 0xb0bbd
leaq 0x7a140(%rsp), %r12
movq %r12, %r8
callq 0x7df46
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x7e093
movq %r14, %rdi
movl %ebx, %esi
leaq 0x2d547(%rip), %rdx     # 0xb0bbd
movq %r13, %rcx
callq 0x7d316
movl (%rbp), %edx
leaq 0x20(%rsp), %r12
movq %r12, %rdi
leaq 0x2d565(%rip), %rsi     # 0xb0bf5
xorl %eax, %eax
callq 0x41b0
movq %r14, %rdi
movl %ebx, %esi
leaq 0x2d510(%rip), %rdx     # 0xb0bb3
movq %r12, %rcx
callq 0x7d316
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e23a
movq 0x30(%rbp), %rax
testq %rax, %rax
je 0x836eb
movl (%rax), %ecx
cmpl (%rbp), %ecx
jne 0x836d3
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e1e3
movq 0x30(%rbp), %rax
incl %r15d
movq %rax, %rbp
movl %r15d, %r12d
testq %rax, %rax
movl 0xc(%rsp), %ecx
jne 0x835b6
jmp 0x836ee
incl %r15d
testl %r15d, %r15d
movq 0x10(%rsp), %r12
jle 0x83707
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e23a
decl %r15d
jne 0x836f8
leaq 0x2581d(%rip), %rsi     # 0xa8f2b
leaq 0x2d4a8(%rip), %rdx     # 0xb0bbd
leaq 0x2d4ae(%rip), %rcx     # 0xb0bca
leaq 0x7a140(%rsp), %r15
movl %ebx, %edi
movq %r15, %r8
callq 0x7df46
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7e093
leaq 0x22813(%rip), %r15     # 0xa5f55
leaq 0x2d46a(%rip), %rcx     # 0xb0bb3
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x7d912
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e1e3
movl 0x14(%r12), %ecx
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x7d813
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e23a
movq %r14, %rdi
movl %ebx, %esi
callq 0x7db1b
addq $0xf4268, %rsp          # imm = 0xF4268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq