// File: 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
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x100(%rbp)
movq %rdi, -0xf8(%rbp)
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x16100
testb $0x1, %al
jne 0x167be
jmp 0x167c0
jmp 0x167df
leaq 0x687db(%rip), %rdi     # 0x7efa2
leaq 0x68373(%rip), %rsi     # 0x7eb41
movl $0x3221, %edx           # imm = 0x3221
leaq 0x689bd(%rip), %rcx     # 0x7f197
callq 0x6350
movsd -0x8(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x167ef
jmp 0x1680e
leaq 0x68997(%rip), %rdi     # 0x7f18d
leaq 0x68344(%rip), %rsi     # 0x7eb41
movl $0x3222, %edx           # imm = 0x3222
leaq 0x6898e(%rip), %rcx     # 0x7f197
callq 0x6350
movl $0x35, -0xc(%rbp)
movl $0x433, -0x10(%rbp)     # imm = 0x433
movl $0xfffffbce, -0x14(%rbp) # imm = 0xFFFFFBCE
movabsq $0x10000000000000, %rax # imm = 0x10000000000000
movq %rax, -0x20(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x16c70
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
shrq $0x34, %rax
movq %rax, -0x30(%rbp)
movabsq $0xfffffffffffff, %rax  # imm = 0xFFFFFFFFFFFFF
andq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x30(%rbp)
sete %al
andb $0x1, %al
movb %al, -0x39(%rbp)
testb $0x1, -0x39(%rbp)
je 0x16884
movq -0x38(%rbp), %rsi
leaq -0x50(%rbp), %rdi
movl $0xfffffbce, %edx       # imm = 0xFFFFFBCE
callq 0x16c90
jmp 0x168a7
movabsq $0x10000000000000, %rsi # imm = 0x10000000000000
addq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rax
movl %eax, %edx
subl $0x433, %edx            # imm = 0x433
leaq -0x50(%rbp), %rdi
callq 0x16c90
xorl %eax, %eax
cmpq $0x0, -0x38(%rbp)
movb %al, -0x101(%rbp)
jne 0x168c4
cmpq $0x1, -0x30(%rbp)
seta %al
movb %al, -0x101(%rbp)
movb -0x101(%rbp), %al
andb $0x1, %al
movb %al, -0x51(%rbp)
movq -0x50(%rbp), %rsi
shlq %rsi
addq $0x1, %rsi
movl -0x48(%rbp), %edx
subl $0x1, %edx
leaq -0x68(%rbp), %rdi
callq 0x16c90
testb $0x1, -0x51(%rbp)
je 0x1690c
movq -0x50(%rbp), %rsi
shlq $0x2, %rsi
subq $0x1, %rsi
movl -0x48(%rbp), %edx
subl $0x2, %edx
leaq -0x78(%rbp), %rdi
callq 0x16c90
jmp 0x16926
movq -0x50(%rbp), %rsi
shlq %rsi
subq $0x1, %rsi
movl -0x48(%rbp), %edx
subl $0x1, %edx
leaq -0x78(%rbp), %rdi
callq 0x16c90
movups -0x68(%rbp), %xmm0
movaps %xmm0, -0xa0(%rbp)
movq -0xa0(%rbp), %rdi
movl -0x98(%rbp), %esi
callq 0x16cc0
movl %edx, -0xa8(%rbp)
movq %rax, -0xb0(%rbp)
movl -0xa8(%rbp), %eax
movl %eax, -0x80(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0x80(%rbp), %esi
leaq -0x78(%rbp), %rdi
callq 0x16d40
movl %edx, -0xc8(%rbp)
movq %rax, -0xd0(%rbp)
movl -0xc8(%rbp), %eax
movl %eax, -0xb8(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movups -0x50(%rbp), %xmm0
movaps %xmm0, -0xe0(%rbp)
movq -0xe0(%rbp), %rdi
movl -0xd8(%rbp), %esi
callq 0x16cc0
movq -0x100(%rbp), %rcx
movq %rax, %rsi
movq -0xf8(%rbp), %rax
movq %rsi, -0x110(%rbp)
movl %edx, %esi
movq -0x110(%rbp), %rdx
movl %esi, -0xe8(%rbp)
movq %rdx, -0xf0(%rbp)
movq -0xf0(%rbp), %rdx
movq %rdx, (%rcx)
movl -0xe8(%rbp), %edx
movl %edx, 0x8(%rcx)
movq -0xc0(%rbp), %rdx
movq %rdx, 0x10(%rcx)
movl -0xb8(%rbp), %edx
movl %edx, 0x18(%rcx)
movq -0x88(%rbp), %rdx
movq %rdx, 0x20(%rcx)
movl -0x80(%rbp), %edx
movl %edx, 0x28(%rcx)
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw %cs:(%rax,%rax)