// File: /workspace/github_cpp_makefile_star2_O1/Laakeri[P]Triangulator/src/setcover.cpp
// Function: SetCover::LPSolver::Simplex(int)
bool Simplex(int phase) {
		int x = phase == 1 ? m + 1 : m;
		while (true) {
			int s = -1;
			for (int j = 0; j <= n; j++) {
				if (phase == 2 && N[j] == -1) continue;
				if (s==-1||D[x][j]<D[x][s]||(D[x][j]==D[x][s]&&N[j]<N[s])) s=j;
			}
			if (D[x][s] > -eps) return true;
			int r = -1;
			for (int i = 0; i < m; i++) {
				if (D[i][s] < eps) continue;
				if (r == -1 || D[i][n + 1] / D[i][s] < D[r][n + 1] / D[r][s] ||
					((D[i][n + 1]/D[i][s])==(D[r][n+1]/D[r][s])&&B[i]<B[r]))r=i;
			}
			if (r == -1) return false;
			Pivot(r, s);
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %eax, %eax
cmpl $0x1, %esi
sete %al
movslq 0x20(%rdi), %rcx
addq %rcx, %rax
movslq %eax, %rcx
movq %rcx, (%rsp)
leaq (%rax,%rax,2), %r12
movl 0x24(%r14), %eax
testl %eax, %eax
js 0x250ee
movq 0x28(%r14), %rcx
movq (%rsp), %rdx
leaq (%rdx,%rdx,2), %rsi
shlq $0x3, %rsi
addq 0x58(%r14), %rsi
leaq 0x4(,%rax,4), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
xorl %r9d, %r9d
cmpl $0x2, %ebx
jne 0x25093
cmpl $-0x1, (%rcx,%r8)
je 0x250d8
cmpl $-0x1, %edx
fldz
fldz
je 0x250d1
fstp %st(1)
fstp %st(0)
movq (%rsi), %r11
fldt (%r11,%r8,4)
movslq %edx, %r10
movq %r10, %r13
shlq $0x4, %r13
fldt (%r11,%r13)
fucomi %st(1), %st
ja 0x250d1
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jne 0x250d8
jp 0x250d8
movl (%rcx,%r8), %r11d
cmpl (%rcx,%r10,4), %r11d
fldz
fldz
jge 0x250dc
fstp %st(1)
fstp %st(0)
movl %r9d, %edx
fldz
fldz
fstp %st(1)
fstp %st(0)
incl %r9d
addq $0x4, %r8
cmpq %r8, %rdi
jne 0x25087
jmp 0x250f3
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq 0x58(%r14), %rcx
movslq %edx, %rdi
movq (%rcx,%r12,8), %rsi
shlq $0x4, %rdi
fldt (%rsi,%rdi)
fldt (%r14)
fld %st(0)
fchs
fxch %st(2)
fucompi %st(2), %st
fstp %st(1)
jbe 0x25120
fstp %st(0)
movb $0x1, %bpl
xorl %eax, %eax
jmp 0x251e2
movslq 0x20(%r14), %r8
testq %r8, %r8
jle 0x251c1
incl %eax
cltq
movq 0x40(%r14), %r9
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
shlq $0x4, %rax
movq %rcx, %r10
xorl %r11d, %r11d
movq (%r10), %r13
fldt (%r13,%rdi)
fxch %st(1)
fucomi %st(1), %st
jbe 0x25156
fstp %st(1)
jmp 0x251ab
cmpl $-0x1, %esi
fldz
fxch %st(1)
fxch %st(2)
fxch %st(1)
je 0x251a4
fstp %st(0)
fldt (%r13,%rax)
fdivp %st, %st(1)
movslq %esi, %r13
leaq (,%r13,2), %r15
addq %r13, %r15
movq (%rcx,%r15,8), %r15
fldt (%r15,%rax)
fldt (%r15,%rdi)
fdivrp %st, %st(1)
fucomi %st(1), %st
ja 0x251a4
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jne 0x251ab
jp 0x251ab
movl (%r9,%r11,4), %r15d
cmpl (%r9,%r13,4), %r15d
fldz
fldz
jge 0x251af
fstp %st(1)
fstp %st(0)
movl %r11d, %esi
fldz
fldz
fstp %st(1)
fstp %st(0)
incq %r11
addq $0x18, %r10
cmpq %r11, %r8
jne 0x25144
jmp 0x251ca
fstp %st(0)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
fldz
fstp %st(0)
cmpl $-0x1, %esi
setne %al
je 0x251e0
movq %r14, %rdi
callq 0x24eba
movb $0x1, %al
jmp 0x251e2
xorl %ebp, %ebp
testb %al, %al
jne 0x25054
andb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop