// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_value_equals
int json_value_equals(const JSON_Value *a, const JSON_Value *b) {
    JSON_Object *a_object = NULL, *b_object = NULL;
    JSON_Array *a_array = NULL, *b_array = NULL;
    const char *a_string = NULL, *b_string = NULL;
    const char *key = NULL;
    size_t a_count = 0, b_count = 0, i = 0;
    JSON_Value_Type a_type, b_type;
    a_type = json_value_get_type(a);
    b_type = json_value_get_type(b);
    if (a_type != b_type) {
        return 0;
    }
    switch (a_type) {
        case JSONArray:
            a_array = json_value_get_array(a);
            b_array = json_value_get_array(b);
            a_count = json_array_get_count(a_array);
            b_count = json_array_get_count(b_array);
            if (a_count != b_count) {
                return 0;
            }
            for (i = 0; i < a_count; i++) {
                if (!json_value_equals(json_array_get_value(a_array, i),
                                       json_array_get_value(b_array, i))) {
                    return 0;
                }
            }
            return 1;
        case JSONObject:
            a_object = json_value_get_object(a);
            b_object = json_value_get_object(b);
            a_count = json_object_get_count(a_object);
            b_count = json_object_get_count(b_object);
            if (a_count != b_count) {
                return 0;
            }
            for (i = 0; i < a_count; i++) {
                key = json_object_get_name(a_object, i);
                if (!json_value_equals(json_object_get_value(a_object, key),
                                       json_object_get_value(b_object, key))) {
                    return 0;
                }
            }
            return 1;
        case JSONString:
            a_string = json_value_get_string(a);
            b_string = json_value_get_string(b);
            if (a_string == NULL || b_string == NULL) {
                return 0; /* shouldn't happen */
            }
            return strcmp(a_string, b_string) == 0;
        case JSONBoolean:
            return json_value_get_boolean(a) == json_value_get_boolean(b);
        case JSONNumber:
            return fabs(json_value_get_number(a) - json_value_get_number(b)) < 0.000001; /* EPSILON */
        case JSONError:
            return 1;
        case JSONNull:
            return 1;
        default:
            return 1;
    }
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x58b5
movl 0x8(%rdi), %ecx
testq %rsi, %rsi
je 0x58bd
movl 0x8(%rsi), %eax
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl %eax, %ecx
jne 0x5b07
movb $0x1, %al
addl $-0x2, %ecx
cmpl $0x4, %ecx
ja 0x5b09
leaq 0x1a8b(%rip), %rdx      # 0x7370
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
testq %rdi, %rdi
je 0x59ed
cmpl $0x2, 0x8(%rdi)
jne 0x59ed
movq 0x10(%rdi), %rdi
jmp 0x59ef
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x5922
cmpl $0x6, 0x8(%rdi)
jne 0x5922
movl 0x10(%rdi), %ecx
testq %rsi, %rsi
je 0x5930
cmpl $0x6, 0x8(%rsi)
jne 0x5930
movl 0x10(%rsi), %eax
cmpl %eax, %ecx
sete %al
jmp 0x5b09
testq %rdi, %rdi
je 0x59a4
cmpl $0x4, 0x8(%rdi)
jne 0x59a4
movq 0x10(%rdi), %rbx
jmp 0x59a6
testq %rdi, %rdi
je 0x59c5
cmpl $0x5, 0x8(%rdi)
jne 0x59c5
movq 0x10(%rdi), %rbx
jmp 0x59c7
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
testq %rdi, %rdi
je 0x5974
cmpl $0x3, 0x8(%rdi)
jne 0x5974
movsd 0x10(%rdi), %xmm1
testq %rsi, %rsi
je 0x5984
cmpl $0x3, 0x8(%rsi)
jne 0x5984
movsd 0x10(%rsi), %xmm0
subsd %xmm0, %xmm1
andpd 0x1ae0(%rip), %xmm1     # 0x7470
movsd 0x1ae8(%rip), %xmm0     # 0x7480
ucomisd %xmm1, %xmm0
seta %al
jmp 0x5b09
xorl %ebx, %ebx
testq %rsi, %rsi
je 0x59b7
cmpl $0x4, 0x8(%rsi)
jne 0x59b7
movq 0x10(%rsi), %r14
jmp 0x59ba
xorl %r14d, %r14d
testq %rbx, %rbx
je 0x5a26
movq 0x18(%rbx), %r13
jmp 0x5a29
xorl %ebx, %ebx
testq %rsi, %rsi
je 0x59d8
cmpl $0x5, 0x8(%rsi)
jne 0x59d8
movq 0x10(%rsi), %r14
jmp 0x59db
xorl %r14d, %r14d
testq %rbx, %rbx
je 0x5a9e
movq 0x10(%rbx), %r15
jmp 0x5aa1
xorl %edi, %edi
testq %rsi, %rsi
je 0x5b07
cmpl $0x2, 0x8(%rsi)
jne 0x5b07
movq 0x10(%rsi), %rsi
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x5b07
callq 0x21e0
testl %eax, %eax
jmp 0x5932
xorl %r13d, %r13d
testq %r14, %r14
je 0x5a34
movq 0x18(%r14), %rcx
jmp 0x5a36
xorl %ecx, %ecx
cmpq %rcx, %r13
jne 0x5b07
testq %r13, %r13
je 0x5b09
decq %r13
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x5a62
cmpq %rbp, 0x18(%rbx)
jbe 0x5a62
movq 0x8(%rbx), %rax
movq (%rax,%rbp,8), %r15
jmp 0x5a65
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3826
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x3826
movq %r12, %rdi
movq %rax, %rsi
callq 0x58a3
testl %eax, %eax
setne %al
je 0x5b09
leaq 0x1(%rbp), %rcx
cmpq %rbp, %r13
movq %rcx, %rbp
jne 0x5a4d
jmp 0x5b09
xorl %r15d, %r15d
testq %r14, %r14
je 0x5aac
movq 0x10(%r14), %rcx
jmp 0x5aae
xorl %ecx, %ecx
cmpq %rcx, %r15
jne 0x5b07
testq %r15, %r15
je 0x5b09
decq %r15
xorl %r12d, %r12d
testq %rbx, %rbx
je 0x5ad3
cmpq %r12, 0x10(%rbx)
jbe 0x5ad3
movq 0x8(%rbx), %rax
movq (%rax,%r12,8), %rdi
jmp 0x5ad5
xorl %edi, %edi
testq %r14, %r14
je 0x5aea
cmpq %r12, 0x10(%r14)
jbe 0x5aea
movq 0x8(%r14), %rax
movq (%rax,%r12,8), %rsi
jmp 0x5aec
xorl %esi, %esi
callq 0x58a3
testl %eax, %eax
setne %al
je 0x5b09
leaq 0x1(%r12), %rcx
cmpq %r12, %r15
movq %rcx, %r12
jne 0x5abe
jmp 0x5b09
xorl %eax, %eax
movzbl %al, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq