// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x1dfa0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x1dfa0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xc1242
movq -0x30(%rbp), %rax
movl $0x1, 0x20(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0xc1222
movq -0x28(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x44f40
leaq 0x42f3a(%rip), %rax     # 0x104190
movq 0x348(%rax), %rax
movq -0x8(%rbp), %rdx
leaq -0x38(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %esi
callq *%rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x28de0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x58(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x29160
movq -0x40(%rbp), %rdi
callq 0x449f0
movl -0x14(%rbp), %ecx
shll %ecx
cmpl %ecx, %eax
je 0xc12bd
movq -0x40(%rbp), %rdi
callq 0x449f0
movl %eax, %esi
movl -0x14(%rbp), %edx
shll %edx
leaq 0x2c845(%rip), %rdi     # 0xedafb
movb $0x0, %al
callq 0x4030
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xc1376
movq -0x30(%rbp), %rdi
callq 0x43530
movl %eax, -0x4c(%rbp)
leaq 0x42e9f(%rip), %rax     # 0x104190
movq 0x350(%rax), %rax
movq -0x30(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x8(%rbp), %rcx
leaq -0x70(%rbp), %r8
leaq -0xe0(%rbp), %rdi
callq *%rax
leaq -0xa8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
movl $0x38, %edx
callq 0x42b0
movl -0x4c(%rbp), %eax
cmpl -0xa0(%rbp), %eax
je 0xc1347
movq -0x30(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0xc1347
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0xa0(%rbp), %eax
jne 0xc1365
movq -0x30(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0xc1365
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0xc12d3
movq -0x40(%rbp), %rdi
callq 0x44510
movq $0x0, -0x40(%rbp)
movq -0x58(%rbp), %rsi
leaq 0x444ae(%rip), %rax     # 0x105840
movq (%rax), %rdx
movl $0x3fd, %edi            # imm = 0x3FD
callq 0x5ac0
movl -0x44(%rbp), %eax
subl -0x48(%rbp), %eax
cvtsi2sd %eax, %xmm0
cvtsi2sdl -0x14(%rbp), %xmm1
xorps %xmm2, %xmm2
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movaps 0x21aa0(%rip), %xmm1    # 0xe2e60
pand %xmm1, %xmm0
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax)