// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/lambda.cpp
// Function: bamboo::reduction(int, double*, double*, double*)
static void reduction(int n, double *L, double *D, double *Z)
{
    int i,j,k;
    double del;
    
    j=n-2; k=n-2;
    while (j>=0) {
        if (j<=k) for (i=j+1;i<n;i++) gauss(n,L,Z,i,j);
        del=D[j]+L[j+1+j*n]*L[j+1+j*n]*D[j+1];
        if (del+1E-6<D[j+1]) { /* compared considering numerical error */
            perm(n,L,D,j,del,Z);
            k=j; j=n-2;
        }
        else j--;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, -0x48(%rbp)
cmpl $0x2, %edi
jl 0x33397
leal -0x2(%rdi), %eax
movl %edi, %ecx
movq %rcx, -0x60(%rbp)
leaq (,%rcx,8), %r11
movl %eax, %r8d
movl %eax, -0x34(%rbp)
movl %eax, %ecx
movq %r11, -0x58(%rbp)
movq %rdx, -0x68(%rbp)
movq %rsi, -0x50(%rbp)
movq %rdi, -0x70(%rbp)
movq %rcx, -0x30(%rbp)
movl %r8d, -0x38(%rbp)
cmpl %r8d, %ecx
jg 0x3322f
movq -0x30(%rbp), %rax
leal 0x1(%rax), %r9d
cmpl %edi, %r9d
jge 0x3322f
movq -0x30(%rbp), %rax
imull %edi, %eax
movl %r9d, %esi
movq -0x50(%rbp), %rdx
leaq (%rdx,%rax,8), %rcx
movq %rcx, -0x78(%rbp)
movslq %r9d, %rbx
leaq (,%rsi,8), %rcx
leaq (%rcx,%rax,8), %r14
addq %rdx, %r14
leaq (%rdx,%rsi,8), %r12
imull %edi, %r9d
movq -0x48(%rbp), %rcx
leaq (%rcx,%rax,8), %r15
movq %r11, %r13
imulq %rsi, %r13
addq %rcx, %r13
movl %r9d, -0x3c(%rbp)
movq %rsi, -0x80(%rbp)
movq -0x78(%rbp), %rax
movsd (%rax,%rsi,8), %xmm0
addsd 0x38ade(%rip), %xmm0    # 0x6bc78
callq 0x8ad0
movl -0x3c(%rbp), %r9d
movq -0x70(%rbp), %rdi
movq -0x58(%rbp), %r11
movq -0x60(%rbp), %rsi
cvttsd2si %xmm0, %ecx
testl %ecx, %ecx
je 0x3320f
movl %r9d, %eax
leaq (%r12,%rax,8), %rax
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
xorpd 0x37903(%rip), %xmm0    # 0x6aad0
xorl %ecx, %ecx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm0, %xmm1
addsd (%r14,%rcx,8), %xmm1
movsd %xmm1, (%r14,%rcx,8)
incq %rcx
leal (%rcx,%rbx), %edx
cmpl %edi, %edx
jl 0x331cf
xorl %eax, %eax
movsd (%r13,%rax,8), %xmm1
mulsd %xmm0, %xmm1
addsd (%r15,%rax,8), %xmm1
movsd %xmm1, (%r15,%rax,8)
incq %rax
cmpq %rax, %rsi
jne 0x331f0
movq -0x80(%rbp), %rsi
incq %rsi
incq %rbx
addq $0x8, %r14
addq $0x8, %r12
addl %edi, %r9d
addq %r11, %r13
cmpl %edi, %esi
jl 0x33181
movq -0x30(%rbp), %rbx
movl %ebx, %r9d
movq -0x68(%rbp), %rdx
movsd (%rdx,%r9,8), %xmm0
movsd 0x8(%rdx,%r9,8), %xmm2
movl %ebx, %ecx
imull %edi, %ecx
leal (%rbx,%rcx), %r10d
movq -0x50(%rbp), %rsi
movsd 0x8(%rsi,%r10,8), %xmm1
movapd %xmm1, %xmm3
mulsd %xmm1, %xmm3
mulsd %xmm2, %xmm3
addsd %xmm0, %xmm3
movapd %xmm3, %xmm4
addsd 0x399c9(%rip), %xmm4    # 0x6cc40
ucomisd %xmm4, %xmm2
jbe 0x33385
leaq 0x1(%r9), %rax
incq %r10
divsd %xmm3, %xmm0
mulsd %xmm2, %xmm1
divsd %xmm3, %xmm1
mulsd %xmm0, %xmm2
movsd %xmm2, (%rdx,%r9,8)
movsd %xmm3, (%rdx,%rax,8)
testl %ebx, %ebx
je 0x332eb
movq %rsi, %r14
movq %r9, %r8
movsd (%r14,%r9,8), %xmm2
movsd (%r14,%rax,8), %xmm3
movapd %xmm0, %xmm4
mulsd %xmm2, %xmm4
mulsd (%rsi,%r10,8), %xmm2
movapd %xmm1, %xmm5
mulsd %xmm3, %xmm5
subsd %xmm2, %xmm3
movsd %xmm3, (%r14,%r9,8)
addsd %xmm4, %xmm5
movsd %xmm5, (%r14,%rax,8)
addq %r11, %r14
decq %r8
jne 0x332ad
movsd %xmm1, (%rsi,%r10,8)
leal 0x2(%rbx), %r9d
movl %ecx, %ecx
cmpl %edi, %r9d
jge 0x33343
movl %eax, %r8d
imull %edi, %r8d
movl %r9d, %r10d
leaq (,%r10,8), %r9
leaq (%r9,%r8,8), %r11
addq %rsi, %r11
leaq (%r9,%rcx,8), %r14
addq %rsi, %r14
xorl %r8d, %r8d
movsd (%r14,%r8,8), %xmm0
movsd (%r11,%r8,8), %xmm1
movsd %xmm1, (%r14,%r8,8)
movsd %xmm0, (%r11,%r8,8)
incq %r8
leal (%r10,%r8), %r9d
cmpl %edi, %r9d
jl 0x3331f
imull %edi, %eax
movq -0x48(%rbp), %r8
leaq (%r8,%rax,8), %rax
leaq (%r8,%rcx,8), %rcx
xorl %r9d, %r9d
movq -0x60(%rbp), %r8
movsd (%rcx,%r9,8), %xmm0
movsd (%rax,%r9,8), %xmm1
movsd %xmm1, (%rcx,%r9,8)
movsd %xmm0, (%rax,%r9,8)
incq %r9
cmpq %r9, %r8
jne 0x33359
movl -0x34(%rbp), %eax
movl %ebx, %r8d
movq -0x58(%rbp), %r11
jmp 0x3338d
decl %ebx
movl %ebx, %eax
movl -0x38(%rbp), %r8d
movl %eax, %ecx
testl %eax, %eax
jns 0x3311d
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq