// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/./json.hpp
// Function: nlohmann::detail::dtoa_impl::grisu2(char*, int&, int&, nlohmann::detail::dtoa_impl::diyfp, nlohmann::detail::dtoa_impl::diyfp, nlohmann::detail::dtoa_impl::diyfp)
inline void grisu2(char* buf, int& len, int& decimal_exponent,
                   diyfp m_minus, diyfp v, diyfp m_plus)
{
    assert(m_plus.e == m_minus.e);
    assert(m_plus.e == v.e);

    //  --------(-----------------------+-----------------------)--------    (A)
    //          m-                      v                       m+
    //
    //  --------------------(-----------+-----------------------)--------    (B)
    //                      m-          v                       m+
    //
    // First scale v (and m- and m+) such that the exponent is in the range
    // [alpha, gamma].

    const cached_power cached = get_cached_power_for_binary_exponent(m_plus.e);

    const diyfp c_minus_k(cached.f, cached.e); // = c ~= 10^-k

    // The exponent of the products is = v.e + c_minus_k.e + q and is in the range [alpha,gamma]
    const diyfp w       = diyfp::mul(v,       c_minus_k);
    const diyfp w_minus = diyfp::mul(m_minus, c_minus_k);
    const diyfp w_plus  = diyfp::mul(m_plus,  c_minus_k);

    //  ----(---+---)---------------(---+---)---------------(---+---)----
    //          w-                      w                       w+
    //          = c*m-                  = c*v                   = c*m+
    //
    // diyfp::mul rounds its result and c_minus_k is approximated too. w, w- and
    // w+ are now off by a small amount.
    // In fact:
    //
    //      w - v * 10^k < 1 ulp
    //
    // To account for this inaccuracy, add resp. subtract 1 ulp.
    //
    //  --------+---[---------------(---+---)---------------]---+--------
    //          w-  M-                  w                   M+  w+
    //
    // Now any number in [M-, M+] (bounds included) will round to w when input,
    // regardless of how the input rounding algorithm breaks ties.
    //
    // And digit_gen generates the shortest possible such number in [M-, M+].
    // Note that this does not mean that Grisu2 always generates the shortest
    // possible number in the interval (m-, m+).
    const diyfp M_minus(w_minus.f + 1, w_minus.e);
    const diyfp M_plus (w_plus.f  - 1, w_plus.e );

    decimal_exponent = -cached.k; // = -(-k) = k

    grisu2_digit_gen(buf, len, decimal_exponent, M_minus, w, M_plus);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, 0x58(%rsp)
movl %r8d, 0x60(%rsp)
cmpl %r8d, 0xc8(%rsp)
jne 0xb586
movq %rdi, 0x20(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
leaq 0xb0(%rsp), %r13
cmpl %r8d, 0x8(%r13)
jne 0xb5a5
movl %r8d, %edi
callq 0xb658
movq %rdx, %r12
leaq 0x68(%rsp), %r14
movq %rax, (%r14)
movl %r12d, 0x8(%r14)
movq %r13, %rdi
movq %r14, %rsi
callq 0xb796
movq %rax, %r15
movl %edx, %ebx
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
callq 0xb796
movq %rax, %r13
movl %edx, %ebp
leaq 0xc0(%rsp), %rdi
movq %r14, %rsi
callq 0xb796
incq %r13
decq %rax
shrq $0x20, %r12
negl %r12d
movq 0x30(%rsp), %rcx
movl %r12d, (%rcx)
movq %r15, 0x48(%rsp)
movl %ebx, 0x50(%rsp)
movq %rax, 0x38(%rsp)
movl %edx, 0x40(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, 0x10(%rsp)
movups 0x48(%rsp), %xmm0
movups %xmm0, (%rsp)
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %rcx, %rdx
movq %r13, %rcx
movl %ebp, %r8d
callq 0xb7f2
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x289d1(%rip), %rdi     # 0x33f5e
leaq 0x28266(%rip), %rsi     # 0x337fa
leaq 0x289d9(%rip), %rcx     # 0x33f74
movl $0x34a3, %edx           # imm = 0x34A3
callq 0x52c0
leaq 0x28a1c(%rip), %rdi     # 0x33fc8
leaq 0x28247(%rip), %rsi     # 0x337fa
leaq 0x289ba(%rip), %rcx     # 0x33f74
movl $0x34a4, %edx           # imm = 0x34A4
callq 0x52c0