// File: /workspace/github_cpp_makefile_star2_O3/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 0x3db5a
testl %r8d, %r8d
jle 0x3db79
movq %rdi, %rbx
leal (%rdx,%rsi), %r15d
testl %edx, %edx
sets %al
cmpl %r8d, %r15d
setg %dil
orb %al, %dil
je 0x3da03
cmpl %r8d, %r15d
setg %al
testl %r15d, %r15d
setle %dil
orb %al, %dil
je 0x3da30
testl %r15d, %r15d
setg %al
cmpl %ecx, %r15d
setle %cl
orb %al, %cl
jne 0x3da6b
negl %r15d
leaq (%rbx,%r15), %r14
addq $0x2, %r14
movslq %esi, %r12
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x9700
movw $0x2e30, (%rbx)         # imm = 0x2E30
addq $0x2, %rbx
movq %rbx, %rdi
movl $0x30, %esi
movq %r15, %rdx
callq 0x9230
addq %r12, %r14
jmp 0x3db4b
movslq %esi, %rax
leaq (%rbx,%rax), %rdi
movslq %r15d, %r14
movq %r14, %rdx
subq %rax, %rdx
movl $0x30, %esi
callq 0x9230
addq %rbx, %r14
addq $0x2, %r14
movw $0x302e, -0x2(%r14)     # imm = 0x302E
jmp 0x3db4b
testl %edx, %edx
jns 0x3db98
movl %r15d, %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 0x9700
movb $0x2e, -0x1(%r14)
leaq (%rbx,%r15), %r14
incq %r14
jmp 0x3db4b
cmpl $0x1, %esi
je 0x3da8e
leaq 0x2(%rbx), %rdi
leaq 0x1(%rbx), %rax
movslq %esi, %r14
leaq -0x1(%r14), %rdx
movq %rax, %rsi
callq 0x9700
movb $0x2e, 0x1(%rbx)
addq %r14, %rbx
movb $0x65, 0x1(%rbx)
cmpl $0xfffffc19, %r15d      # imm = 0xFFFFFC19
jle 0x3dbb7
cmpl $0x3e9, %r15d           # imm = 0x3E9
jge 0x3dbd6
leaq 0x2(%rbx), %r14
leal -0x1(%r15), %ecx
testl %r15d, %r15d
setle %dl
addb %dl, %dl
addb $0x2b, %dl
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
movb %dl, 0x2(%rbx)
cmpl $0x9, %eax
ja 0x3dad8
movb $0x30, 0x3(%rbx)
addq $0x4, %rbx
jmp 0x3dafc
cmpl $0x63, %eax
ja 0x3db03
movzbl %al, %eax
imull $0xcd, %eax, %ecx
shrl $0xb, %ecx
movl %ecx, %edx
orb $0x30, %dl
movb %dl, 0x3(%rbx)
addq $0x4, %rbx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
subb %cl, %al
movl $0x3, %ecx
jmp 0x3db44
movl $0xffff, %ecx           # imm = 0xFFFF
movl %eax, %edx
andl %ecx, %edx
shrl $0x2, %edx
imull $0x147b, %edx, %edx     # imm = 0x147B
shrl $0x11, %edx
leal 0x30(%rdx), %esi
movb %sil, 0x3(%rbx)
imull $0x64, %edx, %edx
subl %edx, %eax
imull $0x67, %eax, %edx
andl %ecx, %edx
shrl $0xa, %edx
movl %edx, %ecx
orb $0x30, %cl
movb %cl, 0x4(%rbx)
addq $0x5, %rbx
addl %edx, %edx
leal (%rdx,%rdx,4), %ecx
subb %cl, %al
movl $0x4, %ecx
addq %rcx, %r14
orb $0x30, %al
movb %al, (%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1c38c(%rip), %rdi     # 0x59eed
leaq 0x18179(%rip), %rsi     # 0x55ce1
leaq 0x1c38a(%rip), %rcx     # 0x59ef9
movl $0x3bd5, %edx           # imm = 0x3BD5
callq 0x92a0
leaq 0x1c3c6(%rip), %rdi     # 0x59f46
leaq 0x1815a(%rip), %rsi     # 0x55ce1
leaq 0x1c36b(%rip), %rcx     # 0x59ef9
movl $0x3bd6, %edx           # imm = 0x3BD6
callq 0x92a0
leaq 0x1c3b3(%rip), %rdi     # 0x59f52
leaq 0x1813b(%rip), %rsi     # 0x55ce1
leaq 0x1c34c(%rip), %rcx     # 0x59ef9
movl $0x3bf0, %edx           # imm = 0x3BF0
callq 0x92a0
leaq 0x1c39a(%rip), %rdi     # 0x59f58
leaq 0x1811c(%rip), %rsi     # 0x55ce1
leaq 0x1c396(%rip), %rcx     # 0x59f62
movl $0x3ba0, %edx           # imm = 0x3BA0
callq 0x92a0
leaq 0x1c3c5(%rip), %rdi     # 0x59fa2
leaq 0x180fd(%rip), %rsi     # 0x55ce1
leaq 0x1c377(%rip), %rcx     # 0x59f62
movl $0x3ba1, %edx           # imm = 0x3BA1
callq 0x92a0