// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/svmsimplex.c
// Function: prepare_qp_for_epsilon_svm
Quadraticprogramptr prepare_qp_for_epsilon_svm(Instanceptr data, Svm_simplex_parameterptr parameters)
{
 int i, size = data_size(data);
 double *c, *b;
 matrix A, Q;
 Instanceptr tmp;
 Quadraticprogramptr program;
 Q = prepare_Q_for_epsilon_svm(data, parameters->kernel);
 c = safemalloc(2 * size * sizeof(double), "prepare_qp_for_epsilon_svm", 4);
 for (i = 0, tmp = data; i < size; i++, tmp = tmp->next)
  {
   c[i] = parameters->epsilon - give_regressionvalue(tmp);
   c[i + size] = parameters->epsilon + give_regressionvalue(tmp);
  }
 b = safemalloc((2 * size + 2) * sizeof(double), "prepare_qp_for_epsilon_svm", 7);
 for (i = 0; i < 2 * size; i++)
   b[i] = parameters->C;
 b[2 * size] = 0;
 b[2 * size + 1] = 0;
 A = matrix_alloc(2 * size + 2, 2 * size);
 for (i = 0; i < 2 * size; i++)
   A.values[i][i] = 1;
 for (i = 0; i < size; i++)
  {
   A.values[2 * size][i] = 1;
   A.values[2 * size][size + i] = -1;
   A.values[2 * size + 1][i] = -1;
   A.values[2 * size + 1][size + 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
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2fa14
movl %eax, %r13d
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movupd (%rbx), %xmm0
movupd %xmm0, (%rsp)
movq %r14, %rdi
callq 0x9236c
movq %rax, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
leal (,%r13,2), %eax
movl %eax, 0x24(%rsp)
cltq
movq %rax, 0x28(%rsp)
leaq (,%rax,8), %rdi
leaq 0x1c5ac(%rip), %rsi     # 0xaeb64
movl $0x4, %edx
callq 0x390f5
movq %rax, %r15
movl %r13d, %r12d
movq %r13, 0x30(%rsp)
testl %r13d, %r13d
jle 0x92628
leaq (%r15,%r12,8), %rbp
xorl %r13d, %r13d
movsd 0x28(%rbx), %xmm0
movsd %xmm0, 0x18(%rsp)
movq %r14, %rdi
callq 0x2eaee
movsd 0x18(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%r15,%r13,8)
movsd 0x28(%rbx), %xmm0
movsd %xmm0, 0x18(%rsp)
movq %r14, %rdi
callq 0x2eaee
addsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rbp,%r13,8)
incq %r13
movq 0x10(%r14), %r14
cmpq %r13, %r12
jne 0x925d9
movq 0x28(%rsp), %rax
leal 0x2(%rax), %r14d
leaq 0x10(,%rax,8), %rdi
leaq 0x1c524(%rip), %rsi     # 0xaeb64
movl $0x7, %edx
callq 0x390f5
movq %rax, %rbp
movq 0x30(%rsp), %r13
testl %r13d, %r13d
jle 0x9267b
movl 0x24(%rsp), %ecx
cmpl $0x2, %ecx
movl $0x1, %eax
cmovgel %ecx, %eax
xorl %ecx, %ecx
movsd 0x20(%rbx), %xmm0
movsd %xmm0, (%rbp,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x92668
xorl %eax, %eax
movq 0x28(%rsp), %rsi
movq %rax, (%rbp,%rsi,8)
movl %esi, %ecx
orl $0x1, %ecx
movslq %ecx, %rbx
movq %rax, (%rbp,%rbx,8)
movl %r14d, %edi
callq 0x3c6e5
movq %rdx, %r14
movabsq $0x3ff0000000000000, %r10 # imm = 0x3FF0000000000000
testl %r13d, %r13d
jle 0x926cf
movl 0x24(%rsp), %edx
cmpl $0x2, %edx
movl $0x1, %ecx
cmovgel %edx, %ecx
xorl %edx, %edx
movq (%r14,%rdx,8), %rsi
movq %r10, (%rsi,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x926bf
testl %r13d, %r13d
jle 0x9270e
movq 0x28(%rsp), %rcx
movq (%r14,%rcx,8), %rcx
movq (%r14,%rbx,8), %rdx
leaq (%rdx,%r12,8), %rsi
leaq (%rcx,%r12,8), %rdi
xorl %r8d, %r8d
movabsq $-0x4010000000000000, %r9 # imm = 0xBFF0000000000000
movq %r10, (%rcx,%r8,8)
movq %r9, (%rdi,%r8,8)
movq %r9, (%rdx,%r8,8)
movq %r10, (%rsi,%r8,8)
incq %r8
cmpq %r8, %r12
jne 0x926f6
movq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq 0x38(%rsp), %r13
movq %r13, %rsi
movq %rax, %rdx
movq %r14, %rcx
movq %r15, %r8
movq %rbp, %r9
movq %rax, %r12
callq 0xecc7
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3dbad
movq %r12, %rdi
movq %r14, %rsi
callq 0x3dbad
movq %r15, %rdi
callq 0x39194
movq %rbp, %rdi
callq 0x39194
movq 0x18(%rsp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq