// File: /workspace/github_c_makefile_star2_O0/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: msgpack_compare_map
static msgpack_compare_t
msgpack_compare_map(as_unpacker *pk1, as_unpacker *pk2, size_t depth)
{
	int64_t len1 = as_unpack_map_header_element_count(pk1);
	int64_t len2 = as_unpack_map_header_element_count(pk2);
	int64_t minlen = (len1 < len2) ? len1 : len2;

	if (minlen < 0) {
		return MSGPACK_COMPARE_ERROR;
	}

	if (len1 != len2) {
		if (! msgpack_skip(pk1, len1)) {
			return MSGPACK_COMPARE_ERROR;
		}

		if (! msgpack_skip(pk2, len2)) {
			return MSGPACK_COMPARE_ERROR;
		}

		MSGPACK_COMPARE_RET_LESS_OR_GREATER(len1, len2);
	}

	if (minlen == 0) {
		return MSGPACK_COMPARE_EQUAL;
	}

	as_val_t type1 = as_unpack_peek_type(pk1);
	as_val_t type2 = as_unpack_peek_type(pk2);

	if (type1 == type2 && type1 == AS_CMP_EXT) {
		msgpack_compare_t ret = compare_ext(pk1, pk2);

		if (ret == MSGPACK_COMPARE_ERROR ||
				! msgpack_skip(pk1, 1) || ! msgpack_skip(pk2, 1)) {
			return MSGPACK_COMPARE_ERROR;
		}

		if (ret != MSGPACK_COMPARE_EQUAL) {
			if (! msgpack_skip(pk1, len1 - 1)) {
				return MSGPACK_COMPARE_ERROR;
			}

			if (! msgpack_skip(pk2, len2 - 1)) {
				return MSGPACK_COMPARE_ERROR;
			}

			return ret;
		}

		minlen--;
	}

	for (int64_t i = 0; i < minlen; i++) {
		as_val_t type;
		msgpack_compare_t ret = msgpack_compare_internal(pk1, pk2, depth,
				&type);

		if (ret != MSGPACK_COMPARE_EQUAL|| type == AS_CMP_WILDCARD) {
			if (! msgpack_skip(pk1, 2 * (len1 - i) - 1)) {
				return MSGPACK_COMPARE_ERROR;
			}

			if (! msgpack_skip(pk2, 2 * (len2 - i) - 1)) {
				return MSGPACK_COMPARE_ERROR;
			}

			return ret;
		}

		ret = msgpack_compare_internal(pk1, pk2, depth, &type);

		if (ret != MSGPACK_COMPARE_EQUAL || type == AS_CMP_WILDCARD) {
			if (! msgpack_skip(pk1, 2 * (len1 - i - 1))) {
				return MSGPACK_COMPARE_ERROR;
			}

			if (! msgpack_skip(pk2, 2 * (len2 - i - 1))) {
				return MSGPACK_COMPARE_ERROR;
			}

			return ret;
		}
	}

	return MSGPACK_COMPARE_EQUAL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8c00
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8c00
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jge 0x12722
movq -0x28(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x1272a
movq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jge 0x12745
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x129d1
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
je 0x127b7
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x13080
testb $0x1, %al
jne 0x1276c
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x129d1
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x13080
testb $0x1, %al
jne 0x12789
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x129d1
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jge 0x1279f
movl $0x0, -0x4(%rbp)
jmp 0x129d1
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jle 0x127b5
movl $0x2, -0x4(%rbp)
jmp 0x129d1
jmp 0x127b7
cmpq $0x0, -0x38(%rbp)
jne 0x127ca
movl $0x1, -0x4(%rbp)
jmp 0x129d1
movq -0x10(%rbp), %rdi
callq 0x8490
movb %al, -0x39(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8490
movb %al, -0x3a(%rbp)
movzbl -0x39(%rbp), %eax
movzbl -0x3a(%rbp), %ecx
cmpl %ecx, %eax
jne 0x128a6
movzbl -0x39(%rbp), %eax
cmpl $0xc, %eax
jne 0x128a6
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x132e0
movl %eax, -0x40(%rbp)
cmpl $-0x2, -0x40(%rbp)
je 0x1283b
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x13080
testb $0x1, %al
jne 0x12829
jmp 0x1283b
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x13080
testb $0x1, %al
jne 0x12847
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x129d1
cmpl $0x1, -0x40(%rbp)
je 0x1289a
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
subq $0x1, %rsi
callq 0x13080
testb $0x1, %al
jne 0x1286e
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x129d1
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
subq $0x1, %rsi
callq 0x13080
testb $0x1, %al
jne 0x1288f
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x129d1
movl -0x40(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x129d1
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jge 0x129ca
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x49(%rbp), %rcx
callq 0x10e40
movl %eax, -0x50(%rbp)
cmpl $0x1, -0x50(%rbp)
jne 0x128e3
movzbl -0x49(%rbp), %eax
cmpl $0xd, %eax
jne 0x1293e
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
subq -0x48(%rbp), %rsi
shlq %rsi
subq $0x1, %rsi
callq 0x13080
testb $0x1, %al
jne 0x1290b
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x129d1
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
subq -0x48(%rbp), %rsi
shlq %rsi
subq $0x1, %rsi
callq 0x13080
testb $0x1, %al
jne 0x12933
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x129d1
movl -0x50(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x129d1
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x49(%rbp), %rcx
callq 0x10e40
movl %eax, -0x50(%rbp)
cmpl $0x1, -0x50(%rbp)
jne 0x12965
movzbl -0x49(%rbp), %eax
cmpl $0xd, %eax
jne 0x129b7
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
subq -0x48(%rbp), %rsi
subq $0x1, %rsi
shlq %rsi
callq 0x13080
testb $0x1, %al
jne 0x1298a
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x129d1
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
subq -0x48(%rbp), %rsi
subq $0x1, %rsi
shlq %rsi
callq 0x13080
testb $0x1, %al
jne 0x129af
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x129d1
movl -0x50(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x129d1
jmp 0x129b9
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x128ae
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)