// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/convex.c
// Function: formulate_infeasibility_form
Linearprogramptr formulate_infeasibility_form(Linearprogramptr program)
{
 int i, j, totalvariables;
 double sum;
 Linearprogramptr newprogram;
 newprogram = safemalloc(sizeof(Linearprogram), "formulate_infeasibility_form", 2);
 newprogram->variablecount = program->variablecount + program->constraintcount;
 newprogram->constraintcount = program->constraintcount;
 totalvariables = program->variablecount + 2 * program->constraintcount;
 newprogram->isbasic = safecalloc(totalvariables, sizeof(BOOLEAN), "formulate_infeasibility_form", 7);
 newprogram->basic = safemalloc(program->constraintcount * sizeof(int), "formulate_infeasibility_form", 8);
 for (i = 0; i < newprogram->variablecount; i++)
   newprogram->isbasic[i] = BOOLEAN_FALSE;
 for (i = newprogram->variablecount; i < totalvariables; i++)
  {
   newprogram->isbasic[i] = BOOLEAN_TRUE;
   newprogram->basic[i - newprogram->variablecount] = i;
  }
 newprogram->constraints = matrix_alloc(program->constraintcount + 1, totalvariables + 1);
 for (i = 0; i < program->constraintcount; i++)
  {
   newprogram->constraints.values[i][newprogram->variablecount + i] = 1.0;
   if (program->constraints.values[i][program->constraints.col - 1] < 0)
    {
     for (j = 0; j < newprogram->variablecount; j++)
       newprogram->constraints.values[i][j] = -program->constraints.values[i][j];
     newprogram->constraints.values[i][newprogram->constraints.col - 1] = -program->constraints.values[i][program->constraints.col - 1];
    }
   else
    {
     for (j = 0; j < newprogram->variablecount; j++)
       newprogram->constraints.values[i][j] = program->constraints.values[i][j];
     newprogram->constraints.values[i][newprogram->constraints.col - 1] = program->constraints.values[i][program->constraints.col - 1];     
    }
  }
 for (j = 0; j < program->variablecount; j++)
   newprogram->constraints.values[program->constraintcount][j] = program->objectives[j];
 newprogram->objectives = safecalloc(totalvariables + 1, sizeof(double), "formulate_infeasibility_form", 26);
 for (i = 0; i < newprogram->variablecount; i++)
  {
   sum = 0.0;
   for (j = 0; j < program->constraintcount; j++)
     sum += newprogram->constraints.values[j][i];
   newprogram->objectives[i] = -sum;
  }
 sum = 0.0;
 for (j = 0; j < program->constraintcount; j++)
   sum += newprogram->constraints.values[j][newprogram->constraints.col - 1];
 newprogram->objectives[totalvariables] = -sum;
 return newprogram;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl $0x30, %edi
leaq 0xcd6b4(%rip), %rsi     # 0xe2f6c
movl $0x2, %edx
callq 0x52d70
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %ecx
movq -0x8(%rbp), %rax
addl 0x4(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
shll %ecx
addl %ecx, %eax
movl %eax, -0x14(%rbp)
movslq -0x14(%rbp), %rdi
movl $0x4, %esi
leaq 0xcd661(%rip), %rdx     # 0xe2f6c
movl $0x7, %ecx
callq 0x52f40
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movslq 0x4(%rax), %rdi
shlq $0x2, %rdi
leaq 0xcd639(%rip), %rsi     # 0xe2f6c
movl $0x8, %edx
callq 0x52d70
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x28(%rax)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x15978
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0xc(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x1594f
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x159c1
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0xc(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movl -0xc(%rbp), %edx
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movl -0xc(%rbp), %ecx
movq -0x28(%rbp), %rsi
subl (%rsi), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x15981
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %edi
addl $0x1, %edi
movl -0x14(%rbp), %esi
addl $0x1, %esi
callq 0x57fc0
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x38(%rbp)
movq %rdx, -0x30(%rbp)
movq -0x38(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rcx
movq %rcx, 0x10(%rax)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x15bd1
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addl -0xc(%rbp), %ecx
movslq %ecx, %rcx
movsd 0xcc5e0(%rip), %xmm0    # 0xe2018
movsd %xmm0, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x8(%rbp), %rcx
movl 0xc(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
xorps %xmm0, %xmm0
ucomisd (%rax,%rcx,8), %xmm0
jbe 0x15b2e
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x15ace
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x15a6f
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x8(%rbp), %rcx
movl 0xc(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x28(%rbp), %rcx
movl 0xc(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x15bc1
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x15b7d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x15b35
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x8(%rbp), %rcx
movl 0xc(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x28(%rbp), %rcx
movl 0xc(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x15bc3
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x15a04
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x15c1c
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x10(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movslq 0x4(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x15bd8
movl -0x14(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
movl $0x8, %esi
leaq 0xcd33b(%rip), %rdx     # 0xe2f6c
movl $0x1a, %ecx
callq 0x52f40
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x15ce0
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x15ca5
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x15c6b
movsd -0x20(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0xc(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x15c4d
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x15d32
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x28(%rbp), %rcx
movl 0xc(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x15cef
movsd -0x20(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)