// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/srm.c
// Function: vc_single_epsilon_estimate
double vc_single_epsilon_estimate(void* parameters, Datasetptr d, int n, int* nodecount)
{
 Instanceptr data, tmp, traindata = NULL, testdata = NULL;
 int misclassified1, misclassified2, realclassno;
 void* model;
 double pos[2]; 
 Prediction predicted;
 traindata = generate_random_data(d, n);
 data = generate_random_data(d, n);
 tmp = data;
 while (tmp)
  {
   tmp->isexception = YES;
   tmp = tmp->next;
  }
 merge_instancelist(&traindata, data);
 model = classification_algorithms[NBTREE - SELECTMAX].train_algorithm(&traindata, NULL, parameters);
 *nodecount = decisiontree_node_count((Decisionnodeptr) model);
 accumulate_instances_tree(&testdata, (Decisionnodeptr) model);
 if (data_size(testdata) != (2 * n))
   printf("Test data is not correctly accumulated %d %d\n", data_size(testdata), 2 * n);
 tmp = testdata;
 misclassified1 = 0;
 misclassified2 = 0;
 while (tmp)
  {
   realclassno = give_classno(tmp);
   predicted = classification_algorithms[NBTREE - SELECTMAX].test_algorithm(tmp, model, parameters, pos);
   if (realclassno != predicted.classno && !(tmp->isexception))
     misclassified1++;
   if (realclassno == predicted.classno && tmp->isexception)
     misclassified2++; 
   tmp = tmp->next;
  }
 deallocate(testdata);
 testdata = NULL;
 free_model_of_supervised_algorithm(NBTREE, model, current_dataset);
 return fabs((misclassified1 - misclassified2) / (n + 0.0));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, %r12
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, 0x8(%rsp)
movq $0x0, (%rsp)
movq %rsi, %rdi
movl %edx, %esi
callq 0x1527d
movq %rax, 0x18(%rsp)
movq %r15, %rdi
movl %ebx, %esi
callq 0x1527d
testq %rax, %rax
je 0x8cf47
movq %rax, %rcx
movl $0x1, 0x20(%rcx)
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
jne 0x8cf37
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x30648
leaq 0x47262(%rip), %rax     # 0xd41c0
xorl %r14d, %r14d
movq %r15, %rdi
xorl %esi, %esi
movq 0x8(%rsp), %rdx
callq *0x348(%rax)
movq %rax, %r15
movq %rax, %rdi
callq 0x1cce7
movl %eax, (%r12)
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x1cef5
movq (%r12), %rdi
callq 0x30309
leal (%rbx,%rbx), %ebp
cmpl %ebp, %eax
je 0x8cfb9
movq (%rsp), %rdi
callq 0x30309
leaq 0x244dd(%rip), %rdi     # 0xb148b
movl %eax, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x4030
movq (%rsp), %r12
testq %r12, %r12
je 0x8d02c
movq %rbx, 0x10(%rsp)
xorl %r13d, %r13d
leaq 0x20(%rsp), %rbp
xorl %r14d, %r14d
movq %r12, %rdi
callq 0x2f33a
movl %eax, %ebx
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq 0x8(%rsp), %rcx
movq %rbp, %r8
leaq 0x471ca(%rip), %rax     # 0xd41c0
callq *0x350(%rax)
movl 0x20(%r12), %eax
cmpl 0x38(%rsp), %ebx
jne 0x8d010
cmpl $0x1, %eax
sbbl $-0x1, %r14d
jmp 0x8d017
cmpl $0x1, %eax
adcl $0x0, %r13d
movq 0x10(%r12), %r12
testq %r12, %r12
jne 0x8cfd2
movq (%rsp), %rdi
movq 0x10(%rsp), %rbx
jmp 0x8d031
xorl %edi, %edi
xorl %r13d, %r13d
subl %r14d, %r13d
callq 0x2ff55
movq $0x0, (%rsp)
leaq 0x48828(%rip), %rax     # 0xd5870
movq (%rax), %rdx
movl $0x3fd, %edi            # imm = 0x3FD
movq %r15, %rsi
callq 0x4d38
cvtsi2sd %r13d, %xmm0
cvtsi2sd %ebx, %xmm1
divsd %xmm1, %xmm0
andpd 0x19173(%rip), %xmm0    # 0xa61e0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq