// File: /workspace/github_c_makefile_star2_O1/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 0x6c1d
xorl %ecx, %ecx
jmp 0x6d42
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 0x6c7b
addl $-0x8, %eax
roll $0x1d, %eax
movb $0x1, %cl
cmpl $0x7, %eax
ja 0x6d3a
movl %edx, %ebx
leaq 0x159c(%rip), %rdx      # 0x81f0
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movl 0x28(%r15), %eax
cmpl 0x28(%r14), %eax
jne 0x6c7b
movsd 0x30(%r15), %xmm0
ucomisd 0x30(%r14), %xmm0
jne 0x6c7b
jnp 0x6d3a
xorl %ecx, %ecx
jmp 0x6d3a
addq $0x10, %r15
addq $0x10, %r14
movq (%r15), %r15
movq (%r14), %r14
testq %r15, %r15
je 0x6d2f
testq %r14, %r14
je 0x6d2f
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x6c06
xorl %ecx, %ecx
testl %eax, %eax
jne 0x6c8a
jmp 0x6d3a
movq 0x20(%r15), %rdi
movq 0x20(%r14), %rsi
callq 0x2210
testl %eax, %eax
jmp 0x6d37
leaq 0x10(%r15), %r12
movq 0x10(%r15), %rdi
movl %ebx, %esi
callq 0x7004
movq %rax, 0x10(%r15)
leaq 0x10(%r14), %r15
movq 0x10(%r14), %rdi
movl %ebx, %esi
callq 0x7004
movq %rax, 0x10(%r14)
movq (%r12), %r12
movq (%r15), %r15
testq %r12, %r12
je 0x6d34
testq %r15, %r15
je 0x6d34
movq 0x38(%r12), %rdi
movq 0x38(%r15), %rsi
movl %ebx, %edx
callq 0x6f52
testl %eax, %eax
jne 0x6c7b
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x6c06
xorl %ecx, %ecx
testl %eax, %eax
jne 0x6cf1
jmp 0x6d3a
orq %r14, %r15
jmp 0x6d37
orq %r15, %r12
sete %cl
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
movzbl %cl, %eax
retq