// File: /workspace/github_c_makefile_star2_O3/ammarfaizi2[P]riyuu/src/third_party/cjson/cJSON_Utils.c
// Function: compare_json(cJSON*, cJSON*, int)
static cJSON_bool compare_json(cJSON *a, cJSON *b, const cJSON_bool case_sensitive)
{
    if ((a == NULL) || (b == NULL) || ((a->type & 0xFF) != (b->type & 0xFF)))
    {
        /* mismatched type. */
        return false;
    }
    switch (a->type & 0xFF)
    {
        case cJSON_Number:
            /* numeric mismatch. */
            if ((a->valueint != b->valueint) || (a->valuedouble != b->valuedouble))
            {
                return false;
            }
            else
            {
                return true;
            }

        case cJSON_String:
            /* string mismatch. */
            if (strcmp(a->valuestring, b->valuestring) != 0)
            {
                return false;
            }
            else
            {
                return true;
            }

        case cJSON_Array:
            for ((void)(a = a->child), b = b->child; (a != NULL) && (b != NULL); (void)(a = a->next), b = b->next)
            {
                cJSON_bool identical = compare_json(a, b, case_sensitive);
                if (!identical)
                {
                    return false;
                }
            }

            /* array size mismatch? (one of both children is not NULL) */
            if ((a != NULL) || (b != NULL))
            {
                return false;
            }
            else
            {
                return true;
            }

        case cJSON_Object:
            sort_object(a, case_sensitive);
            sort_object(b, case_sensitive);
            for ((void)(a = a->child), b = b->child; (a != NULL) && (b != NULL); (void)(a = a->next), b = b->next)
            {
                cJSON_bool identical = false;
                /* compare object keys */
                if (compare_strings((unsigned char*)a->string, (unsigned char*)b->string, case_sensitive))
                {
                    /* missing member */
                    return false;
                }
                identical = compare_json(a, b, case_sensitive);
                if (!identical)
                {
                    return false;
                }
            }

            /* object length mismatch (one of both children is not null) */
            if ((a != NULL) || (b != NULL))
            {
                return false;
            }
            else
            {
                return true;
            }

        default:
            break;
    }

    /* null, true or false */
    return true;
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x6a9f
xorl %ecx, %ecx
jmp 0x6bc4
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movzbl 0x18(%rdi), %eax
movzbl 0x18(%rsi), %ecx
cmpl %ecx, %eax
jne 0x6afd
addl $-0x8, %eax
roll $0x1d, %eax
movb $0x1, %cl
cmpl $0x7, %eax
ja 0x6bbc
movl %edx, %ebx
leaq 0x1712(%rip), %rdx      # 0x81e8
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movl 0x28(%r15), %eax
cmpl 0x28(%r14), %eax
jne 0x6afd
movsd 0x30(%r15), %xmm0
ucomisd 0x30(%r14), %xmm0
jne 0x6afd
jnp 0x6bbc
xorl %ecx, %ecx
jmp 0x6bbc
addq $0x10, %r15
addq $0x10, %r14
movq (%r15), %r15
movq (%r14), %r14
testq %r15, %r15
je 0x6bb1
testq %r14, %r14
je 0x6bb1
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x6a88
xorl %ecx, %ecx
testl %eax, %eax
jne 0x6b0c
jmp 0x6bbc
movq 0x20(%r15), %rdi
movq 0x20(%r14), %rsi
callq 0x2210
testl %eax, %eax
jmp 0x6bb9
leaq 0x10(%r15), %r12
movq 0x10(%r15), %rdi
movl %ebx, %esi
callq 0x6e82
movq %rax, 0x10(%r15)
leaq 0x10(%r14), %r15
movq 0x10(%r14), %rdi
movl %ebx, %esi
callq 0x6e82
movq %rax, 0x10(%r14)
movq (%r12), %r12
movq (%r15), %r15
testq %r12, %r12
je 0x6bb6
testq %r15, %r15
je 0x6bb6
movq 0x38(%r12), %rdi
movq 0x38(%r15), %rsi
movl %ebx, %edx
callq 0x6dd0
testl %eax, %eax
jne 0x6afd
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x6a88
xorl %ecx, %ecx
testl %eax, %eax
jne 0x6b73
jmp 0x6bbc
orq %r14, %r15
jmp 0x6bb9
orq %r15, %r12
sete %cl
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
movzbl %cl, %eax
retq