// File: DoubleString[P]RtConverter/src/Rtklib/rtkcmn.cpp
// Function: bamboo::smoother(double const*, double const*, double const*, double const*, int, double*, double*)
extern int smoother(const double *xf, const double *Qf, const double *xb,
                    const double *Qb, int n, double *xs, double *Qs)
{
    double *invQf=mat(n,n),*invQb=mat(n,n),*xx=mat(n,1);
    int i,info=-1;
    
    matcpy(invQf,Qf,n,n);
    matcpy(invQb,Qb,n,n);
    if (!matinv(invQf,n)&&!matinv(invQb,n)) {
        for (i=0;i<n*n;i++) Qs[i]=invQf[i]+invQb[i];
        if (!(info=matinv(Qs,n))) {
            matmul("NN",n,1,n,1.0,invQf,xf,0.0,xx);
            matmul("NN",n,1,n,1.0,invQb,xb,1.0,xx);
            matmul("NN",n,1,n,1.0,Qs,xx,0.0,xs);
        }
    }
    free(invQf); free(invQb); free(xx);
    return info;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movl -0x24(%rbp), %edi
movl -0x24(%rbp), %esi
callq 0x8c500
movq %rax, -0x38(%rbp)
movl -0x24(%rbp), %edi
movl -0x24(%rbp), %esi
callq 0x8c500
movq %rax, -0x40(%rbp)
movl -0x24(%rbp), %edi
movl $0x1, %esi
callq 0x8c500
movq %rax, -0x48(%rbp)
movl $0xffffffff, -0x50(%rbp) # imm = 0xFFFFFFFF
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x24(%rbp), %edx
movl -0x24(%rbp), %ecx
callq 0x8c9e0
movq -0x40(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
movl -0x24(%rbp), %ecx
callq 0x8c9e0
movq -0x38(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x8cd10
cmpl $0x0, %eax
jne 0x8dd61
movq -0x40(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x8cd10
cmpl $0x0, %eax
jne 0x8dd61
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movl -0x24(%rbp), %ecx
imull -0x24(%rbp), %ecx
cmpl %ecx, %eax
jge 0x8dcb1
movq -0x38(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x40(%rbp), %rax
movslq -0x4c(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movq 0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x8dc71
movq 0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x8cd10
movl %eax, -0x50(%rbp)
cmpl $0x0, %eax
jne 0x8dd5f
movl -0x24(%rbp), %esi
movl -0x24(%rbp), %ecx
movq -0x38(%rbp), %r8
movq -0x8(%rbp), %r9
movq -0x48(%rbp), %rax
leaq 0x39caa(%rip), %rdi     # 0xc798c
movl $0x1, %edx
movsd 0x2e171(%rip), %xmm0    # 0xbbe60
xorps %xmm1, %xmm1
movq %rax, (%rsp)
callq 0x8ca20
movl -0x24(%rbp), %esi
movl -0x24(%rbp), %ecx
movq -0x40(%rbp), %r8
movq -0x18(%rbp), %r9
movq -0x48(%rbp), %rax
leaq 0x39c78(%rip), %rdi     # 0xc798c
movl $0x1, %edx
movsd 0x2e13f(%rip), %xmm1    # 0xbbe60
movaps %xmm1, %xmm0
movq %rax, (%rsp)
callq 0x8ca20
movl -0x24(%rbp), %esi
movl -0x24(%rbp), %ecx
movq 0x10(%rbp), %r8
movq -0x48(%rbp), %r9
movq -0x30(%rbp), %rax
leaq 0x39c46(%rip), %rdi     # 0xc798c
movl $0x1, %edx
movsd 0x2e10d(%rip), %xmm0    # 0xbbe60
xorps %xmm1, %xmm1
movq %rax, (%rsp)
callq 0x8ca20
jmp 0x8dd61
movq -0x38(%rbp), %rdi
callq 0x9900
movq -0x40(%rbp), %rdi
callq 0x9900
movq -0x48(%rbp), %rdi
callq 0x9900
movl -0x50(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)