// File: /workspace/github_cpp_makefile_star2_O2/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 $0xb8, %rsp
movq %rcx, -0x48(%rbp)
movq %rdx, -0x70(%rbp)
leal -0x2(%rdi), %eax
xorl %ecx, %ecx
testl %edi, %edi
cmovgl %edi, %ecx
movq %rcx, -0xa0(%rbp)
movslq %edi, %rcx
leaq 0x8(%rsi), %rdx
movq %rdx, -0xb8(%rbp)
movl %edi, %r8d
imull %eax, %r8d
leal -0x1(%rcx), %r9d
movl %edi, %r10d
imull %r9d, %r10d
movq %rcx, -0xd0(%rbp)
leaq (,%rcx,8), %rcx
movq %rcx, -0x50(%rbp)
movq %rsi, -0x38(%rbp)
leaq (%rsi,%r9,8), %r11
movl %eax, -0x3c(%rbp)
movl %eax, -0x5c(%rbp)
movl %r8d, -0x58(%rbp)
movq %r9, -0xb0(%rbp)
movl %r10d, -0x54(%rbp)
movq %r11, -0xa8(%rbp)
movq %rdi, -0xc0(%rbp)
movl %edi, %ecx
movq %r11, %rdx
movq %r9, -0x80(%rbp)
movl %r10d, -0x2c(%rbp)
movl %r8d, %esi
movl %eax, %ebx
testl %ebx, %ebx
js 0x2d3ac
movq %rdx, -0x88(%rbp)
movl %ecx, -0x40(%rbp)
movl %esi, -0x60(%rbp)
movslq %esi, %rax
movq -0x48(%rbp), %rcx
leaq (%rcx,%rax,8), %r15
movl %ebx, %ecx
movq %rcx, -0x98(%rbp)
movl %eax, %eax
movq %rax, -0x78(%rbp)
movl %ebx, %eax
imull %edi, %eax
movq %rax, -0x90(%rbp)
movl %ebx, -0x64(%rbp)
cmpl -0x3c(%rbp), %ebx
jle 0x2d18b
movq -0x70(%rbp), %rax
movq -0x98(%rbp), %r13
movsd (%rax,%r13,8), %xmm0
movsd 0x8(%rax,%r13,8), %xmm2
movl -0x64(%rbp), %ebx
movq -0x90(%rbp), %rsi
addl %ebx, %esi
movq -0x38(%rbp), %rax
movsd 0x8(%rax,%rsi,8), %xmm1
movapd %xmm1, %xmm3
mulsd %xmm1, %xmm3
mulsd %xmm2, %xmm3
addsd %xmm0, %xmm3
movapd %xmm3, %xmm4
addsd 0x35ae2(%rip), %xmm4    # 0x62c40
ucomisd %xmm4, %xmm2
ja 0x2d29f
decl %ebx
movl -0x60(%rbp), %esi
subl %edi, %esi
subl %edi, -0x2c(%rbp)
decq -0x80(%rbp)
movq -0x88(%rbp), %rdx
addq $-0x8, %rdx
movl -0x40(%rbp), %ecx
decl %ecx
jmp 0x2d0d1
movq -0x98(%rbp), %rdx
leaq 0x1(%rdx), %rbx
imulq -0x50(%rbp), %rbx
addq -0x48(%rbp), %rbx
leaq (,%rdx,8), %rax
movq -0x78(%rbp), %rcx
leaq (%rax,%rcx,8), %r14
movq -0xb8(%rbp), %rax
addq %rax, %r14
leaq (%rax,%rdx,8), %r12
movslq -0x90(%rbp), %rax
movq -0x38(%rbp), %rcx
leaq (%rcx,%rax,8), %rax
movq %rax, -0xc8(%rbp)
movq -0x80(%rbp), %r13
movl -0x2c(%rbp), %r9d
incq %rdx
cmpq -0xd0(%rbp), %rdx
jge 0x2d114
movq -0xc8(%rbp), %rax
movq %rdx, -0xd8(%rbp)
movsd (%rax,%rdx,8), %xmm0
addsd 0x34a72(%rip), %xmm0    # 0x61c78
movl %r9d, -0x68(%rbp)
callq 0x8ac0
movl -0x68(%rbp), %r9d
movq -0xc0(%rbp), %rdi
cvttsd2si %xmm0, %ecx
testl %ecx, %ecx
movq -0xa0(%rbp), %rsi
je 0x2d281
movl %r9d, %eax
leaq (%r12,%rax,8), %rax
cvtsi2sd %ecx, %xmm0
xorpd 0x33884(%rip), %xmm0    # 0x60ac0
xorl %ecx, %ecx
leal (%rcx,%r13), %edx
cmpl %edi, %edx
jge 0x2d260
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm0, %xmm1
addsd (%r14,%rcx,8), %xmm1
movsd %xmm1, (%r14,%rcx,8)
incq %rcx
jmp 0x2d23e
xorl %eax, %eax
cmpq %rax, %rsi
je 0x2d281
movsd (%rbx,%rax,8), %xmm1
mulsd %xmm0, %xmm1
addsd (%r15,%rax,8), %xmm1
movsd %xmm1, (%r15,%rax,8)
incq %rax
jmp 0x2d262
addq $0x8, %r14
addq $0x8, %r12
addl %edi, %r9d
incq %r13
addq -0x50(%rbp), %rbx
movq -0xd8(%rbp), %rdx
jmp 0x2d1db
incq %rsi
divsd %xmm3, %xmm0
mulsd %xmm2, %xmm1
divsd %xmm3, %xmm1
mulsd %xmm0, %xmm2
movq -0x70(%rbp), %rcx
movsd %xmm2, (%rcx,%r13,8)
leaq 0x1(%r13), %rax
movsd %xmm3, (%rcx,%rax,8)
movq -0x38(%rbp), %rax
leaq (%rax,%r13,8), %rax
movl -0x58(%rbp), %r8d
movq -0xb0(%rbp), %r9
movl -0x54(%rbp), %r10d
movq -0xa8(%rbp), %r11
movl -0x40(%rbp), %r14d
movq -0x88(%rbp), %rdx
movq -0x78(%rbp), %r12
subq $0x1, %r13
jb 0x2d335
movsd (%rax), %xmm2
movsd (%rdx), %xmm3
movapd %xmm0, %xmm4
mulsd %xmm2, %xmm4
movq -0x38(%rbp), %rcx
mulsd (%rcx,%rsi,8), %xmm2
movapd %xmm1, %xmm5
mulsd %xmm3, %xmm5
subsd %xmm2, %xmm3
movsd %xmm3, (%rax)
addsd %xmm4, %xmm5
movsd %xmm5, (%rdx)
movq -0x50(%rbp), %rcx
addq %rcx, %rdx
addq %rcx, %rax
jmp 0x2d2f2
movq -0x38(%rbp), %rdx
movsd %xmm1, (%rdx,%rsi,8)
movl -0x2c(%rbp), %eax
movl %r14d, %ecx
leaq (%rdx,%rcx,8), %rcx
movq -0xa0(%rbp), %rdx
cmpl %edi, %r14d
jge 0x2d373
movsd (%rcx,%r12,8), %xmm0
movsd (%rcx,%rax,8), %xmm1
movsd %xmm1, (%rcx,%r12,8)
movsd %xmm0, (%rcx,%rax,8)
addq $0x8, %rcx
incl %r14d
jmp 0x2d34f
movslq -0x2c(%rbp), %rax
movq -0x48(%rbp), %rcx
leaq (%rcx,%rax,8), %rax
xorl %ecx, %ecx
cmpq %rcx, %rdx
je 0x2d3a1
movsd (%r15,%rcx,8), %xmm0
movsd (%rax,%rcx,8), %xmm1
movsd %xmm1, (%r15,%rcx,8)
movsd %xmm0, (%rax,%rcx,8)
incq %rcx
jmp 0x2d381
movl %ebx, -0x3c(%rbp)
movl -0x5c(%rbp), %eax
jmp 0x2d0bf
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq