// File: /workspace/github_c_makefile_star2_O0/tomcatzh[P]RealityBenchmark/external/cJSON.c
// Function: parse_object
static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer)
{
    cJSON *head = NULL; /* linked list head */
    cJSON *current_item = NULL;

    if (input_buffer->depth >= CJSON_NESTING_LIMIT)
    {
        return false; /* to deeply nested */
    }
    input_buffer->depth++;

    if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != '{'))
    {
        goto fail; /* not an object */
    }

    input_buffer->offset++;
    buffer_skip_whitespace(input_buffer);
    if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '}'))
    {
        goto success; /* empty object */
    }

    /* check if we skipped to the end of the buffer */
    if (cannot_access_at_index(input_buffer, 0))
    {
        input_buffer->offset--;
        goto fail;
    }

    /* step back to character in front of the first element */
    input_buffer->offset--;
    /* loop through the comma separated array elements */
    do
    {
        /* allocate next item */
        cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks));
        if (new_item == NULL)
        {
            goto fail; /* allocation failure */
        }

        /* attach next item to list */
        if (head == NULL)
        {
            /* start the linked list */
            current_item = head = new_item;
        }
        else
        {
            /* add to the end and advance */
            current_item->next = new_item;
            new_item->prev = current_item;
            current_item = new_item;
        }

        /* parse the name of the child */
        input_buffer->offset++;
        buffer_skip_whitespace(input_buffer);
        if (!parse_string(current_item, input_buffer))
        {
            goto fail; /* failed to parse name */
        }
        buffer_skip_whitespace(input_buffer);

        /* swap valuestring and string, because we parsed the name */
        current_item->string = current_item->valuestring;
        current_item->valuestring = NULL;

        if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != ':'))
        {
            goto fail; /* invalid object */
        }

        /* parse the value */
        input_buffer->offset++;
        buffer_skip_whitespace(input_buffer);
        if (!parse_value(current_item, input_buffer))
        {
            goto fail; /* failed to parse value */
        }
        buffer_skip_whitespace(input_buffer);
    }
    while (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ','));

    if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != '}'))
    {
        goto fail; /* expected end of object */
    }

success:
    input_buffer->depth--;

    item->type = cJSON_Object;
    item->child = head;

    input_buffer->offset++;
    return true;

fail:
    if (head != NULL)
    {
        cJSON_Delete(head);
    }

    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x3e8, 0x18(%rax)      # imm = 0x3E8
jb 0xa0aa
movl $0x0, -0x4(%rbp)
jmp 0xa380
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
cmpq $0x0, -0x18(%rbp)
je 0xa0ef
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x0, %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0xa0ef
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x7b, %eax
je 0xa0f4
jmp 0xa369
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
callq 0x6e00
cmpq $0x0, -0x18(%rbp)
je 0xa147
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x0, %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0xa147
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x7d, %eax
jne 0xa147
jmp 0xa329
cmpq $0x0, -0x18(%rbp)
je 0xa164
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x0, %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jb 0xa179
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x10(%rax)
jmp 0xa369
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
callq 0x6ae0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0xa1a6
jmp 0xa369
cmpq $0x0, -0x20(%rbp)
jne 0xa1bb
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
movq %rax, -0x28(%rbp)
jmp 0xa1da
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
callq 0x6e00
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9890
cmpl $0x0, %eax
jne 0xa20a
jmp 0xa369
movq -0x18(%rbp), %rdi
callq 0x6e00
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x20(%rax)
cmpq $0x0, -0x18(%rbp)
je 0xa264
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x0, %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0xa264
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
je 0xa269
jmp 0xa369
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
callq 0x6e00
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x6b20
cmpl $0x0, %eax
jne 0xa299
jmp 0xa369
movq -0x18(%rbp), %rdi
callq 0x6e00
xorl %eax, %eax
cmpq $0x0, -0x18(%rbp)
movb %al, -0x31(%rbp)
je 0xa2e5
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x0, %rcx
movq -0x18(%rbp), %rdx
xorl %eax, %eax
cmpq 0x8(%rdx), %rcx
movb %al, -0x31(%rbp)
jae 0xa2e5
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x2c, %eax
sete %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0xa189
cmpq $0x0, -0x18(%rbp)
je 0xa325
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x0, %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0xa325
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x7d, %eax
je 0xa327
jmp 0xa369
jmp 0xa329
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movl $0x40, 0x18(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movl $0x1, -0x4(%rbp)
jmp 0xa380
cmpq $0x0, -0x20(%rbp)
je 0xa379
movq -0x20(%rbp), %rdi
callq 0x67e0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)