// File: /workspace/github_c_makefile_star2_O2/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:
pushq $-0x1
popq %rcx
movl %ecx, %eax
testq %rdi, %rdi
je 0x41be
movl 0x8(%rdi), %eax
testq %rsi, %rsi
je 0x41c6
movl 0x8(%rsi), %ecx
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl %ecx, %eax
jne 0x440e
addl $-0x2, %eax
cmpl $0x4, %eax
ja 0x42ae
leaq 0x11a4(%rip), %rcx      # 0x5390
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
testq %rdi, %rdi
je 0x4303
cmpl $0x2, 0x8(%rdi)
jne 0x4303
movq 0x10(%rdi), %rdi
jmp 0x4305
pushq $-0x1
popq %rax
movl %eax, %ecx
testq %rdi, %rdi
je 0x4226
cmpl $0x6, 0x8(%rdi)
movl %eax, %ecx
jne 0x4226
movl 0x10(%rdi), %ecx
testq %rsi, %rsi
je 0x4234
cmpl $0x6, 0x8(%rsi)
jne 0x4234
movl 0x10(%rsi), %eax
cmpl %eax, %ecx
sete %bpl
jmp 0x4410
testq %rdi, %rdi
je 0x42b6
cmpl $0x4, 0x8(%rdi)
jne 0x42b6
movq 0x10(%rdi), %rbx
jmp 0x42b8
testq %rdi, %rdi
je 0x42db
cmpl $0x5, 0x8(%rdi)
jne 0x42db
movq 0x10(%rdi), %rbx
jmp 0x42dd
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
testq %rdi, %rdi
je 0x427d
cmpl $0x3, 0x8(%rdi)
jne 0x427d
movsd 0x10(%rdi), %xmm1
testq %rsi, %rsi
je 0x428d
cmpl $0x3, 0x8(%rsi)
jne 0x428d
movsd 0x10(%rsi), %xmm0
subsd %xmm0, %xmm1
andpd 0x11f7(%rip), %xmm1     # 0x5490
movsd 0x11ff(%rip), %xmm0     # 0x54a0
ucomisd %xmm1, %xmm0
seta %bpl
jmp 0x4410
movb $0x1, %bpl
jmp 0x4410
xorl %ebx, %ebx
testq %rsi, %rsi
je 0x42c9
cmpl $0x4, 0x8(%rsi)
jne 0x42c9
movq 0x10(%rsi), %r13
jmp 0x42cc
xorl %r13d, %r13d
testq %rbx, %rbx
je 0x433c
movq 0x18(%rbx), %rax
movq %rax, (%rsp)
jmp 0x4344
xorl %ebx, %ebx
testq %rsi, %rsi
je 0x42ee
cmpl $0x5, 0x8(%rsi)
jne 0x42ee
movq 0x10(%rsi), %r14
jmp 0x42f1
xorl %r14d, %r14d
testq %rbx, %rbx
je 0x43b1
movq 0x10(%rbx), %r15
jmp 0x43b4
xorl %edi, %edi
testq %rsi, %rsi
je 0x440e
cmpl $0x2, 0x8(%rsi)
jne 0x440e
movq 0x10(%rsi), %rsi
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x440e
callq 0x11d0
testl %eax, %eax
jmp 0x4236
movq $0x0, (%rsp)
testq %r13, %r13
je 0x434f
movq 0x18(%r13), %rax
jmp 0x4351
xorl %eax, %eax
cmpq %rax, (%rsp)
jne 0x440e
xorl %r14d, %r14d
cmpq %r14, (%rsp)
sete %bpl
je 0x4410
testq %rbx, %rbx
je 0x4381
cmpq %r14, 0x18(%rbx)
jbe 0x4381
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %r15
jmp 0x4384
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x25cc
movq %rax, %r12
movq %r13, %rdi
movq %r15, %rsi
callq 0x25cc
movq %r12, %rdi
movq %rax, %rsi
callq 0x41b1
incq %r14
testl %eax, %eax
jne 0x435e
jmp 0x4410
xorl %r15d, %r15d
testq %r14, %r14
je 0x43bf
movq 0x10(%r14), %rax
jmp 0x43c1
xorl %eax, %eax
cmpq %rax, %r15
jne 0x440e
xorl %r12d, %r12d
cmpq %r12, %r15
sete %bpl
je 0x4410
testq %rbx, %rbx
je 0x43e7
cmpq %r12, 0x10(%rbx)
jbe 0x43e7
movq 0x8(%rbx), %rax
movq (%rax,%r12,8), %rdi
jmp 0x43e9
xorl %edi, %edi
testq %r14, %r14
je 0x43fe
cmpq %r12, 0x10(%r14)
jbe 0x43fe
movq 0x8(%r14), %rax
movq (%rax,%r12,8), %rsi
jmp 0x4400
xorl %esi, %esi
callq 0x41b1
incq %r12
testl %eax, %eax
jne 0x43c9
jmp 0x4410
xorl %ebp, %ebp
movzbl %bpl, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq