// File: /workspace/github_cpp_makefile_star2_O3/Konano[P]UselessDatabase/./json.hpp
// Function: nlohmann::detail::dtoa_impl::boundaries nlohmann::detail::dtoa_impl::compute_boundaries<double>(double)
boundaries compute_boundaries(FloatType value)
{
    assert(std::isfinite(value));
    assert(value > 0);

    // Convert the IEEE representation into a diyfp.
    //
    // If v is denormal:
    //      value = 0.F * 2^(1 - bias) = (          F) * 2^(1 - bias - (p-1))
    // If v is normalized:
    //      value = 1.F * 2^(E - bias) = (2^(p-1) + F) * 2^(E - bias - (p-1))

    static_assert(std::numeric_limits<FloatType>::is_iec559,
                  "internal error: dtoa_short requires an IEEE-754 floating-point implementation");

    constexpr int      kPrecision = std::numeric_limits<FloatType>::digits; // = p (includes the hidden bit)
    constexpr int      kBias      = std::numeric_limits<FloatType>::max_exponent - 1 + (kPrecision - 1);
    constexpr int      kMinExp    = 1 - kBias;
    constexpr std::uint64_t kHiddenBit = std::uint64_t{1} << (kPrecision - 1); // = 2^(p-1)

    using bits_type = typename std::conditional<kPrecision == 24, std::uint32_t, std::uint64_t >::type;

    const std::uint64_t bits = reinterpret_bits<bits_type>(value);
    const std::uint64_t E = bits >> (kPrecision - 1);
    const std::uint64_t F = bits & (kHiddenBit - 1);

    const bool is_denormal = E == 0;
    const diyfp v = is_denormal
                    ? diyfp(F, kMinExp)
                    : diyfp(F + kHiddenBit, static_cast<int>(E) - kBias);

    // Compute the boundaries m- and m+ of the floating-point value
    // v = f * 2^e.
    //
    // Determine v- and v+, the floating-point predecessor and successor if v,
    // respectively.
    //
    //      v- = v - 2^e        if f != 2^(p-1) or e == e_min                (A)
    //         = v - 2^(e-1)    if f == 2^(p-1) and e > e_min                (B)
    //
    //      v+ = v + 2^e
    //
    // Let m- = (v- + v) / 2 and m+ = (v + v+) / 2. All real numbers _strictly_
    // between m- and m+ round to v, regardless of how the input rounding
    // algorithm breaks ties.
    //
    //      ---+-------------+-------------+-------------+-------------+---  (A)
    //         v-            m-            v             m+            v+
    //
    //      -----------------+------+------+-------------+-------------+---  (B)
    //                       v-     m-     v             m+            v+

    const bool lower_boundary_is_closer = F == 0 and E > 1;
    const diyfp m_plus = diyfp(2 * v.f + 1, v.e - 1);
    const diyfp m_minus = lower_boundary_is_closer
                          ? diyfp(4 * v.f - 1, v.e - 2)  // (B)
                          : diyfp(2 * v.f - 1, v.e - 1); // (A)

    // Determine the normalized w+ = m+.
    const diyfp w_plus = diyfp::normalize(m_plus);

    // Determine w- = m- such that e_(w-) = e_(w+).
    const diyfp w_minus = diyfp::normalize_to(m_minus, w_plus.e);

    return {diyfp::normalize(v), w_minus, w_plus};
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %xmm0, %rax
movq %rax, %rcx
btrq $0x3f, %rcx
movabsq $0x7ff0000000000000, %rdx # imm = 0x7FF0000000000000
cmpq %rdx, %rcx
jge 0xc8e7
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xc906
movq %rdi, %rbx
movabsq $0x10000000000000, %r14 # imm = 0x10000000000000
leaq -0x1(%r14), %rdx
andq %rax, %rdx
movq %rax, %rcx
shrq $0x34, %rcx
jne 0xc83e
leaq 0x1(,%rax,2), %rdi
addq %rax, %rax
movl $0xfffffbce, 0x4(%rsp)  # imm = 0xFFFFFBCE
movl $0xfffffbcd, %esi       # imm = 0xFFFFFBCD
jmp 0xc886
movq %rdx, %r8
orq %r14, %r8
leal -0x433(%rcx), %esi
movl %esi, 0x4(%rsp)
testq %rdx, %rdx
setne %dl
shrq $0x35, %rax
sete %al
leaq 0x1(,%r8,2), %rdi
leal -0x434(%rcx), %esi
orb %dl, %al
jne 0xc87f
addl $0xfffffbcb, %ecx       # imm = 0xFFFFFBCB
movabsq $0x3fffffffffffff, %rax # imm = 0x3FFFFFFFFFFFFF
jmp 0xc88e
leaq (%r8,%r8), %rax
movq %r8, %rdx
decq %rax
movl %esi, %ecx
movq %rdx, %r14
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
movl %ecx, 0x8(%r15)
callq 0xca54
movq %rax, %r12
movl %edx, %r13d
movq %r15, %rdi
movl %edx, %esi
callq 0xca8c
movq %rax, %r15
movl %edx, %ebp
movq %r14, %rdi
movl 0x4(%rsp), %esi
callq 0xca54
movq %rax, (%rbx)
movl %edx, 0x8(%rbx)
movq %r15, 0x10(%rbx)
movl %ebp, 0x18(%rbx)
movq %r12, 0x20(%rbx)
movl %r13d, 0x28(%rbx)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x302a1(%rip), %rdi     # 0x3cb8f
leaq 0x2ff05(%rip), %rsi     # 0x3c7fa
leaq 0x3046c(%rip), %rcx     # 0x3cd68
movl $0x3221, %edx           # imm = 0x3221
callq 0x5280
leaq 0x30451(%rip), %rdi     # 0x3cd5e
leaq 0x2fee6(%rip), %rsi     # 0x3c7fa
leaq 0x3044d(%rip), %rcx     # 0x3cd68
movl $0x3222, %edx           # imm = 0x3222
callq 0x5280