// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../tools/sparse.c
// Function: sp_refactor
int sp_refactor(sp_num *N, sp_mat *A){
	double pivot, *Lx, *Ux, *x;
	int *Lp, *Li, *Up, *Ui, *pinv, *pvec, *q;
	int n, ipiv, k, top, p, i, col, lnz, unz;
	n = A->ncols;
	Li = N->L->Ai; Lp = N->L->Ap; Lx = N->L->Ax;
	Ui = N->U->Ai; Up = N->U->Ap; Ux = N->U->Ax;
	q = N->q;
	lnz = 0; unz = 0;
	x = N->w; pinv = N->pinv; pvec = N->p;
	for (i=0; i<n; i++) x[i]=0;
	for (k=0; k<=n; k++) Lp[k] = 0;
	for(k=0; k<n; k++){
		/* Triangular solve: */
		Lp[k] = lnz;
		Up[k] = unz;
		col = q ? (q[k]) : k;

		top = N->topvec[k];
		sp_splsolve(N->L, A, col, N->xi[k], top, x, pinv);
		/* Assign values to U and L: */
		ipiv = pvec[k];
		pivot = x[ipiv];
		Li[lnz] = ipiv;
		Lx[lnz] = 1;
		lnz++;
		for (p=top; p<n; p++){
			i = N->xi[k][p];
			if (pinv[i]<k){
				Ui[unz] = pinv[i];
				Ux[unz] = x[i];
				unz++;
			}
			if (pinv[i]>k){
				Li[lnz] = i;
				Lx[lnz] = x[i]/pivot;
				lnz++;
			}
			x[i] = 0;
		}
		Ui[unz] = k;
		Ux[unz] = pivot;
		unz++;
	}
	Lp[n] = lnz;
	Up[n] = unz;
	for(p=0; p<lnz; p++) Li[p] = pinv[Li[p]];
	return _SUCCESS_;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq 0x88(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x2c(%rsp)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0x60(%rsp)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, 0x78(%rsp)
movq 0x90(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x90(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x90(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, 0x70(%rsp)
movq 0x90(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x30(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movq 0x90(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, 0x68(%rsp)
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x90(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x38(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jge 0xc938
movq 0x68(%rsp), %rax
movslq 0x18(%rsp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xc90f
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jg 0xc968
movq 0x60(%rsp), %rax
movslq 0x24(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0xc940
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jge 0xcbcd
movl 0x10(%rsp), %edx
movq 0x60(%rsp), %rax
movslq 0x24(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0xc(%rsp), %edx
movq 0x50(%rsp), %rax
movslq 0x24(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
cmpq $0x0, 0x30(%rsp)
je 0xc9bb
movq 0x30(%rsp), %rax
movslq 0x24(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x8(%rsp)
jmp 0xc9c3
movl 0x24(%rsp), %eax
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x90(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0x24(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x20(%rsp)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x88(%rsp), %rsi
movl 0x14(%rsp), %edx
movq 0x90(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movl 0x20(%rsp), %r8d
movq 0x68(%rsp), %r9
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
callq 0xbc90
movq 0x38(%rsp), %rax
movslq 0x24(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x28(%rsp)
movq 0x68(%rsp), %rax
movslq 0x28(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x80(%rsp)
movl 0x28(%rsp), %edx
movq 0x58(%rsp), %rax
movslq 0x10(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x78(%rsp), %rax
movslq 0x10(%rsp), %rcx
movsd 0x1c57d4(%rip), %xmm0   # 0x1d2248
movsd %xmm0, (%rax,%rcx,8)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
movl 0x20(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jge 0xcb89
movq 0x90(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x1c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x18(%rsp)
movq 0x40(%rsp), %rax
movslq 0x18(%rsp), %rcx
movl (%rax,%rcx,4), %eax
cmpl 0x24(%rsp), %eax
jge 0xcb11
movq 0x40(%rsp), %rax
movslq 0x18(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x48(%rsp), %rax
movslq 0xc(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x68(%rsp), %rax
movslq 0x18(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x70(%rsp), %rax
movslq 0xc(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
movq 0x40(%rsp), %rax
movslq 0x18(%rsp), %rcx
movl (%rax,%rcx,4), %eax
cmpl 0x24(%rsp), %eax
jle 0xcb67
movl 0x18(%rsp), %edx
movq 0x58(%rsp), %rax
movslq 0x10(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x68(%rsp), %rax
movslq 0x18(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
divsd 0x80(%rsp), %xmm0
movq 0x78(%rsp), %rax
movslq 0x10(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
movq 0x68(%rsp), %rax
movslq 0x18(%rsp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xca8c
movl 0x24(%rsp), %edx
movq 0x48(%rsp), %rax
movslq 0xc(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movsd 0x80(%rsp), %xmm0
movq 0x70(%rsp), %rax
movslq 0xc(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0xc970
movl 0x10(%rsp), %edx
movq 0x60(%rsp), %rax
movslq 0x2c(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0xc(%rsp), %edx
movq 0x50(%rsp), %rax
movslq 0x2c(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x10(%rsp), %eax
jge 0xcc31
movq 0x40(%rsp), %rax
movq 0x58(%rsp), %rcx
movslq 0x1c(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %edx
movq 0x58(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xcbf7
xorl %eax, %eax
addq $0x98, %rsp
retq
nopl (%rax,%rax)