// File: /workspace/github_c_makefile_star2_O1/ammarfaizi2[P]riyuu/src/third_party/cjson/cJSON_Utils.c
// Function: get_item_from_pointer(cJSON*, char const*, int)
static cJSON *get_item_from_pointer(cJSON * const object, const char * pointer, const cJSON_bool case_sensitive)
{
    cJSON *current_element = object;

    if (pointer == NULL)
    {
        return NULL;
    }

    /* follow path of the pointer */
    while ((pointer[0] == '/') && (current_element != NULL))
    {
        pointer++;
        if (cJSON_IsArray(current_element))
        {
            size_t index = 0;
            if (!decode_array_index_from_pointer((const unsigned char*)pointer, &index))
            {
                return NULL;
            }

            current_element = get_array_item(current_element, index);
        }
        else if (cJSON_IsObject(current_element))
        {
            current_element = current_element->child;
            /* GetObjectItem. */
            while ((current_element != NULL) && !compare_pointers((unsigned char*)current_element->string, (const unsigned char*)pointer, case_sensitive))
            {
                current_element = current_element->next;
            }
        }
        else
        {
            return NULL;
        }

        /* skip to the next path token or end of string */
        while ((pointer[0] != '\0') && (pointer[0] != '/'))
        {
            pointer++;
        }
    }

    return current_element;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rsi, %rsi
je 0x5cc0
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x2f, (%rsi)
setne %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x5cc2
movl %edx, %r12d
leaq -0x38(%rbp), %r15
movl %edx, -0x3c(%rbp)
incq %r14
movq %rbx, %rdi
callq 0x4f5d
testl %eax, %eax
je 0x5bc5
movq $0x0, -0x38(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6b83
testl %eax, %eax
je 0x5bb8
movq -0x38(%rbp), %rcx
addq $0x10, %rbx
movq (%rbx), %rbx
addq $-0x1, %rcx
setb %dl
testq %rbx, %rbx
je 0x5bb8
testb %dl, %dl
jne 0x5ba5
testl %eax, %eax
jne 0x5c9d
jmp 0x5cc0
movq %rbx, %rdi
callq 0x4f71
testl %eax, %eax
je 0x5cc0
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
je 0x5c9b
movq %r14, -0x30(%rbp)
movq 0x38(%rbx), %r14
testq %r14, %r14
je 0x5c83
movb (%r14), %al
testb %al, %al
je 0x5c6a
incq %r14
movq -0x30(%rbp), %r15
movzbl %al, %edi
movzbl (%r15), %r13d
cmpl $0x7e, %r13d
je 0x5c27
xorl %ecx, %ecx
testl %r13d, %r13d
je 0x5c70
cmpl $0x2f, %r13d
je 0x5c70
testl %r12d, %r12d
je 0x5c42
cmpb %r13b, %al
je 0x5c5b
jmp 0x5c83
movb 0x1(%r15), %al
incq %r15
cmpl $0x7e, %edi
jne 0x5c37
cmpb $0x30, %al
je 0x5c5b
cmpl $0x2f, %edi
jne 0x5c83
cmpb $0x31, %al
je 0x5c5b
jmp 0x5c83
callq 0x2240
movl %eax, %r12d
movl %r13d, %edi
callq 0x2240
cmpl %eax, %r12d
movl -0x3c(%rbp), %r12d
jne 0x5c83
incq %r15
movb (%r14), %al
incq %r14
testb %al, %al
jne 0x5c01
jmp 0x5c6e
movq -0x30(%rbp), %r15
movb $0x1, %cl
movb (%r15), %al
testb %al, %al
sete %dl
cmpb $0x2f, %al
sete %al
orb %dl, %al
cmpb %al, %cl
je 0x5c91
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x5be6
xorl %ebx, %ebx
movq -0x30(%rbp), %r14
leaq -0x38(%rbp), %r15
jmp 0x5c9d
xorl %ebx, %ebx
movzbl (%r14), %eax
testl %eax, %eax
je 0x5caf
cmpl $0x2f, %eax
je 0x5caf
incq %r14
jmp 0x5c9d
cmpb $0x2f, (%r14)
jne 0x5cc2
testq %rbx, %rbx
jne 0x5b77
jmp 0x5cc2
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq