// File: /workspace/github_cpp_makefile_star2_O3/DoubleString[P]RtConverter/src/Rtklib/rtkcmn.cpp
// Function: bamboo::matinv(double*, int)
extern int matinv(double *A, int n)
{
    double d,*B;
    int i,j,*indx;
    
    indx=imat(n,1); B=mat(n,n); matcpy(B,A,n,n);
    if (ludcmp(B,n,indx,&d)) {free(indx); free(B); return -1;}
    for (j=0;j<n;j++) {
        for (i=0;i<n;i++) A[i+j*n]=0.0;
        A[j+j*n]=1.0;
        lubksb(B,n,indx,A+j*n);
    }
    free(indx); free(B);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %r15d
movq %rdi, %r12
movl %esi, %edi
movl $0x1, %esi
callq 0x4dd75
movq %rax, -0x40(%rbp)
movl %r15d, %edi
movl %r15d, %esi
callq 0x4dc73
movq %rax, %r14
movslq %r15d, %r13
movq %r13, %rdx
imulq %r13, %rdx
shlq $0x3, %rdx
movq %rax, %rdi
movq %r12, -0x60(%rbp)
movq %r12, %rsi
callq 0x84f0
movl %r13d, %edi
movl $0x1, %esi
callq 0x4dc73
testl %r13d, %r13d
jle 0x4e5cd
movl %r15d, %ebx
leaq (,%rbx,8), %rcx
xorl %edx, %edx
movapd 0x1b710(%rip), %xmm0    # 0x69930
xorpd %xmm2, %xmm2
movsd 0x1b6f4(%rip), %xmm1    # 0x69920
movq %r14, %rsi
movq %rsi, %rdi
movq %rbx, %r8
xorpd %xmm3, %xmm3
movapd %xmm3, %xmm4
movsd (%rdi), %xmm3
andpd %xmm0, %xmm3
maxsd %xmm4, %xmm3
addq %rcx, %rdi
decq %r8
jne 0x4e239
ucomisd %xmm2, %xmm3
jbe 0x4e5ad
movapd %xmm1, %xmm4
divsd %xmm3, %xmm4
movsd %xmm4, (%rax,%rdx,8)
incq %rdx
addq $0x8, %rsi
cmpq %rbx, %rdx
jne 0x4e22f
leal -0x1(%r15), %edx
movq %rdx, -0x58(%rbp)
leal 0x1(%r15), %edx
movl %edx, -0x2c(%rbp)
xorl %r12d, %r12d
xorpd %xmm2, %xmm2
movq %rbx, %rdi
movq %r14, %r8
xorl %r11d, %r11d
xorl %r10d, %r10d
movq %rbx, -0x50(%rbp)
testq %r11, %r11
movq %r12, -0x48(%rbp)
je 0x4e305
movl %r12d, %edx
leaq (%r14,%rdx,8), %r9
movl %r11d, %edx
imull %r15d, %edx
movq %rdx, -0x38(%rbp)
leaq (%r14,%rdx,8), %r12
movq %r14, %rbx
xorl %edx, %edx
movsd (%r12,%rdx,8), %xmm3
testq %rdx, %rdx
je 0x4e2e9
movq %rbx, %r13
xorl %esi, %esi
movsd (%r13), %xmm4
mulsd (%r9,%rsi,8), %xmm4
subsd %xmm4, %xmm3
incq %rsi
addq %rcx, %r13
cmpq %rsi, %rdx
jne 0x4e2ce
movsd %xmm3, (%r12,%rdx,8)
incq %rdx
addq $0x8, %rbx
cmpq %r11, %rdx
jne 0x4e2be
movq -0x50(%rbp), %rbx
movq -0x38(%rbp), %rdx
jmp 0x4e307
xorl %edx, %edx
movq %rdx, -0x38(%rbp)
leaq (%r14,%rdx,8), %r12
xorpd %xmm3, %xmm3
movq %r8, %r13
movq %r11, %r9
movsd (%r12,%r9,8), %xmm4
testq %r11, %r11
je 0x4e342
movq %r13, %rdx
xorl %esi, %esi
movsd (%rdx), %xmm5
mulsd (%r12,%rsi,8), %xmm5
subsd %xmm5, %xmm4
incq %rsi
addq %rcx, %rdx
cmpq %rsi, %r11
jne 0x4e329
movsd %xmm4, (%r12,%r9,8)
andpd %xmm0, %xmm4
mulsd (%rax,%r9,8), %xmm4
ucomisd %xmm3, %xmm4
movapd %xmm3, %xmm5
cmpnlesd %xmm4, %xmm5
movapd %xmm5, %xmm6
andnpd %xmm4, %xmm6
andpd %xmm3, %xmm5
orpd %xmm6, %xmm5
cmovael %r9d, %r10d
incq %r9
addq $0x8, %r13
movapd %xmm5, %xmm3
cmpq %rbx, %r9
jne 0x4e319
movl %r10d, %edx
cmpq %rdx, %r11
movq -0x40(%rbp), %r9
movq -0x48(%rbp), %r12
je 0x4e3d0
movslq %r10d, %rdx
leaq (%r14,%rdx,8), %rsi
xorl %r9d, %r9d
movsd (%rsi,%r9), %xmm3
movsd (%r8,%r9), %xmm4
movsd %xmm4, (%rsi,%r9)
movsd %xmm3, (%r8,%r9)
addq %rcx, %r9
decq %rbx
jne 0x4e39d
movsd (%rax,%r11,8), %xmm3
movsd %xmm3, (%rax,%rdx,8)
movq -0x40(%rbp), %r9
movq -0x50(%rbp), %rbx
movl %r10d, (%r9,%r11,4)
movl -0x2c(%rbp), %edx
imull %r11d, %edx
movsd (%r14,%rdx,8), %xmm3
ucomisd %xmm2, %xmm3
jne 0x4e3ed
jnp 0x4e5ad
cmpq -0x58(%rbp), %r11
je 0x4e439
incq %r11
cmpq %rbx, %r11
jae 0x4e426
movapd %xmm1, %xmm4
divsd %xmm3, %xmm4
movq -0x38(%rbp), %rdx
leaq (%r8,%rdx,8), %rdx
movl $0x1, %esi
movsd (%rdx,%rsi,8), %xmm3
mulsd %xmm4, %xmm3
movsd %xmm3, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rdi
jne 0x4e410
addl %r15d, %r12d
addq $0x8, %r8
decq %rdi
cmpq %rbx, %r11
jne 0x4e29a
movq %rax, %rdi
callq 0x87a0
testl %r15d, %r15d
movl -0x2c(%rbp), %eax
jle 0x4e5d5
leaq (,%rbx,8), %r13
movq -0x60(%rbp), %r12
leaq (%r12,%rbx,8), %rcx
movq %rcx, -0x48(%rbp)
movl %r15d, %ecx
imull %eax, %ecx
decl %ecx
movl %ecx, -0x64(%rbp)
movl %r15d, %ebx
notl %ebx
xorl %eax, %eax
movq %rax, -0x38(%rbp)
imull %r15d, %eax
movq -0x60(%rbp), %rcx
leaq (%rcx,%rax,8), %rdi
movq %rdi, -0x58(%rbp)
xorl %esi, %esi
movq %r13, %rdx
callq 0x8390
xorpd %xmm2, %xmm2
movq -0x38(%rbp), %rdx
movq %rdx, %rax
imulq -0x50(%rbp), %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq -0x58(%rbp), %rsi
movq %rcx, (%rsi,%rdx,8)
movq -0x60(%rbp), %rcx
leaq (%rcx,%rax,8), %rax
movq -0x50(%rbp), %r10
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rcx
xorl %esi, %esi
movq -0x40(%rbp), %r9
movslq (%r9,%rsi,4), %rdi
movsd (%rax,%rdi,8), %xmm0
movsd (%rax,%rsi,8), %xmm1
movsd %xmm1, (%rax,%rdi,8)
testl %edx, %edx
js 0x4e511
movl %edx, %edi
cmpq %rdi, %rsi
jbe 0x4e51b
movq %r13, %r8
imulq %rdi, %r8
addq %rcx, %r8
movsd (%r8), %xmm1
mulsd (%r12,%rdi,8), %xmm1
subsd %xmm1, %xmm0
incq %rdi
addq %r13, %r8
cmpq %rdi, %rsi
jne 0x4e4f5
jmp 0x4e51b
ucomisd %xmm2, %xmm0
jne 0x4e519
jnp 0x4e51b
movl %esi, %edx
movsd %xmm0, (%rax,%rsi,8)
incq %rsi
addq $0x8, %rcx
cmpq %r10, %rsi
jne 0x4e4cd
movl -0x64(%rbp), %ecx
movq -0x48(%rbp), %rdx
movq %r10, %rsi
movl -0x2c(%rbp), %r11d
movsd -0x8(%rax,%rsi,8), %xmm0
cmpq %r10, %rsi
jge 0x4e56c
movl %ecx, %edi
xorl %r8d, %r8d
movl %edi, %r9d
movsd (%r14,%r9,8), %xmm1
mulsd (%rdx,%r8,8), %xmm1
subsd %xmm1, %xmm0
incq %r8
leal (%r8,%rsi), %r9d
addl %r15d, %edi
cmpl %r15d, %r9d
jl 0x4e54a
leaq -0x1(%rsi), %rdi
movl %r11d, %r8d
imull %edi, %r8d
movslq %r8d, %r8
divsd (%r14,%r8,8), %xmm0
movsd %xmm0, (%rax,%rdi,8)
addq $-0x8, %rdx
addl %ebx, %ecx
cmpq $0x1, %rsi
movq %rdi, %rsi
jg 0x4e53a
movq -0x38(%rbp), %rax
incq %rax
addq %r13, %r12
addq %r13, -0x48(%rbp)
cmpq %r10, %rax
jne 0x4e473
jmp 0x4e5d5
movq %rax, %rdi
callq 0x87a0
movq -0x40(%rbp), %rdi
callq 0x87a0
movq %r14, %rdi
callq 0x87a0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4e5e8
movq %rax, %rdi
callq 0x87a0
movq -0x40(%rbp), %rdi
callq 0x87a0
movq %r14, %rdi
callq 0x87a0
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq