// File: /workspace/github_c_makefile_star2_O1/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 0x5b19
movl 0x8(%rdi), %ecx
testq %rsi, %rsi
je 0x5b21
movl 0x8(%rsi), %eax
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl %eax, %ecx
jne 0x5d67
movb $0x1, %al
addl $-0x2, %ecx
cmpl $0x4, %ecx
ja 0x5d69
leaq 0x1837(%rip), %rdx      # 0x7380
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
testq %rdi, %rdi
je 0x5c4e
cmpl $0x2, 0x8(%rdi)
jne 0x5c4e
movq 0x10(%rdi), %rdi
jmp 0x5c50
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x5b86
cmpl $0x6, 0x8(%rdi)
jne 0x5b86
movl 0x10(%rdi), %ecx
testq %rsi, %rsi
je 0x5b94
cmpl $0x6, 0x8(%rsi)
jne 0x5b94
movl 0x10(%rsi), %eax
cmpl %eax, %ecx
jmp 0x5c7e
testq %rdi, %rdi
je 0x5c05
cmpl $0x4, 0x8(%rdi)
jne 0x5c05
movq 0x10(%rdi), %rbx
jmp 0x5c07
testq %rdi, %rdi
je 0x5c26
cmpl $0x5, 0x8(%rdi)
jne 0x5c26
movq 0x10(%rdi), %rbx
jmp 0x5c28
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
testq %rdi, %rdi
je 0x5bd5
cmpl $0x3, 0x8(%rdi)
jne 0x5bd5
movsd 0x10(%rdi), %xmm1
testq %rsi, %rsi
je 0x5be5
cmpl $0x3, 0x8(%rsi)
jne 0x5be5
movsd 0x10(%rsi), %xmm0
subsd %xmm0, %xmm1
andpd 0x188f(%rip), %xmm1     # 0x7480
movsd 0x1897(%rip), %xmm0     # 0x7490
ucomisd %xmm1, %xmm0
seta %al
jmp 0x5d69
xorl %ebx, %ebx
testq %rsi, %rsi
je 0x5c18
cmpl $0x4, 0x8(%rsi)
jne 0x5c18
movq 0x10(%rsi), %r14
jmp 0x5c1b
xorl %r14d, %r14d
testq %rbx, %rbx
je 0x5c86
movq 0x18(%rbx), %r13
jmp 0x5c89
xorl %ebx, %ebx
testq %rsi, %rsi
je 0x5c39
cmpl $0x5, 0x8(%rsi)
jne 0x5c39
movq 0x10(%rsi), %r14
jmp 0x5c3c
xorl %r14d, %r14d
testq %rbx, %rbx
je 0x5cfe
movq 0x10(%rbx), %r15
jmp 0x5d01
xorl %edi, %edi
testq %rsi, %rsi
je 0x5c61
cmpl $0x2, 0x8(%rsi)
jne 0x5c61
movq 0x10(%rsi), %rsi
jmp 0x5c63
xorl %esi, %esi
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x5d67
callq 0x21f0
testl %eax, %eax
sete %al
jmp 0x5d69
xorl %r13d, %r13d
testq %r14, %r14
je 0x5c94
movq 0x18(%r14), %rcx
jmp 0x5c96
xorl %ecx, %ecx
cmpq %rcx, %r13
jne 0x5d67
testq %r13, %r13
je 0x5d69
decq %r13
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x5cc2
cmpq %rbp, 0x18(%rbx)
jbe 0x5cc2
movq 0x8(%rbx), %rax
movq (%rax,%rbp,8), %r15
jmp 0x5cc5
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3936
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x3936
movq %r12, %rdi
movq %rax, %rsi
callq 0x5b07
testl %eax, %eax
setne %al
je 0x5d69
leaq 0x1(%rbp), %rcx
cmpq %rbp, %r13
movq %rcx, %rbp
jne 0x5cad
jmp 0x5d69
xorl %r15d, %r15d
testq %r14, %r14
je 0x5d0c
movq 0x10(%r14), %rcx
jmp 0x5d0e
xorl %ecx, %ecx
cmpq %rcx, %r15
jne 0x5d67
testq %r15, %r15
je 0x5d69
decq %r15
xorl %r12d, %r12d
testq %rbx, %rbx
je 0x5d33
cmpq %r12, 0x10(%rbx)
jbe 0x5d33
movq 0x8(%rbx), %rax
movq (%rax,%r12,8), %rdi
jmp 0x5d35
xorl %edi, %edi
testq %r14, %r14
je 0x5d4a
cmpq %r12, 0x10(%r14)
jbe 0x5d4a
movq 0x8(%r14), %rax
movq (%rax,%r12,8), %rsi
jmp 0x5d4c
xorl %esi, %esi
callq 0x5b07
testl %eax, %eax
setne %al
je 0x5d69
leaq 0x1(%r12), %rcx
cmpq %r12, %r15
movq %rcx, %r12
jne 0x5d1e
jmp 0x5d69
xorl %eax, %eax
movzbl %al, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq