// File: /workspace/github_c_makefile_star2_O2/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, %r13
movq %rdi, %rbp
callq 0x2c3cc
movl %eax, %ebx
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movupd (%r13), %xmm0
movupd %xmm0, (%rsp)
movq %rbp, %rdi
callq 0x86900
movq %rax, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
leal (%rbx,%rbx), %eax
cltq
movq %rax, 0x28(%rsp)
leaq (,%rax,8), %rdi
leaq 0x1b025(%rip), %rsi     # 0xa1b3c
pushq $0x4
popq %rdx
callq 0x34f59
movslq %ebx, %r14
xorl %ebx, %ebx
testl %r14d, %r14d
movl $0x0, %r15d
cmovgl %r14d, %r15d
movq %rax, 0x30(%rsp)
leaq (%rax,%r14,8), %r12
cmpq %rbx, %r15
je 0x86b90
movsd 0x28(%r13), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %rbp, %rdi
callq 0x2b4a0
movsd 0x20(%rsp), %xmm1
subsd %xmm0, %xmm1
movq 0x30(%rsp), %rax
movsd %xmm1, (%rax,%rbx,8)
movsd 0x28(%r13), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %rbp, %rdi
callq 0x2b4a0
addsd 0x20(%rsp), %xmm0
movsd %xmm0, (%r12,%rbx,8)
incq %rbx
movq 0x10(%rbp), %rbp
jmp 0x86b3a
movq 0x28(%rsp), %r12
leal 0x2(%r12), %ebx
leaq 0x10(,%r12,8), %rdi
leaq 0x1af93(%rip), %rsi     # 0xa1b3c
pushq $0x7
popq %rdx
callq 0x34f59
movq %r12, %rsi
movq %rax, %rbp
xorl %eax, %eax
testl %esi, %esi
movl $0x0, %r12d
cmovgl %esi, %r12d
cmpq %rax, %r12
je 0x86bdb
movsd 0x20(%r13), %xmm0
movsd %xmm0, (%rbp,%rax,8)
incq %rax
jmp 0x86bc5
movl %esi, %eax
orl $0x1, %eax
movslq %eax, %r13
xorpd %xmm0, %xmm0
movupd %xmm0, (%rbp,%rsi,8)
movl %ebx, %edi
callq 0x380d3
movq %rdx, %rbx
xorl %ecx, %ecx
movabsq $0x3ff0000000000000, %r9 # imm = 0x3FF0000000000000
cmpq %rcx, %r12
je 0x86c15
movq (%rbx,%rcx,8), %rdx
movq %r9, (%rdx,%rcx,8)
incq %rcx
jmp 0x86c03
shlq $0x3, %r14
xorl %ecx, %ecx
movabsq $-0x4010000000000000, %rdx # imm = 0xBFF0000000000000
movq 0x28(%rsp), %r8
cmpq %rcx, %r15
je 0x86c54
movq (%rbx,%r8,8), %rsi
leaq (%rsi,%rcx,8), %rdi
movq %r9, (%rsi,%rcx,8)
movq %rdx, (%r14,%rdi)
movq (%rbx,%r13,8), %rsi
leaq (%rsi,%rcx,8), %rdi
movq %rdx, (%rsi,%rcx,8)
movq %r9, (%r14,%rdi)
incq %rcx
jmp 0x86c2a
movq 0x40(%rsp), %r14
movq %r14, %rdi
movq 0x38(%rsp), %r15
movq %r15, %rsi
movq %rax, %rdx
movq %rbx, %rcx
movq 0x30(%rsp), %r13
movq %r13, %r8
movq %rax, %r12
movq %rbp, %r9
callq 0xe2c1
movq %rax, 0x20(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x3929f
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3929f
movq %r13, %rdi
callq 0x34ff7
movq %rbp, %rdi
callq 0x34ff7
movq 0x20(%rsp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq