LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: pack_map_foreach
static bool
pack_map_foreach(const as_val* key, const as_val* val, void* udata)
{
	as_packer* pk = (as_packer*)udata;
	int rc = as_pack_val(pk, (as_val*)key);

	if (rc == 0) {
		rc = as_pack_val(pk, (as_val*)val);
	}

	return rc == 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %rsi
movq %rdx, %rdi
movq %rdx, %r14
callq 0x8ad0
testl %eax, %eax
je 0xc484
xorl %eax, %eax
jmp 0xc494
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8ad0
testl %eax, %eax
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: pack_type_uint64
static inline int
pack_type_uint64(as_packer *pk, unsigned char type, uint64_t val, bool resize)
{
	if (pk->buffer) {
		if (pk->offset + 9 > pk->capacity) {
			if (! resize || pack_resize(pk, 9) != 0) {
				return -1;
			}
		}
		uint64_t swapped = cf_swap_to_be64(val);
		unsigned char *p = pk->buffer + pk->offset;
		*p++ = type;
		memcpy(p, &swapped, 8);
	}
	return advance_offset(pk, 9);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x10(%rdi), %rax
movq %rdi, %r14
testq %rax, %rax
pushq $-0x1
popq %rbx
je 0xc4ed
movq %rdx, %r15
movl 0x18(%r14), %edx
movl %esi, %ebp
leal 0x9(%rdx), %esi
cmpl 0x1c(%r14), %esi
jbe 0xc4df
testb %cl, %cl
je 0xc501
pushq $0x9
popq %rsi
movq %r14, %rdi
callq 0xc3d0
testl %eax, %eax
jne 0xc501
movq 0x10(%r14), %rax
movl 0x18(%r14), %edx
movl %edx, %ecx
bswapq %r15
movb %bpl, (%rax,%rcx)
movq %r15, 0x1(%rax,%rcx)
movl 0x18(%r14), %eax
cmpl $0x7ffffff6, %eax       # imm = 0x7FFFFFF6
ja 0xc501
addl $0x9, %eax
xorl %ebx, %ebx
movl %eax, 0x18(%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: unpack_list_elements_size
static int64_t
unpack_list_elements_size(as_unpacker *pk, uint32_t ele_count, uint32_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);

		state->index = 0;
		state->map_pair = 0;
		state->len = ele_count;
		state->type = AS_LIST;

		int64_t ret = unpack_size_non_recursive(pk, block, state);

		msgpack_parse_memblock_destroy(block);

		return ret;
	}

	int64_t total = 0;

	for (uint32_t i = 0; i < ele_count; i++) {
		int64_t ret = unpack_size_internal(pk, depth);

		if (ret < 0) {
			return -1;
		}

		total += ret;
	}

	return total;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
incl %r14d
cmpl $0x100, %r14d           # imm = 0x100
jbe 0xc573
xorl %edi, %edi
callq 0xc65e
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rax, (%r14)
callq 0xc679
andl $0x0, 0xc(%rax)
movw $0x500, 0x10(%rax)      # imm = 0x500
movl %ebp, 0x8(%rax)
movq %rbx, %rdi
movq %rax, %rdx
movq (%r14), %r14
movq %r14, %rsi
callq 0xc6b8
movq %r14, %rdi
movq %rax, %rbx
callq 0xc7fb
movq %rbx, %rax
jmp 0xc59a
xorl %r15d, %r15d
pushq $-0x1
popq %r12
subl $0x1, %ebp
jb 0xc597
movq %rbx, %rdi
movl %r14d, %esi
callq 0xbb3e
testq %rax, %rax
js 0xc594
addq %rax, %r15
jmp 0xc57a
movq %r12, %r15
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: unpack_map_elements_size
static int64_t
unpack_map_elements_size(as_unpacker *pk, uint32_t ele_count, uint32_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);

		state->index = 0;
		state->map_pair = 0;
		state->len = ele_count;
		state->type = AS_MAP;

		int64_t ret = unpack_size_non_recursive(pk, block, state);
		msgpack_parse_memblock_destroy(block);

		return ret;
	}

	int64_t total = 0;

	for (uint32_t i = 0; i < ele_count; i++) {
		int64_t ret = unpack_size_internal(pk, depth);

		if (ret < 0) {
			return -1;
		}

		total += ret;
		ret = unpack_size_internal(pk, depth);

		if (ret < 0) {
			return -2;
		}

		total += ret;
	}

	return total;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
incl %r14d
cmpl $0x100, %r14d           # imm = 0x100
jbe 0xc609
xorl %edi, %edi
callq 0xc65e
movq %rsp, %r14
movq %r14, %rdi
movq %rax, (%r14)
callq 0xc679
andl $0x0, 0xc(%rax)
movw $0x600, 0x10(%rax)      # imm = 0x600
movl %ebp, 0x8(%rax)
movq %rbx, %rdi
movq %rax, %rdx
movq (%r14), %r14
movq %r14, %rsi
callq 0xc6b8
movq %r14, %rdi
movq %rax, %rbx
callq 0xc7fb
movq %rbx, %rax
jmp 0xc64f
xorl %r15d, %r15d
pushq $-0x2
popq %r13
subl $0x1, %ebp
jb 0xc64c
movq %rbx, %rdi
movl %r14d, %esi
callq 0xbb3e
testq %rax, %rax
js 0xc643
movq %rbx, %rdi
movl %r14d, %esi
movq %rax, %r12
callq 0xbb3e
testq %rax, %rax
js 0xc649
addq %r15, %r12
addq %rax, %r12
movq %r12, %r15
jmp 0xc610
pushq $-0x1
popq %r15
jmp 0xc64c
movq %r13, %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: msgpack_parse_memblock_create
static msgpack_parse_memblock *
msgpack_parse_memblock_create(msgpack_parse_memblock *prev)
{
	msgpack_parse_memblock *p = cf_malloc(sizeof(msgpack_parse_memblock));
	p->prev = prev;
	p->count = 0;
	return p;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x1810, %edi           # imm = 0x1810
callq 0x8080
movq %rbx, (%rax)
andq $0x0, 0x1808(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: msgpack_parse_memblock_next
static msgpack_parse_state *
msgpack_parse_memblock_next(msgpack_parse_memblock **block)
{
	msgpack_parse_memblock *ptr = *block;

	if (ptr->count >= MSGPACK_PARSE_MEMBLOCK_STATE_COUNT) {
		ptr = msgpack_parse_memblock_create(ptr);
		*block = ptr;
	}

	return &ptr->buffer[ptr->count++];
}

// Assembly:
pushq %rbx
movq (%rdi), %rax
movq 0x1808(%rax), %rcx
cmpq $0x100, %rcx            # imm = 0x100
jb 0xc6a2
movq %rdi, %rbx
movq %rax, %rdi
callq 0xc65e
movq %rax, (%rbx)
movq 0x1808(%rax), %rcx
leaq 0x1(%rcx), %rdx
imulq $0x18, %rcx, %rcx
movq %rdx, 0x1808(%rax)
leaq 0x8(%rax,%rcx), %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: unpack_size_non_recursive
static int64_t
unpack_size_non_recursive(as_unpacker *pk, msgpack_parse_memblock *block,
		msgpack_parse_state *state)
{
	int start = pk->offset;

	while (state) {
		while (state->index >= state->len) {
			if (! msgpack_parse_memblock_has_prev(block)) {
				return (int64_t)(pk->offset - start);
			}

			state = msgpack_parse_memblock_prev(&block);
		}

		if (state->type == AS_LIST) {
			state->index++;
		}
		else if (state->type == AS_MAP) {
			if (state->map_pair == 0) {
				state->map_pair++;
			}
			else {
				state->map_pair = 0;
				state->index++;
			}
		}
		else {
			return -1;
		}

		as_val_t type = as_unpack_peek_type(pk);

		if (type == AS_UNDEF) {
			return -2;
		}

		if (type == AS_LIST ) {
			state = msgpack_parse_memblock_next(&block);

			if (! msgpack_parse_state_list_size_init(state, pk)) {
				return -3;
			}

			continue;
		}

		if (type == AS_MAP) {
			state = msgpack_parse_memblock_next(&block);

			if (! msgpack_parse_state_map_size_init(state, pk)) {
				return -4;
			}

			continue;
		}

		if (unpack_size_internal(pk, 0) < 0) {
			return -5;
		}
	}

	return -6;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsp, %r15
movq %rdx, %r12
movq %rdi, %r14
movq %rsi, (%r15)
movl 0x8(%rdi), %r13d
pushq $-0x6
popq %rbx
testq %r12, %r12
je 0xc7d4
movl 0xc(%r12), %eax
cmpl 0x8(%r12), %eax
jb 0xc710
movq (%rsp), %rax
cmpq $0x0, (%rax)
jne 0xc703
cmpq $0x1, 0x1808(%rax)
jbe 0xc7cd
movq %r15, %rdi
callq 0xc810
movq %rax, %r12
jmp 0xc6df
movzbl 0x11(%r12), %ecx
cmpl $0x6, %ecx
je 0xc725
cmpl $0x5, %ecx
je 0xc737
jmp 0xc7e6
cmpb $0x0, 0x10(%r12)
je 0xc7c2
movb $0x0, 0x10(%r12)
incl %eax
movl %eax, 0xc(%r12)
movq %r14, %rdi
callq 0x8430
movl %eax, %ebp
cmpb $0x5, %al
je 0xc78f
movzbl %bpl, %eax
cmpl $0x6, %eax
je 0xc775
testl %eax, %eax
je 0xc7ea
movq %r14, %rdi
xorl %esi, %esi
callq 0xbb3e
testq %rax, %rax
jns 0xc6d6
jmp 0xc7f6
movq %r15, %rdi
callq 0xc679
movq %r14, %rdi
movq %rax, %r12
callq 0x8b40
testq %rax, %rax
jns 0xc7a7
jmp 0xc7f2
movq %r15, %rdi
callq 0xc679
movq %r14, %rdi
movq %rax, %r12
callq 0x8650
testq %rax, %rax
js 0xc7ee
andl $0x0, 0xc(%r12)
movb $0x0, 0x10(%r12)
movl %eax, 0x8(%r12)
movb %bpl, 0x11(%r12)
jmp 0xc6d6
movb $0x1, 0x10(%r12)
jmp 0xc73e
movl 0x8(%r14), %ebx
subl %r13d, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
jmp 0xc7f8
pushq $-0x2
jmp 0xc7f8
pushq $-0x3
jmp 0xc7f8
pushq $-0x4
jmp 0xc7f8
pushq $-0x5
popq %rbx
jmp 0xc7d4
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: msgpack_parse_memblock_destroy
static void
msgpack_parse_memblock_destroy(msgpack_parse_memblock *block)
{
	while (block) {
		msgpack_parse_memblock *p = block;
		block = block->prev;
		cf_free(p);
	}
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0xc80e
movq (%rdi), %rbx
callq 0x8a00
movq %rbx, %rdi
jmp 0xc7fc
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: msgpack_parse_memblock_prev
static msgpack_parse_state *
msgpack_parse_memblock_prev(msgpack_parse_memblock **block)
{
	msgpack_parse_memblock *ptr = *block;

	if (ptr->count <= 1) {
		ptr = ptr->prev;
		cf_free(*block);
		*block = ptr;
	}
	else {
		ptr->count--;
	}

	// No check for NULL ptr here, use has_prev to make sure it doesn't happen.

	return &ptr->buffer[ptr->count - 1];
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x1808(%rdi), %rax
cmpq $0x1, %rax
ja 0xc83e
movq (%rdi), %r14
callq 0x8a00
movq %r14, (%rbx)
movq %r14, %rdi
movq 0x1808(%r14), %rax
jmp 0xc848
decq %rax
movq %rax, 0x1808(%rdi)
imulq $0x18, %rax, %rax
leaq -0x10(%rax,%rdi), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: msgpack_peek_compare_type
static inline msgpack_compare_t
msgpack_peek_compare_type(const as_unpacker *pk1, const as_unpacker *pk2,
		as_val_t *type)
{
	int n1 = pk1->length - pk1->offset;
	int n2 = pk2->length - pk2->offset;

	*type = AS_UNDEF;

	if (n1 == 0 || n2 == 0) {
		MSGPACK_COMPARE_RET_LESS_OR_GREATER(n1, n2);

		return MSGPACK_COMPARE_END;
	}

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

	if (type1 == AS_UNDEF || type2 == AS_UNDEF) {
		return MSGPACK_COMPARE_ERROR;
	}

	if (type1 == AS_CMP_WILDCARD || type2 == AS_CMP_WILDCARD) {
		*type = AS_CMP_WILDCARD;

		return MSGPACK_COMPARE_EQUAL;
	}

	MSGPACK_COMPARE_RET_LESS_OR_GREATER(type1, type2);

	*type = type1;

	return MSGPACK_COMPARE_EQUAL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0xc(%rdi), %eax
movl 0xc(%rsi), %ecx
movq %rdx, %rbx
movq %rsi, %r14
subl 0x8(%rdi), %eax
sete %dl
subl 0x8(%rsi), %ecx
movb $0x0, (%rbx)
sete %sil
orb %dl, %sil
cmpb $0x1, %sil
jne 0xc88a
cmpl %ecx, %eax
jge 0xc8ac
xorl %eax, %eax
jmp 0xc8d1
callq 0x8430
movq %r14, %rdi
movl %eax, %ebp
callq 0x8430
testb %bpl, %bpl
sete %cl
testb %al, %al
sete %dl
orb %cl, %dl
je 0xc8b8
pushq $-0x2
jmp 0xc8d0
setg %al
movzbl %al, %eax
leal -0x1(%rax,%rax,2), %eax
jmp 0xc8d1
cmpb $0xd, %bpl
sete %cl
cmpb $0xd, %al
sete %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0xc8d6
movb $0xd, (%rbx)
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
cmpb %al, %bpl
jb 0xc886
jbe 0xc8e1
pushq $0x2
jmp 0xc8d0
movb %bpl, (%rbx)
jmp 0xc8ce
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: msgpack_compare_blob
static inline msgpack_compare_t
msgpack_compare_blob(as_unpacker *pk1, as_unpacker *pk2)
{
	int64_t len1 = msgpack_get_blob_len(pk1);
	int64_t len2 = msgpack_get_blob_len(pk2);

	if (len1 < 0 || len2 < 0) {
		return MSGPACK_COMPARE_ERROR;
	}

	return msgpack_compare_blob_internal(pk1, (uint32_t)len1, pk2, (uint32_t)len2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0xd175
movq %r14, %rdi
movq %rax, %rbx
callq 0xd175
movq %rbx, %rcx
orq %rax, %rcx
jns 0xd0fe
pushq $-0x2
popq %rcx
jmp 0xd16a
movl 0x8(%r15), %ecx
cmpl %eax, %ebx
movl %eax, %edx
movl 0x8(%r14), %r8d
cmovbl %ebx, %edx
leal (%rcx,%rbx), %esi
movl %esi, 0x8(%r15)
addl %eax, 0x8(%r14)
xorl %esi, %esi
pushq $0x2
popq %r9
xorl %ebp, %ebp
cmpl %ebp, %edx
je 0xd155
movl %ebp, %edi
movq (%r15), %r12
movq (%r14), %rbp
leal (%r8,%rdi), %r11d
leal (%rcx,%rdi), %r10d
movl %r10d, %r10d
movl %r11d, %r11d
movb (%r12,%r10), %r10b
movb (%rbp,%r11), %r11b
cmpb %r11b, %r10b
jb 0xd157
leal 0x1(%rdi), %ebp
cmpb %r11b, %r10b
jbe 0xd120
movl %r9d, %esi
jmp 0xd157
movl %edx, %edi
xorl %ecx, %ecx
cmpl %eax, %ebx
seta %cl
incl %ecx
cmpl %edx, %edi
cmovbl %esi, %ecx
cmpl %eax, %ebx
cmovbl %esi, %ecx
movl %ecx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: msgpack_parse_state_list_cmp_init
static bool
msgpack_parse_state_list_cmp_init(msgpack_parse_state *state, as_unpacker *pk1,
		as_unpacker *pk2)
{
	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 false;
	}

	state->len1 = (uint32_t)len1;
	state->len2 = (uint32_t)len2;
	state->index = 0;
	state->map_pair = 0;
	state->len = (uint32_t)minlen;
	state->type = AS_LIST;
	state->default_compare_type = msgpack_compare_int64_t(len1, len2);

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, %r15
callq 0x8650
movq %r15, %rdi
movq %rax, %r14
callq 0x8650
cmpq %rax, %r14
movq %rax, %rcx
cmovlq %r14, %rcx
testq %rcx, %rcx
js 0xd1f6
xorl %edx, %edx
cmpq %rax, %r14
movl %r14d, (%rbx)
movl %eax, 0x4(%rbx)
movw $0x500, 0x10(%rbx)      # imm = 0x500
movl %ecx, 0x8(%rbx)
setg %dl
xorl %esi, %esi
incl %edx
cmpq %rax, %r14
cmovgel %edx, %esi
andl $0x0, 0xc(%rbx)
movl %esi, 0x14(%rbx)
testq %rcx, %rcx
setns %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: msgpack_skip
static bool
msgpack_skip(as_unpacker *pk, size_t n)
{
	for (size_t i = 0; i < n; i++) {
		if (as_unpack_size(pk) < 0) {
			return false;
		}
	}

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %ecx, %ecx
movq %rcx, %r15
cmpq %rcx, %rbx
je 0xd228
movq %r14, %rdi
callq 0x8950
leaq 0x1(%r15), %rcx
testq %rax, %rax
jns 0xd20f
cmpq %rbx, %r15
setae %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: msgpack_compare_unwind
static bool
msgpack_compare_unwind(as_unpacker *pk1, as_unpacker *pk2,
		const msgpack_parse_state *state)
{
	if (state->type == AS_LIST) {
		if (! msgpack_skip(pk1, state->len1 - state->index)) {
			return false;
		}

		if (! msgpack_skip(pk2, state->len2 - state->index)) {
			return false;
		}
	}
	else if (state->type == AS_MAP) {
		if (! msgpack_skip(pk1,
				2 * (state->len1 - state->index) - state->map_pair)) {
			return false;
		}

		if (! msgpack_skip(pk2,
				2 * (state->len2 - state->index) - state->map_pair)) {
			return false;
		}
	}

	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movzbl 0x11(%rdx), %eax
movq %rdx, %r14
movq %rsi, %rbx
cmpl $0x6, %eax
je 0xd266
cmpl $0x5, %eax
jne 0xd29c
movl (%r14), %esi
subl 0xc(%r14), %esi
callq 0xd202
testb %al, %al
je 0xd2a0
movl 0x4(%r14), %esi
subl 0xc(%r14), %esi
jmp 0xd290
movl (%r14), %esi
movzbl 0x10(%r14), %eax
subl 0xc(%r14), %esi
addl %esi, %esi
subl %eax, %esi
callq 0xd202
testb %al, %al
je 0xd2a0
movl 0x4(%r14), %esi
movzbl 0x10(%r14), %eax
subl 0xc(%r14), %esi
addl %esi, %esi
subl %eax, %esi
movq %rbx, %rdi
callq 0xd202
testb %al, %al
je 0xd2a0
movb $0x1, %al
jmp 0xd2a2
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack_serializer.c
// Function: as_msgpack_serializer_serialize_presized
static int32_t as_msgpack_serializer_serialize_presized(as_serializer *s, const as_val *v, uint8_t *buf)
{
	as_packer packer = {
		.buffer = buf,
		// Prevent extra allocation.
		// buf should contain (pre-sized) space for the unpacking.
		.capacity = INT32_MAX,
		.offset = 0,
		.head = 0,
		.tail = 0,
	};

	if (as_pack_val(&packer, v) != 0) {
		return -1;
	}

	return packer.offset;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rsp, %rbx
xorps %xmm0, %xmm0
movabsq $0x7fffffff00000000, %rax # imm = 0x7FFFFFFF00000000
movq %rbx, %rdi
movaps %xmm0, (%rbx)
movq %rdx, 0x10(%rbx)
movq %rax, 0x18(%rbx)
callq 0x8ad0
xorl %ecx, %ecx
negl %eax
sbbl %ecx, %ecx
orl 0x18(%rbx), %ecx
movl %ecx, %eax
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack_serializer.c
// Function: as_msgpack_serializer_deserialize
static int as_msgpack_serializer_deserialize(as_serializer *s, as_buffer *buff, as_val **v)
{
	as_unpacker unpacker = {
			.buffer = buff->data,
			.length = buff->size,
			.offset = 0,
	};

	return as_unpack_val(&unpacker, v);
}

// Assembly:
subq $0x18, %rsp
movq 0x8(%rsi), %rax
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
andl $0x0, 0x8(%rdi)
movl 0x4(%rsi), %eax
movq %rdx, %rsi
movl %eax, 0xc(%rdi)
callq 0x86d0
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_orderedmap.c
// Function: as_orderedmap_cons
static as_orderedmap*
as_orderedmap_cons(as_orderedmap* map, uint32_t capacity)
{
	map->count = 0;
	map->capacity = ((capacity + 8) / 8) * 8; // can add 1 without realloc

	size_t size = map->capacity * sizeof(map_entry);

	map->table = (map_entry*)cf_malloc(size);

	if (map->table == NULL) {
		return NULL;
	}

	map->hold_count = 0;
	map->hold_table = NULL;
	map->hold_locations = NULL;

	return map;
}

// Assembly:
pushq %rbx
andl $0x0, 0x18(%rdi)
andl $-0x8, %esi
movq %rdi, %rbx
leal 0x8(%rsi), %edi
movl %edi, 0x1c(%rbx)
shlq $0x4, %rdi
callq 0x8080
testq %rax, %rax
movq %rax, 0x20(%rbx)
je 0xd51b
andl $0x0, 0x28(%rbx)
andq $0x0, 0x30(%rbx)
andq $0x0, 0x38(%rbx)
jmp 0xd51d
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_orderedmap.c
// Function: as_orderedmap_new
as_orderedmap*
as_orderedmap_new(uint32_t capacity)
{
	as_orderedmap* map = (as_orderedmap*)cf_malloc(sizeof(as_orderedmap));

	if (map == NULL) {
		return NULL;
	}

	as_map_cons((as_map*)map, true, 1, &as_orderedmap_map_hooks);

	return as_orderedmap_cons(map, capacity);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
pushq $0x40
popq %rdi
callq 0x8080
testq %rax, %rax
je 0xd55a
movq %rax, %r14
leaq 0x105e9(%rip), %rcx     # 0x1db28
pushq $0x1
popq %rdx
movq %rax, %rdi
movl %edx, %esi
callq 0x88c0
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xd4e8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_orderedmap.c
// Function: as_orderedmap_release
bool
as_orderedmap_release(as_orderedmap* map)
{
	if (map == NULL) {
		return false;
	}

	as_orderedmap_clear(map);
	cf_free(map->table);

	if (map->hold_table != NULL) {
		cf_free(map->hold_table);
		cf_free(map->hold_locations);
	}

	return true;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
je 0xd595
movq %rbx, %rdi
callq 0x81a0
movq 0x20(%rbx), %rdi
callq 0x8a00
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0xd595
callq 0x8a00
movq 0x38(%rbx), %rdi
callq 0x8a00
testq %rbx, %rbx
setne %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_orderedmap.c
// Function: as_orderedmap_clear
int
as_orderedmap_clear(as_orderedmap* map)
{
	if (map == NULL) {
		return -1;
	}

	for (uint32_t ix = 0; ix < map->count; ix++) {
		as_val_destroy(map->table[ix].key);
		as_val_destroy(map->table[ix].value);
	}

	map->count = 0;

	for (uint32_t ix = 0; ix < map->hold_count; ix++) {
		as_val_destroy(map->hold_table[ix].key);
		as_val_destroy(map->hold_table[ix].value);
	}

	map->hold_count = 0;

	return 0;
}

// Assembly:
testq %rdi, %rdi
je 0xd61e
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %r15d, %r15d
movl 0x18(%rbx), %eax
cmpq %rax, %r15
jae 0xd5dc
movq 0x20(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x84e0
movq 0x20(%rbx), %rax
movq 0x8(%rax,%r14), %rdi
callq 0x84e0
incq %r15
addq $0x10, %r14
jmp 0xd5b0
andl $0x0, 0x18(%rbx)
xorl %r14d, %r14d
xorl %r15d, %r15d
movl 0x28(%rbx), %eax
cmpq %rax, %r15
jae 0xd612
movq 0x30(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x84e0
movq 0x30(%rbx), %rax
movq 0x8(%rax,%r14), %rdi
callq 0x84e0
incq %r15
addq $0x10, %r14
jmp 0xd5e6
andl $0x0, 0x28(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_orderedmap.c
// Function: as_orderedmap_get
as_val*
as_orderedmap_get(const as_orderedmap* map, const as_val* key)
{
	if (map == NULL || ! is_valid_key_type(key)) {
		return NULL;
	}

	uint32_t ix;

	if (key_find(map->table, map->count, key, &ix, false)) {
		return (as_val*)map->table[ix].value;
	}

	if (key_find(map->hold_table, map->hold_count, key, &ix, false)) {
		return (as_val*)map->hold_table[ix].value;
	}

	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0xd677
movq %rdi, %rbx
movq %rsi, %rdi
movq %rsi, %r14
callq 0xd6bb
testb %al, %al
je 0xd677
movq 0x20(%rbx), %rdi
movl 0x18(%rbx), %esi
leaq 0xc(%rsp), %rcx
movq %r14, %rdx
xorl %r8d, %r8d
callq 0xd6df
testb %al, %al
je 0xd67c
addq $0x20, %rbx
jmp 0xd69e
xorl %r15d, %r15d
jmp 0xd6ae
movq 0x30(%rbx), %rdi
movl 0x28(%rbx), %esi
leaq 0xc(%rsp), %rcx
movq %r14, %rdx
xorl %r8d, %r8d
xorl %r15d, %r15d
callq 0xd6df
testb %al, %al
je 0xd6ae
addq $0x30, %rbx
movl 0xc(%rsp), %ecx
movq (%rbx), %rax
shlq $0x4, %rcx
movq 0x8(%rax,%rcx), %r15
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_orderedmap.c
// Function: key_find
static bool
key_find(const map_entry* table, uint32_t count, const as_val* key,
		uint32_t* ix_r, bool check_last_first)
{
	int64_t low = 0;
	int64_t high = (int64_t)count - 1;

	while (low <= high) {
		int64_t ix;

		// On the first iteration, probe at the end when 'check_last_first' is
		// set. Otherwise, fall back to binary search.
		if (check_last_first) {
			check_last_first = false;
			ix = high;
		}
		else {
			ix = (low + high) / 2;
		}

		msgpack_compare_t cmp = as_val_cmp(key, table[ix].key);

		if (cmp == MSGPACK_COMPARE_GREATER) {
			low = ix + 1;
		}
		else if (cmp == MSGPACK_COMPARE_LESS) {
			high = ix - 1;
		}
		else if (cmp == MSGPACK_COMPARE_EQUAL) {
			*ix_r = (uint32_t)ix;
			return true;
		}
		else {
			*ix_r = UINT32_MAX; // error
			return false;
		}
	}

	*ix_r = (uint32_t)low; // location to insert the key at

	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdx, %r14
movq %rdi, %r15
xorl %ebx, %ebx
movq %rcx, (%rsp)
decq %rbp
pushq $0x2
popq %r13
cmpq %rbp, %rbx
jg 0xd751
testb $0x1, %r8b
movq %rbp, %r12
jne 0xd71a
leaq (%rbp,%rbx), %rax
cqto
idivq %r13
movq %rax, %r12
movq %r12, %rax
movq %r14, %rdi
shlq $0x4, %rax
movq (%r15,%rax), %rsi
callq 0x8090
testl %eax, %eax
jne 0xd73c
decq %r12
xorl %r8d, %r8d
movq %r12, %rbp
jmp 0xd6ff
cmpl $0x1, %eax
je 0xd758
cmpl $0x2, %eax
jne 0xd75c
incq %r12
xorl %r8d, %r8d
movq %r12, %rbx
jmp 0xd6ff
xorl %eax, %eax
movl %ebx, %r12d
jmp 0xd762
movb $0x1, %al
jmp 0xd762
pushq $-0x1
popq %r12
xorl %eax, %eax
movq (%rsp), %rcx
movl %r12d, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_orderedmap.c
// Function: as_orderedmap_merge
static bool
as_orderedmap_merge(as_orderedmap* map)
{
	if (map->hold_count == 0) {
		return true;
	}

	uint32_t new_capacity = map->count + map->hold_count;

	if (new_capacity < map->capacity) {
		new_capacity = map->capacity;
	}

	map_entry* new_table = cf_malloc(new_capacity * sizeof(map_entry));

	if (new_table == NULL) {
		return false;
	}

	uint32_t src_ix = 0;
	uint32_t dst_ix = 0;

	for (uint32_t ix = 0; ix < map->hold_count; ix++) {
		uint32_t n_entries = map->hold_locations[ix] - src_ix;

		memcpy(new_table + dst_ix, map->table + src_ix,
				n_entries * sizeof(map_entry));

		src_ix += n_entries;
		dst_ix += n_entries;

		new_table[dst_ix].key = map->hold_table[ix].key;
		new_table[dst_ix].value = map->hold_table[ix].value;

		dst_ix++;
	}

	memcpy(new_table + dst_ix, map->table + src_ix,
			(map->count - src_ix) * sizeof(map_entry));

	cf_free(map->table);

	map->count += map->hold_count;
	map->capacity = new_capacity;
	map->table = new_table;

	map->hold_count = 0;

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl 0x28(%rdi), %ebx
movb $0x1, %al
testl %ebx, %ebx
je 0xdad9
addl 0x18(%rdi), %ebx
movl 0x1c(%rdi), %eax
movq %rdi, %r12
cmpl %eax, %ebx
cmovbel %eax, %ebx
movq %rbx, %rdi
shlq $0x4, %rdi
callq 0x8080
xorl %ecx, %ecx
testq %rax, %rax
movq %rax, 0x8(%rsp)
je 0xdad7
movq 0x8(%rsp), %rbp
movq %rbx, 0x10(%rsp)
xorl %r13d, %r13d
xorl %edx, %edx
xorl %ebx, %ebx
movl 0x28(%r12), %eax
movl %ebx, %edi
movl %ecx, %esi
cmpq %rax, %rdx
jae 0xda7f
movq 0x38(%r12), %rax
shlq $0x4, %rsi
shlq $0x4, %rdi
movq %rdx, %r14
addq 0x20(%r12), %rsi
addq %rbp, %rdi
movl (%rax,%r13), %eax
movl %eax, %r15d
movl %eax, 0x4(%rsp)
subl %ecx, %r15d
movq %r15, %rdx
shlq $0x4, %rdx
callq 0x8630
movq 0x30(%r12), %rcx
leal (%r15,%rbx), %eax
movq %r14, %rdx
leal 0x1(%r15,%rbx), %ebx
shlq $0x4, %rax
incq %rdx
movq (%rcx,%r13,4), %rcx
movq %rcx, (%rbp,%rax)
movq 0x30(%r12), %rcx
movq 0x8(%rcx,%r13,4), %rcx
addq $0x4, %r13
movq %rcx, 0x8(%rbp,%rax)
movl 0x4(%rsp), %ecx
movl %ecx, %ecx
jmp 0xda03
movq 0x8(%rsp), %rbx
movl 0x18(%r12), %edx
shlq $0x4, %rsi
shlq $0x4, %rdi
addq 0x20(%r12), %rsi
movq %rbx, %rax
subl %ecx, %edx
addq %rdi, %rax
shlq $0x4, %rdx
movq %rax, %rdi
callq 0x8630
movq 0x20(%r12), %rdi
callq 0x8a00
movl 0x28(%r12), %eax
addl %eax, 0x18(%r12)
movq 0x10(%rsp), %rax
movl %eax, 0x1c(%r12)
movq %rbx, 0x20(%r12)
andl $0x0, 0x28(%r12)
movb $0x1, %al
jmp 0xdad9
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_orderedmap.c
// Function: as_orderedmap_remove
int
as_orderedmap_remove(as_orderedmap* map, const as_val* key)
{
	if (map == NULL || ! is_valid_key_type(key)) {
		return -1;
	}

	if (! as_orderedmap_merge(map)) {
		return -1;
	}

	uint32_t ix;

	if (key_find(map->table, map->count, key, &ix, false)) {
		as_val_destroy(map->table[ix].key);
		as_val_destroy(map->table[ix].value);
		memmove(&map->table[ix], &map->table[ix + 1],
				sizeof(map_entry) * (map->count - (ix + 1)));
		map->count--;
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
pushq $-0x1
popq %rbx
testq %rdi, %rdi
je 0xdb88
movq %rdi, %r14
movq %rsi, %rdi
movq %rsi, %r15
callq 0xd6bb
testb %al, %al
je 0xdb88
movq %r14, %rdi
callq 0xd9ad
testb %al, %al
je 0xdb88
movq 0x20(%r14), %rdi
movl 0x18(%r14), %esi
leaq 0x4(%rsp), %rcx
movq %r15, %rdx
xorl %r8d, %r8d
xorl %ebx, %ebx
callq 0xd6df
testb %al, %al
je 0xdb88
movl 0x4(%rsp), %r12d
movq 0x20(%r14), %rax
movq %r12, %r15
shlq $0x4, %r15
movq (%rax,%r15), %rdi
callq 0x84e0
movq 0x20(%r14), %rax
movq 0x8(%rax,%r15), %rdi
callq 0x84e0
movq 0x20(%r14), %rax
movl 0x18(%r14), %edx
leal 0x1(%r12), %esi
subl %esi, %edx
shlq $0x4, %rsi
addq %rax, %r15
addq %rax, %rsi
shlq $0x4, %rdx
movq %r15, %rdi
callq 0x88f0
decl 0x18(%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_orderedmap.c
// Function: as_orderedmap_foreach
bool
as_orderedmap_foreach(const as_orderedmap* map,
		as_map_foreach_callback callback, void* udata)
{
	if (map == NULL) {
		return false;
	}

	if (! as_orderedmap_merge((as_orderedmap*)map)) {
		return false;
	}

	for (uint32_t ix = 0; ix < map->count; ix++) {
		if (! callback(map->table[ix].key, map->table[ix].value, udata)) {
			return false;
		}
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xdbef
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0xd9ad
testb %al, %al
je 0xdbef
pushq $0x8
popq %rax
pushq $-0x1
popq %r12
movl 0x18(%r15), %ecx
incq %r12
cmpq %rcx, %r12
setae %bpl
jae 0xdbf1
movq 0x20(%r15), %rcx
movq %rbx, %rdx
leaq 0x10(%rax), %r13
movq -0x8(%rcx,%rax), %rdi
movq (%rcx,%rax), %rsi
callq *%r14
testb %al, %al
movq %r13, %rax
jne 0xdbbf
jmp 0xdbf1
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_orderedmap.c
// Function: as_orderedmap_iterator_init
as_orderedmap_iterator*
as_orderedmap_iterator_init(as_orderedmap_iterator* it,
		const as_orderedmap* map)
{
	if (map != NULL && ! as_orderedmap_merge((as_orderedmap*)map)) {
		return NULL;
	}

	if (it == NULL) {
		return NULL;
	}

	as_iterator_init((as_iterator*)it, false, NULL,
			&as_orderedmap_iterator_hooks);
	it->ix = 0;
	it->map = map;

	return it;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0xdc27
movq %r14, %rdi
callq 0xd9ad
testq %rbx, %rbx
setne %cl
testb %al, %cl
jne 0xdc2c
xorl %ebx, %ebx
jmp 0xdc47
testq %rbx, %rbx
je 0xdc23
leaq 0xff4d(%rip), %rcx      # 0x1db80
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x8a10
andl $0x0, 0x20(%rbx)
movq %r14, 0x18(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_orderedmap.c
// Function: as_orderedmap_iterator_new
as_orderedmap_iterator*
as_orderedmap_iterator_new(const as_orderedmap* map)
{
	if (map != NULL && ! as_orderedmap_merge((as_orderedmap*)map)) {
		return NULL;
	}

	as_orderedmap_iterator* it =
			(as_orderedmap_iterator*)cf_malloc(sizeof(as_orderedmap_iterator));

	if (it == NULL) {
		return NULL;
	}

	as_iterator_init((as_iterator*)it, true, NULL,
			&as_orderedmap_iterator_hooks);
	it->ix = 0;
	it->map = map;

	return it;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
je 0xdc6a
movq %rbx, %rdi
callq 0xd9ad
testb %al, %al
je 0xdc99
pushq $0x40
popq %rdi
callq 0x8080
testq %rax, %rax
je 0xdc99
movq %rax, %r14
leaq 0xfeff(%rip), %rcx      # 0x1db80
pushq $0x1
popq %rsi
movq %rax, %rdi
xorl %edx, %edx
callq 0x8a10
andl $0x0, 0x20(%r14)
movq %rbx, 0x18(%r14)
jmp 0xdc9c
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_orderedmap.c
// Function: as_orderedmap_iterator_next
const as_val*
as_orderedmap_iterator_next(as_orderedmap_iterator* it)
{
	if (it->ix >= it->map->count) {
		return NULL;
	}

	as_pair_init(&it->pair, it->map->table[it->ix].key,
			it->map->table[it->ix].value);
	it->ix++;

	return (as_val*)&it->pair;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x20(%rdi), %eax
movq 0x18(%rdi), %rcx
cmpl 0x18(%rcx), %eax
jae 0xdcfb
movq 0x20(%rcx), %rcx
shlq $0x4, %rax
leaq 0x28(%rdi), %r14
movq %rdi, %rbx
movq %r14, %rdi
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
callq 0x83b0
incl 0x20(%rbx)
jmp 0xdcfe
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_pair.c
// Function: as_pair_init
as_pair * as_pair_init(as_pair * pair, as_val * _1, as_val * _2)
{
	if ( !pair ) return pair;

	as_val_init((as_val *) pair, AS_PAIR, false);
	pair->_1 = _1;
	pair->_2 = _2;
	return pair;
}

// Assembly:
movq %rdi, %rax
testq %rdi, %rdi
je 0xdd9c
movw $0x8, 0x4(%rax)
movl $0x1, (%rax)
movq %rsi, 0x8(%rax)
movq %rdx, 0x10(%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_pair.c
// Function: as_pair_new
as_pair * as_pair_new(as_val * _1, as_val * _2)
{
	as_pair * pair = (as_pair *) cf_malloc(sizeof(as_pair));
	if ( !pair ) return pair;

	as_val_init((as_val *) pair, AS_PAIR, true);
	pair->_1 = _1;
	pair->_2 = _2;
	return pair;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x18
popq %rdi
callq 0x8080
testq %rax, %rax
je 0xddc8
movw $0x108, 0x4(%rax)       # imm = 0x108
movl $0x1, (%rax)
movq %r14, 0x8(%rax)
movq %rbx, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_pair.c
// Function: as_pair_val_tostring
char *as_pair_val_tostring(const as_val * v)
{
	as_pair * p = as_pair_fromval(v);
	if ( p == NULL ) return NULL;

	char * a = as_val_tostring(p->_1);
	size_t al = strlen(a);
	char * b = as_val_tostring(p->_2);
	size_t bl = strlen(b);
	
	size_t l = al + bl + 5;
	char * str = (char *) cf_malloc(sizeof(char) * l);
	if (!str) return str;

	strcpy(str, "(");
	strcpy(str+1, a);
	strcpy(str+1+al,", ");
	strcpy(str+1+al+2, b);
	strcpy(str+1+al+2+bl,")");
	*(str+1+al+2+bl+1) = '\0';
	
	cf_free(a);
	cf_free(b);

	return str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xdea2
cmpb $0x8, 0x4(%rdi)
movq %rdi, %r14
jne 0xdea2
movq 0x8(%r14), %rdi
callq 0x82a0
movq %rax, %rdi
movq %rax, %rbx
callq 0x8270
movq 0x10(%r14), %rdi
movq %rax, %r12
callq 0x82a0
movq %rax, %rdi
movq %rax, %r15
callq 0x8270
leaq 0x5(%r12,%rax), %rdi
movq %rax, %r13
callq 0x8080
testq %rax, %rax
je 0xdea2
leaq 0x1(%rax), %rdi
movq %rbx, %rsi
movq %rax, %r14
movw $0x28, (%rax)
callq 0x8190
leaq 0x3(%r14,%r12), %rdi
movq %r15, %rsi
leaq 0x1(%r14,%r12), %rbp
movw $0x202c, 0x1(%r14,%r12) # imm = 0x202C
movb $0x0, 0x3(%r14,%r12)
callq 0x8190
movq %rbx, %rdi
movw $0x29, 0x2(%r13,%rbp)
callq 0x8a00
movq %r15, %rdi
callq 0x8a00
jmp 0xdea5
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_password.c
// Function: as_password_prompt_hash
bool
as_password_prompt_hash(const char* password, char* hash)
{
	char pass[AS_PASSWORD_HASH_SIZE];
	
	if (password && *password) {
		as_strncpy(pass, password, sizeof(pass));
	}
	else {
		as_password_prompt(pass, sizeof(pass));
	}
	
	return as_password_get_constant_hash(pass, hash);
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
testq %rdi, %rdi
je 0xdf66
cmpb $0x0, (%rdi)
movq %rdi, %rsi
je 0xdf66
movq %rsp, %rdi
pushq $0x40
popq %rdx
callq 0x81b0
jmp 0xdf71
movq %rsp, %rdi
pushq $0x40
popq %rsi
callq 0xdf82
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x8c00
addq $0x40, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_password.c
// Function: as_password_prompt
static void
as_password_prompt(char* password, int size)
{
	// Turn off echo.
	as_set_echo(false);

	// Prompt for password.
	printf("Enter Password: ");
	fflush(stdout);

	// Read password until newline.
	char* s = fgets(password, size, stdin);

	if (s) {
		int len = (int)strlen(password);

		if (password[len - 1] == '\n') {
			password[--len] = 0;
		}
	}
	else {
		password[0] = 0;
	}

	// Restore echo.
	as_set_echo(true);
	printf("\n");
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %edi, %edi
movl %esi, %ebp
callq 0xe00b
leaq 0x7406(%rip), %rdi      # 0x1539e
xorl %eax, %eax
callq 0x82c0
movq 0xffda(%rip), %rax      # 0x1df80
movq (%rax), %rdi
callq 0x8710
movq 0xffdb(%rip), %rax      # 0x1df90
movq %rbx, %rdi
movl %ebp, %esi
movq (%rax), %rdx
callq 0x84c0
testq %rax, %rax
je 0xdfdc
movq %rbx, %rdi
callq 0x8270
decl %eax
cltq
cmpb $0xa, (%rbx,%rax)
jne 0xdfdf
addq %rax, %rbx
movb $0x0, (%rbx)
pushq $0x1
popq %rdi
callq 0xe00b
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x8110
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_password.c
// Function: as_set_echo
static void
as_set_echo(bool echo)
{
	struct termios tty;
	tcgetattr(STDIN_FILENO, &tty);

	if (echo)
	{
		tty.c_lflag |= ECHO;
	}
	else
	{
		tty.c_lflag &= ~ECHO;
	}
	tcsetattr(STDIN_FILENO, TCSANOW, &tty);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
leaq 0xc(%rsp), %r14
movl %edi, %ebx
xorl %edi, %edi
movq %r14, %rsi
callq 0x8990
movl 0xc(%r14), %eax
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rdx
andl $-0x9, %eax
leal (%rax,%rbx,8), %eax
movl %eax, 0xc(%r14)
callq 0x89a0
addq $0x48, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_queue.c
// Function: as_queue_init
bool
as_queue_init(as_queue* queue, uint32_t item_size, uint32_t capacity)
{
	queue->data = cf_malloc(capacity * item_size);
	
	if (! queue->data) {
		return false;
	}
	queue->capacity = capacity;
	queue->head = queue->tail = 0;
	queue->item_size = item_size;
	queue->total = 0;
	queue->flags = ITEMS_ON_HEAP;
	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl %edx, %edi
movl %edx, %r14d
movl %esi, %ebp
imull %esi, %edi
callq 0x8080
testq %rax, %rax
movq %rax, (%rbx)
je 0xe080
movl %r14d, 0x8(%rbx)
andq $0x0, 0xc(%rbx)
movabsq $0x100000000, %rcx      # imm = 0x100000000
movl %ebp, 0x14(%rbx)
movq %rcx, 0x18(%rbx)
testq %rax, %rax
setne %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_queue.c
// Function: as_queue_create
as_queue*
as_queue_create(uint32_t item_size, uint32_t capacity)
{
	as_queue* queue = (as_queue*)cf_malloc(sizeof(as_queue));
	
	if (! queue) {
		return 0;
	}

	if (! as_queue_init(queue, item_size, capacity)) {
		cf_free(queue);
		return 0;
	}
	queue->flags = ITEMS_ON_HEAP | ALL_ON_HEAP;
	return queue;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movl %edi, %r14d
pushq $0x20
popq %rdi
callq 0x8080
testq %rax, %rax
je 0xe0c6
movq %rax, %rdi
movl %r14d, %esi
movl %ebp, %edx
movq %rax, %rbx
callq 0x8a30
testb %al, %al
je 0xe0be
movl $0x3, 0x1c(%rbx)
jmp 0xe0c8
movq %rbx, %rdi
callq 0x8a00
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_queue.c
// Function: as_queue_destroy
void
as_queue_destroy(as_queue* queue)
{
	if (queue->flags & ITEMS_ON_HEAP) {
		cf_free(queue->data);
		
		if (queue->flags & ALL_ON_HEAP) {
			cf_free(queue);
		}
	}
}

// Assembly:
pushq %rbx
testb $0x1, 0x1c(%rdi)
je 0xe0e8
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x8a00
testb $0x2, 0x1c(%rbx)
jne 0xe0ea
popq %rbx
retq
movq %rbx, %rdi
popq %rbx
jmp 0x8a00
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_queue.c
// Function: as_queue_push
bool
as_queue_push(as_queue* queue, const void* ptr)
{
	// Check queue length.
	if (as_queue_size(queue) == queue->capacity) {
		if (! as_queue_increase_capacity(queue)) {
			return false;
		}
	}

	memcpy(as_queue_get(queue, queue->tail), ptr, queue->item_size);
	queue->tail++;
	as_queue_unwrap(queue);
	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x10(%rdi), %eax
movl 0x8(%rdi), %ecx
movq %rsi, %r14
movq %rdi, %rbx
movl %eax, %edx
subl 0xc(%rdi), %edx
cmpl %ecx, %edx
jne 0xe11e
movq %rbx, %rdi
callq 0xe14e
testb %al, %al
je 0xe144
movl 0x8(%rbx), %ecx
movl 0x10(%rbx), %eax
xorl %edx, %edx
movq %r14, %rsi
divl %ecx
movl %edx, %edi
movl 0x14(%rbx), %edx
imull %edx, %edi
addq (%rbx), %rdi
callq 0x8630
incl 0x10(%rbx)
movq %rbx, %rdi
callq 0xe1c9
movb $0x1, %al
jmp 0xe146
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_queue.c
// Function: as_queue_increase_capacity
static bool
as_queue_increase_capacity(as_queue* queue)
{
	uint32_t new_capacity = queue->capacity * 2;
	
	if (queue->flags & ITEMS_ON_HEAP) {
		// Data already allocated on heap.
		// Check for The rare case where the queue is not fragmented, and realloc makes sense
		// and none of the offsets need to move.
		if (queue->head % queue->capacity == 0) {
			queue->data = cf_realloc(queue->data, new_capacity * queue->item_size);
			
			if (! queue->data) {
				return false;
			}
			queue->head = 0;
			queue->tail = queue->capacity;
			queue->capacity = new_capacity;
			return true;
		}
		
		// Copy to new queue.
		return as_queue_copy(queue, new_capacity, true);
	}
	
	// Switch over from stack to heap allocated.
	if (! as_queue_copy(queue, new_capacity, false)) {
		return false;
	}
	queue->flags |= ITEMS_ON_HEAP;
	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x8(%rdi), %ecx
testb $0x1, 0x1c(%rdi)
movq %rdi, %rbx
leal (%rcx,%rcx), %ebp
jne 0xe17a
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
xorl %r14d, %r14d
callq 0xe2e2
testb %al, %al
je 0xe1bc
orb $0x1, 0x1c(%rbx)
jmp 0xe1b9
movl 0xc(%rbx), %eax
xorl %edx, %edx
divl %ecx
testl %edx, %edx
je 0xe196
pushq $0x1
popq %rdx
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0xe2e2
movl 0x14(%rbx), %esi
movq (%rbx), %rdi
imull %ebp, %esi
callq 0x8540
testq %rax, %rax
movq %rax, (%rbx)
je 0xe1c4
andl $0x0, 0xc(%rbx)
movl 0x8(%rbx), %eax
movl %eax, 0x10(%rbx)
movl %ebp, 0x8(%rbx)
movb $0x1, %r14b
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
xorl %r14d, %r14d
jmp 0xe1bc
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_queue.c
// Function: as_queue_unwrap
static inline void
as_queue_unwrap(as_queue* queue)
{
	if ((queue->tail & 0xC0000000) != 0) {
		uint32_t sz = as_queue_size(queue);
		queue->head %= queue->capacity;
		queue->tail = queue->head + sz;
	}
}

// Assembly:
movl 0x10(%rdi), %ecx
cmpl $0x40000000, %ecx       # imm = 0x40000000
jb 0xe1e6
movl 0xc(%rdi), %eax
xorl %edx, %edx
subl %eax, %ecx
divl 0x8(%rdi)
addl %edx, %ecx
movl %edx, 0xc(%rdi)
movl %ecx, 0x10(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_queue.c
// Function: as_queue_push_limit
bool
as_queue_push_limit(as_queue* queue, const void* ptr)
{
	if (as_queue_size(queue) >= queue->capacity) {
		return false;
	}

	memcpy(as_queue_get(queue, queue->tail), ptr, queue->item_size);
	queue->tail++;
	as_queue_unwrap(queue);
	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x10(%rdi), %eax
movl 0x8(%rdi), %ebp
movl %eax, %r14d
subl 0xc(%rdi), %r14d
cmpl %ebp, %r14d
jae 0xe21f
xorl %edx, %edx
movq %rdi, %rbx
divl %ebp
movl %edx, %edi
movl 0x14(%rbx), %edx
imull %edx, %edi
addq (%rbx), %rdi
callq 0x8630
incl 0x10(%rbx)
movq %rbx, %rdi
callq 0xe1c9
cmpl %ebp, %r14d
setb %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_queue.c
// Function: as_queue_push_head
bool
as_queue_push_head(as_queue *queue, const void* ptr)
{
	if (as_queue_size(queue) == queue->capacity) {
		if (! as_queue_increase_capacity(queue)) {
			return false;
		}
	}

	if (queue->head == 0) {
		queue->head += queue->capacity;
		queue->tail += queue->capacity;
	}

	queue->head--;
	memcpy(as_queue_get(queue, queue->head), ptr, queue->item_size);
	as_queue_unwrap(queue);
	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x10(%rdi), %edx
movl 0xc(%rdi), %eax
movl 0x8(%rdi), %ecx
movq %rsi, %r14
movq %rdi, %rbx
subl %eax, %edx
cmpl %ecx, %edx
jne 0xe255
movq %rbx, %rdi
callq 0xe14e
testb %al, %al
je 0xe286
movl 0x8(%rbx), %ecx
movl 0xc(%rbx), %eax
testl %eax, %eax
jne 0xe25e
addl %ecx, 0x10(%rbx)
movl %ecx, %eax
decl %eax
xorl %edx, %edx
movq %r14, %rsi
movl %eax, 0xc(%rbx)
divl %ecx
movl %edx, %edi
movl 0x14(%rbx), %edx
imull %edx, %edi
addq (%rbx), %rdi
callq 0x8630
movq %rbx, %rdi
callq 0xe1c9
movb $0x1, %al
jmp 0xe288
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_queue.c
// Function: as_queue_push_head_limit
bool
as_queue_push_head_limit(as_queue *queue, const void* ptr)
{
	if (as_queue_size(queue) >= queue->capacity) {
		return false;
	}

	if (queue->head == 0) {
		queue->head += queue->capacity;
		queue->tail += queue->capacity;
	}

	queue->head--;
	memcpy(as_queue_get(queue, queue->head), ptr, queue->item_size);
	as_queue_unwrap(queue);
	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x10(%rdi), %ecx
movl 0xc(%rdi), %eax
movl 0x8(%rdi), %ebp
movl %ecx, %r14d
subl %eax, %r14d
cmpl %ebp, %r14d
jae 0xe2d7
movq %rdi, %rbx
testl %eax, %eax
jne 0xe2b6
addl %ebp, %ecx
movl %ebp, %eax
movl %ecx, 0x10(%rbx)
decl %eax
xorl %edx, %edx
movl %eax, 0xc(%rbx)
divl %ebp
movl %edx, %edi
movl 0x14(%rbx), %edx
imull %edx, %edi
addq (%rbx), %rdi
callq 0x8630
movq %rbx, %rdi
callq 0xe1c9
cmpl %ebp, %r14d
setb %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_queue.c
// Function: as_queue_copy
static bool
as_queue_copy(as_queue* queue, uint32_t new_capacity, bool free_old)
{
	uint8_t* tmp = cf_malloc(new_capacity * queue->item_size);
	
	if (! tmp) {
		return false;
	}
	
	// end_sz is used bytes in old queue from insert point to end.
	size_t end_sz = (queue->capacity - (queue->head % queue->capacity)) * queue->item_size;
	
	memcpy(tmp, as_queue_get(queue, queue->head), end_sz);
	memcpy(&tmp[end_sz], queue->data, (queue->capacity * queue->item_size) - end_sz);
	
	if (free_old) {
		cf_free(queue->data);
	}
	queue->data = tmp;
	queue->head = 0;
	queue->tail = queue->capacity;
	queue->capacity = new_capacity;
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movl 0x14(%rdi), %edi
movl %edx, %ebp
movl %esi, %ebx
imull %esi, %edi
callq 0x8080
movq %rax, %r15
testq %rax, %rax
je 0xe366
movl 0x8(%r14), %r12d
movl 0xc(%r14), %eax
xorl %edx, %edx
movq %r15, %rdi
divl %r12d
movl 0x14(%r14), %esi
subl %edx, %r12d
imull %esi, %r12d
imull %edx, %esi
addq (%r14), %rsi
movq %r12, %rdx
callq 0x8630
movl 0x14(%r14), %edx
movq (%r14), %rsi
leaq (%r15,%r12), %rdi
imull 0x8(%r14), %edx
subq %r12, %rdx
callq 0x8630
testb %bpl, %bpl
je 0xe352
movq (%r14), %rdi
callq 0x8a00
movq %r15, (%r14)
andl $0x0, 0xc(%r14)
movl 0x8(%r14), %eax
movl %eax, 0x10(%r14)
movl %ebx, 0x8(%r14)
testq %r15, %r15
setne %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)