// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/svmsimplex.c
// Function: prepare_qp_for_C_svm
Quadraticprogramptr prepare_qp_for_C_svm(Instanceptr data, Svm_simplex_parameterptr parameters, int negative)
{
 int i, size = data_size(data);
 double *c, *b;
 matrix A, Q;
 Instanceptr tmp;
 Quadraticprogramptr program;
 Q = prepare_Q_for_C_svm(data, parameters->kernel, negative);
 c = safemalloc(size * sizeof(double), "prepare_qp_for_C_svm", 4);
 for (i = 0; i < size; i++)
   c[i] = -1;
 b = safemalloc((size + 2) * sizeof(double), "prepare_qp_for_C_svm", 7);
 for (i = 0; i < size; i++)
   b[i] = parameters->C;
 b[size] = 0;
 b[size + 1] = 0;
 A = matrix_alloc(size + 2, size);
 for (i = 0, tmp = data; i < size; i++, tmp = tmp->next)
  {
   A.values[size][i] = svm_classno(tmp, negative);
   A.values[size + 1][i] = -svm_classno(tmp, negative);
   A.values[i][i] = 1;
  }
 program = prepare_quadratic_program(Q, A, c, b);
 matrix_free(Q);
 matrix_free(A);
 safe_free(c);
 safe_free(b);
 return program;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
callq 0x449f0
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %esi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xcc420
movq %rax, -0x70(%rbp)
movq %rdx, -0x68(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x48(%rbp)
movslq -0x1c(%rbp), %rdi
shlq $0x3, %rdi
leaq 0x21925(%rip), %rsi     # 0xee217
movl $0x4, %edx
callq 0x52d70
movq %rax, -0x28(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xcc92f
movq -0x28(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsd 0x16129(%rip), %xmm0    # 0xe2a48
movsd %xmm0, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xcc907
movl -0x1c(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
leaq 0x218d4(%rip), %rsi     # 0xee217
movl $0x7, %edx
callq 0x52d70
movq %rax, -0x30(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xcc981
movq -0x10(%rbp), %rax
movsd 0x20(%rax), %xmm0
movq -0x30(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xcc958
movq -0x30(%rbp), %rax
movslq -0x1c(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x30(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x1c(%rbp), %edi
addl $0x2, %edi
movl -0x1c(%rbp), %esi
callq 0x57fc0
movq %rax, -0x80(%rbp)
movq %rdx, -0x78(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xcca73
movq -0x58(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x444b0
cvtsi2sd %eax, %xmm0
movq -0x38(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x58(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x444b0
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
cvtsi2sd %eax, %xmm0
movq -0x38(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
movsd 0x155c4(%rip), %xmm0    # 0xe2018
movsd %xmm0, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0xcc9db
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x143e0
movq %rax, -0x60(%rbp)
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x59ea0
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x59ea0
movq -0x28(%rbp), %rdi
callq 0x52e80
movq -0x30(%rbp), %rdi
callq 0x52e80
movq -0x60(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)