// File: /workspace/github_cpp_makefile_star2_O2/schuyler[P]quickfix/include/quickfix/fix.h
// Function: Beacon<float, 2> Beacon<float, 2>::Fix<Beacon<float, 2>::DifferenceSolver>(float, float, int) const
Beacon<F, D> Beacon<F, D>::Fix(F time, F rmsError, int maxTries) const {
    F mseTarget = rmsError * rmsError;
    Beacon best = *this;
    Heap heap;
    int tries;

    best.estimatePosition<Solver>(time);
    heap.push(best);

    for (tries = 0; !heap.empty() && (maxTries <= 0 || tries < maxTries);) {
        Beacon b = heap.top();
        //qfdebug("Fix: " << b.A.rows() << ": " << b.X << " (" << b.Err << ")");
        heap.pop();
        if (b.Err <= mseTarget) break;
        if (b.A.rows() <= D + 2) continue;

        for (int drop = 0; drop < b.A.rows() && (maxTries <= 0 || tries < maxTries); drop++, tries++) {
            Beacon next = b;
            dropRow<Anchors>(next.A, drop);
            dropRow<Ranges>(next.R, drop);
            next.estimatePosition<Solver>(time);
            heap.push(next);
            if (next.Err <= mseTarget) {
                b = next;
                break;
            }
        }
        if (b < best) best = b;
    }
    qfdebug("Fix took " << tries << " of " <<  maxTries << " tries using " << best.A.rows() << " of " <<  A.rows() << " anchors");
    best.clipToBound();
    return best;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %edx, %ebp
movss %xmm1, 0x8(%rsp)
movss %xmm0, 0xc(%rsp)
movq %rdi, %rbx
callq 0x4dfa0
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
movq %rbx, %rdi
movss 0xc(%rsp), %xmm0
movq %rbx, 0x10(%rsp)
callq 0x4f2e0
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x4c3a0
movss 0x8(%rsp), %xmm0
mulss %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
xorl %r14d, %r14d
leaq 0x40(%rsp), %r15
leaq 0x20(%rsp), %r12
leaq 0xa0(%rsp), %r13
testl %ebp, %ebp
setle %al
movq 0x20(%rsp), %rsi
cmpl %ebp, %r14d
setl %cl
cmpq 0x28(%rsp), %rsi
je 0x51212
orb %cl, %al
je 0x51212
movq %r15, %rdi
callq 0x4dfa0
movq %r12, %rdi
callq 0x4d030
movss 0x80(%rsp), %xmm1
movss 0x8(%rsp), %xmm0
movss %xmm1, 0x1c(%rsp)
ucomiss %xmm1, %xmm0
setae %cl
movq 0x48(%rsp), %rax
cmpq $0x5, %rax
setl %dl
orb %cl, %dl
jne 0x511f9
movl %r14d, %r14d
xorl %ebx, %ebx
testl %ebp, %ebp
setle %cl
leal (%r14,%rbx), %edx
cmpl %ebp, %edx
setl %dl
cmpq %rbx, %rax
jle 0x511da
orb %dl, %cl
je 0x511da
movq %r13, %rdi
movq %r15, %rsi
callq 0x4dfa0
movq %r13, %rdi
movl %ebx, %esi
callq 0x4d4b0
leaq 0xb0(%rsp), %rdi
movl %ebx, %esi
callq 0x4e3b0
movq %r13, %rdi
movss 0xc(%rsp), %xmm0
callq 0x4f2e0
movq %r12, %rdi
movq %r13, %rsi
callq 0x4c3a0
movss 0x8(%rsp), %xmm0
ucomiss 0xe0(%rsp), %xmm0
jae 0x511c7
movq %r13, %rdi
callq 0x4f560
incq %rbx
movq 0x48(%rsp), %rax
jmp 0x51151
movq %r15, %rdi
movq %r13, %rsi
callq 0x4fd10
movq %r13, %rdi
callq 0x4f560
movss 0x80(%rsp), %xmm0
addq %rbx, %r14
movq 0x10(%rsp), %rdi
ucomiss 0x40(%rdi), %xmm0
jae 0x511f9
movq %r15, %rsi
callq 0x4fd10
movq %r15, %rdi
callq 0x4f560
movss 0x1c(%rsp), %xmm0
ucomiss 0x8(%rsp), %xmm0
ja 0x510ea
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x4fd80
leaq 0x20(%rsp), %rdi
callq 0x4fc20
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x51242
jmp 0x5124e
movq %rax, %rbx
jmp 0x51268
jmp 0x51249
movq %rax, %rbx
jmp 0x5125e
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x4f560
leaq 0x40(%rsp), %rdi
callq 0x4f560
leaq 0x20(%rsp), %rdi
callq 0x4fc20
movq 0x10(%rsp), %rdi
callq 0x4f560
movq %rbx, %rdi
callq 0x4f920