// File: /workspace/github_cpp_makefile_star2_O1/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 0x3df4d
testl %r8d, %r8d
jle 0x3df6c
movq %rdi, %rbx
leal (%rdx,%rsi), %r14d
testl %edx, %edx
sets %al
cmpl %r8d, %r14d
setg %dil
orb %al, %dil
je 0x3de07
cmpl %r8d, %r14d
setg %al
testl %r14d, %r14d
setle %dil
orb %al, %dil
je 0x3de35
cmpl %ecx, %r14d
setle %al
testl %r14d, %r14d
setg %cl
orb %al, %cl
jne 0x3de6f
negl %r14d
leaq (%rbx,%r14), %r15
addq $0x2, %r15
movslq %esi, %r12
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x9700
movw $0x2e30, (%rbx)         # imm = 0x2E30
addq $0x2, %rbx
movq %rbx, %rdi
movl $0x30, %esi
movq %r14, %rdx
callq 0x9230
addq %r12, %r15
jmp 0x3df3e
movslq %esi, %rax
leaq (%rbx,%rax), %rdi
movslq %r14d, %r14
movq %r14, %rdx
subq %rax, %rdx
movl $0x30, %esi
callq 0x9230
leaq (%rbx,%r14), %r15
addq $0x2, %r15
movw $0x302e, -0x2(%r15)     # imm = 0x302E
jmp 0x3df3e
testl %edx, %edx
jns 0x3df8b
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 0x9700
movb $0x2e, -0x1(%r14)
addq %rbx, %r15
incq %r15
jmp 0x3df3e
cmpl $0x1, %esi
je 0x3de92
leaq 0x2(%rbx), %rdi
leaq 0x1(%rbx), %rax
movslq %esi, %r15
leaq -0x1(%r15), %rdx
movq %rax, %rsi
callq 0x9700
movb $0x2e, 0x1(%rbx)
addq %r15, %rbx
movb $0x65, 0x1(%rbx)
cmpl $0xfffffc19, %r14d      # imm = 0xFFFFFC19
jle 0x3dfaa
cmpl $0x3e9, %r14d           # imm = 0x3E9
jge 0x3dfc9
leal -0x1(%r14), %ecx
testl %r14d, %r14d
setle %dl
addb %dl, %dl
addb $0x2b, %dl
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
movb %dl, 0x2(%rbx)
cmpl $0x9, %eax
ja 0x3ded4
movb $0x30, 0x3(%rbx)
jmp 0x3def7
movl %eax, %ecx
cmpl $0x63, %eax
ja 0x3df02
movl $0xcccccccd, %edx       # imm = 0xCCCCCCCD
imulq %rcx, %rdx
shrq $0x23, %rdx
movl %edx, %ecx
orb $0x30, %cl
movb %cl, 0x3(%rbx)
addl %edx, %edx
leal (%rdx,%rdx,4), %ecx
subl %ecx, %eax
orb $0x30, %al
movb %al, 0x4(%rbx)
addq $0x5, %rbx
jmp 0x3df3b
imulq $0x51eb851f, %rcx, %rcx # imm = 0x51EB851F
shrq $0x25, %rcx
leal 0x30(%rcx), %edx
movb %dl, 0x3(%rbx)
imull $0x64, %ecx, %ecx
subl %ecx, %eax
imulq $0x1999999a, %rax, %rcx # imm = 0x1999999A
shrq $0x20, %rcx
movl %ecx, %edx
orb $0x30, %dl
movb %dl, 0x4(%rbx)
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
orb $0x30, %al
movb %al, 0x5(%rbx)
addq $0x6, %rbx
movq %rbx, %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1cfa1(%rip), %rdi     # 0x5aef5
leaq 0x18d8e(%rip), %rsi     # 0x56ce9
leaq 0x1cf9f(%rip), %rcx     # 0x5af01
movl $0x3bd5, %edx           # imm = 0x3BD5
callq 0x92a0
leaq 0x1cfdb(%rip), %rdi     # 0x5af4e
leaq 0x18d6f(%rip), %rsi     # 0x56ce9
leaq 0x1cf80(%rip), %rcx     # 0x5af01
movl $0x3bd6, %edx           # imm = 0x3BD6
callq 0x92a0
leaq 0x1cfc8(%rip), %rdi     # 0x5af5a
leaq 0x18d50(%rip), %rsi     # 0x56ce9
leaq 0x1cf61(%rip), %rcx     # 0x5af01
movl $0x3bf0, %edx           # imm = 0x3BF0
callq 0x92a0
leaq 0x1cfaf(%rip), %rdi     # 0x5af60
leaq 0x18d31(%rip), %rsi     # 0x56ce9
leaq 0x1cfab(%rip), %rcx     # 0x5af6a
movl $0x3ba0, %edx           # imm = 0x3BA0
callq 0x92a0
leaq 0x1cfda(%rip), %rdi     # 0x5afaa
leaq 0x18d12(%rip), %rsi     # 0x56ce9
leaq 0x1cf8c(%rip), %rcx     # 0x5af6a
movl $0x3ba1, %edx           # imm = 0x3BA1
callq 0x92a0