// File: /workspace/github_c_makefile_star2_O3/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, %rbp
callq 0x30309
movl %eax, %r14d
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movupd (%rbx), %xmm0
movupd %xmm0, (%rsp)
movq %rbp, %rdi
callq 0x94db8
movq %rax, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
leal (%r14,%r14), %eax
movl %eax, 0x24(%rsp)
movslq %eax, %r13
leaq (,%r13,8), %rdi
leaq 0x1cbe0(%rip), %rsi     # 0xb1bdc
movl $0x4, %edx
callq 0x3a0e1
movq %rax, %r12
movl %r14d, %eax
movq %r14, 0x30(%rsp)
testl %r14d, %r14d
movq %rax, 0x28(%rsp)
jle 0x95072
leaq (%r12,%rax,8), %r14
xorl %r15d, %r15d
movsd 0x28(%rbx), %xmm0
movsd %xmm0, 0x18(%rsp)
movq %rbp, %rdi
callq 0x2f35e
movsd 0x18(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%r12,%r15,8)
movsd 0x28(%rbx), %xmm0
movsd %xmm0, 0x18(%rsp)
movq %rbp, %rdi
callq 0x2f35e
addsd 0x18(%rsp), %xmm0
movsd %xmm0, (%r14,%r15,8)
incq %r15
movq 0x10(%rbp), %rbp
cmpq %r15, 0x28(%rsp)
jne 0x95022
leal 0x2(%r13), %r14d
leaq 0x10(,%r13,8), %rdi
leaq 0x1cb57(%rip), %rsi     # 0xb1bdc
movl $0x7, %edx
callq 0x3a0e1
movq %rax, %rbp
movq 0x30(%rsp), %r15
testl %r15d, %r15d
jle 0x950b6
movsd 0x20(%rbx), %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
xorl %eax, %eax
movupd %xmm0, (%rbp,%rax,8)
addq $0x2, %rax
cmpq %rax, %r13
jne 0x950a7
xorpd %xmm0, %xmm0
movupd %xmm0, (%rbp,%r13,8)
movl %r14d, %edi
movl %r13d, %esi
callq 0x3d79d
movq %rdx, %r14
testl %r15d, %r15d
movq %r12, %r8
movq 0x28(%rsp), %r11
jle 0x9513c
movl 0x24(%rsp), %ecx
orl $0x1, %ecx
movslq %ecx, %rcx
xorl %edx, %edx
movabsq $0x3ff0000000000000, %rbx # imm = 0x3FF0000000000000
movq (%r14,%rdx,8), %rsi
movq %rbx, (%rsi,%rdx,8)
incq %rdx
cmpq %rdx, %r13
jne 0x950f2
testl %r15d, %r15d
jle 0x9513c
movq (%r14,%r13,8), %rdx
movq (%r14,%rcx,8), %rcx
leaq (%rcx,%r11,8), %rsi
leaq (%rdx,%r11,8), %rdi
xorl %r10d, %r10d
movabsq $-0x4010000000000000, %r9 # imm = 0xBFF0000000000000
movq %rbx, (%rdx,%r10,8)
movq %r9, (%rdi,%r10,8)
movq %r9, (%rcx,%r10,8)
movq %rbx, (%rsi,%r10,8)
incq %r10
cmpq %r10, %r11
jne 0x95124
movq 0x40(%rsp), %r15
movq %r15, %rdi
movq 0x38(%rsp), %r13
movq %r13, %rsi
movq %rax, %rdx
movq %r14, %rcx
movq %rbp, %r9
movq %rax, %r12
movq %r8, %rbx
callq 0xed29
movq %rax, 0x18(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x3ed51
movq %r12, %rdi
movq %r14, %rsi
callq 0x3ed51
movq %rbx, %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