// File: /workspace/github_cpp_makefile_star2_O2/Falldog[P]dcinja/src/include/nlohmann/json.hpp
// Function: nlohmann::detail::dtoa_impl::format_buffer(char*, int, int, int, int)
inline char* format_buffer(char* buf, int len, int decimal_exponent,
                           int min_exp, int max_exp)
{
    JSON_ASSERT(min_exp < 0);
    JSON_ASSERT(max_exp > 0);

    const int k = len;
    const int n = len + decimal_exponent;

    // v = buf * 10^(n-k)
    // k is the length of the buffer (number of decimal digits)
    // n is the position of the decimal point relative to the start of the buffer.

    if (k <= n && n <= max_exp)
    {
        // digits[000]
        // len <= max_exp + 2

        std::memset(buf + k, '0', static_cast<size_t>(n) - static_cast<size_t>(k));
        // Make it look like a floating-point number (#362, #378)
        buf[n + 0] = '.';
        buf[n + 1] = '0';
        return buf + (static_cast<size_t>(n) + 2);
    }

    if (0 < n && n <= max_exp)
    {
        // dig.its
        // len <= max_digits10 + 1

        JSON_ASSERT(k > n);

        std::memmove(buf + (static_cast<size_t>(n) + 1), buf + n, static_cast<size_t>(k) - static_cast<size_t>(n));
        buf[n] = '.';
        return buf + (static_cast<size_t>(k) + 1U);
    }

    if (min_exp < n && n <= 0)
    {
        // 0.[000]digits
        // len <= 2 + (-min_exp - 1) + max_digits10

        std::memmove(buf + (2 + static_cast<size_t>(-n)), buf, static_cast<size_t>(k));
        buf[0] = '0';
        buf[1] = '.';
        std::memset(buf + 2, '0', static_cast<size_t>(-n));
        return buf + (2U + static_cast<size_t>(-n) + static_cast<size_t>(k));
    }

    if (k == 1)
    {
        // dE+123
        // len <= 1 + 5

        buf += 1;
    }
    else
    {
        // d.igitsE+123
        // len <= max_digits10 + 1 + 5

        std::memmove(buf + 2, buf + 1, static_cast<size_t>(k) - 1);
        buf[1] = '.';
        buf += 1 + static_cast<size_t>(k);
    }

    *buf++ = 'e';
    return append_exponent(buf, n - 1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testl %ecx, %ecx
jns 0x31ca9
testl %r8d, %r8d
jle 0x31cc8
movq %rdi, %rbx
leal (%rdx,%rsi), %r14d
testl %edx, %edx
sets %al
cmpl %r8d, %r14d
setg %dil
orb %al, %dil
je 0x31bf8
cmpl %r8d, %r14d
setg %al
testl %r14d, %r14d
setle %dil
orb %al, %dil
je 0x31c21
testl %r14d, %r14d
setg %al
cmpl %ecx, %r14d
setle %cl
orb %al, %cl
jne 0x31c65
negl %r14d
leaq (%rbx,%r14), %r15
addq $0x2, %r15
movslq %esi, %r12
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x9720
movw $0x2e30, (%rbx)         # imm = 0x2E30
addq $0x2, %rbx
pushq $0x30
popq %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9260
addq %r12, %r15
jmp 0x31c56
movslq %esi, %rax
leaq (%rbx,%rax), %rdi
movslq %r14d, %r14
movq %r14, %rdx
subq %rax, %rdx
pushq $0x30
popq %rsi
callq 0x9260
leaq (%rbx,%r14), %r15
addq $0x2, %r15
movw $0x302e, -0x2(%r15)     # imm = 0x302E
jmp 0x31c56
testl %edx, %edx
jns 0x31ce7
movl %r14d, %ecx
leaq (%rbx,%rcx), %rax
leaq (%rbx,%rcx), %r14
incq %r14
movl %esi, %r15d
movq %r15, %rdx
subq %rcx, %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x9720
movb $0x2e, -0x1(%r14)
addq %rbx, %r15
incq %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
cmpl $0x1, %esi
je 0x31c88
leaq 0x2(%rbx), %rdi
leaq 0x1(%rbx), %rax
movslq %esi, %r15
leaq -0x1(%r15), %rdx
movq %rax, %rsi
callq 0x9720
movb $0x2e, 0x1(%rbx)
addq %r15, %rbx
movb $0x65, 0x1(%rbx)
addq $0x2, %rbx
decl %r14d
movq %rbx, %rdi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x32626
leaq 0x19706(%rip), %rdi     # 0x4b3b6
leaq 0x14fd2(%rip), %rsi     # 0x46c89
leaq 0x19704(%rip), %rcx     # 0x4b3c2
movl $0x3bd5, %edx           # imm = 0x3BD5
callq 0x92f0
leaq 0x19740(%rip), %rdi     # 0x4b40f
leaq 0x14fb3(%rip), %rsi     # 0x46c89
leaq 0x196e5(%rip), %rcx     # 0x4b3c2
movl $0x3bd6, %edx           # imm = 0x3BD6
callq 0x92f0
leaq 0x1972d(%rip), %rdi     # 0x4b41b
leaq 0x14f94(%rip), %rsi     # 0x46c89
leaq 0x196c6(%rip), %rcx     # 0x4b3c2
movl $0x3bf0, %edx           # imm = 0x3BF0
callq 0x92f0