LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/multivariaterule.c
// Function: validation_error_after_pruning
int validation_error_after_pruning(Ruleset r, Instanceptr cvdata, int positive)
{
 /*!Last Changed 02.02.2004 added safecalloc*/
 /*!Last Changed 14.01.2004*/
 int result, *deleted, rulecount, tmp, i;
 Decisionruleptr rule;
 deleted = safecalloc(r.rulecount, sizeof(int), "validation_error_after_pruning", 3);
 result = error_of_ruleset_with_deleted_rules(r, cvdata, deleted);
 rule = r.start;
 rulecount = 0;
 while (rule && rule->classno != positive)
  {
   rule = rule->next;
   rulecount++;
  }
 for (i = r.rulecount - 1; i >= rulecount; i--)
  {
   deleted[i] = 1;
   tmp = error_of_ruleset_with_deleted_rules(r, cvdata, deleted);
   if (tmp > result)
     deleted[i] = 0;
   else
     result = tmp;
  }
 safe_free(deleted);
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %r12d
movq %rdi, %rbx
movslq 0x80(%rsp), %r14
leaq 0x5ea1e(%rip), %rdx     # 0xaa6fb
movl $0x4, %esi
movq %r14, %rdi
movl $0x3, %ecx
callq 0x3a1fc
movq %rax, %r15
movq 0x90(%rsp), %rax
movq %rax, 0x20(%rsp)
movaps 0x70(%rsp), %xmm0
movaps 0x80(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, 0x30(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4bbdc
movl %eax, %ebp
movq 0x70(%rsp), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x4bd40
cmpl %r12d, (%rcx)
je 0x4bd40
incl %eax
movq 0x30(%rcx), %rcx
jmp 0x4bd2e
cmpl %eax, %r14d
jle 0x4bd9f
leaq 0x70(%rsp), %r13
movslq %eax, %rbx
movl $0x1, -0x4(%r15,%r14,4)
movq 0x20(%r13), %rax
movq %rax, 0x20(%rsp)
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0x4bbdc
movl %eax, %r12d
cmpl %ebp, %eax
jle 0x4bd92
movl $0x0, -0x4(%r15,%r14,4)
movl %ebp, %r12d
decq %r14
movl %r12d, %ebp
cmpq %rbx, %r14
jg 0x4bd4d
jmp 0x4bda2
movl %ebp, %r12d
movq %r15, %rdi
callq 0x3a180
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/multivariaterule.c
// Function: growrule_multivariate
Decisionruleptr growrule_multivariate(Instanceptr* growset, int positive, Ripper_parameterptr param)
{
 /*!Last Changed 21.01.2004*/
 /*!Last Changed 29.12.2003*/
 /*!Last Changed 02.12.2003*/
 /*!Last Changed 10.05.2003*/
 Decisionruleptr result;
 Decisionconditionptr newcondition = NULL;
 Instanceptr obey, notobey = NULL;
 int n, pnew, nnew;
 result = empty_rule(positive);
 obey = (*growset);
 if (rule_cover_negative(obey, *result))
   n = 1;
 else
   n = 0;
 while (n > 0)
  {
   newcondition = find_best_multivariate_condition(&obey, positive, MULTIVARIATE_LINEAR, param);
   if (newcondition && newcondition->featureindex != -1)
    {
     count_examples_for_condition(newcondition, &pnew, &nnew, positive, obey);
     if (result->decisioncount == 0 || nnew != n)
       n = nnew;
     else
      {
       free_condition(*newcondition);
       safe_free(newcondition);
       break;
      }
     send_exceptions(newcondition, &obey, &notobey);
     add_condition(result, newcondition);
    }
   else
    {
     if (newcondition && newcondition->featureindex == -1)
      {
       free_condition(*newcondition);
       safe_free(newcondition);
      }
     break;
    }
  }
 if (notobey)
  {
   merge_instancelist(&notobey, obey);
   (*growset) = notobey;
  }
 else
   (*growset) = obey;
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, 0x98(%rsp)
movl %esi, %ebp
movq %rdi, %rbx
movq $0x0, 0x80(%rsp)
movl %esi, %edi
callq 0x7bfd8
movq %rax, %r14
movq %rbx, 0x90(%rsp)
movq (%rbx), %rdi
movq %rdi, 0x78(%rsp)
movq 0x30(%rax), %rax
movq %rax, 0x30(%rsp)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x7c604
testl %eax, %eax
je 0x4c4da
movl $0x1, %r15d
leaq 0x78(%rsp), %r12
movq %r12, %rdi
movl %ebp, %esi
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movq 0x98(%rsp), %rcx
callq 0x4ca77
testq %rax, %rax
je 0x4c4da
movq %rax, %r13
cmpl $-0x1, (%rax)
je 0x4c4bf
movq 0x78(%rsp), %r8
movq %r13, %rdi
leaq 0xa4(%rsp), %rsi
leaq 0x8c(%rsp), %rdx
movl %ebp, %ecx
callq 0x7b141
cmpl $0x0, 0x28(%r14)
setne %al
movl 0x8c(%rsp), %ebx
cmpl %r15d, %ebx
sete %cl
testb %cl, %al
jne 0x4c4bf
movq %r13, %rdi
movq %r12, %rsi
leaq 0x80(%rsp), %rdx
callq 0x9f29e
movq %r14, %rdi
movq %r13, %rsi
callq 0x7c040
movl %ebx, %r15d
testl %ebx, %ebx
jg 0x4c434
jmp 0x4c4da
movl $0xe, %ecx
movq %rsp, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x7c1f4
movq %r13, %rdi
callq 0x3a180
cmpq $0x0, 0x80(%rsp)
je 0x4c4fc
movq 0x78(%rsp), %rsi
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
callq 0x30648
jmp 0x4c501
leaq 0x78(%rsp), %rbx
movq (%rbx), %rax
movq 0x90(%rsp), %rcx
movq %rax, (%rcx)
movq %r14, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/multivariaterule.c
// Function: grow_revision_rule_multivariate
Decisionruleptr grow_revision_rule_multivariate(Instanceptr* growset, Decisionruleptr rule, int positive, Ripper_parameterptr param)
{
 /* Last Changed 21.01.2004*/
 /* Last Changed 14.01.2004*/
 /* Last Changed 20.05.2003*/
 Decisionruleptr newrule = create_copy_of_rule(rule);
 Decisionconditionptr newcondition;
 Instanceptr obey, notobey = NULL;
 int n, pnew, nnew;
 obey = (*growset);
 if (rule_cover_negative(obey, *newrule))
   n = 1;
 else
   n = 0;
 while (n > 0)
  {
   newcondition = find_best_multivariate_condition(&obey, positive, MULTIVARIATE_LINEAR, param);
   if (newcondition && newcondition->featureindex != -1)
    {
     count_examples_for_condition(newcondition, &pnew, &nnew, positive, obey);
     if (notobey == NULL || nnew != n)
       n = nnew;
     else
      {
       free_condition(*newcondition);
       safe_free(newcondition);       
       break;
      }
     send_exceptions(newcondition, &obey, &notobey);
     add_condition(newrule, newcondition);
    }
   else
    {
     if (newcondition && newcondition->featureindex == -1)
      {
       free_condition(*newcondition);
       safe_free(newcondition);
      }
     break;
    }
  }
 if (notobey)
  {
   merge_instancelist(&notobey, obey);
   (*growset) = notobey;
  }
 return newrule;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rcx, 0x98(%rsp)
movl %edx, %ebp
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x7be1e
movq %rax, %r14
movq $0x0, 0x78(%rsp)
movq %rbx, 0x90(%rsp)
movq (%rbx), %rdi
movq %rdi, 0x80(%rsp)
movq 0x30(%rax), %rax
movq %rax, 0x30(%rsp)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x7c604
testl %eax, %eax
je 0x4c650
movl $0x1, %r15d
leaq 0x80(%rsp), %r12
movq %r12, %rdi
movl %ebp, %esi
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movq 0x98(%rsp), %rcx
callq 0x4ca77
testq %rax, %rax
je 0x4c650
movq %rax, %r13
cmpl $-0x1, (%rax)
je 0x4c635
movq 0x80(%rsp), %r8
movq %r13, %rdi
leaq 0xa4(%rsp), %rsi
leaq 0x8c(%rsp), %rdx
movl %ebp, %ecx
callq 0x7b141
cmpq $0x0, 0x78(%rsp)
setne %al
movl 0x8c(%rsp), %ebx
cmpl %r15d, %ebx
sete %cl
testb %cl, %al
jne 0x4c635
movq %r13, %rdi
movq %r12, %rsi
leaq 0x78(%rsp), %rdx
callq 0x9f29e
movq %r14, %rdi
movq %r13, %rsi
callq 0x7c040
movl %ebx, %r15d
testl %ebx, %ebx
jg 0x4c5a9
jmp 0x4c650
movl $0xe, %ecx
movq %rsp, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x7c1f4
movq %r13, %rdi
callq 0x3a180
cmpq $0x0, 0x78(%rsp)
je 0x4c67b
movq 0x80(%rsp), %rsi
leaq 0x78(%rsp), %rbx
movq %rbx, %rdi
callq 0x30648
movq (%rbx), %rax
movq 0x90(%rsp), %rcx
movq %rax, (%rcx)
movq %r14, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/multivariaterule.c
// Function: simplify_ruleset_multivariate
void simplify_ruleset_multivariate(Ruleset* r, int positive, Instanceptr cvdata)
{
 /*!Last Changed 14.01.2004*/
 Decisionruleptr firstrule, deleted, tmprule, deletedbefore;
 int minerror = error_of_ruleset(*r, cvdata), error;
 firstrule = r->start;
 while (firstrule && firstrule->classno != positive)
   firstrule = firstrule->next;
 if (!firstrule)
   return;
 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_rule_after(r, deletedbefore, deleted);
   error = error_of_ruleset(*r, cvdata);
   if (error > minerror)
     add_rule_after(r, deletedbefore, deleted);
   else
    {
     free_rule(*deleted);
     safe_free(deleted);
     minerror = error;
    }
   deleted = deletedbefore;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %r15d
movq %rdi, %r14
movq 0x20(%rdi), %rax
movq %rax, 0x20(%rsp)
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rdx, 0x40(%rsp)
movq %rdx, %rdi
callq 0x7b93f
movq (%r14), %rbx
testq %rbx, %rbx
je 0x4c7a6
movl %eax, %ebp
cmpl %r15d, (%rbx)
je 0x4c6eb
movq 0x30(%rbx), %rbx
testq %rbx, %rbx
jne 0x4c6d8
jmp 0x4c7a6
movq 0x8(%r14), %r15
testq %r15, %r15
je 0x4c7a6
cmpq %rbx, 0x30(%r15)
je 0x4c7a6
movq (%r14), %rax
cmpq %r15, %rax
je 0x4c718
movq %rax, %r12
movq 0x30(%rax), %rax
cmpq %r15, %rax
jne 0x4c70a
jmp 0x4c71b
xorl %r12d, %r12d
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x7c89d
movq 0x20(%r14), %rax
movq %rax, 0x20(%rsp)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq 0x40(%rsp), %rdi
callq 0x7b93f
cmpl %ebp, %eax
jle 0x4c762
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x7c86e
jmp 0x4c79a
movl %eax, %r13d
movq 0x30(%r15), %rax
movq %rax, 0x30(%rsp)
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x7c251
movq %r15, %rdi
callq 0x3a180
movl %r13d, %ebp
movq %r12, %r15
testq %r12, %r12
jne 0x4c6f8
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/multivariaterule.c
// Function: count_multivariate_condition_over_threshold
int count_multivariate_condition_over_threshold(Instanceptr list, Decisionconditionptr condition)
{
 /*!Last Changed 09.01.2004*/
 int result = 0;
 Instanceptr tmp = list;
 while (tmp)
  {
   if (multiply_with_matrix(tmp, condition->w) > condition->w0)
     result++;
   tmp = tmp->next;
  }
 return result;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x4c7ed
movq %rsi, %rbx
movq %rdi, %r14
xorl %ebp, %ebp
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0x2efa4
xorl %eax, %eax
ucomisd 0x30(%rbx), %xmm0
seta %al
addl %eax, %ebp
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0x4c7c6
jmp 0x4c7ef
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/multivariaterule.c
// Function: find_best_multivariate_condition_svm
Decisionconditionptr find_best_multivariate_condition_svm(Instanceptr* growset, int positive)
{
 /*!Last Changed 18.02.2008*/
 Decisionconditionptr result;
 int i;
 Partition p;
 Svm_split split;
 result = empty_condition();
 result->conditiontype = MULTIVARIATE_CONDITION;
 result->featureindex = LINEAR;
 result->freeparam = current_dataset->multifeaturecount - 1;
 result->comparison = '>';
 result->w = matrix_alloc(1, current_dataset->multifeaturecount - 1);
 p = get_two_class_partition_for_one_vs_all(current_dataset, positive);
	split = find_best_svm_split_for_partition(*growset, p);
	result->w0 = split.rho;
	for (i = 0; i < current_dataset->multifeaturecount - 1; i++)
 		result->w.values[0][i] = split.weights[i];
	free_svm_split(split);
 free_partition(p);
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movl %esi, %ebp
movq %rdi, %r14
xorl %eax, %eax
callq 0x7c366
movq %rax, %rbx
movl $0x1, 0x40(%rax)
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
leaq 0x89048(%rip), %r12     # 0xd5870
movq (%r12), %rax
movl 0x1c0(%rax), %esi
decl %esi
movl %esi, 0x3c(%rbx)
movb $0x3e, 0x4(%rbx)
movl $0x1, %edi
callq 0x3d79d
movq %rax, 0x20(%rbx)
movq %rdx, 0x28(%rbx)
movq (%r12), %rsi
leaq 0x90(%rsp), %r15
movq %r15, %rdi
movl %ebp, %edx
callq 0x557f8
movq (%r14), %rsi
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
leaq 0xa8(%rsp), %r14
movq %r14, %rdi
callq 0x975e2
movsd 0x70(%r14), %xmm0
movsd %xmm0, 0x30(%rbx)
movq (%r12), %rax
movl 0x1c0(%rax), %eax
cmpl $0x2, %eax
jl 0x4c8c6
decl %eax
movq 0x120(%rsp), %rcx
movq 0x28(%rbx), %rdx
movq (%rdx), %rdx
xorl %esi, %esi
movsd (%rcx,%rsi,8), %xmm0
movsd %xmm0, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x4c8b4
leaq 0xa8(%rsp), %rsi
movl $0x11, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
callq 0x90540
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x90(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x55a69
movq %rbx, %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/multivariaterule.c
// Function: find_best_multivariate_condition_lp
Decisionconditionptr find_best_multivariate_condition_lp(Instanceptr* growset, int positive)
{
 /*!Last Changed 17.11.2005 added result->freeparam*/
 /*!Last Changed 26.06.2005*/
 /*!Last Changed 28.05.2004*/
 Mlpparameters mlpparams;
 Mlpnetwork neuralnetwork;
 matrix train;
 Decisionconditionptr result;
 int i;
 result = empty_condition();
 result->conditiontype = MULTIVARIATE_CONDITION;
 result->featureindex = LINEAR;
 result->freeparam = current_dataset->multifeaturecount - 1;
 mlpparams = prepare_Mlpparameters(*growset, *growset, 0, 0.0, 0, NULL, 0, 0.0, 0.0, 0, CLASSIFICATION);
 train = instancelist_to_matrix(*growset, 2, positive, MULTIVARIATE_LINEAR);
 neuralnetwork = mlpn_general(train, train, &mlpparams, CLASSIFICATION);
 result->comparison = '>';
 result->w0 = neuralnetwork.weights->values[1][0] - neuralnetwork.weights->values[0][0];
 result->w = matrix_alloc(1, current_dataset->multifeaturecount - 1);
 for (i = 0; i < current_dataset->multifeaturecount - 1; i++)
   result->w.values[0][i] = neuralnetwork.weights->values[0][i + 1] - neuralnetwork.weights->values[1][i + 1];
 free_mlpnnetwork(&neuralnetwork);
 matrix_free(train);
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movl %esi, %ebp
movq %rdi, %r14
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x7c366
movq %rax, %rbx
movl $0x1, 0x40(%rax)
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
leaq 0x88f2a(%rip), %rax     # 0xd5870
movq (%rax), %rax
movl 0x1c0(%rax), %eax
decl %eax
movl %eax, 0x3c(%rbx)
movq (%r14), %rdx
subq $0x8, %rsp
leaq 0x8(%rsp), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %rdx, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %r12
pushq %r12
pushq %r12
callq 0x445fb
addq $0x20, %rsp
movq (%r14), %rdi
movl $0x2, %esi
movl %ebp, %edx
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
callq 0x3008b
movq %rax, %r14
movq %rdx, %r15
subq $0x8, %rsp
leaq 0x98(%rsp), %r13
movq %r13, %rdi
movq %rax, %rsi
movq %rax, %rcx
movq %rdx, %r8
leaq 0x8(%rsp), %r9
pushq %r12
callq 0x43e30
addq $0x10, %rsp
movb $0x3e, 0x4(%rbx)
movq (%r13), %r12
movq 0x8(%r12), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movsd (%rax), %xmm0
subsd (%rcx), %xmm0
movsd %xmm0, 0x30(%rbx)
leaq 0x88e83(%rip), %r13     # 0xd5870
movq (%r13), %rax
movl 0x1c0(%rax), %esi
decl %esi
movl $0x1, %edi
callq 0x3d79d
movq %rax, 0x20(%rbx)
movq %rdx, 0x28(%rbx)
movq (%r13), %rax
movl 0x1c0(%rax), %eax
cmpl $0x2, %eax
jl 0x4ca4a
decl %eax
movq 0x8(%r12), %rsi
movq (%rsi), %rcx
movq 0x8(%rsi), %rsi
movq (%rdx), %rdx
xorl %edi, %edi
movsd 0x8(%rcx,%rdi,8), %xmm0
subsd 0x8(%rsi,%rdi,8), %xmm0
movsd %xmm0, (%rdx,%rdi,8)
leaq 0x1(%rdi), %r8
movq %r8, %rdi
cmpq %r8, %rax
jne 0x4ca2d
leaq 0x90(%rsp), %rdi
callq 0x45646
movq %r14, %rdi
movq %r15, %rsi
callq 0x3ed51
movq %rbx, %rax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/multivariaterule.c
// Function: multivariate_rule_learner
Ruleset multivariate_rule_learner(Instanceptr* instances, Instanceptr cvdata, Ripper_parameterptr param)
{
 /*!Last Changed 09.01.2004*/
 Ruleset result;
 int classno, *counts, *classes, posclass, classcount, i, maxcount;
 Instanceptr removed, totalremoved = NULL;
 empty_ruleset(&result);
 classno = all_in_one_class(*instances, &maxcount);
 if (!(classno % 10))
   return result;
 counts = find_class_counts(*instances);
 classes = find_max_occured(counts, current_dataset->classno, &classcount);
 safe_free(counts);
 result.defaultclass = classes[0];
 for (i = classcount - 1; i > 0; i--)
  {
   posclass = classes[i];
   removed = learn_multivariate_rules_for_positive_class(instances, &result, posclass, cvdata, param);
   merge_instancelist(&totalremoved, removed);
  }
 safe_free(classes);
 merge_instancelist(instances, totalremoved);
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movq $0x0, 0x8(%rsp)
callq 0x7c32b
movq (%r14), %rdi
leaq 0x14(%rsp), %rsi
callq 0x115f8
imull $0xcccccccd, %eax, %eax # imm = 0xCCCCCCCD
addl $0x19999998, %eax       # imm = 0x19999998
rorl %eax
cmpl $0x19999999, %eax       # imm = 0x19999999
jb 0x4cf51
movq (%r14), %rdi
callq 0x115a6
movq %rax, %rbp
leaq 0x8899c(%rip), %rax     # 0xd5870
movq (%rax), %rax
movl 0x10(%rax), %esi
leaq 0x4(%rsp), %rdx
movq %rbp, %rdi
callq 0x38089
movq %rax, %r13
movq %rbp, %rdi
callq 0x3a180
movl (%r13), %eax
movl %eax, 0x14(%rbx)
movq %r12, %rbp
movq %r15, %r12
leaq 0x4(%rsp), %rax
movslq (%rax), %r15
cmpq $0x2, %r15
jl 0x4cf3c
incq %r15
movl -0x8(%r13,%r15,4), %edx
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rcx
movq %r12, %r8
callq 0x4cc79
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x30648
decq %r15
cmpq $0x2, %r15
ja 0x4cf10
movq %r13, %rdi
callq 0x3a180
movq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x30648
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/multivariatetree.c
// Function: decisiontree_multivariate_linear_node_count
int decisiontree_multivariate_linear_node_count(Decisionnodeptr node)
{
 /*!Last Changed 24.11.2004*/
 if (node->featureno == LEAF_NODE)
   return 0;
 else
   if (node->featureno == LINEAR)
     return 1 + decisiontree_multivariate_linear_node_count(node->left) + decisiontree_multivariate_linear_node_count(node->right);
   else
     return decisiontree_multivariate_linear_node_count(node->left) + decisiontree_multivariate_linear_node_count(node->right);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %ebp, %ebp
xorl %r14d, %r14d
movl 0x30(%rbx), %eax
cmpl $-0x2, %eax
jne 0x4cf8c
movq (%rbx), %rdi
callq 0x4cf64
movq 0x8(%rbx), %rbx
addl %eax, %r14d
incl %r14d
jmp 0x4cf70
cmpl $-0x1, %eax
je 0x4cfa8
movq (%rbx), %rdi
callq 0x4cf64
movq 0x8(%rbx), %rbx
addl %ebp, %r14d
addl %eax, %r14d
movl %r14d, %ebp
jmp 0x4cf6d
addl %ebp, %r14d
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/multivariatetree.c
// Function: decisiontree_multivariate_quadratic_node_count
int decisiontree_multivariate_quadratic_node_count(Decisionnodeptr node)
{
 /*!Last Changed 29.01.2005*/
 if (node->featureno == LEAF_NODE)
   return 0;
 else
   if (node->featureno == QUADRATIC)
     return 1 + decisiontree_multivariate_quadratic_node_count(node->left) + decisiontree_multivariate_quadratic_node_count(node->right);
   else
     return decisiontree_multivariate_quadratic_node_count(node->left) + decisiontree_multivariate_quadratic_node_count(node->right);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %ebp, %ebp
xorl %r14d, %r14d
movl 0x30(%rbx), %eax
cmpl $-0x3, %eax
jne 0x4cfdb
movq (%rbx), %rdi
callq 0x4cfb3
movq 0x8(%rbx), %rbx
addl %eax, %r14d
incl %r14d
jmp 0x4cfbf
cmpl $-0x1, %eax
je 0x4cff7
movq (%rbx), %rdi
callq 0x4cfb3
movq 0x8(%rbx), %rbx
addl %ebp, %r14d
addl %eax, %r14d
movl %r14d, %ebp
jmp 0x4cfbc
addl %ebp, %r14d
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/multivariatetree.c
// Function: test_multivariate
int test_multivariate(Instanceptr testingdata, matrix w, double w0, int leftclass, int rightclass)
{
 /*!Last Changed 23.09.2004*/
 int i, error = 0;
 double value;
 Instanceptr test = testingdata;
 while (test)
  {
   value = multiply_with_matrix(test, w);
   i = give_classno(test);
   if (value <= w0)
    {
     if (i != leftclass)
       error++;
    }
   else
    {
     if (i != rightclass)
       error++;
    }
   test = test->next;
  }
 return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0x4d0b6
movl %r8d, %ebx
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
xorl %r12d, %r12d
movsd %xmm0, 0x8(%rsp)
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2efa4
movsd %xmm0, 0x10(%rsp)
movq %r13, %rdi
callq 0x2f33a
movsd 0x8(%rsp), %xmm0
ucomisd 0x10(%rsp), %xmm0
movl %ebp, %ecx
cmovbl %ebx, %ecx
xorl %edx, %edx
cmpl %ecx, %eax
setne %dl
addl %edx, %r12d
movq 0x10(%r13), %r13
testq %r13, %r13
jne 0x4d074
jmp 0x4d0b9
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/multivariatetree.c
// Function: find_counts_for_multivariate_split
void find_counts_for_multivariate_split(Instanceptr instances, matrix w, double w0, int* leftcounts, int* rightcounts)
{
 /*!Last Changed 22.09.2004*/
 int j;
 double value;
 Instanceptr tmp = instances;
 for (j = 0; j < MAXCLASSES; j++)
  {
   leftcounts[j] = 0;
   rightcounts[j] = 0;
  }
 while (tmp)
  {
   value = multiply_with_matrix(tmp, w);
   j = give_classno(tmp);
   if (value <= w0)
     leftcounts[j]++;
   else
     rightcounts[j]++;
   tmp = tmp->next;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
xorl %eax, %eax
xorl %ecx, %ecx
movl %eax, (%r14,%rcx,4)
movl %eax, (%rbx,%rcx,4)
incq %rcx
cmpq $0x32, %rcx
jne 0x4de2c
testq %r13, %r13
je 0x4de82
movsd %xmm0, (%rsp)
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x2efa4
movsd %xmm0, 0x8(%rsp)
movq %r13, %rdi
callq 0x2f33a
movsd (%rsp), %xmm0
ucomisd 0x8(%rsp), %xmm0
movq %r14, %rcx
cmovbq %rbx, %rcx
cltq
incl (%rcx,%rax,4)
movq 0x10(%r13), %r13
testq %r13, %r13
jne 0x4de46
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/multivariatetree.c
// Function: find_gain_for_partition_multivariate
double find_gain_for_partition_multivariate(Instanceptr* instances, Partition p, matrix* w, double* w0, MULTIVARIATE_TYPE multivariate_type, int* newdim, double variance_explained)
{
 /*!Last Changed 21.09.2004*/
 if (p.count == 0 || instances == NULL || all_same_side(p))
  {
   *w = identity(1);
   return ISELL;
  }
 if (!find_split_for_partition_multivariate(instances, p, w, w0, multivariate_type, newdim, variance_explained))
   return ISELL;
 return information_gain_for_multivariate_split(*instances, *w, *w0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rsi, %rbx
testq %rdi, %rdi
je 0x4dfb6
cmpl $0x0, 0x200(%rsp)
je 0x4dfb6
movq %r8, %r12
movl %ecx, %ebp
movq %rdx, %r14
movq %rdi, %r15
leaq 0x1f0(%rsp), %r13
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm1
movups %xmm1, (%rsp)
movsd %xmm0, 0x18(%rsp)
callq 0x558e2
movsd 0x18(%rsp), %xmm0
testl %eax, %eax
je 0x4dfe1
movl $0x1, %edi
callq 0x3eddb
movq %rax, (%rbx)
movq %rdx, 0x8(%rbx)
movsd 0x57d21(%rip), %xmm0    # 0xa5cf0
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm1
movups %xmm1, (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl %ebp, %ecx
movq %r12, %r8
callq 0x4debc
testl %eax, %eax
je 0x4dfc7
movq (%r15), %rdi
movsd (%r14), %xmm0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
leaq 0xe8(%rsp), %r8
leaq 0x20(%rsp), %rbx
movq %rbx, %rcx
callq 0x4de0c
movq %rbx, %rdi
callq 0x1df2d
jmp 0x4dfcf
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/multivariatetree.c
// Function: log_likelihood_for_multi_ldt_splits
double log_likelihood_for_multi_ldt_splits(Instanceptr data, matrix w, double w0)
{
 int counts[2][MAXCLASSES];
 double result = 0;
 find_counts_for_multivariate_split(data, w, w0, counts[0], counts[1]);
 result += log_likelihood_for_classification(counts[0]);
 result += log_likelihood_for_classification(counts[1]);
 return result;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
leaq 0xd8(%rsp), %rbx
leaq 0x10(%rsp), %r14
movq %r14, %rcx
movq %rbx, %r8
callq 0x4de0c
movq %r14, %rdi
callq 0x1de84
xorpd %xmm1, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x1de84
addsd 0x8(%rsp), %xmm0
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/multivariatetree.c
// Function: create_multildtchildren
int create_multildtchildren(Decisionnodeptr node, Multildt_parameterptr param)
{
 /*!Last Changed 21.09.2004*/
 node->conditiontype = MULTIVARIATE_CONDITION;
 if (!(can_be_divided(node, &(param->c45param))))
   return 1;
 node->lineard = find_best_multi_ldt_split(&(node->instances),&(node->w),&(node->w0), MULTIVARIATE_LINEAR, param->variance_explained);
 if (!(node->lineard))
  {
   matrix_free(node->w);
   make_leaf_node(node);
   return 1;
  }
 node->featureno = LINEAR; 
 if (!(make_multivariate_children(node)))
   return 1;
 create_multildtchildren(node->left, param);
 create_multildtchildren(node->right, param);
 return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x1, 0x98(%rdi)
callq 0x1d053
testl %eax, %eax
je 0x4e457
leaq 0x20(%rbx), %rdi
leaq 0x38(%rbx), %rsi
leaq 0x48(%rbx), %rdx
movsd 0x20(%r14), %xmm0
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
callq 0x4e089
movl %eax, 0x90(%rbx)
testl %eax, %eax
je 0x4e442
movl $0xfffffffe, 0x30(%rbx) # imm = 0xFFFFFFFE
movq %rbx, %rdi
callq 0x4db5c
testl %eax, %eax
je 0x4e457
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x4e3cb
movq 0x8(%rbx), %rbx
movl $0x1, 0x98(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x4e3df
movq 0x38(%rbx), %rdi
movq 0x40(%rbx), %rsi
callq 0x3ed51
movq %rbx, %rdi
callq 0x1cab0
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/network.c
// Function: table_list
int* table_list(struct node mynode, int pos)
{
	/*!Last Changed 02.02.2004 added safemalloc*/
 int i, *result;
	result = (int *) safemalloc(mynode.parents * sizeof(int), "table_list", 2);
 for (i = mynode.parents - 1; i > -1; i--)
  {
   result[i] = pos % (mynode.parent_counts[i]);
   pos = pos / (mynode.parent_counts[i]);
  }
 return result;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movslq 0x40(%rsp), %r14
leaq (,%r14,4), %rdi
leaq 0x5c260(%rip), %rsi     # 0xaa72c
movl $0x2, %edx
callq 0x3a0e1
movq %rax, %rcx
testq %r14, %r14
jle 0x4e50a
leaq 0x20(%rsp), %rax
movq 0x18(%rax), %rsi
incq %r14
movl %ebx, %eax
cltd
idivl -0x8(%rsi,%r14,4)
movl %edx, -0x8(%rcx,%r14,4)
movl %ebx, %eax
cltd
idivl -0x8(%rsi,%r14,4)
decq %r14
movl %eax, %ebx
cmpq $0x1, %r14
ja 0x4e4ea
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/network.c
// Function: table_pos
int table_pos(struct node mynode, int *list)
{
 int i, table_index = 0;
 for (i = 0; i < mynode.parents; i++)
   if (i != 0)
     table_index = list[i] + table_index * mynode.parent_counts[i];
   else
     table_index = list[0];
 return table_index;
}

// Assembly:
movslq 0x28(%rsp), %rcx
testq %rcx, %rcx
jle 0x4e545
leaq 0x8(%rsp), %rax
movq 0x18(%rax), %rdx
xorl %esi, %esi
xorl %eax, %eax
testq %rsi, %rsi
je 0x4e53a
imull (%rdx,%rsi,4), %eax
addl (%rdi,%rsi,4), %eax
jmp 0x4e53c
movl (%rdi), %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x4e52c
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/network.c
// Function: find_parents
int* find_parents(bayesiangraphptr mygraph, int node)
{
 /*!Last changed 15.01.2001*/
 int i = 0, where, *result = NULL;
 where = mygraph->nodes[node].pointer;
 while (where != -1)
  {
   i++;
   result = alloc(result, i * sizeof(int), i);
   result[i - 1] = mygraph->dest[where];
   where = mygraph->arcs[where].pointer;
  }
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
movslq %esi, %rcx
leaq (%rcx,%rcx,8), %rcx
movl 0x30(%rax,%rcx,8), %r15d
cmpl $-0x1, %r15d
je 0x4e5a7
movq %rdi, %rbx
movl $0x4, %r14d
movl $0x1, %ebp
xorl %eax, %eax
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x3a0b4
movq 0x28(%rbx), %rcx
movslq %r15d, %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0x4(%rax,%r14)
movq 0x18(%rbx), %rcx
movl (%rcx,%rdx,4), %r15d
addq $0x4, %r14
incl %ebp
cmpl $-0x1, %r15d
jne 0x4e575
jmp 0x4e5a9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/network.c
// Function: parent_index
int parent_index(bayesiangraphptr mygraph, int node, int pindex)
{
 int i = 0, where;
 where = mygraph->nodes[node].pointer;
 while (i < pindex)
  {
   i++;
   where = mygraph->arcs[where].pointer;
  }
 return mygraph->dest[where];
}

// Assembly:
movq 0x8(%rdi), %rax
movslq %esi, %rcx
leaq (%rcx,%rcx,8), %rcx
movl 0x30(%rax,%rcx,8), %eax
testl %edx, %edx
jle 0x4e5d4
movq 0x18(%rdi), %rcx
cltq
movl (%rcx,%rax,4), %eax
decl %edx
jne 0x4e5cb
movq 0x28(%rdi), %rcx
cltq
movl (%rcx,%rax,4), %eax
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/network.c
// Function: add_one_node
nodeptr add_one_node(bayesiangraphptr mygraph, char *st)
{
/*!Last Changed 15.01.2001*/
 nodeptr current;
 mygraph->nodecount++;
 mygraph->nodes = alloc(mygraph->nodes, mygraph->nodecount * sizeof(struct node), mygraph->nodecount);
 current = &(mygraph->nodes[mygraph->nodecount - 1]);
 current->value_count = 0;
 current->parents = 0;
 current->table_count = 1;
 current->pointer = -1;
 current->name = strcopy(current->name, st);
 return current;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x10(%rdi), %rax
leaq 0x1(%rax), %rdx
movl %edx, 0x10(%rdi)
movq 0x8(%rdi), %rdi
leaq 0x8(,%rax,8), %rax
leaq (%rax,%rax,8), %rsi
callq 0x3a0b4
movq %rax, 0x8(%r14)
movslq 0x10(%r14), %rcx
leaq (%rcx,%rcx,8), %rcx
leaq (%rax,%rcx,8), %r14
addq $-0x48, %r14
xorl %eax, %eax
movl %eax, 0x10(%r14)
movl %eax, 0x20(%r14)
movq $0x1, 0x28(%r14)
movl $0xffffffff, 0x30(%r14) # imm = 0xFFFFFFFF
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3b494
movq %rax, (%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/network.c
// Function: find_arc_with_no
int find_arc_with_no(bayesiangraphptr mygraph, int arc_no, int *from, int *to, int *from_order, int *before)
{
/*!Last Changed 25.02.2001*/
 int i, pos1;
 for (i = 0; i < mygraph->nodecount; i++)
  {
   pos1 = mygraph->nodes[i].pointer;
   if (pos1 == -1)
     continue;
   *from_order = 0;
   *before = -1;
   if (pos1 == arc_no)
    {
     *to = i;
     *from = mygraph->dest[arc_no];
     return arc_no;
    }
   else
     while (mygraph->arcs[pos1].pointer != -1)
      {
       (*from_order)++;
       *before = pos1;
       if (mygraph->arcs[pos1].pointer == arc_no)
        {
         *from = mygraph->dest[arc_no];
         *to = i;
         return pos1;
        }
       pos1 = mygraph->arcs[pos1].pointer;
      }
  }
 return -1;
}

// Assembly:
movl 0x10(%rdi), %r11d
testl %r11d, %r11d
jle 0x4e6ce
pushq %r14
pushq %rbx
movl %esi, %eax
movq 0x8(%rdi), %r10
xorl %esi, %esi
leaq (%rsi,%rsi,8), %rbx
movl 0x30(%r10,%rbx,8), %ebx
cmpl $-0x1, %ebx
je 0x4e6a8
movl $0x0, (%r8)
movl $0xffffffff, (%r9)      # imm = 0xFFFFFFFF
cmpl %eax, %ebx
je 0x4e6d4
movq 0x18(%rdi), %r14
movl %ebx, %r11d
movslq %ebx, %rbx
cmpl $-0x1, (%r14,%rbx,4)
je 0x4e6a4
incl (%r8)
movl %ebx, (%r9)
movl (%r14,%rbx,4), %ebx
cmpl %eax, %ebx
jne 0x4e687
jmp 0x4e6ba
movl 0x10(%rdi), %r11d
incq %rsi
movslq %r11d, %rbx
cmpq %rbx, %rsi
jl 0x4e663
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4e6ca
movq 0x28(%rdi), %rdi
cltq
movl (%rdi,%rax,4), %eax
movl %eax, (%rdx)
movl %esi, (%rcx)
movl %r11d, %eax
popq %rbx
popq %r14
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
movl %esi, (%rcx)
movq 0x28(%rdi), %rcx
movslq %eax, %rsi
movl (%rcx,%rsi,4), %ecx
movl %ecx, (%rdx)
jmp 0x4e6ca
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/network.c
// Function: modify_one_arc
void modify_one_arc(bayesiangraphptr G, int arc_no, int *from, int *to, int *from_order)
{
 /*!Last Changed 25.02.2001*/
 int before = -1;
 find_arc_with_no(G, arc_no, from, to, from_order, &before);
 if (before == -1)
   G->nodes[*to].pointer = G->arcs[arc_no].pointer;
 else
   G->arcs[before].pointer = G->arcs[arc_no].pointer;
 before = G->nodes[*from].pointer;
 if (before == -1)
   G->nodes[*from].pointer = arc_no;
 else
  {
   while (G->arcs[before].pointer != -1)
     before = G->arcs[before].pointer;
   G->arcs[before].pointer = arc_no;
  }
 G->arcs[arc_no].pointer = -1;
 G->dest[arc_no] = *to;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r14
leaq 0xc(%rsp), %r12
movl $0xffffffff, (%r12)     # imm = 0xFFFFFFFF
movq %r12, %r9
callq 0x4e64f
movslq (%r12), %rdx
movq 0x18(%r14), %rcx
movslq %ebp, %rax
movl (%rcx,%rax,4), %esi
cmpq $-0x1, %rdx
je 0x4e72d
movl %esi, (%rcx,%rdx,4)
movq 0x8(%r14), %rdx
jmp 0x4e73c
movq 0x8(%r14), %rdx
movslq (%rbx), %rdi
leaq (%rdi,%rdi,8), %rdi
movl %esi, 0x30(%rdx,%rdi,8)
movslq (%r15), %rsi
leaq (%rsi,%rsi,8), %rdi
movl 0x30(%rdx,%rdi,8), %esi
cmpl $-0x1, %esi
je 0x4e75c
movslq %esi, %rdx
movl (%rcx,%rdx,4), %esi
cmpl $-0x1, %esi
jne 0x4e74c
movl %ebp, (%rcx,%rdx,4)
jmp 0x4e766
leaq (%rdx,%rdi,8), %rdx
addq $0x30, %rdx
movl %ebp, (%rdx)
movl $0xffffffff, (%rcx,%rax,4) # imm = 0xFFFFFFFF
movl (%rbx), %ecx
movq 0x28(%r14), %rdx
movl %ecx, (%rdx,%rax,4)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/network.c
// Function: delete_one_arc
void delete_one_arc(bayesiangraphptr mygraph, int arc_no, int *from, int *to, int *from_order)
{
 /*!Last Changed 07.03.2001*/
 int i, dummy;
/*Once silinecek arcin yeri bulunuyor ve ondan sonra gelen parentlarin yerleri bir one aliniyor*/
 find_arc_with_no(mygraph, arc_no, from, to, from_order, &dummy);
 if (mygraph->nodes[*to].pointer == arc_no)
   mygraph->nodes[*to].pointer = mygraph->arcs[arc_no].pointer;
 else
   mygraph->arcs[dummy].pointer = mygraph->arcs[arc_no].pointer;
/*Silinecek arcdan sonrakileri teker teker kaydir*/
 for (i = arc_no; i < mygraph->arccount - 1; i++)
  {
   mygraph->arcs[i].pointer = mygraph->arcs[i + 1].pointer;
   mygraph->dest[i] = mygraph->dest[i + 1];
  }
/*Silinecek arcdan daha yuksek arc numarasi olanlarin arc numarasini bir azalt*/
 for (i = 0; i < mygraph->nodecount; i++)
   if (mygraph->nodes[i].pointer > arc_no)
     mygraph->nodes[i].pointer--;
 for (i = 0; i < mygraph->arccount; i++)
   if (mygraph->arcs[i].pointer > arc_no)
     mygraph->arcs[i].pointer--;
/*Arc ve desti yeniden realloc et*/
 mygraph->arccount--;
 mygraph->arcs = alloc(mygraph->arcs, mygraph->arccount * sizeof(struct arc), mygraph->arccount);
 mygraph->dest = alloc(mygraph->dest, mygraph->arccount * sizeof(int), mygraph->arccount);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movl %esi, %ebp
movq %rdi, %rbx
leaq 0xc(%rsp), %r9
callq 0x4e64f
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rdi
movslq (%r14), %rcx
leaq (%rcx,%rcx,8), %rdx
movslq %ebp, %rsi
movl (%rdi,%rsi,4), %ecx
cmpl %ebp, 0x30(%rax,%rdx,8)
jne 0x4e7c4
leaq (%rax,%rdx,8), %rdx
addq $0x30, %rdx
movl %ecx, (%rdx)
jmp 0x4e7cc
movslq 0xc(%rsp), %rdx
movl %ecx, (%rdi,%rdx,4)
movl 0x20(%rbx), %edx
leal -0x1(%rdx), %ecx
cmpl %ebp, %ecx
jle 0x4e7fe
movq 0x28(%rbx), %r8
movl 0x4(%rdi,%rsi,4), %ecx
movl %ecx, (%rdi,%rsi,4)
movl 0x4(%r8,%rsi,4), %ecx
movl %ecx, (%r8,%rsi,4)
leaq 0x1(%rsi), %r9
movslq 0x20(%rbx), %rdx
leaq -0x1(%rdx), %rcx
movq %r9, %rsi
cmpq %rcx, %r9
jl 0x4e7da
movslq 0x10(%rbx), %rsi
testq %rsi, %rsi
jle 0x4e82d
shlq $0x3, %rsi
leaq (%rsi,%rsi,8), %rsi
xorl %r8d, %r8d
movl 0x30(%rax,%r8), %r9d
cmpl %ebp, %r9d
jle 0x4e824
decl %r9d
movl %r9d, 0x30(%rax,%r8)
addq $0x48, %r8
cmpq %r8, %rsi
jne 0x4e812
testl %edx, %edx
jle 0x4e849
movl %edx, %eax
xorl %edx, %edx
movl (%rdi,%rdx,4), %esi
cmpl %ebp, %esi
jle 0x4e841
decl %esi
movl %esi, (%rdi,%rdx,4)
incq %rdx
cmpq %rdx, %rax
jne 0x4e835
movl %ecx, 0x20(%rbx)
movslq %ecx, %rdx
leaq (,%rdx,4), %rsi
callq 0x3a0b4
movq %rax, 0x18(%rbx)
movq 0x28(%rbx), %rdi
movslq 0x20(%rbx), %rdx
movq %rdx, %rsi
shlq $0x2, %rsi
callq 0x3a0b4
movq %rax, 0x28(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/network.c
// Function: add_one_arc
Arcptr add_one_arc(bayesiangraphptr mygraph)
{
/*!Last Changed 25.02.2001*/
 mygraph->arccount++;
 mygraph->arcs = alloc(mygraph->arcs, mygraph->arccount * sizeof(struct arc), mygraph->arccount);
 mygraph->dest = alloc(mygraph->dest, mygraph->arccount * sizeof(int), mygraph->arccount);
 mygraph->arcs[mygraph->arccount - 1].pointer = -1;
 return &mygraph->arcs[mygraph->arccount - 1];
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movslq 0x20(%rdi), %rax
leaq 0x1(%rax), %rdx
movl %edx, 0x20(%rdi)
movq 0x18(%rdi), %rdi
leaq 0x4(,%rax,4), %rsi
callq 0x3a0b4
movq %rax, 0x18(%rbx)
movq 0x28(%rbx), %rdi
movslq 0x20(%rbx), %rdx
movq %rdx, %rsi
shlq $0x2, %rsi
callq 0x3a0b4
movq %rax, 0x28(%rbx)
movq 0x18(%rbx), %rax
movslq 0x20(%rbx), %rcx
leaq (%rax,%rcx,4), %rax
addq $-0x4, %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/network.c
// Function: add_one_pointer
void add_one_pointer(bayesiangraphptr mygraph, nodeptr src, int dest)
{
 /*!Last Changed 23.12.2000*/
 int where;
 if (src->pointer == -1)
   src->pointer = mygraph->arccount - 1;
 else
  {
   where = src->pointer;
   while (mygraph->arcs[where].pointer != -1)
     where = mygraph->arcs[where].pointer;
   mygraph->arcs[where].pointer = mygraph->arccount - 1;
  }
 mygraph->dest[mygraph->arccount - 1] = dest;
}

// Assembly:
movl 0x30(%rsi), %ecx
cmpl $-0x1, %ecx
je 0x4e8f9
movq 0x18(%rdi), %rax
movslq %ecx, %rsi
movl (%rax,%rsi,4), %ecx
cmpl $-0x1, %ecx
jne 0x4e8e1
movl 0x20(%rdi), %ecx
leal -0x1(%rcx), %r8d
movl %r8d, (%rax,%rsi,4)
jmp 0x4e902
movl 0x20(%rdi), %ecx
leal -0x1(%rcx), %eax
movl %eax, 0x30(%rsi)
movq 0x28(%rdi), %rax
movslq %ecx, %rcx
movl %edx, -0x4(%rax,%rcx,4)
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/network.c
// Function: delete_parent_counts
void delete_parent_counts(nodeptr Node, int parent_order)
{ /*Delete one parent from the parent_counts array*/
/*!Last Changed 25.02.2001*/
 int i;
 Node->table_count/=Node->parent_counts[parent_order];
 for (i=parent_order;i<Node->parents-1;i++)
   Node->parent_counts[i]=Node->parent_counts[i+1];
 Node->parents--;/*Yer kucultmede alloc yapma*/
 Node->parent_counts = alloc(Node->parent_counts, Node->parents * sizeof(int), Node->parents);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq 0x28(%rbx), %rax
movslq %esi, %rcx
movslq (%rdi,%rcx,4), %rsi
cqto
idivq %rsi
movq %rax, 0x28(%rbx)
movslq 0x20(%rbx), %rdx
decq %rdx
cmpl %ecx, %edx
jle 0x4e94f
movl 0x4(%rdi,%rcx,4), %eax
movl %eax, (%rdi,%rcx,4)
leaq 0x1(%rcx), %rax
movslq 0x20(%rbx), %rdx
decq %rdx
movq %rax, %rcx
cmpq %rdx, %rax
jl 0x4e935
movl %edx, 0x20(%rbx)
movq %rdx, %rsi
shlq $0x2, %rsi
callq 0x3a0b4
movq %rax, 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/network.c
// Function: add_parent_counts
void add_parent_counts(bayesiangraphptr mygraph,nodeptr Node,int parent)
{ /*Add one parent in the parent_counts array*/
/*!Last Changed 23.12.2000*/
 Node->parents++;
 Node->parent_counts=alloc(Node->parent_counts,Node->parents*sizeof(int),Node->parents);
 Node->parent_counts[Node->parents-1]=mygraph->nodes[parent].value_count;
 Node->table_count*=mygraph->nodes[parent].value_count;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movslq 0x20(%rsi), %rax
leaq 0x1(%rax), %rdx
movl %edx, 0x20(%rsi)
movq 0x18(%rsi), %rdi
leaq 0x4(,%rax,4), %rsi
callq 0x3a0b4
movq %rax, 0x18(%r14)
movq 0x8(%r15), %rcx
movslq %ebx, %rdx
leaq (%rdx,%rdx,8), %rdx
movslq 0x10(%rcx,%rdx,8), %rcx
movslq 0x20(%r14), %rdx
movl %ecx, -0x4(%rax,%rdx,4)
imulq 0x28(%r14), %rcx
movq %rcx, 0x28(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/network.c
// Function: add_one_value
void add_one_value(nodeptr current,char *st)
{/*Verilmis bir node a bir deger ekliyor*/
/*!Last Changed 15.01.2001*/
 current->value_count++;
 current->values=alloc(current->values,current->value_count*sizeof(char *),current->value_count);
 current->values[current->value_count-1]=strcopy(current->values[current->value_count-1],st);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x10(%rdi), %rax
leaq 0x1(%rax), %rdx
movl %edx, 0x10(%rdi)
movq 0x8(%rdi), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x3a0b4
movq %rax, 0x8(%r14)
movslq 0x10(%r14), %rcx
movq -0x8(%rax,%rcx,8), %rdi
movq %rbx, %rsi
callq 0x3b494
movq 0x8(%r14), %rcx
movslq 0x10(%r14), %rdx
movq %rax, -0x8(%rcx,%rdx,8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/network.c
// Function: find_parent_order
int find_parent_order(bayesiangraphptr G,int parent,int node)
{
/* parentin nodeun kacinci parenti olduguna doner,
   eger parent bulunamazsa -1 e doner */
/*!Last Changed 03.01.2001*/
 int where=G->nodes[node].pointer,order=-1;
 while (where!=-1)
  {
   order++;
   if (G->dest[where]==parent)
     return order;
   where=G->arcs[where].pointer;
  }
 return -1;
}

// Assembly:
movq 0x8(%rdi), %rax
movslq %edx, %rcx
leaq (%rcx,%rcx,8), %rcx
movl 0x30(%rax,%rcx,8), %r8d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $-0x1, %r8d
je 0x4ea6e
movq 0x28(%rdi), %rdx
xorl %ecx, %ecx
movslq %r8d, %r8
cmpl %esi, (%rdx,%r8,4)
je 0x4ea6f
movq 0x18(%rdi), %r9
movl (%r9,%r8,4), %r8d
incl %ecx
cmpl $-0x1, %r8d
jne 0x4ea55
retq
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/network.c
// Function: find_arc_no
int find_arc_no(bayesiangraphptr G,int from, int to, int *arc_no, int *before)
{
/* eger belirtilen arc yoksa 0 a varsa 1 e donsun....*/
/* arc_no from-->to arcinin numarasi, before bundan bir oncekinin numarasi*/
/*!Last Changed 03.01.2001*/
 *before = -1;
 if ((to<0)||(to>=G->nodecount))
   return 0;
 if ((from<0)||(from>=G->nodecount))
   return 0;
 *arc_no=G->nodes[to].pointer;
 while ((*arc_no!=-1)&&(G->dest[*arc_no]!=from))
  {
   *before=*arc_no;
   *arc_no=G->arcs[*arc_no].pointer;
  }
 if (*arc_no==-1)
   return 0;
 else
   return 1;
}

// Assembly:
movl $0xffffffff, (%r8)      # imm = 0xFFFFFFFF
xorl %eax, %eax
testl %edx, %edx
js 0x4eadd
movl 0x10(%rdi), %r9d
cmpl %edx, %r9d
jle 0x4eadd
testl %esi, %esi
sets %r10b
cmpl %esi, %r9d
setle %r9b
orb %r10b, %r9b
jne 0x4eadd
movq 0x8(%rdi), %r9
movl %edx, %edx
leaq (%rdx,%rdx,8), %rdx
movl 0x30(%r9,%rdx,8), %edx
movl %edx, (%rcx)
cmpl $-0x1, %edx
je 0x4eadd
movq 0x28(%rdi), %rax
movslq %edx, %r9
movl (%rax,%r9,4), %r9d
cmpl %esi, %r9d
je 0x4ead5
movl %edx, (%r8)
movq 0x18(%rdi), %rdx
movslq (%rcx), %r10
movl (%rdx,%r10,4), %edx
movl %edx, (%rcx)
cmpl $-0x1, %edx
jne 0x4eab4
xorl %eax, %eax
cmpl %esi, %r9d
sete %al
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/network.c
// Function: create_graph
bayesiangraphptr create_graph(char *graph_name)
{
 /*!Last Changed 02.02.2004 added safemalloc*/
 /*!Last Changed 07.03.2001*/
 bayesiangraphptr result;
 result = (bayesiangraphptr)safemalloc(sizeof(bayesiangraph), "create_graph", 2);
 result->nodecount=0;
 result->arccount=0;
 result->ordering=NULL;
 result->independence=NULL;
 result->one_independence=NULL;
 result->name=strcopy(result->name,graph_name);
 return result;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x5bc63(%rip), %rsi     # 0xaa74f
movl $0x48, %edi
movl $0x2, %edx
callq 0x3a0e1
movq %rax, %r14
xorl %eax, %eax
movl %eax, 0x10(%r14)
movl %eax, 0x20(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r14)
movq $0x0, 0x40(%r14)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3b494
movq %rax, (%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/network.c
// Function: deallocate_graph
void deallocate_graph(bayesiangraphptr G)
{
 /*!Last Changed 07.03.2001*/
 int i;
 safe_free(G->name);
 for (i = 0; i < G->nodecount; i++)
  {
   safe_free(G->nodes[i].name);
			free_2d((void**)G->nodes[i].values, G->nodes[i].value_count);
   if (G->nodes[i].parents)
     safe_free(G->nodes[i].parent_counts);
			free_2d((void**)G->nodes[i].table, G->nodes[i].table_count);
  }
 if (G->independence!=NULL)
		 free_2d((void**)G->independence, G->nodecount);
 if (G->one_independence!=NULL)
		 free_3d((void***)G->one_independence, G->nodecount, G->nodecount);
 safe_free(G->dest);
 safe_free(G->arcs);
 safe_free(G->nodes);
 safe_free(G);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x3a180
movl 0x10(%rbx), %esi
testl %esi, %esi
jle 0x4eba7
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x3a180
movq 0x8(%rbx), %rax
movq 0x8(%rax,%r14), %rdi
movl 0x10(%rax,%r14), %esi
callq 0x3a14b
movq 0x8(%rbx), %rax
cmpl $0x0, 0x20(%rax,%r14)
je 0x4eb88
movq 0x18(%rax,%r14), %rdi
callq 0x3a180
movq 0x8(%rbx), %rax
movq 0x38(%rax,%r14), %rdi
movl 0x28(%rax,%r14), %esi
callq 0x3a14b
incq %r15
movslq 0x10(%rbx), %rsi
addq $0x48, %r14
cmpq %rsi, %r15
jl 0x4eb4e
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x4ebb5
callq 0x3a14b
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x4ebc8
movl 0x10(%rbx), %edx
movl %edx, %esi
callq 0x3a185
movq 0x28(%rbx), %rdi
callq 0x3a180
movq 0x18(%rbx), %rdi
callq 0x3a180
movq 0x8(%rbx), %rdi
callq 0x3a180
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3a180