LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_bytes.c
// Function: as_bytes_from_string
int
as_bytes_from_string(uint8_t* bytes, uint32_t bytes_size, const char* str)
{
	// Skip prefix if it exists.
	if (*str == '0' && *(str+1) == 'x') {
		str += 2;
	}

	int len = (int)strlen(str);
	int count = len / 2;
	int rem = len - (count * 2);

	// Hex string length must be even (2 chars per byte).
	if (rem != 0) {
		return -1;
	}

	// Byte array must have enough space.
	if ((uint32_t)count > bytes_size) {
		return -1;
	}

	uint8_t hb; // high byte
	uint8_t lb; // low byte

	while (*str) {
		hb = hex_char_to_byte(*str++);

		if (hb == 0xff) {
			return -1;
		}

		lb = hex_char_to_byte(*str++);

		if (lb == 0xff) {
			return -1;
		}
		*bytes++ = (hb << 4) + lb;
	}
	return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x30, (%rdx)
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
jne 0x9c3b
xorl %eax, %eax
cmpb $0x78, 0x1(%rbx)
sete %al
leaq (%rbx,%rax,2), %rbx
movq %rbx, %rdi
callq 0x8270
movq %rax, %rcx
pushq $0x2
popq %rsi
cltd
idivl %esi
movl %eax, %r15d
leal (%r15,%r15), %eax
cmpl %ecx, %eax
setne %al
cmpl %ebp, %r15d
seta %cl
orb %al, %cl
pushq $-0x1
popq %rbp
jne 0x9ca1
xorl %r13d, %r13d
movb (%rbx,%r13,2), %al
testb %al, %al
je 0x9c9e
movsbl %al, %edi
callq 0x9cb2
cmpb $-0x1, %al
je 0x9ca1
movsbl 0x1(%rbx,%r13,2), %edi
movl %eax, %r12d
callq 0x9cb2
cmpb $-0x1, %al
je 0x9ca1
shlb $0x4, %r12b
addb %r12b, %al
movb %al, (%r14,%r13)
incq %r13
jmp 0x9c68
movl %r15d, %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_bytes.c
// Function: hex_char_to_byte
static inline uint8_t
hex_char_to_byte(const char c)
{
    if (c >= '0' && c <= '9') {
		return (uint8_t)(c - '0');
	}

    if (c >= 'A' && c <= 'F') {
		return (uint8_t)(c - 'A' + 10);
	}

    if (c >= 'a' && c <= 'f') {
		return (unsigned char)(c - 'a' + 10);
	}
    return 0xff;
}

// Assembly:
leal -0x30(%rdi), %eax
cmpb $0xa, %al
jb 0x9cc6
leal -0x41(%rdi), %eax
cmpb $0x5, %al
ja 0x9cc7
addb $-0x37, %dil
movl %edi, %eax
retq
leal -0x61(%rdi), %eax
addb $-0x57, %dil
cmpb $0x6, %al
movzbl %dil, %ecx
movl $0xff, %eax
cmovbl %ecx, %eax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_double.c
// Function: as_double_val_tostring
char*
as_double_val_tostring(const as_val * val)
{
	as_double* value_ptr = (as_double*)val;
	char* str = (char*)cf_malloc(sizeof(char) * 64);
	sprintf(str, "%.16g", value_ptr->value);
	return str;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x40
popq %rdi
callq 0x8080
movsd 0x8(%rbx), %xmm0
movq %rax, %r14
movq %rax, %rdi
leaq 0xb2cf(%rip), %rsi      # 0x15041
movb $0x1, %al
callq 0x8ac0
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_geojson.c
// Function: as_geojson_val_hashcode
uint32_t as_geojson_val_hashcode(const as_val * v)
{
	as_geojson * string = as_geojson_fromval(v);
	if ( string == NULL || string->value == NULL) return 0;
	uint32_t hash = 0;
	int c;
	char * str = string->value;
	while ( (c = *str++) ) {
		hash = c + (hash << 6) + (hash << 16) - hash;
	}
	return hash;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x9ec2
cmpb $0xb, 0x4(%rdi)
jne 0x9ec2
movq 0x10(%rdi), %rcx
testq %rcx, %rcx
je 0x9ec2
xorl %eax, %eax
movsbl (%rcx), %edx
testl %edx, %edx
je 0x9ec2
imull $0x1003f, %eax, %eax    # imm = 0x1003F
incq %rcx
addl %edx, %eax
jmp 0x9eae
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_geojson.c
// Function: as_geojson_val_tostring
char * as_geojson_val_tostring(const as_val * v)
{
	as_geojson * s = (as_geojson *) v;
	if (s->value == NULL) return(NULL);
	size_t sl = as_geojson_len(s);
	size_t st = 3 + sl;
	char * str = (char *) cf_malloc(sizeof(char) * st);
	if (!str) return str;
	*(str + 0) = '\"';
	strcpy(str + 1, s->value);
	*(str + 1 + sl) = '\"';
	*(str + 1 + sl + 1) = '\0';
	return str;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x0, 0x10(%rdi)
je 0x9f07
movq %rdi, %r14
callq 0x8aa0
leaq 0x3(%rax), %rdi
movq %rax, %r15
callq 0x8080
testq %rax, %rax
je 0x9f07
movb $0x22, (%rax)
movq %rax, %rdi
movq %rax, %rbx
movq 0x10(%r14), %rsi
incq %rdi
callq 0x8190
movw $0x22, 0x1(%rbx,%r15)
jmp 0x9f09
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_integer.c
// Function: as_integer_val_tostring
char * as_integer_val_tostring(const as_val * v)
{
	as_integer * i = (as_integer *) v;
	char * str = (char *) cf_malloc(sizeof(char) * 32);
	memset(str, 0, 32);
	sprintf(str, "%" PRId64, i->value);
	return str;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x20
popq %rdi
callq 0x8080
andq $0x0, (%rax)
andq $0x0, 0x8(%rax)
andq $0x0, 0x10(%rax)
andq $0x0, 0x18(%rax)
movq %rax, %r14
movq %rax, %rdi
leaq 0xb09d(%rip), %rsi      # 0x15047
xorl %eax, %eax
movq 0x8(%rbx), %rdx
callq 0x8ac0
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_iterator.c
// Function: as_iterator_destroy
void as_iterator_destroy(as_iterator * iterator)
{
    as_util_hook(destroy, 1, iterator);
	iterator->data = NULL;
	iterator->hooks = NULL;
    if ( iterator->free ) {
    	cf_free(iterator);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
je 0x9ff3
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x9ff3
movq (%rax), %rax
testq %rax, %rax
je 0x9ff3
movq %rbx, %rdi
callq *%rax
andq $0x0, 0x10(%rbx)
andq $0x0, 0x8(%rbx)
cmpb $0x1, (%rbx)
jne 0xa00b
movq %rbx, %rdi
popq %rbx
jmp 0x8a00
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_list.c
// Function: as_list_cons
as_list * as_list_cons(as_list * list, bool free, const as_list_hooks * hooks)
{
	if ( !list ) return list;

	as_val_cons((as_val *) list, AS_LIST, free);
	list->hooks = hooks;
	list->flags = 0;
	return list;
}

// Assembly:
movq %rdi, %rax
testq %rdi, %rdi
je 0xa02e
movb $0x5, 0x4(%rax)
movb %sil, 0x5(%rax)
movl $0x1, (%rax)
movq %rdx, 0x10(%rax)
andl $0x0, 0x8(%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_list.c
// Function: as_list_val_tostring
char * as_list_val_tostring(const as_val * v) 
{
	as_list_val_tostring_data data = {
		.buf = NULL,
		.blk = 256,
		.cap = 1024,
		.pos = 0,
		.sep = false
	};

	data.buf = (char *) cf_calloc(data.cap, sizeof(char));

	strcpy(data.buf, "[");
	data.pos += 1;

	if ( v ) {
		as_list_foreach((as_list *) v, as_list_val_tostring_foreach, &data);
	}

	if ( data.pos + 2 >= data.cap ) {
		data.buf = cf_realloc(data.buf, sizeof(char) * (data.cap + 2));
		data.cap += 2;
	}

	data.buf[data.pos] = ']';
	data.buf[data.pos + 1] = 0;
	
	return data.buf;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq 0xafa6(%rip), %rax      # 0x15068
movq 0xaf97(%rip), %rdx      # 0x15060
movq 0xaf88(%rip), %rcx      # 0x15058
movq %rdi, %rbx
movq %rax, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rcx, (%rsp)
pushq $0x1
popq %rsi
movl $0x400, %edi            # imm = 0x400
callq 0x8960
movq %rax, (%rsp)
movw $0x5b, (%rax)
movl $0x1, 0x10(%rsp)
pushq $0x1
popq %rcx
movl $0x400, %esi            # imm = 0x400
testq %rbx, %rbx
je 0xa13f
movq 0x10(%rbx), %rdx
testq %rdx, %rdx
je 0xa13f
movq 0xf0(%rdx), %r8
testq %r8, %r8
je 0xa13f
movq %rsp, %r14
leaq 0x4e(%rip), %rsi        # 0xa179
movq %rbx, %rdi
movq %r14, %rdx
callq *%r8
movl 0x10(%r14), %ecx
movl 0xc(%r14), %esi
movq (%r14), %rax
leal 0x2(%rcx), %edx
cmpl %esi, %edx
jb 0xa159
addl $0x2, %esi
movq %rax, %rdi
callq 0x8540
movq %rax, (%rsp)
movl 0x10(%rsp), %ecx
movl %ecx, %ecx
movb $0x5d, (%rax,%rcx)
movl 0x10(%rsp), %ecx
movq (%rsp), %rax
incl %ecx
movb $0x0, (%rax,%rcx)
movq (%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_list.c
// Function: as_list_val_tostring_foreach
static bool as_list_val_tostring_foreach(as_val * val, void * udata)
{
	as_list_val_tostring_data * data = (as_list_val_tostring_data *) udata;

	char * str = as_val_tostring(val);

	if ( !str ) {
		str = (char *)NULL_STR;
	}

	uint32_t len = (uint32_t)strlen(str);

	if ( data->pos + len + 2 >= data->cap ) {
		uint32_t adj = ((len+2) > data->blk) ? len+2 : data->blk;
		data->buf = cf_realloc(data->buf, sizeof(char) * (data->cap + adj));
		data->cap += adj;
	}

	if ( data->sep ) {
		data->buf[data->pos] = ',';
		data->buf[data->pos + 1] = ' ';
		data->pos += 2;
	}

	memcpy(data->buf + data->pos, str, len);
	data->pos += len;
	data->sep = true;

	if ( str != NULL_STR ) {
		cf_free(str);
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
callq 0x82a0
movq %rax, %r14
testq %rax, %rax
jne 0xa197
movq 0x13e01(%rip), %r14     # 0x1df98
movq %r14, %rdi
callq 0x8270
movl 0x10(%rbx), %ecx
movl 0xc(%rbx), %esi
movq %rax, %r15
leal 0x2(%rax,%rcx), %eax
cmpl %esi, %eax
movq (%rbx), %rax
jb 0xa1d2
movl 0x8(%rbx), %ebp
leal 0x2(%r15), %ecx
movq %rax, %rdi
cmpl %ebp, %ecx
cmoval %ecx, %ebp
addl %ebp, %esi
callq 0x8540
movq %rax, (%rbx)
addl %ebp, 0xc(%rbx)
movl 0x10(%rbx), %ecx
cmpb $0x1, 0x14(%rbx)
jne 0xa1f6
movl %ecx, %ecx
movb $0x2c, (%rax,%rcx)
movl 0x10(%rbx), %ecx
movq (%rbx), %rax
incl %ecx
movb $0x20, (%rax,%rcx)
movl 0x10(%rbx), %ecx
addl $0x2, %ecx
movl %ecx, 0x10(%rbx)
movq (%rbx), %rax
movl %ecx, %edi
movl %r15d, %edx
movq %r14, %rsi
addq %rax, %rdi
callq 0x8630
addl %r15d, 0x10(%rbx)
cmpq 0x13d87(%rip), %r14     # 0x1df98
movb $0x1, 0x14(%rbx)
je 0xa21f
movq %r14, %rdi
callq 0x8a00
movb $0x1, %al
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_map.c
// Function: as_map_cons
as_map* as_map_cons(as_map* map, bool free, uint32_t flags, const as_map_hooks* hooks)
{
	if ( !map ) return map;

	as_val_cons((as_val*) map, AS_MAP, free);
	map->flags = flags;
	map->hooks = hooks;
	return map;
}

// Assembly:
movq %rdi, %rax
testq %rdi, %rdi
je 0xa249
movb $0x6, 0x4(%rax)
movb %sil, 0x5(%rax)
movl $0x1, (%rax)
movl %edx, 0x8(%rax)
movq %rcx, 0x10(%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_map.c
// Function: as_map_val_tostring
char * as_map_val_tostring(const as_val* v)
{
	as_map_val_tostring_data data = {
		.buf = NULL,
		.blk = 1024,
		.cap = 1024,
		.pos = 0,
		.sep = false
	};

	data.buf = (char *) cf_calloc(data.cap, sizeof(char));

	strcpy(data.buf, "{");
	data.pos += 1;
	
	if ( v ) {
		as_map_foreach((as_map*) v, as_map_val_tostring_foreach, &data);
	}

	if ( data.pos + 2 >= data.cap ) {
		data.buf = cf_realloc(data.buf, sizeof(char) * (data.cap + 2));
		data.cap += 2;
	}

	data.buf[data.pos] = '}';
	data.buf[data.pos + 1] = 0;
	
	return data.buf;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq 0xadc3(%rip), %rax      # 0x150a0
movq 0xadb4(%rip), %rdx      # 0x15098
movq 0xada5(%rip), %rcx      # 0x15090
movq %rdi, %rbx
movq %rax, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rcx, (%rsp)
pushq $0x1
popq %rsi
movl $0x400, %edi            # imm = 0x400
callq 0x8960
movq %rax, (%rsp)
movw $0x7b, (%rax)
movl $0x1, 0x10(%rsp)
pushq $0x1
popq %rcx
movl $0x400, %esi            # imm = 0x400
testq %rbx, %rbx
je 0xa357
movq 0x10(%rbx), %rdx
testq %rdx, %rdx
je 0xa357
movq 0x40(%rdx), %r8
testq %r8, %r8
je 0xa357
movq %rsp, %r14
leaq 0x4e(%rip), %rsi        # 0xa391
movq %rbx, %rdi
movq %r14, %rdx
callq *%r8
movl 0x10(%r14), %ecx
movl 0xc(%r14), %esi
movq (%r14), %rax
leal 0x2(%rcx), %edx
cmpl %esi, %edx
jb 0xa371
addl $0x2, %esi
movq %rax, %rdi
callq 0x8540
movq %rax, (%rsp)
movl 0x10(%rsp), %ecx
movl %ecx, %ecx
movb $0x7d, (%rax,%rcx)
movl 0x10(%rsp), %ecx
movq (%rsp), %rax
incl %ecx
movb $0x0, (%rax,%rcx)
movq (%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_map.c
// Function: as_map_val_tostring_foreach
static bool as_map_val_tostring_foreach(const as_val* key, const as_val* val, void* udata)
{
	as_map_val_tostring_data * data = (as_map_val_tostring_data *) udata;

	char * keystr = as_val_tostring(key);
	if (!keystr) {
		return false;
	}
	int keylen = (int)strlen(keystr);

	char * valstr = as_val_tostring(val);
    if (!valstr) {
		cf_free(keystr);
    	return false;
    }
	int vallen = (int)strlen(valstr);

	uint32_t entlen = keylen + 2 + vallen + 2;

	if ( data->pos + entlen >= data->cap ) {
		uint32_t adj = entlen > data->blk ? entlen : data->blk;
		data->buf = cf_realloc(data->buf, sizeof(char) * (data->cap + adj));
		memset(data->buf + data->cap, 0, sizeof(char) * adj);
		data->cap += adj;
	}

	if ( data->sep ) {
		data->buf[data->pos] = ',';
		data->buf[data->pos + 1] = ' ';
		data->pos += 2;
	}

	strcpy(data->buf + data->pos, keystr);
	data->pos += keylen;

	strcpy(data->buf + data->pos, ":");
	data->pos += 1;

	strcpy(data->buf + data->pos, valstr);
	data->pos += vallen;

	data->sep = true;

	cf_free(keystr);
	keystr = NULL;

	cf_free(valstr);
	valstr = NULL;

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
callq 0x82a0
testq %rax, %rax
je 0xa498
movq %rax, %rdi
movq %rax, %r14
callq 0x8270
movq %r15, %rdi
movq %rax, %r12
callq 0x82a0
testq %rax, %rax
setne %bpl
je 0xa49c
movq %rax, %rdi
movq %rax, %r15
callq 0x8270
movq %rax, %r13
leal (%r12,%rax), %ecx
movl 0x10(%rbx), %eax
movl 0xc(%rbx), %esi
leal 0x4(%rax,%rcx), %ecx
cmpl %esi, %ecx
jb 0xa430
leal 0x4(%r12,%r13), %eax
movq %r13, (%rsp)
movl 0x8(%rbx), %r13d
movq (%rbx), %rdi
cmpl %r13d, %eax
cmoval %eax, %r13d
addl %r13d, %esi
callq 0x8540
movq %rax, (%rbx)
xorl %esi, %esi
movq %r13, %rdx
movl 0xc(%rbx), %edi
addq %rax, %rdi
callq 0x8420
addl %r13d, 0xc(%rbx)
movq (%rsp), %r13
movl 0x10(%rbx), %eax
cmpb $0x1, 0x14(%rbx)
jne 0xa454
movq (%rbx), %rcx
movl %eax, %eax
movb $0x2c, (%rcx,%rax)
movl 0x10(%rbx), %ecx
movq (%rbx), %rax
incl %ecx
movb $0x20, (%rax,%rcx)
movl 0x10(%rbx), %eax
addl $0x2, %eax
movl %eax, 0x10(%rbx)
movl %eax, %edi
movq %r14, %rsi
addq (%rbx), %rdi
callq 0x8190
addl 0x10(%rbx), %r12d
movq %r15, %rsi
movl %r12d, 0x10(%rbx)
movq (%rbx), %rax
movw $0x3a, (%rax,%r12)
movl 0x10(%rbx), %edi
incl %edi
movl %edi, 0x10(%rbx)
addq (%rbx), %rdi
callq 0x8190
addl %r13d, 0x10(%rbx)
movq %r14, %rdi
movb $0x1, 0x14(%rbx)
callq 0x8a00
jmp 0xa49f
xorl %ebp, %ebp
jmp 0xa4a7
movq %r14, %r15
movq %r15, %rdi
callq 0x8a00
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_module.c
// Function: as_module_configure
int as_module_configure(as_module * m, void * config) {
    as_module_event e = {
        .type = AS_MODULE_EVENT_CONFIGURE,
        .data.config = config
    };
    return as_module_update(m, &e);
}

// Assembly:
subq $0x18, %rsp
movq %rsp, %rax
andl $0x0, (%rax)
movq %rsi, 0x8(%rax)
andq $0x0, 0x10(%rax)
movq %rax, %rsi
callq 0x8100
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: pack_byte
static inline int
pack_byte(as_packer *pk, uint8_t val, bool resize)
{
	if (pk->buffer) {
		if (pk->offset + 1 > pk->capacity) {
			if (! resize || pack_resize(pk, 1) != 0) {
				return -1;
			}
		}
		*(pk->buffer + pk->offset) = val;
	}
	return advance_offset(pk, 1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq 0x10(%rdi), %rax
movq %rdi, %r14
testq %rax, %rax
pushq $-0x1
popq %rbx
je 0xac11
movl 0x18(%r14), %ecx
movl %esi, %ebp
leal 0x1(%rcx), %esi
cmpl 0x1c(%r14), %esi
jbe 0xac0b
testb %dl, %dl
je 0xac24
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0xc3d0
testl %eax, %eax
jne 0xac24
movq 0x10(%r14), %rax
movl 0x18(%r14), %ecx
movl %ecx, %ecx
movb %bpl, (%rax,%rcx)
movl 0x18(%r14), %eax
cmpl $0x7ffffffe, %eax       # imm = 0x7FFFFFFE
ja 0xac24
incl %eax
xorl %ebx, %ebx
movl %eax, 0x18(%r14)
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: unpack_blob
static int
unpack_blob(as_unpacker *pk, uint32_t size, as_val **val)
{
	unsigned char type = 0;

	if (size != 0) {
		type = pk->buffer[pk->offset++];
		size--;
	}

	if (type == AS_BYTES_STRING) {
		char *v = cf_strndup((const char *)pk->buffer + pk->offset, size);
		*val = (as_val*)as_string_new(v, true);
	}
	else if (type == AS_BYTES_GEOJSON) {
		char *v = cf_strndup((const char *)pk->buffer + pk->offset, size);
		*val = (as_val *)as_geojson_new(v, true);
	}
	else {
		as_bytes *b;

		if (size != 0) {
			unsigned char *buf = cf_malloc(size);

			if (! buf) {
				return -1;
			}

			memcpy(buf, pk->buffer + pk->offset, size);
			b = as_bytes_new_wrap(buf, size, true);

			if (! b) {
				cf_free(buf);
				return -2;
			}
		}
		else {
			b = as_bytes_new_wrap(NULL, 0, false);
		}

		if (! b) {
			return -3;
		}

		b->type = (as_bytes_type) type;
		*val = (as_val *)b;
	}

	if (! *val) {
		return -4;
	}

	pk->offset += size;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
testl %esi, %esi
movl $0x0, %r13d
je 0xafcf
movl 0x8(%rbx), %ecx
movq (%rbx), %rdi
movl %esi, %ebp
decl %ebp
leal 0x1(%rcx), %eax
movl %eax, 0x8(%rbx)
movzbl (%rdi,%rcx), %r13d
cmpl $0x17, %r13d
je 0xaf66
cmpl $0x3, %r13d
jne 0xaf89
movl %eax, %eax
movl %ebp, %esi
addq %rax, %rdi
callq 0x8450
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x8060
jmp 0xaf7d
movl %eax, %eax
movl %ebp, %esi
addq %rax, %rdi
callq 0x8450
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x8390
testq %rax, %rax
movq %rax, (%r14)
jne 0xafe8
pushq $-0x4
jmp 0xaff5
testl %ebp, %ebp
je 0xafcf
movl %ebp, %r12d
movq %r12, %rdi
callq 0x8080
testq %rax, %rax
je 0xaff3
movl 0x8(%rbx), %esi
movq %rax, %rdi
movq %r12, %rdx
movq %rax, %r15
addq (%rbx), %rsi
callq 0x8630
pushq $0x1
popq %rdx
movq %r15, %rdi
movl %ebp, %esi
callq 0x8070
testq %rax, %rax
jne 0xafe1
movq %r15, %rdi
callq 0x8a00
pushq $-0x2
jmp 0xaff5
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x8070
testq %rax, %rax
je 0xafef
xorl %ebp, %ebp
movl %r13d, 0x1c(%rax)
movq %rax, (%r14)
addl %ebp, 0x8(%rbx)
xorl %eax, %eax
jmp 0xaff6
pushq $-0x3
jmp 0xaff5
pushq $-0x1
popq %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: unpack_list
static int
unpack_list(as_unpacker *pk, uint32_t size, as_val **val)
{
	uint8_t flags = 0;

	// Skip ext element key which is only at the start for metadata.
	if (size != 0 && as_unpack_peek_is_ext(pk)) {
		as_msgpack_ext ext;

		if (as_unpack_ext(pk, &ext) != 0) {
			return -1;
		}

		flags = ext.type;
		size--;
	}

	as_arraylist *list = as_arraylist_new(size, 8);

	if (! list) {
		return -2;
	}

	for (uint32_t i = 0; i < size; i++) {
		as_val *v = NULL;

		if (as_unpack_val(pk, &v) != 0 || ! v) {
			as_arraylist_destroy(list);
			return -3;
		}

		as_arraylist_set(list, i, v);
	}

	*val = (as_val *)list;
	list->_.flags = flags;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r12
movq %rdi, %r14
testl %esi, %esi
je 0xb044
movq %r14, %rdi
movl %esi, %ebp
callq 0x8840
testb %al, %al
je 0xb046
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x8af0
testl %eax, %eax
je 0xb0cb
pushq $-0x1
jmp 0xb0bb
xorl %ebp, %ebp
xorl %ebx, %ebx
pushq $0x8
popq %rsi
movl %ebp, %edi
callq 0x8560
testq %rax, %rax
je 0xb09d
movl %ebx, 0xc(%rsp)
movq %r12, %rbx
movq %rax, %r15
xorl %r12d, %r12d
leaq 0x10(%rsp), %r13
cmpl %r12d, %ebp
je 0xb0a1
andq $0x0, 0x10(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x86d0
testl %eax, %eax
jne 0xb0b1
movq 0x10(%rsp), %rdx
testq %rdx, %rdx
je 0xb0b1
movq %r15, %rdi
movl %r12d, %esi
callq 0x8bf0
incl %r12d
jmp 0xb069
pushq $-0x2
jmp 0xb0bb
movzbl 0xc(%rsp), %eax
movq %r15, (%rbx)
movl %eax, 0x8(%r15)
xorl %eax, %eax
jmp 0xb0bc
movq %r15, %rdi
callq 0x8830
pushq $-0x3
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb 0x20(%rsp), %bl
decl %ebp
jmp 0xb048
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: pack_uint64
static inline int
pack_uint64(as_packer *pk, uint64_t val, bool resize)
{
	if (val < (1ULL << 7)) {
		return pack_byte(pk, (uint8_t)val, resize);
	}

	if (val < (1ULL << 8)) {
		return pack_type_uint8(pk, 0xcc, (uint8_t)val, resize);
	}

	if (val < (1ULL << 16)) {
		return pack_type_uint16(pk, 0xcd, (uint16_t)val, resize);
	}

	if (val < (1ULL << 32)) {
		return pack_type_uint32(pk, 0xce, (uint32_t)val, resize);
	}

	return pack_type_uint64(pk, 0xcf, val, resize);
}

// Assembly:
movq %rsi, %rax
cmpq $0x7f, %rsi
ja 0xb3aa
movzbl %dl, %edx
movzbl %al, %esi
jmp 0xabce
cmpq $0xff, %rax
ja 0xb3c2
movzbl %dl, %ecx
movzbl %al, %edx
movl $0xcc, %esi
jmp 0xb780
cmpq $0xffff, %rax           # imm = 0xFFFF
ja 0xb3da
movzbl %dl, %ecx
movzwl %ax, %edx
movl $0xcd, %esi
jmp 0xb7ef
movq %rax, %rcx
shrq $0x20, %rcx
jne 0xb3f2
movzbl %dl, %ecx
movl $0xce, %esi
movl %eax, %edx
jmp 0xb47d
movzbl %dl, %ecx
movl $0xcf, %esi
movq %rax, %rdx
jmp 0xc49c
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: pack_int64
static inline int
pack_int64(as_packer *pk, int64_t val, bool resize)
{
	if (val >= 0) {
		return pack_uint64(pk, (uint64_t)val, resize);
	}

	if (val >= -(1LL << 5)) {
		return pack_byte(pk, (uint8_t)(0xe0 | (val + 32)), resize);
	}

	if (val >= -(1LL << 7)) {
		return pack_type_uint8(pk, 0xd0, (uint8_t)val, resize);
	}

	if (val >= -(1LL << 15)) {
		return pack_type_uint16(pk, 0xd1, (uint16_t)val, resize);
	}

	if (val >= -(1LL << 31)) {
		return pack_type_uint32(pk, 0xd2, (uint32_t)val, resize);
	}

	return pack_type_uint64(pk, 0xd3, (uint64_t)val, resize);
}

// Assembly:
movq %rsi, %rax
testq %rsi, %rsi
js 0xb416
movzbl %dl, %edx
movq %rax, %rsi
jmp 0xb396
cmpq $-0x20, %rax
jb 0xb427
movzbl %dl, %edx
movzbl %al, %esi
jmp 0xabce
movzbl %dl, %ecx
cmpq $-0x80, %rax
jb 0xb43d
movzbl %al, %edx
movl $0xd0, %esi
jmp 0xb780
cmpq $-0x8000, %rax          # imm = 0x8000
jb 0xb452
movzwl %ax, %edx
movl $0xd1, %esi
jmp 0xb7ef
cmpq $-0x80000000, %rax      # imm = 0x80000000
jb 0xb463
movl $0xd2, %esi
movl %eax, %edx
jmp 0xb47d
movl $0xd3, %esi
movq %rax, %rdx
jmp 0xc49c
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: pack_type_uint32
static inline int
pack_type_uint32(as_packer *pk, unsigned char type, uint32_t val, bool resize)
{
	if (pk->buffer) {
		if (pk->offset + 5 > pk->capacity) {
			if (! resize || pack_resize(pk, 5) != 0) {
				return -1;
			}
		}
		uint32_t swapped = cf_swap_to_be32(val);
		unsigned char *p = pk->buffer + pk->offset;
		*p++ = type;
		memcpy(p, &swapped, 4);
	}
	return advance_offset(pk, 5);
}

// 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 0xb4cc
movl %edx, %ebp
movl 0x18(%r14), %edx
movl %esi, %r15d
leal 0x5(%rdx), %esi
cmpl 0x1c(%r14), %esi
jbe 0xb4c0
testb %cl, %cl
je 0xb4e0
pushq $0x5
popq %rsi
movq %r14, %rdi
callq 0xc3d0
testl %eax, %eax
jne 0xb4e0
movq 0x10(%r14), %rax
movl 0x18(%r14), %edx
movl %edx, %ecx
bswapl %ebp
movb %r15b, (%rax,%rcx)
movl %ebp, 0x1(%rax,%rcx)
movl 0x18(%r14), %eax
cmpl $0x7ffffffa, %eax       # imm = 0x7FFFFFFA
ja 0xb4e0
addl $0x5, %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: as_pack_bytes
int
as_pack_bytes(as_packer *pk, const uint8_t *buf, uint32_t sz)
{
	int rc = pack_byte_array_header(pk, sz + 1);

	if (rc == 0) {
		rc = pack_byte(pk, AS_BYTES_BLOB, true);
	}

	if (rc == 0) {
		rc = pack_append(pk, buf, sz, false);
	}
	return rc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leal 0x1(%rbx), %esi
callq 0xb547
testl %eax, %eax
jne 0xb52d
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0xabce
testl %eax, %eax
je 0xb536
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
popq %rbx
popq %r14
popq %r15
jmp 0xb54f
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: pack_append
static inline int
pack_append(as_packer *pk, const unsigned char *src, uint32_t sz, bool resize)
{
	if (pk->buffer) {
		if (pk->offset + sz > pk->capacity) {
			if (! resize || pack_resize(pk, sz) != 0) {
				return -1;
			}
		}
		memcpy(pk->buffer + pk->offset, src, (size_t)sz);
	}
	return advance_offset(pk, sz);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x10(%rdi), %rax
movl %edx, %r12d
movq %rdi, %r14
testq %rax, %rax
pushq $-0x1
popq %rbx
je 0xb5aa
movl 0x18(%r14), %edx
movq %rsi, %r15
leal (%rdx,%r12), %esi
cmpl 0x1c(%r14), %esi
jbe 0xb595
testb %cl, %cl
je 0xb5c2
movq %r14, %rdi
movl %r12d, %esi
callq 0xc3d0
testl %eax, %eax
jne 0xb5c2
movq 0x10(%r14), %rax
movl 0x18(%r14), %edx
movl %edx, %edi
movl %r12d, %r12d
movq %r15, %rsi
addq %rax, %rdi
movq %r12, %rdx
callq 0x8630
jmp 0xb5ad
movl %r12d, %r12d
movl 0x18(%r14), %eax
addq %r12, %rax
cmpq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
ja 0xb5c2
xorl %ebx, %ebx
movl %eax, 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_msgpack.c
// Function: pack_string_header
static int
pack_string_header(as_packer *pk, uint32_t size, bool resize)
{
	if (size < 32) {
		return pack_byte(pk, (uint8_t)(0xa0 | size), resize);
	}

	if (size < 256) {
		return pack_type_uint8(pk, 0xd9, (uint8_t)size, resize);
	}

	if (size < 65536) {
		return pack_type_uint16(pk, 0xda, (uint16_t)size, resize);
	}

	return pack_type_uint32(pk, 0xdb, size, resize);
}

// Assembly:
movl %esi, %eax
cmpl $0x1f, %esi
ja 0xb667
orb $-0x60, %al
movzbl %dl, %edx
movzbl %al, %esi
jmp 0xabce
movzbl %dl, %ecx
cmpl $0xff, %eax
ja 0xb67e
movzbl %al, %edx
movl $0xd9, %esi
jmp 0xb780
cmpl $0xffff, %eax           # imm = 0xFFFF
ja 0xb692
movzwl %ax, %edx
movl $0xda, %esi
jmp 0xb7ef
movl $0xdb, %esi
movl %eax, %edx
jmp 0xb47d
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: as_pack_str_with_type
int
as_pack_str_with_type(as_packer *pk, uint8_t type, const uint8_t *buf,
		uint32_t sz)
{
	int rc = pack_string_header(pk, sz + 1, false);

	if (rc == 0 && buf) {
		if ((rc = pack_byte(pk, type, false)) == 0) {
			return pack_append(pk, buf, sz, false);
		}
	}

	return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r14
movl %esi, %ebp
xorl %edx, %edx
movq %rdi, %r15
leal 0x1(%rbx), %esi
callq 0xb653
testl %eax, %eax
setne %cl
testq %r14, %r14
sete %dl
orb %cl, %dl
jne 0xb6dd
movzbl %bpl, %esi
movq %r15, %rdi
xorl %edx, %edx
callq 0xabce
testl %eax, %eax
je 0xb6e8
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xb54f
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: as_pack_bin
int
as_pack_bin(as_packer *pk, const uint8_t *buf, uint32_t sz)
{
	int rc;

	if (sz < (1 << 8)) {
		rc = pack_type_uint8(pk, 0xc4, (uint8_t)sz, false);
	}
	else if (sz < (1 << 16)) {
		rc = pack_type_uint16(pk, 0xc5, (uint16_t)sz, false);
	}
	else {
		rc = pack_type_uint32(pk, 0xc6, sz, false);
	}

	if (rc == 0 && buf) {
		return pack_append(pk, buf, sz, false);
	}

	return rc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
cmpl $0xff, %edx
ja 0xb72a
movzbl %bl, %edx
movq %r15, %rdi
movl $0xc4, %esi
xorl %ecx, %ecx
callq 0xb780
jmp 0xb757
cmpl $0xffff, %ebx           # imm = 0xFFFF
ja 0xb746
movzwl %bx, %edx
movq %r15, %rdi
movl $0xc5, %esi
xorl %ecx, %ecx
callq 0xb7ef
jmp 0xb757
movq %r15, %rdi
movl $0xc6, %esi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0xb47d
testl %eax, %eax
setne %cl
testq %r14, %r14
sete %dl
orb %cl, %dl
jne 0xb77a
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
popq %rbx
popq %r14
popq %r15
jmp 0xb54f
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: pack_type_uint8
static inline int
pack_type_uint8(as_packer *pk, unsigned char type, uint8_t val, bool resize)
{
	if (pk->buffer) {
		if (pk->offset + 2 > pk->capacity) {
			if (! resize || pack_resize(pk, 2) != 0) {
				return -1;
			}
		}
		unsigned char *p = pk->buffer + pk->offset;
		*p++ = type;
		*p = val;
	}
	return advance_offset(pk, 2);
}

// 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 0xb7ce
movl %edx, %ebp
movl 0x18(%r14), %edx
movl %esi, %r15d
leal 0x2(%rdx), %esi
cmpl 0x1c(%r14), %esi
jbe 0xb7c3
testb %cl, %cl
je 0xb7e2
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0xc3d0
testl %eax, %eax
jne 0xb7e2
movq 0x10(%r14), %rax
movl 0x18(%r14), %edx
movl %edx, %ecx
movb %r15b, (%rax,%rcx)
movb %bpl, 0x1(%rax,%rcx)
movl 0x18(%r14), %eax
cmpl $0x7ffffffd, %eax       # imm = 0x7FFFFFFD
ja 0xb7e2
addl $0x2, %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: pack_type_uint16
static inline int
pack_type_uint16(as_packer *pk, unsigned char type, uint16_t val, bool resize)
{
	if (pk->buffer) {
		if (pk->offset + 3 > pk->capacity) {
			if (! resize || pack_resize(pk, 3) != 0) {
				return -1;
			}
		}
		uint16_t swapped = cf_swap_to_be16(val);
		unsigned char *s = (unsigned char *)&swapped;
		unsigned char *p = pk->buffer + pk->offset;
		*p++ = type;
		*p++ = *s++;
		*p = *s;
	}
	return advance_offset(pk, 3);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x10(%rdi), %rax
movq %rdi, %r14
testq %rax, %rax
pushq $-0x1
popq %rbp
je 0xb844
movl %edx, %ebx
movl 0x18(%r14), %edx
movl %esi, %r15d
leal 0x3(%rdx), %esi
cmpl 0x1c(%r14), %esi
jbe 0xb832
testb %cl, %cl
je 0xb858
pushq $0x3
popq %rsi
movq %r14, %rdi
callq 0xc3d0
testl %eax, %eax
jne 0xb858
movq 0x10(%r14), %rax
movl 0x18(%r14), %edx
movl %edx, %ecx
rolw $0x8, %bx
movb %r15b, (%rax,%rcx)
movb %bl, 0x1(%rax,%rcx)
movb %bh, 0x2(%rax,%rcx)
movl 0x18(%r14), %eax
cmpl $0x7ffffffc, %eax       # imm = 0x7FFFFFFC
ja 0xb858
addl $0x3, %eax
xorl %ebp, %ebp
movl %eax, 0x18(%r14)
movl %ebp, %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: as_pack_list_header
int
as_pack_list_header(as_packer *pk, uint32_t ele_count)
{
	int rc;

	if (ele_count < 16) {
		rc = pack_byte(pk, (uint8_t)(0x90 | ele_count), false);
	}
	else if (ele_count < (1 << 16)) {
		rc = pack_type_uint16(pk, 0xdc, (uint16_t)ele_count, false);
	}
	else {
		rc = pack_type_uint32(pk, 0xdd, ele_count, false);
	}

	return rc;
}

// Assembly:
movl %esi, %edx
cmpl $0xf, %esi
ja 0xb879
orb $-0x70, %dl
movzbl %dl, %esi
xorl %edx, %edx
jmp 0xabce
cmpl $0xffff, %edx           # imm = 0xFFFF
ja 0xb890
movzwl %dx, %edx
movl $0xdc, %esi
xorl %ecx, %ecx
jmp 0xb7ef
movl $0xdd, %esi
xorl %ecx, %ecx
jmp 0xb47d
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: pack_map_header_internal
static inline int
pack_map_header_internal(as_packer *pk, uint32_t ele_count, bool resize)
{
	int rc;

	if (ele_count < 16) {
		rc = pack_byte(pk, (uint8_t)(0x80 | ele_count), resize);
	}
	else if (ele_count < (1 << 16)) {
		rc = pack_type_uint16(pk, 0xde, (uint16_t)ele_count, resize);
	}
	else {
		rc = pack_type_uint32(pk, 0xdf, ele_count, resize);
	}

	return rc;
}

// Assembly:
movl %esi, %eax
cmpl $0xf, %esi
ja 0xb8cd
orb $-0x80, %al
movzbl %dl, %edx
movzbl %al, %esi
jmp 0xabce
movzbl %dl, %ecx
cmpl $0xffff, %eax           # imm = 0xFFFF
ja 0xb8e4
movzwl %ax, %edx
movl $0xde, %esi
jmp 0xb7ef
movl $0xdf, %esi
movl %eax, %edx
jmp 0xb47d
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: pack_ext_header_internal
static inline int
pack_ext_header_internal(as_packer *pk, uint32_t content_size, uint8_t type,
		bool resize)
{
	int rc;

	if (content_size == 1) {
		rc = pack_byte(pk, 0xd4, resize);
	}
	else if (content_size == 2) {
		rc = pack_byte(pk, 0xd5, resize);
	}
	else if (content_size == 4) {
		rc = pack_byte(pk, 0xd6, resize);
	}
	else if (content_size == 8) {
		rc = pack_byte(pk, 0xd7, resize);
	}
	else if (content_size == 16) {
		rc = pack_byte(pk, 0xd8, resize);
	}
	else if (content_size < (1 << 8)) {
		rc = pack_type_uint8(pk, 0xc7, (uint8_t)content_size, resize);
	}
	else if (content_size < (1 << 16)) {
		rc = pack_type_uint16(pk, 0xc8, (uint16_t)content_size, resize);
	}
	else {
		rc = pack_type_uint32(pk, 0xc9, content_size, resize);
	}

	if (rc != 0) {
		return rc;
	}

	return pack_byte(pk, type, resize);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %edx
movq %rdi, %r14
movzbl %cl, %ebp
leal -0x1(%rdx), %eax
cmpl $0x7, %eax
ja 0xb953
leaq 0x984c(%rip), %rcx      # 0x1518c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
movl $0xd4, %esi
jmp 0xb99a
cmpl $0x10, %edx
jne 0xb962
movq %r14, %rdi
movl $0xd8, %esi
jmp 0xb99a
cmpl $0xff, %edx
ja 0xb9be
movzbl %dl, %edx
movq %r14, %rdi
movl $0xc7, %esi
movl %ebp, %ecx
callq 0xb780
jmp 0xb9a1
movq %r14, %rdi
movl $0xd6, %esi
jmp 0xb99a
movq %r14, %rdi
movl $0xd7, %esi
jmp 0xb99a
movq %r14, %rdi
movl $0xd5, %esi
movl %ebp, %edx
callq 0xabce
testl %eax, %eax
je 0xb9ad
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
movzbl %bl, %esi
movq %r14, %rdi
movl %ebp, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0xabce
cmpl $0xffff, %edx           # imm = 0xFFFF
ja 0xb9da
movzwl %dx, %edx
movq %r14, %rdi
movl $0xc8, %esi
movl %ebp, %ecx
callq 0xb7ef
jmp 0xb9a1
movq %r14, %rdi
movl $0xc9, %esi
movl %ebp, %ecx
callq 0xb47d
jmp 0xb9a1
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: as_unpack_blob_size
int64_t
as_unpack_blob_size(as_unpacker *pk)
{
	if (pk->offset >= pk->length) {
		return -1;
	}

	uint8_t type = pk->buffer[pk->offset++];
	uint32_t size = pk->length - pk->offset;

	switch (type) {
	case 0xc4:
	case 0xd9: // string/raw bytes with 8 bit header
		if (size < 1) {
			return -2;
		}
		return (int64_t)pk->buffer[pk->offset++];

	case 0xc5:
	case 0xda: // string/raw bytes with 16 bit header
		if (size < 2) {
			return -3;
		}
		return (int64_t)extract_uint16(pk);

	case 0xc6:
	case 0xdb: // string/raw bytes with 32 bit header
		if (size < 4) {
			return -4;
		}
		return (int64_t)extract_uint32(pk);

	default:
		if ((type & 0xe0) == 0xa0) { // raw bytes with 8 bit combined header
			return type & 0x1f;
		}
		break;
	}

	return -5;
}

// Assembly:
movl 0x8(%rdi), %ecx
movl 0xc(%rdi), %esi
cmpl %esi, %ecx
jae 0xbdbe
movq (%rdi), %rdx
leaq 0x1(%rcx), %r8
movl %r8d, 0x8(%rdi)
movzbl (%rdx,%rcx), %eax
leal -0xc4(%rax), %r9d
cmpl $0x17, %r9d
ja 0xbde7
movl $0x200001, %r10d        # imm = 0x200001
btl %r9d, %r10d
jb 0xbdcb
movl $0x400002, %r10d        # imm = 0x400002
subl %r8d, %esi
btl %r9d, %r10d
jb 0xbdc2
movl $0x800004, %r8d         # imm = 0x800004
btl %r9d, %r8d
jae 0xbde7
cmpl $0x4, %esi
jae 0xbdf8
pushq $-0x4
jmp 0xbdc0
pushq $-0x1
popq %rax
retq
cmpl $0x2, %esi
jae 0xbdd4
pushq $-0x3
jmp 0xbdc0
cmpl %r8d, %esi
jne 0xbe05
pushq $-0x2
jmp 0xbdc0
movzwl 0x1(%rdx,%rcx), %eax
addl $0x3, %ecx
movl %ecx, 0x8(%rdi)
rolw $0x8, %ax
movzwl %ax, %eax
retq
movl %eax, %ecx
andl $-0x20, %ecx
cmpl $0xa0, %ecx
jne 0xbe11
andl $0x1f, %eax
retq
movl 0x1(%rdx,%rcx), %eax
addl $0x5, %ecx
movl %ecx, 0x8(%rdi)
bswapl %eax
retq
leal 0x2(%rcx), %eax
movl %eax, 0x8(%rdi)
movzbl (%rdx,%r8), %eax
retq
pushq $-0x5
jmp 0xbdc0
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: as_unpack_double
int
as_unpack_double(as_unpacker *pk, double *x)
{
	if (pk->offset >= pk->length) {
		return -1;
	}

	uint8_t type = pk->buffer[pk->offset++];
	uint32_t size = pk->length - pk->offset;

	switch (type) {
	case 0xca: // float
		if (size < 4) {
			return -2;
		}
		*x = (double)extract_float(pk);
		break;
	case 0xcb: // double
		if (size < 8) {
			return -3;
		}
		*x = extract_double(pk);
		break;
	default:
		return -4;
	}

	return 0;
}

// Assembly:
movl 0x8(%rdi), %eax
movl 0xc(%rdi), %edx
cmpl %edx, %eax
jae 0xbfa2
movq (%rdi), %rcx
leaq 0x1(%rax), %r8
movl %r8d, 0x8(%rdi)
subl %r8d, %edx
movzbl (%rcx,%rax), %r9d
cmpl $0xcb, %r9d
je 0xbfa6
cmpl $0xca, %r9d
jne 0xbfaf
cmpl $0x4, %edx
jae 0xbfb3
pushq $-0x2
jmp 0xbfb1
pushq $-0x1
jmp 0xbfb1
cmpl $0x8, %edx
jae 0xbfc9
pushq $-0x3
jmp 0xbfb1
pushq $-0x4
popq %rax
retq
movl (%rcx,%r8), %ecx
addl $0x5, %eax
movl %eax, 0x8(%rdi)
bswapl %ecx
movd %ecx, %xmm0
cvtss2sd %xmm0, %xmm0
jmp 0xbfdc
movq 0x1(%rcx,%rax), %rcx
addl $0x9, %eax
movl %eax, 0x8(%rdi)
bswapq %rcx
movq %rcx, %xmm0
xorl %eax, %eax
movq %xmm0, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: unpack_str_bin
static inline const uint8_t *
unpack_str_bin(as_unpacker *pk, uint32_t *sz_r)
{
	if (pk->offset >= pk->length) {
		return NULL;
	}

	uint8_t type = pk->buffer[pk->offset++];
	uint32_t size = pk->length - pk->offset;

	switch (type) {
	case 0xd9:
	case 0xc4: // str/bin with 8 bit header
		if (size < 1) {
			return NULL;
		}
		*sz_r = (uint32_t)pk->buffer[pk->offset++];
		break;
	case 0xc5:
	case 0xda: // str/bin with 16 bit header
		if (size < 2) {
			return NULL;
		}
		*sz_r = (uint32_t)extract_uint16(pk);
		break;
	case 0xc6:
	case 0xdb: // str/bin with 32 bit header
		if (size < 4) {
			return NULL;
		}
		*sz_r = extract_uint32(pk);
		break;
	default:
		if ((type & 0xe0) == 0xa0) { // str bytes with 8 bit combined header
			*sz_r = (uint32_t)(type & 0x1f);
			break;
		}

		return NULL;
	}

	const uint8_t *buf = &pk->buffer[pk->offset];

	pk->offset += *sz_r;

	if (pk->offset > pk->length) {
		return NULL;
	}

	return buf;
}

// Assembly:
movl 0x8(%rdi), %eax
movl 0xc(%rdi), %r8d
cmpl %r8d, %eax
jae 0xc09e
movq (%rdi), %rdx
leaq 0x1(%rax), %r9
movl %r9d, 0x8(%rdi)
movzbl (%rdx,%rax), %ecx
leal -0xc4(%rcx), %r10d
cmpl $0x17, %r10d
ja 0xc078
movl $0x200001, %r11d        # imm = 0x200001
btl %r10d, %r11d
jb 0xc066
movl $0x400002, %r11d        # imm = 0x400002
subl %r9d, %r8d
btl %r10d, %r11d
jb 0xc04c
movl $0x800004, %r9d         # imm = 0x800004
btl %r10d, %r9d
jae 0xc078
cmpl $0x4, %r8d
jb 0xc09e
movl 0x1(%rdx,%rax), %ecx
addl $0x5, %eax
movl %eax, 0x8(%rdi)
bswapl %ecx
jmp 0xc087
cmpl $0x2, %r8d
jb 0xc09e
movzwl 0x1(%rdx,%rax), %ecx
addl $0x3, %eax
movl %eax, 0x8(%rdi)
rolw $0x8, %cx
movzwl %cx, %ecx
jmp 0xc087
cmpl %r9d, %r8d
je 0xc09e
addl $0x2, %eax
movl %eax, 0x8(%rdi)
movzbl (%rdx,%r9), %ecx
jmp 0xc087
movl %ecx, %eax
andl $-0x20, %eax
cmpl $0xa0, %eax
jne 0xc09e
andl $0x1f, %ecx
movl %ecx, (%rsi)
xorl %eax, %eax
movl 0x8(%rdi), %edx
addl %edx, %ecx
movl %ecx, 0x8(%rdi)
addq (%rdi), %rdx
cmpl 0xc(%rdi), %ecx
cmovbeq %rdx, %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: as_unpack_ext
int
as_unpack_ext(as_unpacker *pk, as_msgpack_ext *ext)
{
	// Need at least 3 bytes.
	if (pk->length - pk->offset < 3) {
		return -1;
	}

	uint8_t type = pk->buffer[pk->offset++];

	switch (type) {
	case 0xd4: // fixext 1
		ext->size = 1;
		break;
	case 0xd5: // fixext 2
		ext->size = 2;
		break;
	case 0xd6: // fixext 4
		ext->size = 4;
		break;
	case 0xd7: // fixext 8
		ext->size = 8;
		break;
	case 0xd8: // fixext 16
		ext->size = 16;
		break;
	case 0xc7: // ext 8
		ext->size = (uint32_t)pk->buffer[pk->offset++];
		break;
	case 0xc8: // ext 16
		ext->size = extract_uint16(pk);
		break;
	case 0xc9: // ext 32
		// Need at least 4 more bytes.
		if (pk->length - pk->offset < 4) {
			return -2;
		}
		ext->size = extract_uint32(pk);
		break;
	default:
		return -3;
	}

	if (pk->length - pk->offset < 1 + ext->size) {
		return -4;
	}

	ext->type_offset = pk->offset;
	ext->type = pk->buffer[pk->offset++];
	ext->data = pk->buffer + pk->offset;
	pk->offset += ext->size;

	return 0;
}

// Assembly:
movl 0xc(%rdi), %r9d
movl 0x8(%rdi), %ecx
movl %r9d, %eax
subl %ecx, %eax
cmpl $0x3, %eax
jae 0xc0be
pushq $-0x1
jmp 0xc14b
movq (%rdi), %rdx
leal 0x1(%rcx), %r8d
movl %r8d, 0x8(%rdi)
movzbl (%rdx,%rcx), %r10d
pushq $-0x3
popq %rax
addl $0xffffff39, %r10d      # imm = 0xFFFFFF39
cmpl $0x11, %r10d
ja 0xc173
leaq 0x91e3(%rip), %r11      # 0x152cc
movslq (%r11,%r10,4), %r10
addq %r11, %r10
jmpq *%r10
addl $0x2, %ecx
movl %r8d, %eax
movl %ecx, 0x8(%rdi)
movzbl (%rdx,%rax), %eax
jmp 0xc138
pushq $0x4
jmp 0xc137
movl %r8d, %eax
addl $0x3, %ecx
movzwl (%rdx,%rax), %eax
movl %ecx, 0x8(%rdi)
rolw $0x8, %ax
movzwl %ax, %eax
jmp 0xc138
pushq $0x8
jmp 0xc137
pushq $0x10
jmp 0xc137
subl %r8d, %r9d
cmpl $0x4, %r9d
jae 0xc174
pushq $-0x2
jmp 0xc14b
pushq $0x1
jmp 0xc137
pushq $0x2
popq %rax
movl %eax, 0x8(%rsi)
incl %eax
movl 0x8(%rdi), %ecx
movl 0xc(%rdi), %edx
subl %ecx, %edx
cmpl %eax, %edx
jae 0xc14d
pushq $-0x4
popq %rax
retq
movl %ecx, 0xc(%rsi)
movl 0x8(%rdi), %ecx
movq (%rdi), %rax
leal 0x1(%rcx), %edx
movl %edx, 0x8(%rdi)
movb (%rax,%rcx), %al
movb %al, 0x10(%rsi)
movl 0x8(%rdi), %eax
addq (%rdi), %rax
movq %rax, (%rsi)
movl 0x8(%rsi), %eax
addl %eax, 0x8(%rdi)
xorl %eax, %eax
retq
movl %r8d, %eax
addl $0x5, %ecx
movl (%rdx,%rax), %eax
movl %ecx, 0x8(%rdi)
bswapl %eax
jmp 0xc138
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: as_unpack_list_header_element_count
int64_t
as_unpack_list_header_element_count(as_unpacker *pk)
{
	if (pk->offset >= pk->length) {
		return -1;
	}

	uint8_t type = pk->buffer[pk->offset++];
	uint32_t size = pk->length - pk->offset;

	switch (type) {
	case 0xdc: // list with 16 bit header
		if (size < 2) {
			return -2;
		}
		return extract_uint16(pk);
	case 0xdd: // list with 32 bit header
		if (size < 4) {
			return -3;
		}
		return (int64_t)extract_uint32(pk);
	default:
		break;
	}

	if ((type & 0xf0) == 0x90) { // list with 8 bit combined header
		return (int64_t)(type & 0x0f);
	}

	return -4;
}

// Assembly:
movl 0x8(%rdi), %ecx
movl 0xc(%rdi), %esi
cmpl %esi, %ecx
jae 0xc1d7
movq (%rdi), %rdx
leaq 0x1(%rcx), %r8
movl %r8d, 0x8(%rdi)
subl %r8d, %esi
movzbl (%rdx,%rcx), %eax
cmpl $0xdd, %eax
je 0xc1db
cmpl $0xdc, %eax
jne 0xc1e4
cmpl $0x2, %esi
jae 0xc1f5
pushq $-0x2
jmp 0xc1d9
pushq $-0x1
popq %rax
retq
cmpl $0x4, %esi
jae 0xc208
pushq $-0x3
jmp 0xc1d9
movl %eax, %ecx
andl $-0x10, %ecx
cmpl $0x90, %ecx
jne 0xc215
andl $0xf, %eax
retq
movzwl (%rdx,%r8), %eax
addl $0x3, %ecx
movl %ecx, 0x8(%rdi)
rolw $0x8, %ax
movzwl %ax, %eax
retq
movl 0x1(%rdx,%rcx), %eax
addl $0x5, %ecx
movl %ecx, 0x8(%rdi)
bswapl %eax
retq
pushq $-0x4
jmp 0xc1d9
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: as_unpack_map_header_element_count
int64_t
as_unpack_map_header_element_count(as_unpacker *pk)
{
	if (pk->offset >= pk->length) {
		return -1;
	}

	uint8_t type = pk->buffer[pk->offset++];
	uint32_t size = pk->length - pk->offset;

	switch (type) {
	case 0xde: // map with 16 bit header
		if (size < 2) {
			return -2;
		}
		return extract_uint16(pk);
	case 0xdf: // map with 32 bit header
		if (size < 4) {
			return -3;
		}
		return extract_uint32(pk);
	default:
		break;
	}

	if ((type & 0xf0) == 0x80) { // map with 8 bit combined header
		return type & 0x0f;
	}

	return -4;
}

// Assembly:
movl 0x8(%rdi), %ecx
movl 0xc(%rdi), %esi
cmpl %esi, %ecx
jae 0xc24c
movq (%rdi), %rdx
leaq 0x1(%rcx), %r8
movl %r8d, 0x8(%rdi)
subl %r8d, %esi
movzbl (%rdx,%rcx), %eax
cmpl $0xdf, %eax
je 0xc250
cmpl $0xde, %eax
jne 0xc259
cmpl $0x2, %esi
jae 0xc26a
pushq $-0x2
jmp 0xc24e
pushq $-0x1
popq %rax
retq
cmpl $0x4, %esi
jae 0xc27d
pushq $-0x3
jmp 0xc24e
movl %eax, %ecx
andl $-0x10, %ecx
cmpl $0x80, %ecx
jne 0xc28a
andl $0xf, %eax
retq
movzwl (%rdx,%r8), %eax
addl $0x3, %ecx
movl %ecx, 0x8(%rdi)
rolw $0x8, %ax
movzwl %ax, %eax
retq
movl 0x1(%rdx,%rcx), %eax
addl $0x5, %ecx
movl %ecx, 0x8(%rdi)
bswapl %eax
retq
pushq $-0x4
jmp 0xc24e
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: msgpack_compare_internal
static inline msgpack_compare_t
msgpack_compare_internal(as_unpacker *pk1, as_unpacker *pk2, size_t depth,
		as_val_t *type)
{
	msgpack_compare_t ret = msgpack_peek_compare_type(pk1, pk2, type);

	if (ret == MSGPACK_COMPARE_ERROR || ret == MSGPACK_COMPARE_END) {
		return MSGPACK_COMPARE_ERROR;
	}

	if (ret != MSGPACK_COMPARE_EQUAL || *type == AS_CMP_WILDCARD) {
		if (as_unpack_size(pk1) < 0) {
			return MSGPACK_COMPARE_ERROR;
		}

		if (as_unpack_size(pk2) < 0) {
			return MSGPACK_COMPARE_ERROR;
		}

		return ret;
	}

	return msgpack_compare_type(pk1, pk2, *type, depth);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rcx, %rdx
movq %rcx, %r13
movq %rsi, %rbx
movq %rdi, %r12
callq 0xc859
pushq $-0x2
popq %r14
cmpl $-0x3, %eax
ja 0xc33c
movl %eax, %ebp
cmpl $0x1, %eax
jne 0xc31b
movb (%r13), %al
cmpb $0xd, %al
jne 0xc34e
movq %r12, %rdi
callq 0x8950
testq %rax, %rax
js 0xc33c
movq %rbx, %rdi
callq 0x8950
testq %rax, %rax
pushq $-0x2
popq %rax
cmovsl %eax, %ebp
movl %ebp, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl %al, %edx
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc8e6
// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: pack_resize
static int
pack_resize(as_packer *pk, uint32_t sz)
{
	// Add current buffer to linked list and allocate a new buffer
	as_packer_buffer *entry =
			(as_packer_buffer *)cf_malloc(sizeof(as_packer_buffer));

	if (! entry) {
		return -1;
	}

	entry->buffer = pk->buffer;
	entry->length = pk->offset;
	entry->next = 0;

	size_t newcap = (size_t)((sz > (uint32_t)pk->capacity) ? sz : pk->capacity);

	if (! (pk->buffer = (unsigned char *)cf_malloc(newcap))) {
		cf_free(entry);
		return -1;
	}

	pk->capacity = (int)newcap;
	pk->offset = 0;

	if (pk->tail) {
		pk->tail->next = entry;
		pk->tail = entry;
	}
	else {
		pk->head = entry;
		pk->tail = entry;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %rbx
pushq $0x18
popq %rdi
callq 0x8080
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0xc444
movq %rax, %r14
movq 0x10(%rbx), %rax
movq %rax, 0x8(%r14)
movl 0x18(%rbx), %eax
movl %eax, 0x10(%r14)
andq $0x0, (%r14)
movl 0x1c(%rbx), %eax
cmpl %r15d, %eax
cmoval %eax, %r15d
movq %r15, %rdi
callq 0x8080
testq %rax, %rax
movq %rax, 0x10(%rbx)
je 0xc43c
movl %r15d, 0x1c(%rbx)
andl $0x0, 0x18(%rbx)
movq 0x8(%rbx), %rax
testq %rax, %rax
cmoveq %rbx, %rax
xorl %ebp, %ebp
movq %r14, (%rax)
movq %r14, 0x8(%rbx)
jmp 0xc444
movq %r14, %rdi
callq 0x8a00
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq