// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/svm.c
// Function: svm_predict_probability
void svm_predict_probability(Svm_modelptr model, Svm_nodeptr x, double* prob_estimates)
{
 /*Last Changed 04.01.2006*/
 int i, j, nr_class, k = 0;
 double *dec_values, min_prob = 1e-7, **pairwise_prob;
 nr_class = model->nr_class;
 dec_values = safemalloc((nr_class * (nr_class - 1) / 2) * sizeof(double), "svm_predict_probability", 4);
 svm_predict_values(model, x, dec_values);
 pairwise_prob = (double **) safemalloc_2d(sizeof(double*), sizeof(double), nr_class, nr_class, "svm_predict_probability", 6);
 for (i = 0; i < nr_class; i++)
   for (j = i + 1; j < nr_class; j++)
    {
     pairwise_prob[i][j] = fmin(fmax(sigmoid_predict(dec_values[k], model->probA[k], model->probB[k]), min_prob), 1 - min_prob);
     pairwise_prob[j][i] = 1 - pairwise_prob[i][j];
     k++;
    }
 multiclass_probability(nr_class, pairwise_prob, prob_estimates);
 free_2d((void**)pairwise_prob, nr_class);
 safe_free(dec_values);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x28(%rbp)
movsd 0x244dd(%rip), %xmm0    # 0xedff0
movsd %xmm0, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl 0x58(%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
imull %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movslq %eax, %rdi
shlq $0x3, %rdi
leaq 0x245ca(%rip), %rsi     # 0xee10e
movl $0x4, %edx
callq 0x52d70
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0xc85c0
movl -0x24(%rbp), %edx
movl -0x24(%rbp), %ecx
movl $0x8, %esi
leaq 0x24599(%rip), %r8      # 0xee10e
movl $0x6, %r9d
movq %rsi, %rdi
callq 0x53120
movq %rax, -0x40(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0xc9ca8
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0xc9c98
movq -0x30(%rbp), %rax
movslq -0x28(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rax
movslq -0x28(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rax
movslq -0x28(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
callq 0xc94f0
movaps %xmm0, %xmm2
movsd -0x38(%rbp), %xmm1
movaps %xmm1, %xmm4
movaps %xmm2, %xmm3
cmpunordsd %xmm3, %xmm3
movaps %xmm3, %xmm0
pand %xmm4, %xmm0
maxsd %xmm2, %xmm1
pandn %xmm1, %xmm3
por %xmm0, %xmm3
movsd 0x18401(%rip), %xmm2    # 0xe2018
subsd -0x38(%rbp), %xmm2
movaps %xmm2, %xmm4
movaps %xmm3, %xmm0
cmpunordsd %xmm0, %xmm0
movaps %xmm0, %xmm1
pand %xmm4, %xmm1
minsd %xmm3, %xmm2
pandn %xmm2, %xmm0
por %xmm1, %xmm0
movq -0x40(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x40(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movsd 0x183b1(%rip), %xmm0    # 0xe2018
subsd (%rax,%rcx,8), %xmm0
movq -0x40(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xc9ba3
jmp 0xc9c9a
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xc9b8e
movl -0x24(%rbp), %edi
movq -0x40(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xc95d0
movq -0x40(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x52e20
movq -0x30(%rbp), %rdi
callq 0x52e80
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)