// File: /workspace/github_c_makefile_star2_O3/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 0x5b63
movq %rdi, %rbx
testq %rdi, %rdi
je 0x5b65
movq %rsi, %r14
cmpb $0x2f, (%rsi)
jne 0x5b65
movl %edx, %r12d
leaq -0x38(%rbp), %r15
movl %edx, -0x3c(%rbp)
incq %r14
movq %rbx, %rdi
callq 0x4e88
testl %eax, %eax
je 0x5a65
movq $0x0, -0x38(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a1a
testl %eax, %eax
je 0x5b63
movq -0x38(%rbp), %rax
addq $0x10, %rbx
movq (%rbx), %rbx
addq $-0x1, %rax
setb %cl
testq %rbx, %rbx
je 0x5b47
testb %cl, %cl
jne 0x5a49
jmp 0x5b47
movq %rbx, %rdi
callq 0x4e9c
testl %eax, %eax
je 0x5b63
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
je 0x5b34
movq %r14, -0x30(%rbp)
movq 0x38(%rbx), %r14
testq %r14, %r14
je 0x5b17
movb (%r14), %al
movq -0x30(%rbp), %r15
testb %al, %al
je 0x5b0a
incq %r14
movq -0x30(%rbp), %r15
movzbl %al, %edi
movzbl (%r15), %r13d
cmpl $0x7e, %r13d
je 0x5ac9
testl %r13d, %r13d
je 0x5b25
cmpl $0x2f, %r13d
je 0x5b25
testl %r12d, %r12d
je 0x5ae4
cmpb %r13b, %al
je 0x5afd
jmp 0x5b17
movb 0x1(%r15), %al
incq %r15
cmpl $0x7e, %edi
jne 0x5ad9
cmpb $0x30, %al
je 0x5afd
cmpl $0x2f, %edi
jne 0x5b17
cmpb $0x31, %al
je 0x5afd
jmp 0x5b17
callq 0x2240
movl %eax, %r12d
movl %r13d, %edi
callq 0x2240
cmpl %eax, %r12d
movl -0x3c(%rbp), %r12d
jne 0x5b17
incq %r15
movb (%r14), %al
incq %r14
testb %al, %al
jne 0x5aa5
movzbl (%r15), %eax
testl %eax, %eax
je 0x5b3a
cmpl $0x2f, %eax
je 0x5b3a
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x5a86
jmp 0x5b38
movzbl (%r15), %eax
testl %eax, %eax
je 0x5b17
cmpl $0x2f, %eax
je 0x5b17
jmp 0x5b3a
xorl %ebx, %ebx
jmp 0x5b47
xorl %ebx, %ebx
movq -0x30(%rbp), %r14
leaq -0x38(%rbp), %r15
jmp 0x5b47
incq %r14
movzbl (%r14), %eax
testl %eax, %eax
je 0x5b54
cmpl $0x2f, %eax
jne 0x5b44
testq %rbx, %rbx
je 0x5b65
cmpb $0x2f, %al
je 0x5a17
jmp 0x5b65
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq