// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../tools/sparse.c
// Function: sp_lusolve
int sp_lusolve(sp_num *N, double *b, double *x){
	int p, j, n, *Ap, *Ai;
	double *Ax, *w;
	n=N->n;
	/* permute b and initialize x:*/
	for (j=0; j<n; j++) x[N->pinv[j]] = b[j];
	/* lower solve: */
	Ap = N->L->Ap; Ai = N->L->Ai; Ax = N->L->Ax;
	for (j=0; j<n; j++){
		x[j] /=Ax[Ap[j]];
		for (p=Ap[j]+1; p<Ap[j+1]; p++){
			x[Ai[p]] -=Ax[p]*x[j];
		}
	}
	/* upper solve: */
	Ap = N->U->Ap; Ai = N->U->Ai; Ax = N->U->Ax;
	for (j=n-1; j>=0; j--){
		x[j] /=Ax[Ap[j+1]-1];
		for (p=Ap[j];p<Ap[j+1]-1; p++){
			x[Ai[p]] -= Ax[p]*x[j];
		}
	}
	if (N->q!=NULL){
		/* We must permute once more..*/
		w = N->w;
		for(j=0;j<n;j++) w[j] = x[j];
		for(j=0; j<n; j++) x[N->q[j]] = w[j];
	}
	return _SUCCESS_;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movq -0x8(%rsp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rsp)
movl $0x0, -0x20(%rsp)
movl -0x20(%rsp), %eax
cmpl -0x24(%rsp), %eax
jge 0xc514
movq -0x10(%rsp), %rax
movslq -0x20(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rsp), %rax
movq -0x8(%rsp), %rcx
movq 0x28(%rcx), %rcx
movslq -0x20(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0xc4d2
movq -0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rsp)
movq -0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rsp)
movq -0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x40(%rsp)
movl $0x0, -0x20(%rsp)
movl -0x20(%rsp), %eax
cmpl -0x24(%rsp), %eax
jge 0xc635
movq -0x40(%rsp), %rax
movq -0x30(%rsp), %rcx
movslq -0x20(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x18(%rsp), %rax
movslq -0x20(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x30(%rsp), %rax
movslq -0x20(%rsp), %rcx
movl (%rax,%rcx,4), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
movl -0x1c(%rsp), %eax
movq -0x30(%rsp), %rcx
movl -0x20(%rsp), %edx
addl $0x1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0xc623
movq -0x40(%rsp), %rax
movslq -0x1c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rsp), %rax
movslq -0x20(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm2
movq -0x18(%rsp), %rax
movq -0x38(%rsp), %rcx
movslq -0x1c(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd (%rax,%rcx,8), %xmm1
movq %xmm0, %rdx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
xorq %rsi, %rdx
movq %rdx, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0xc5a4
jmp 0xc625
movl -0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0xc552
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rsp)
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rsp)
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x40(%rsp)
movl -0x24(%rsp), %eax
subl $0x1, %eax
movl %eax, -0x20(%rsp)
cmpl $0x0, -0x20(%rsp)
jl 0xc765
movq -0x40(%rsp), %rax
movq -0x30(%rsp), %rcx
movl -0x20(%rsp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movl (%rcx,%rdx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x18(%rsp), %rax
movslq -0x20(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x30(%rsp), %rax
movslq -0x20(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rsp)
movl -0x1c(%rsp), %eax
movq -0x30(%rsp), %rcx
movl -0x20(%rsp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movl (%rcx,%rdx,4), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0xc753
movq -0x40(%rsp), %rax
movslq -0x1c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rsp), %rax
movslq -0x20(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm2
movq -0x18(%rsp), %rax
movq -0x38(%rsp), %rcx
movslq -0x1c(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd (%rax,%rcx,8), %xmm1
movq %xmm0, %rdx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
xorq %rsi, %rdx
movq %rdx, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0xc6cc
jmp 0xc755
movl -0x20(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0xc676
movq -0x8(%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0xc80c
movq -0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x48(%rsp)
movl $0x0, -0x20(%rsp)
movl -0x20(%rsp), %eax
cmpl -0x24(%rsp), %eax
jge 0xc7c0
movq -0x18(%rsp), %rax
movslq -0x20(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x48(%rsp), %rax
movslq -0x20(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0xc78b
movl $0x0, -0x20(%rsp)
movl -0x20(%rsp), %eax
cmpl -0x24(%rsp), %eax
jge 0xc80a
movq -0x48(%rsp), %rax
movslq -0x20(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rsp), %rax
movq -0x8(%rsp), %rcx
movq 0x38(%rcx), %rcx
movslq -0x20(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0xc7c8
jmp 0xc80c
xorl %eax, %eax
retq
nop