// File: /workspace/github_c_makefile_star2_O0/tomcatzh[P]RealityBenchmark/external/cJSON.c
// Function: print_number
static cJSON_bool print_number(const cJSON * const item, printbuffer * const output_buffer)
{
    unsigned char *output_pointer = NULL;
    double d = item->valuedouble;
    int length = 0;
    size_t i = 0;
    unsigned char number_buffer[26]; /* temporary buffer to print the number into */
    unsigned char decimal_point = get_decimal_point();
    double test;

    if (output_buffer == NULL)
    {
        return false;
    }

    /* This checks for NaN and Infinity */
    if ((d * 0) != 0)
    {
        length = sprintf((char*)number_buffer, "null");
    }
    else
    {
        /* Try 15 decimal places of precision to avoid nonsignificant nonzero digits */
        length = sprintf((char*)number_buffer, "%1.15g", d);

        /* Check whether the original double can be recovered */
        if ((sscanf((char*)number_buffer, "%lg", &test) != 1) || ((double)test != d))
        {
            /* If not, print with 17 decimal places of precision */
            length = sprintf((char*)number_buffer, "%1.17g", d);
        }
    }

    /* sprintf failed or buffer overrun occurred */
    if ((length < 0) || (length > (int)(sizeof(number_buffer) - 1)))
    {
        return false;
    }

    /* reserve appropriate space in the output */
    output_pointer = ensure(output_buffer, (size_t)length + sizeof(""));
    if (output_pointer == NULL)
    {
        return false;
    }

    /* copy the printed number to the output and replace locale
     * dependent decimal point with '.' */
    for (i = 0; i < ((size_t)length); i++)
    {
        if (number_buffer[i] == decimal_point)
        {
            output_pointer[i] = '.';
            continue;
        }

        output_pointer[i] = number_buffer[i];
    }
    output_pointer[i] = '\0';

    output_buffer->offset += (size_t)length;

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
callq 0xa6f0
movb %al, -0x61(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xa970
movl $0x0, -0x4(%rbp)
jmp 0xaab2
xorps %xmm0, %xmm0
mulsd -0x28(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xa985
jp 0xa985
jmp 0xa99c
leaq -0x60(%rbp), %rdi
leaq 0x2275(%rip), %rsi      # 0xcc05
movb $0x0, %al
callq 0x2080
movl %eax, -0x2c(%rbp)
jmp 0xa9fd
leaq -0x60(%rbp), %rdi
movsd -0x28(%rbp), %xmm0
leaq 0x2269(%rip), %rsi      # 0xcc15
movb $0x1, %al
callq 0x2080
movl %eax, -0x2c(%rbp)
leaq -0x60(%rbp), %rdi
leaq 0x225b(%rip), %rsi      # 0xcc1c
leaq -0x70(%rbp), %rdx
movb $0x0, %al
callq 0x2250
cmpl $0x1, %eax
jne 0xa9e1
movsd -0x70(%rbp), %xmm0
ucomisd -0x28(%rbp), %xmm0
jne 0xa9e1
jp 0xa9e1
jmp 0xa9fb
leaq -0x60(%rbp), %rdi
movsd -0x28(%rbp), %xmm0
leaq 0x222f(%rip), %rsi      # 0xcc20
movb $0x1, %al
callq 0x2080
movl %eax, -0x2c(%rbp)
jmp 0xa9fd
cmpl $0x0, -0x2c(%rbp)
jl 0xaa09
cmpl $0x19, -0x2c(%rbp)
jle 0xaa15
movl $0x0, -0x4(%rbp)
jmp 0xaab2
movq -0x18(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
addq $0x1, %rsi
callq 0xa700
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xaa3a
movl $0x0, -0x4(%rbp)
jmp 0xaab2
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movslq -0x2c(%rbp), %rcx
cmpq %rcx, %rax
jae 0xaa8f
movq -0x38(%rbp), %rax
movzbl -0x60(%rbp,%rax), %eax
movzbl -0x61(%rbp), %ecx
cmpl %ecx, %eax
jne 0xaa6e
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rcx
movb $0x2e, (%rax,%rcx)
jmp 0xaa81
movq -0x38(%rbp), %rax
movb -0x60(%rbp,%rax), %dl
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xaa42
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movslq -0x2c(%rbp), %rcx
movq -0x18(%rbp), %rax
addq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)