// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: as_val_cmp
msgpack_compare_t
as_val_cmp(const as_val* v1, const as_val* v2)
{
	as_val_t t1 = as_val_type(v1);
	as_val_t t2 = as_val_type(v2);

	MSGPACK_COMPARE_RET_LESS_OR_GREATER(t1, t2);

	if (t1 == AS_CMP_WILDCARD || t2 == AS_CMP_WILDCARD) {
		return MSGPACK_COMPARE_EQUAL;
	}

	switch (t1) {
	case AS_NIL:
		break;
	case AS_BOOLEAN:
		MSGPACK_COMPARE_RET_LESS_OR_GREATER(
				(unsigned int)((as_boolean*)v1)->value,
				(unsigned int)((as_boolean*)v2)->value);
		break;
	case AS_INTEGER:
		MSGPACK_COMPARE_RET_LESS_OR_GREATER(
				as_integer_get((const as_integer*)v1),
				as_integer_get((const as_integer*)v2));
		break;
	case AS_DOUBLE:
		MSGPACK_COMPARE_RET_LESS_OR_GREATER(as_double_get((const as_double*)v1),
				as_double_get((const as_double*)v2));
		break;
	case AS_STRING:
		return str_cmp(as_string_get((const as_string*)v1),
				as_string_get((const as_string*)v2));
	case AS_GEOJSON:
		return str_cmp(as_geojson_get((const as_geojson*)v1),
				as_geojson_get((const as_geojson*)v2));
	case AS_BYTES:
		return as_bytes_cmp((as_bytes*)v1, (as_bytes*)v2);
	case AS_LIST:
		return as_list_cmp((as_list*)v1, (as_list*)v2);
	case AS_MAP:
		return as_map_cmp((as_map*)v1, (as_map*)v2);
	default:
		return MSGPACK_COMPARE_ERROR;
	}

	return MSGPACK_COMPARE_EQUAL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
xorl %eax, %eax
movq %rsi, %rbx
movq %rdi, %r14
testq %rdi, %rdi
movl $0x0, %ecx
je 0xa59c
movzbl 0x4(%r14), %ecx
testq %rbx, %rbx
je 0xa5a5
movzbl 0x4(%rbx), %eax
xorl %r15d, %r15d
cmpl %eax, %ecx
jb 0xa5cd
pushq $0x2
popq %r12
jbe 0xa5b7
movl %r12d, %r15d
jmp 0xa5cd
cmpl $0xd, %ecx
sete %dl
cmpl $0xd, %eax
sete %al
orb %dl, %al
pushq $0x1
popq %rax
je 0xa5e2
movl %eax, %r15d
movl %r15d, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x2
popq %r15
decl %ecx
cmpl $0xa, %ecx
ja 0xa5cd
leaq 0xaab4(%rip), %rdx      # 0x150a8
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
testq %r14, %r14
je 0xa7e8
movq 0x10(%r14), %rdi
jmp 0xa7ea
movq %r14, %rdi
callq 0xc37c
movq %rbx, %rdi
movl %eax, %r15d
callq 0xc37c
cmpl %eax, %r15d
movl %eax, %r12d
movl %eax, %ebp
movl %r15d, 0x4(%rsp)
cmovbl %r15d, %r12d
xorl %ecx, %ecx
movl %ecx, %r13d
cmpl %ecx, %r12d
je 0xa876
movq %r14, %rdi
movl %r13d, %esi
callq 0xc398
movq %rbx, %rdi
movl %r13d, %esi
movq %rax, %r15
callq 0xc398
testq %r15, %r15
je 0xa66a
cmpb $0xd, 0x4(%r15)
je 0xa80d
testq %rax, %rax
je 0xa679
cmpb $0xd, 0x4(%rax)
je 0xa80d
movq %r15, %rdi
movq %rax, %rsi
callq 0x8090
leal 0x1(%r13), %ecx
cmpl $0x1, %eax
je 0xa635
movl %eax, %ecx
jmp 0xa878
testq %r14, %r14
je 0xa812
movq 0x8(%r14), %rcx
jmp 0xa814
movq %r14, %rdi
callq 0xc3b4
movq %rbx, %rdi
movl %eax, %ebp
callq 0xc3b4
cmpl %eax, %ebp
movl $0x0, %r15d
jb 0xa5cd
movl %r12d, %r15d
ja 0xa5cd
movq %r14, %rdi
callq 0xc3b4
leaq 0x48(%rsp), %r12
movq %r14, %rsi
movl %eax, %ebp
movq %r12, %rdi
callq 0x8500
leaq 0x8(%rsp), %r14
movq %rbx, %rsi
movq %r14, %rdi
callq 0x8500
incl %ebp
pushq $0x1
popq %r15
decl %ebp
je 0xa5cd
movq %r12, %rdi
callq 0x8260
movq %r14, %rdi
movq %rax, %rbx
callq 0x8260
testq %rbx, %rbx
je 0xa725
movq 0x8(%rbx), %rdi
jmp 0xa727
xorl %edi, %edi
testq %rax, %rax
je 0xa732
movq 0x8(%rax), %rsi
jmp 0xa734
xorl %esi, %esi
callq 0x8090
cmpl $0x1, %eax
je 0xa6ff
jmp 0xa5ca
xorl %ebp, %ebp
testq %r14, %r14
movl $0x0, %r12d
je 0xa754
movl 0xc(%r14), %r12d
testq %rbx, %rbx
je 0xa75c
movl 0xc(%rbx), %ebp
cmpl %ebp, %r12d
movl %ebp, %eax
cmovbl %r12d, %eax
testq %r14, %r14
je 0xa838
movq 0x10(%r14), %rdi
jmp 0xa83a
movb 0x8(%rbx), %cl
movl $0x0, %r15d
cmpb %cl, 0x8(%r14)
jb 0xa5cd
jmp 0xa7da
xorpd %xmm0, %xmm0
testq %r14, %r14
xorpd %xmm1, %xmm1
je 0xa79f
movsd 0x8(%r14), %xmm1
testq %rbx, %rbx
je 0xa7a9
movsd 0x8(%rbx), %xmm0
ucomisd %xmm1, %xmm0
movl $0x0, %r15d
ja 0xa5cd
xorpd %xmm0, %xmm0
testq %r14, %r14
xorpd %xmm1, %xmm1
je 0xa7cc
movsd 0x8(%r14), %xmm1
testq %rbx, %rbx
je 0xa7d6
movsd 0x8(%rbx), %xmm0
ucomisd %xmm0, %xmm1
movl %r12d, %r15d
jbe 0xa5ca
jmp 0xa5cd
xorl %edi, %edi
testq %rbx, %rbx
je 0xa7f5
movq 0x10(%rbx), %rsi
jmp 0xa7f7
xorl %esi, %esi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa8c9
pushq $0x1
popq %rcx
jmp 0xa878
xorl %ecx, %ecx
xorl %r15d, %r15d
testq %rbx, %rbx
je 0xa822
movq 0x8(%rbx), %rdx
jmp 0xa824
xorl %edx, %edx
cmpq %rdx, %rcx
jl 0xa5cd
testq %r14, %r14
je 0xa8a9
movq 0x8(%r14), %rcx
jmp 0xa8ab
xorl %edi, %edi
xorl %r15d, %r15d
testq %rbx, %rbx
je 0xa848
movq 0x10(%rbx), %rsi
jmp 0xa84a
xorl %esi, %esi
movl %eax, %edx
callq 0x84b0
testl %eax, %eax
js 0xa5cd
cmpl %ebp, %r12d
setb %cl
xorl %r15d, %r15d
testl %eax, %eax
setne %al
orb %al, %cl
je 0xa89a
movb %al, %r15b
addl %r15d, %r15d
jmp 0xa5cd
xorl %ecx, %ecx
movl 0x4(%rsp), %eax
xorl %r15d, %r15d
cmpl %ebp, %eax
seta %r15b
incl %r15d
cmpl %r12d, %r13d
cmovbl %ecx, %r15d
cmpl %ebp, %eax
cmovbl %ecx, %r15d
jmp 0xa5cd
xorl %r15d, %r15d
cmpl %r12d, %ebp
adcl $0x1, %r15d
jmp 0xa5cd
xorl %ecx, %ecx
testq %rbx, %rbx
je 0xa8b6
movq 0x8(%rbx), %rdx
jmp 0xa8b8
xorl %edx, %edx
cmpq %rdx, %rcx
movl %r12d, %r15d
jle 0xa5ca
jmp 0xa5cd