// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, %ebx
movq %rsi, %r12
movq %rdi, %r14
callq 0x30309
movl %eax, %ebp
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movdqu (%r12), %xmm0
movdqu %xmm0, (%rsp)
movq %r14, %rdi
movl %ebx, %esi
callq 0x94eb4
movq %rax, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movslq %ebp, %rbp
leaq (,%rbp,8), %rdi
leaq 0x1ca00(%rip), %rsi     # 0xb1bf7
movl $0x4, %edx
callq 0x3a0e1
testl %ebp, %ebp
jle 0x952a3
leal 0x1(%rbp), %edi
leaq -0x1(%rbp), %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl %edi
shlq $0x4, %rdi
movdqa 0x11218(%rip), %xmm1    # 0xa6440
xorl %ecx, %ecx
movdqa 0x1121e(%rip), %xmm2    # 0xa6450
pxor %xmm2, %xmm0
movabsq $-0x4010000000000000, %rdx # imm = 0xBFF0000000000000
pcmpeqd %xmm3, %xmm3
movdqa 0x11244(%rip), %xmm4    # 0xa6490
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %esi
notl %esi
testb $0x1, %sil
je 0x95282
movq %rdx, (%rax,%rcx)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x95296
movq %rdx, 0x8(%rax,%rcx)
paddq %xmm4, %xmm1
addq $0x10, %rcx
cmpq %rcx, %rdi
jne 0x9524c
movq %rax, 0x30(%rsp)
leal 0x2(%rbp), %r15d
leaq 0x10(,%rbp,8), %rdi
leaq 0x1c93c(%rip), %rsi     # 0xb1bf7
movl $0x7, %edx
callq 0x3a0e1
testl %ebp, %ebp
jle 0x95367
movq 0x20(%r12), %xmm0
leal 0x1(%rbp), %esi
leaq -0x1(%rbp), %rcx
movq %rcx, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
shrl %esi
shlq $0x4, %rsi
movdqa 0x1114d(%rip), %xmm2    # 0xa6440
xorl %ecx, %ecx
movdqa 0x11153(%rip), %xmm3    # 0xa6450
pxor %xmm3, %xmm1
pcmpeqd %xmm4, %xmm4
movdqa 0x11183(%rip), %xmm5    # 0xa6490
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm1, %xmm7
pcmpeqd %xmm1, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %edx
notl %edx
testb $0x1, %dl
je 0x95346
movq %xmm0, (%rax,%rcx)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0x9535a
movq %xmm0, 0x8(%rax,%rcx)
paddq %xmm5, %xmm2
addq $0x10, %rcx
cmpq %rcx, %rsi
jne 0x9530d
xorl %ecx, %ecx
movq %rcx, (%rax,%rbp,8)
movq %rax, 0x28(%rsp)
movq %rcx, 0x8(%rax,%rbp,8)
movl %r15d, %edi
movl %ebp, %esi
callq 0x3d79d
movq %rax, 0x20(%rsp)
movq %rdx, %r12
testl %ebp, %ebp
jle 0x953ea
leaq 0x1(%rbp), %r13
xorl %r15d, %r15d
movq %r14, %rdi
movl %ebx, %esi
callq 0x2ff28
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movq (%r12,%rbp,8), %rax
movsd %xmm0, (%rax,%r15,8)
movq %r14, %rdi
movl %ebx, %esi
callq 0x2ff28
negl %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movq (%r12,%r13,8), %rax
movsd %xmm0, (%rax,%r15,8)
movq (%r12,%r15,8), %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, (%rax,%r15,8)
incq %r15
movq 0x10(%r14), %r14
cmpq %r15, %rbp
jne 0x95394
movq 0x40(%rsp), %r14
movq %r14, %rdi
movq 0x38(%rsp), %r15
movq %r15, %rsi
movq 0x20(%rsp), %rbx
movq %rbx, %rdx
movq %r12, %rcx
movq 0x30(%rsp), %r13
movq %r13, %r8
movq 0x28(%rsp), %rbp
movq %rbp, %r9
callq 0xed29
movq %rax, 0x18(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x3ed51
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3ed51
movq %r13, %rdi
callq 0x3a180
movq %rbp, %rdi
callq 0x3a180
movq 0x18(%rsp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq