// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/svm.c
// Function: svm_binary_svc_probability
void svm_binary_svc_probability(Svm_problem prob, Svm_parameter param, double Cp, double Cn, double* probA, double* probB)
{
 int i, nr_fold = 5, *perm, begin, end, j, k, p_count, n_count;
 double* dec_values, firstlabel;
 Svm_problem subprob;
 Svm_parameter subparam;
 Svm_modelptr submodel;
 dec_values = safemalloc(prob.l * sizeof(double), "svm_binary_svc_probability", 3);
 perm = random_array(prob.l);
 for (i = 0; i < nr_fold; i++)
  {
   begin = i * prob.l / nr_fold;
   end = (i + 1) * prob.l / nr_fold;
   subprob.l = prob.l - (end - begin);
   subprob.x = safemalloc(subprob.l * sizeof(Svm_nodeptr), "svm_binary_svc_probability", 10);
   subprob.y = safemalloc(subprob.l * sizeof(double), "svm_binary_svc_probability", 11);
   k = 0;
   for (j = 0; j < begin; j++)
    {
     if (k == 0)
       firstlabel = prob.y[perm[j]];
     subprob.x[k] = prob.x[perm[j]];
     subprob.y[k] = prob.y[perm[j]];
     k++;
    }
   for (j = end; j < prob.l; j++)
    {
     if (k == 0)
       firstlabel = prob.y[perm[j]];
     subprob.x[k] = prob.x[perm[j]];
     subprob.y[k] = prob.y[perm[j]];
     k++;
    }
   p_count = 0;
   n_count = 0;
   for (j = 0; j < k; j++)
    {
     if (subprob.y[j] > 0)
       p_count++;
     else
       n_count++;
    }
   if (p_count == 0 && n_count == 0)
     for (j = begin; j < end; j++)
       dec_values[perm[j]] = 0;
   else 
     if (p_count > 0 && n_count == 0)
       for (j = begin; j < end; j++)
         dec_values[perm[j]] = 1;
     else 
       if (p_count == 0 && n_count > 0)
         for (j = begin; j < end; j++)
           dec_values[perm[j]] = -1;
       else
        {
         subparam = param;
         subparam.C = 1.0;
         subparam.cweights = safemalloc(2 * sizeof(double), "svm_binary_svc_probability", 40);
         subparam.cweights[0] = Cp;
         subparam.cweights[1] = Cn;
         submodel = svm_train(subprob, subparam, 0);
         for (j = begin; j < end; j++)
          {
           svm_predict_values(submodel, prob.x[perm[j]], &(dec_values[perm[j]])); 
           dec_values[perm[j]] *= -1;
          }
         free_svm_model(submodel);
         safe_free(subparam.cweights);
         safe_free(subprob.x);
         safe_free(subprob.y);
        }
  }
 sigmoid_train(prob.l, dec_values, prob.y, probA, probB);
 safe_free(dec_values);
 safe_free(perm);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
leaq 0x30(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0xe0(%rbp)
movsd %xmm0, -0x8(%rbp)
movsd %xmm1, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movl $0x5, -0x28(%rbp)
movslq (%rax), %rdi
shlq $0x3, %rdi
leaq 0x2600b(%rip), %rsi     # 0xee0f3
movl $0x3, %edx
callq 0x52d70
movq %rax, %rcx
movq -0xe0(%rbp), %rax
movq %rcx, -0x50(%rbp)
movl (%rax), %edi
callq 0x54600
movq %rax, -0x30(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0xc857b
movq -0xe0(%rbp), %rcx
movl -0x24(%rbp), %eax
imull (%rcx), %eax
cltd
idivl -0x28(%rbp)
movl %eax, -0x34(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
imull (%rcx), %eax
cltd
idivl -0x28(%rbp)
movl %eax, %ecx
movq -0xe0(%rbp), %rax
movl %ecx, -0x38(%rbp)
movl (%rax), %eax
movl -0x38(%rbp), %ecx
subl -0x34(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x78(%rbp)
movslq -0x78(%rbp), %rdi
shlq $0x3, %rdi
leaq 0x25f8c(%rip), %rsi     # 0xee0f3
movl $0xa, %edx
callq 0x52d70
movq %rax, -0x68(%rbp)
movslq -0x78(%rbp), %rdi
shlq $0x3, %rdi
leaq 0x25f6f(%rip), %rsi     # 0xee0f3
movl $0xb, %edx
callq 0x52d70
movq %rax, -0x70(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0xc8233
cmpl $0x0, -0x40(%rbp)
jne 0xc81d3
movq -0xe0(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x30(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0xe0(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x30(%rbp), %rdx
movslq -0x3c(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movq (%rcx,%rdx,8), %rsi
movq -0x68(%rbp), %rcx
movslq -0x40(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x8(%rax), %rax
movq -0x30(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x70(%rbp), %rax
movslq -0x40(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc81a0
movl -0x38(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0xe0(%rbp), %rcx
movl -0x3c(%rbp), %eax
cmpl (%rcx), %eax
jge 0xc82d2
cmpl $0x0, -0x40(%rbp)
jne 0xc8272
movq -0xe0(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x30(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0xe0(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x30(%rbp), %rdx
movslq -0x3c(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movq (%rcx,%rdx,8), %rsi
movq -0x68(%rbp), %rcx
movslq -0x40(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x8(%rax), %rax
movq -0x30(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x70(%rbp), %rax
movslq -0x40(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc8239
movl $0x0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0xc8326
movq -0x70(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xc8310
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xc8319
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xc831b
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc82e7
cmpl $0x0, -0x44(%rbp)
jne 0xc8368
cmpl $0x0, -0x48(%rbp)
jne 0xc8368
movl -0x34(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0xc8363
movq -0x50(%rbp), %rax
movq -0x30(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc8338
jmp 0xc856b
cmpl $0x0, -0x44(%rbp)
jle 0xc83af
cmpl $0x0, -0x48(%rbp)
jne 0xc83af
movl -0x34(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0xc83aa
movq -0x50(%rbp), %rax
movq -0x30(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd 0x19c7e(%rip), %xmm0    # 0xe2018
movsd %xmm0, (%rax,%rcx,8)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc837a
jmp 0xc8569
cmpl $0x0, -0x44(%rbp)
jne 0xc83f6
cmpl $0x0, -0x48(%rbp)
jle 0xc83f6
movl -0x34(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0xc83f1
movq -0x50(%rbp), %rax
movq -0x30(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd 0x1a667(%rip), %xmm0    # 0xe2a48
movsd %xmm0, (%rax,%rcx,8)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc83c1
jmp 0xc8567
movq -0xe8(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
movl $0x58, %edx
callq 0x42b0
movsd 0x19c02(%rip), %xmm0    # 0xe2018
movsd %xmm0, -0xa0(%rbp)
movl $0x10, %edi
leaq 0x25cc9(%rip), %rsi     # 0xee0f3
movl $0x28, %edx
callq 0x52d70
movq %rax, -0x98(%rbp)
movsd -0x8(%rbp), %xmm0
movq -0x98(%rbp), %rax
movsd %xmm0, (%rax)
movsd -0x10(%rbp), %xmm0
movq -0x98(%rbp), %rax
movsd %xmm0, 0x8(%rax)
xorl %eax, %eax
movq -0x80(%rbp), %rcx
movq %rsp, %rax
movq %rax, -0xf0(%rbp)
movq %rcx, 0x70(%rax)
movups -0x90(%rbp), %xmm0
movups %xmm0, 0x60(%rax)
movups -0xd0(%rbp), %xmm0
movups -0xc0(%rbp), %xmm1
movups -0xb0(%rbp), %xmm2
movups -0xa0(%rbp), %xmm3
movups %xmm3, 0x50(%rax)
movups %xmm2, 0x40(%rax)
movups %xmm1, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups -0x78(%rbp), %xmm0
movups -0x68(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
xorl %edi, %edi
callq 0xc7240
movq %rax, -0xd8(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0xc853d
movq -0xe0(%rbp), %rax
movq -0xd8(%rbp), %rdi
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x50(%rbp), %rdx
movq -0x30(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
shlq $0x3, %rax
addq %rax, %rdx
callq 0xc85c0
movq -0x50(%rbp), %rax
movq -0x30(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd 0x1a520(%rip), %xmm0    # 0xe2a48
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc84ca
movq -0xd8(%rbp), %rdi
callq 0xc5e40
movq -0x98(%rbp), %rdi
callq 0x52e80
movq -0x68(%rbp), %rdi
callq 0x52e80
movq -0x70(%rbp), %rdi
callq 0x52e80
jmp 0xc8569
jmp 0xc856b
jmp 0xc856d
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc8112
movq -0xe0(%rbp), %rax
movl (%rax), %edi
movq -0x50(%rbp), %rsi
movq 0x8(%rax), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
callq 0xc8ad0
movq -0x50(%rbp), %rdi
callq 0x52e80
movq -0x30(%rbp), %rdi
callq 0x52e80
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopw %cs:(%rax,%rax)