// File: /workspace/github_c_makefile_star2_O0/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: msgpack_compare_list
static msgpack_compare_t
msgpack_compare_list(as_unpacker *pk1, as_unpacker *pk2, size_t depth)
{
	if (++depth > MSGPACK_COMPARE_MAX_DEPTH) {
		msgpack_parse_memblock *block = msgpack_parse_memblock_create(NULL);
		msgpack_parse_state *state = msgpack_parse_memblock_next(&block);

		if (! msgpack_parse_state_list_cmp_init(state, pk1, pk2)) {
			msgpack_parse_memblock_destroy(block);
			return MSGPACK_COMPARE_ERROR;
		}

		msgpack_compare_t ret = msgpack_compare_non_recursive(pk1, pk2, &block,
				state);

		if (ret == MSGPACK_COMPARE_ERROR ||
				! msgpack_compare_unwind_all(pk1, pk2, &block)) {
			msgpack_parse_memblock_destroy(block);
			return MSGPACK_COMPARE_ERROR;
		}

		msgpack_parse_memblock_destroy(block);

		return ret;
	}

	int64_t len1 = as_unpack_list_header_element_count(pk1);
	int64_t len2 = as_unpack_list_header_element_count(pk2);
	int64_t minlen = (len1 < len2) ? len1 : len2;

	if (minlen < 0) {
		return MSGPACK_COMPARE_ERROR;
	}

	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, len1 - i - 1)) {
				return MSGPACK_COMPARE_ERROR;
			}

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

			return ret;
		}
	}

	if (! msgpack_skip(pk1, len1 - minlen)) {
		return MSGPACK_COMPARE_ERROR;
	}

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

	MSGPACK_COMPARE_RET_LESS_OR_GREATER(len1, len2);

	return MSGPACK_COMPARE_EQUAL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
cmpq $0x100, %rax            # imm = 0x100
jbe 0x1256c
xorl %eax, %eax
movl %eax, %edi
callq 0x11ca0
movq %rax, -0x28(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x11ce0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x12c00
testb $0x1, %al
jne 0x12510
movq -0x28(%rbp), %rdi
callq 0x11ef0
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x126c8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rcx
leaq -0x28(%rbp), %rdx
callq 0x12cd0
movl %eax, -0x34(%rbp)
cmpl $-0x2, -0x34(%rbp)
je 0x12543
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x12fe0
testb $0x1, %al
jne 0x12558
movq -0x28(%rbp), %rdi
callq 0x11ef0
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x126c8
movq -0x28(%rbp), %rdi
callq 0x11ef0
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x126c8
movq -0x10(%rbp), %rdi
callq 0x86e0
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x86e0
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x48(%rbp), %rax
jge 0x1259a
movq -0x40(%rbp), %rax
movq %rax, -0x68(%rbp)
jmp 0x125a2
movq -0x48(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jge 0x125bd
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x126c8
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x50(%rbp), %rax
jge 0x1265f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x59(%rbp), %rcx
callq 0x10e40
movl %eax, -0x60(%rbp)
cmpl $0x1, -0x60(%rbp)
jne 0x125fa
movzbl -0x59(%rbp), %eax
cmpl $0xd, %eax
jne 0x1264c
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
subq -0x58(%rbp), %rsi
subq $0x1, %rsi
callq 0x13080
testb $0x1, %al
jne 0x1261f
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x126c8
movq -0x18(%rbp), %rdi
movq -0x48(%rbp), %rsi
subq -0x58(%rbp), %rsi
subq $0x1, %rsi
callq 0x13080
testb $0x1, %al
jne 0x12644
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x126c8
movl -0x60(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x126c8
jmp 0x1264e
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x125c5
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
subq -0x50(%rbp), %rsi
callq 0x13080
testb $0x1, %al
jne 0x1267d
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x126c8
movq -0x18(%rbp), %rdi
movq -0x48(%rbp), %rsi
subq -0x50(%rbp), %rsi
callq 0x13080
testb $0x1, %al
jne 0x1269b
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x126c8
movq -0x40(%rbp), %rax
cmpq -0x48(%rbp), %rax
jge 0x126ae
movl $0x0, -0x4(%rbp)
jmp 0x126c8
movq -0x40(%rbp), %rax
cmpq -0x48(%rbp), %rax
jle 0x126c1
movl $0x2, -0x4(%rbp)
jmp 0x126c8
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)