// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/vc.c
// Function: decisiontree_vc_dimension_wrt_nodetype
int decisiontree_vc_dimension_wrt_nodetype(Datasetptr d, int nodecount, MODEL_TYPE nodetype)
{
 /*Last Changed 01.10.2006*/
 double* testdata, logd, dimension, multiplier;
 int dim = d->multifeaturecount - 1, size;
 logd = log2(dim);
 switch (nodetype)
  {
   case MODEL_UNI:multiplier = logd;
                  size = 3;
                  break;
   case MODEL_LIN:multiplier = dim;
                  size = 3;
                  break;
   case MODEL_QUA:multiplier = dim;
                  size = 5;
                  break;
  }
 testdata = safemalloc(size * sizeof(double), "decisiontree_vc_dimension_wrt_nodetype", 10);
 testdata[size - 3] = multiplier * nodecount;
 testdata[size - 2] = multiplier;
 testdata[size - 1] = nodecount;
 switch (nodetype)
  {
   case MODEL_UNI:dimension = decisiontree_vc_dimension_univariate1(testdata);
                  break;
   case MODEL_LIN:dimension = decisiontree_vc_dimension_linear1(testdata);
                  break;
   case MODEL_QUA:testdata[0] = dim * dim * nodecount;
                  testdata[1] = dim * dim;
                  dimension = decisiontree_vc_dimension_quadratic1(testdata);
                  break;
  }
 safe_free(testdata);
 return ((int) dimension);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x1c0(%rax), %eax
decl %eax
movl %eax, -0x34(%rbp)
cvtsi2sdl -0x34(%rbp), %xmm0
callq 0x52ad0
movsd %xmm0, -0x20(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x3c(%rbp)
testl %eax, %eax
je 0xe05d0
jmp 0xe05bc
movl -0x3c(%rbp), %eax
subl $0x1, %eax
je 0xe05e3
jmp 0xe05c6
movl -0x3c(%rbp), %eax
subl $0x2, %eax
je 0xe05f6
jmp 0xe0607
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movl $0x3, -0x38(%rbp)
jmp 0xe0607
cvtsi2sdl -0x34(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movl $0x3, -0x38(%rbp)
jmp 0xe0607
cvtsi2sdl -0x34(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movl $0x5, -0x38(%rbp)
movslq -0x38(%rbp), %rdi
shlq $0x3, %rdi
leaq 0xe61a(%rip), %rsi      # 0xeec30
movl $0xa, %edx
callq 0x52d70
movq %rax, -0x18(%rbp)
movsd -0x30(%rbp), %xmm0
cvtsi2sdl -0xc(%rbp), %xmm1
mulsd %xmm1, %xmm0
movq -0x18(%rbp), %rax
movl -0x38(%rbp), %ecx
addl $-0x3, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x30(%rbp), %xmm0
movq -0x18(%rbp), %rax
movl -0x38(%rbp), %ecx
addl $-0x2, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
cvtsi2sdl -0xc(%rbp), %xmm0
movq -0x18(%rbp), %rax
movl -0x38(%rbp), %ecx
decl %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x10(%rbp), %eax
movl %eax, -0x40(%rbp)
testl %eax, %eax
je 0xe0691
jmp 0xe067d
movl -0x40(%rbp), %eax
subl $0x1, %eax
je 0xe06a1
jmp 0xe0687
movl -0x40(%rbp), %eax
subl $0x2, %eax
je 0xe06b1
jmp 0xe06ea
movq -0x18(%rbp), %rdi
callq 0xdf970
movsd %xmm0, -0x28(%rbp)
jmp 0xe06ea
movq -0x18(%rbp), %rdi
callq 0xdfb00
movsd %xmm0, -0x28(%rbp)
jmp 0xe06ea
movl -0x34(%rbp), %eax
imull -0x34(%rbp), %eax
imull -0xc(%rbp), %eax
cvtsi2sd %eax, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
movl -0x34(%rbp), %eax
imull -0x34(%rbp), %eax
cvtsi2sd %eax, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movq -0x18(%rbp), %rdi
callq 0xdfc90
movsd %xmm0, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x52e80
cvttsd2si -0x28(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop