// File: /workspace/github_c_makefile_star2_O0/tomcatzh[P]RealityBenchmark/external/cJSON.c
// Function: parse_number
static cJSON_bool parse_number(cJSON * const item, parse_buffer * const input_buffer)
{
    double number = 0;
    unsigned char *after_end = NULL;
    unsigned char number_c_string[64];
    unsigned char decimal_point = get_decimal_point();
    size_t i = 0;

    if ((input_buffer == NULL) || (input_buffer->content == NULL))
    {
        return false;
    }

    /* copy the number into a temporary buffer and replace '.' with the decimal point
     * of the current locale (for strtod)
     * This also takes care of '\0' not necessarily being available for marking the end of the input */
    for (i = 0; (i < (sizeof(number_c_string) - 1)) && can_access_at_index(input_buffer, i); i++)
    {
        switch (buffer_at_offset(input_buffer)[i])
        {
            case '0':
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9':
            case '+':
            case '-':
            case 'e':
            case 'E':
                number_c_string[i] = buffer_at_offset(input_buffer)[i];
                break;

            case '.':
                number_c_string[i] = decimal_point;
                break;

            default:
                goto loop_end;
        }
    }
loop_end:
    number_c_string[i] = '\0';

    number = strtod((const char*)number_c_string, (char**)&after_end);
    if (number_c_string == after_end)
    {
        return false; /* parse_error */
    }

    item->valuedouble = number;

    /* use saturation in case of overflow */
    if (number >= INT_MAX)
    {
        item->valueint = INT_MAX;
    }
    else if (number <= (double)INT_MIN)
    {
        item->valueint = INT_MIN;
    }
    else
    {
        item->valueint = (int)number;
    }

    item->type = cJSON_Number;

    input_buffer->offset += (size_t)(after_end - number_c_string);
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
callq 0xa6f0
movb %al, -0x71(%rbp)
movq $0x0, -0x80(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x9c24
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x9c30
movl $0x0, -0x4(%rbp)
jmp 0x9deb
movq $0x0, -0x80(%rbp)
xorl %eax, %eax
cmpq $0x3f, -0x80(%rbp)
movb %al, -0x81(%rbp)
jae 0x9c7f
xorl %eax, %eax
cmpq $0x0, -0x18(%rbp)
movb %al, -0x82(%rbp)
je 0x9c73
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
addq -0x80(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
setb %al
movb %al, -0x82(%rbp)
movb -0x82(%rbp), %al
movb %al, -0x81(%rbp)
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0x9c8e
jmp 0x9d37
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq 0x10(%rax), %rax
addq %rax, %rcx
movq -0x80(%rbp), %rax
movzbl (%rax,%rcx), %eax
movl %eax, -0x88(%rbp)
subl $0x2b, %eax
je 0x9cf5
jmp 0x9cb1
movl -0x88(%rbp), %eax
subl $0x2d, %eax
je 0x9cf5
jmp 0x9cbe
movl -0x88(%rbp), %eax
subl $0x2e, %eax
je 0x9d15
jmp 0x9ccb
movl -0x88(%rbp), %eax
addl $-0x30, %eax
subl $0xa, %eax
jb 0x9cf5
jmp 0x9cdb
movl -0x88(%rbp), %eax
subl $0x45, %eax
je 0x9cf5
jmp 0x9ce8
movl -0x88(%rbp), %eax
subl $0x65, %eax
jne 0x9d22
jmp 0x9cf5
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
addq 0x10(%rcx), %rax
movq -0x80(%rbp), %rcx
movb (%rax,%rcx), %cl
movq -0x80(%rbp), %rax
movb %cl, -0x70(%rbp,%rax)
jmp 0x9d24
movb -0x71(%rbp), %cl
movq -0x80(%rbp), %rax
movb %cl, -0x70(%rbp,%rax)
jmp 0x9d24
jmp 0x9d39
jmp 0x9d26
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x9c38
jmp 0x9d39
movq -0x80(%rbp), %rax
movb $0x0, -0x70(%rbp,%rax)
leaq -0x70(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x21d0
movsd %xmm0, -0x20(%rbp)
leaq -0x70(%rbp), %rax
cmpq -0x28(%rbp), %rax
jne 0x9d6a
movl $0x0, -0x4(%rbp)
jmp 0x9deb
movsd -0x20(%rbp), %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x30(%rax)
movsd -0x20(%rbp), %xmm0
movsd 0x2d0b(%rip), %xmm1     # 0xca90
ucomisd %xmm1, %xmm0
jb 0x9d98
movq -0x10(%rbp), %rax
movl $0x7fffffff, 0x28(%rax) # imm = 0x7FFFFFFF
jmp 0x9dc2
movsd 0x2cf8(%rip), %xmm0     # 0xca98
ucomisd -0x20(%rbp), %xmm0
jb 0x9db4
movq -0x10(%rbp), %rax
movl $0x80000000, 0x28(%rax) # imm = 0x80000000
jmp 0x9dc0
cvttsd2si -0x20(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x28(%rax)
jmp 0x9dc2
movq -0x10(%rbp), %rax
movl $0x8, 0x18(%rax)
movq -0x28(%rbp), %rcx
leaq -0x70(%rbp), %rax
subq %rax, %rcx
movq -0x18(%rbp), %rax
addq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw (%rax,%rax)