LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_queue_mt.c
// Function: as_queue_mt_init
bool
as_queue_mt_init(as_queue_mt* queue, uint32_t item_size, uint32_t capacity)
{
	if (! as_queue_init(&queue->queue, item_size, capacity)) {
		return false;
	}

	if (pthread_mutex_init(&queue->lock, NULL) != 0) {
		as_queue_destroy(&queue->queue);
		return false;
	}

	if (pthread_cond_init(&queue->cond, NULL) != 0) {
		pthread_mutex_destroy(&queue->lock);
		as_queue_destroy(&queue->queue);
		return false;
	}
	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x8970
testb %al, %al
je 0x10209
leaq 0x20(%rbx), %r14
xorl %esi, %esi
movq %r14, %rdi
callq 0x8a90
testl %eax, %eax
jne 0x10201
leaq 0x48(%rbx), %rdi
xorl %esi, %esi
callq 0x85f0
testl %eax, %eax
je 0x10213
movq %r14, %rdi
callq 0x82f0
movq %rbx, %rdi
callq 0x81e0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movb $0x1, %al
jmp 0x1020b
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_queue_mt.c
// Function: as_queue_mt_create
as_queue_mt*
as_queue_mt_create(uint32_t item_size, uint32_t capacity)
{
	as_queue_mt* queue = cf_malloc(sizeof(as_queue_mt));

	if (! queue) {
		return NULL;
	}

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %r14d
movl $0x78, %edi
movl %esi, %ebp
callq 0x8080
testq %rax, %rax
je 0x10254
movq %rax, %rdi
movl %r14d, %esi
movl %ebp, %edx
movq %rax, %rbx
callq 0x80c0
testb %al, %al
je 0x1024c
movl $0x3, 0x1c(%rbx)
jmp 0x10256
movq %rbx, %rdi
callq 0x8940
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_queue_mt.c
// Function: as_queue_mt_pop
bool
as_queue_mt_pop(as_queue_mt* queue, void* ptr, int wait_ms)
{
	pthread_mutex_lock(&queue->lock);
	as_queue_mt_wait(queue, wait_ms);
	bool status = as_queue_pop(&queue->queue, ptr);
	pthread_mutex_unlock(&queue->lock);
	return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x20(%rdi), %rbx
movq %rdi, %r14
movl %edx, %ebp
movq %rsi, %r15
movq %rbx, %rdi
callq 0x8ad0
movq %r14, %rdi
movl %ebp, %esi
callq 0x102e3
movl 0xc(%r14), %ebp
movl 0x10(%r14), %r12d
cmpl %ebp, %r12d
je 0x102c9
movl %ebp, %eax
xorl %edx, %edx
movq %r15, %rdi
divl 0x8(%r14)
movl 0x14(%r14), %eax
imull %eax, %edx
addq (%r14), %rdx
movq %rdx, %rsi
movq %rax, %rdx
callq 0x85c0
movl 0xc(%r14), %eax
incl %eax
movl %eax, 0xc(%r14)
cmpl 0x10(%r14), %eax
jne 0x102c9
movq $0x0, 0xc(%r14)
cmpl %ebp, %r12d
movq %rbx, %rdi
setne %bpl
callq 0x8630
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_queue_mt.c
// Function: as_queue_mt_wait
static void
as_queue_mt_wait(as_queue_mt* queue, int wait_ms)
{
	// as_queue_empty() is checked in as_queue_pop(), so no need
	// to check here on AS_QUEUE_NOWAIT.
	if (wait_ms == AS_QUEUE_NOWAIT || ! as_queue_empty(&queue->queue)) {
		return;
	}

	if (wait_ms == AS_QUEUE_FOREVER) {
		// Note that we have to use a while() loop. The pthread_cond_signal()
		// documentation says that AT LEAST ONE waiting thread will be awakened.
		// If more than one are awakened, the first will get the popped element,
		// others will find the queue empty and go back to waiting.
		do {
			pthread_cond_wait(&queue->cond, &queue->lock);
		} while (as_queue_empty(&queue->queue));

		return;
	}

	struct timespec tp;
	cf_set_wait_timespec(wait_ms, &tp);
	pthread_cond_timedwait(&queue->cond, &queue->lock, &tp);
}

// Assembly:
testl %esi, %esi
je 0x103af
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl 0x10(%rdi), %eax
movq %rdi, %rbx
cmpl 0xc(%rdi), %eax
jne 0x103a5
movl %esi, %ebp
cmpl $-0x1, %esi
je 0x1038a
leaq 0x8(%rsp), %r14
xorl %edi, %edi
movq %r14, %rsi
callq 0x81d0
movslq %ebp, %rax
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
movq %rax, %rcx
sarq $0x26, %rax
shrq $0x3f, %rcx
addl %ecx, %eax
movslq %eax, %rcx
movq (%r14), %rax
addq %rcx, %rax
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
subl %ecx, %ebp
movq %rax, (%r14)
imull $0xf4240, %ebp, %ecx    # imm = 0xF4240
movslq %ecx, %rcx
addq 0x8(%r14), %rcx
cmpq $0x3b9aca01, %rcx       # imm = 0x3B9ACA01
movq %rcx, 0x8(%r14)
jl 0x10373
addq $-0x3b9aca00, %rcx      # imm = 0xC4653600
incq %rax
movq %rcx, 0x10(%rsp)
movq %rax, 0x8(%rsp)
leaq 0x48(%rbx), %rdi
addq $0x20, %rbx
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x88c0
jmp 0x103a5
leaq 0x48(%rbx), %r14
leaq 0x20(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x8200
movl 0x10(%rbx), %eax
cmpl 0xc(%rbx), %eax
je 0x10392
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_queue_mt.c
// Function: as_queue_mt_pop_tail
bool
as_queue_mt_pop_tail(as_queue_mt* queue, void* ptr, int wait_ms)
{
	pthread_mutex_lock(&queue->lock);
	as_queue_mt_wait(queue, wait_ms);
	bool status = as_queue_pop_tail(&queue->queue, ptr);
	pthread_mutex_unlock(&queue->lock);
	return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x20(%rdi), %rbx
movq %rdi, %r14
movl %edx, %ebp
movq %rsi, %r15
movq %rbx, %rdi
callq 0x8ad0
movq %r14, %rdi
movl %ebp, %esi
callq 0x102e3
movl 0xc(%r14), %ebp
movl 0x10(%r14), %r12d
cmpl %ebp, %r12d
je 0x1041c
leal -0x1(%r12), %eax
xorl %edx, %edx
movq %r15, %rdi
movl %eax, 0x10(%r14)
divl 0x8(%r14)
movl 0x14(%r14), %eax
imull %eax, %edx
addq (%r14), %rdx
movq %rdx, %rsi
movq %rax, %rdx
callq 0x85c0
movl 0xc(%r14), %eax
cmpl 0x10(%r14), %eax
jne 0x1041c
movq $0x0, 0xc(%r14)
cmpl %ebp, %r12d
movq %rbx, %rdi
setne %bpl
callq 0x8630
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_random.c
// Function: as_random_instance
as_random*
as_random_instance(void)
{
	as_random* random = &as_rand;

	if (!random->initialized) {
		as_random_init(random);
	}
	return random;
}

// Assembly:
pushq %rbx
leaq 0xfb0c(%rip), %rdi      # 0x1ff68
callq 0x84c0
cmpb $0x0, 0x10(%rax)
movq %rax, %rbx
jne 0x10482
callq 0x8450
movq %rax, (%rbx)
callq 0x8450
movq %rax, 0x8(%rbx)
movb $0x1, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_random.c
// Function: as_random_next_bytes
void
as_random_next_bytes(as_random* random, uint8_t* bytes, uint32_t len)
{
	uint8_t* p = bytes;
	uint8_t* end = bytes + len;
	
	while (p + sizeof(uint64_t) <= end) {
		// Append full 8 bytes
		*(uint64_t*)p = as_random_next_uint64(random);
		p += sizeof(uint64_t);
	}

	if (p < end) {
		// Append partial bytes.
		uint8_t tmp[sizeof(uint64_t)];
		uint8_t* t = tmp;
		*(uint64_t*)t = as_random_next_uint64(random);
		
		while (p < end) {
			*p++ = *t++;
		}
	}
}

// Assembly:
movl %edx, %eax
addq %rsi, %rax
cmpl $0x8, %edx
jae 0x10496
movq %rsi, %rcx
jmp 0x104d8
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
movq %rcx, %r8
movq %rdx, %r9
movq %rdx, (%rdi)
shlq $0x17, %r8
shrq $0x5, %r9
xorq %rcx, %r8
xorq %rdx, %r9
leaq 0x8(%rsi), %rcx
xorq %r8, %r9
shrq $0x12, %r8
xorq %r9, %r8
movq %r8, 0x8(%rdi)
addq %rdx, %r8
movq %r8, (%rsi)
addq $0x10, %rsi
cmpq %rax, %rsi
movq %rcx, %rsi
jbe 0x10496
cmpq %rax, %rcx
jae 0x10529
movq (%rdi), %rdx
movq 0x8(%rdi), %rsi
movq %rdx, %r8
movq %rsi, (%rdi)
shlq $0x17, %r8
xorq %rdx, %r8
movq %rsi, %rdx
shrq $0x5, %rdx
xorq %rsi, %rdx
xorq %r8, %rdx
shrq $0x12, %r8
xorq %rdx, %r8
xorl %edx, %edx
movq %r8, 0x8(%rdi)
addq %rsi, %r8
movq %r8, -0x8(%rsp)
movb -0x8(%rsp,%rdx), %sil
leaq 0x1(%rcx,%rdx), %rdi
incq %rdx
cmpq %rax, %rdi
movb %sil, -0x1(%rdi)
jb 0x10513
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_random.c
// Function: as_random_next_str
void
as_random_next_str(as_random* random, char* str, uint32_t len)
{
	uint8_t* p = (uint8_t*)str;
	as_random_next_bytes(random, p, len);
	
	for (uint32_t i = 0; i < len; i++) {
		p[i] = alphanum[p[i] % alphanum_len];
	}
	p[len] = 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
callq 0x8530
testl %ebp, %ebp
je 0x10585
movl %ebp, %eax
leaq 0x7e6c(%rip), %rcx      # 0x183b0
movq %rbx, %rsi
movq %rax, %rdx
movb (%rsi), %dil
movl %edi, %r8d
shrb %r8b
movzbl %r8b, %r8d
imull $0x85, %r8d, %r8d
shrl $0xc, %r8d
leal (%r8,%r8), %r9d
shll $0x6, %r8d
subl %r9d, %r8d
subb %r8b, %dil
movzbl %dil, %edi
movb (%rdi,%rcx), %dil
movb %dil, (%rsi)
incq %rsi
decq %rdx
jne 0x1054a
jmp 0x10587
xorl %eax, %eax
movb $0x0, (%rbx,%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_rec.c
// Function: as_rec_cons
as_rec * as_rec_cons(as_rec * rec, bool free, void * data, const as_rec_hooks * hooks)
{
	if ( !rec ) return rec;

	as_val_init((as_val *) rec, AS_REC, free);
	rec->data = data;
	rec->hooks = hooks;
	return rec;
}

// Assembly:
movq %rdi, %rax
testq %rdi, %rdi
je 0x105b2
movb $0x7, 0x4(%rax)
movb %sil, 0x5(%rax)
movl $0x1, (%rax)
movq %rdx, 0x8(%rax)
movq %rcx, 0x10(%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_result.c
// Function: as_result_new
as_result * as_result_new(void) {
    as_result * r = (as_result *) cf_malloc(sizeof(as_result));
    if (!r) return r;
    r->is_malloc = true;
    r->count = 1;
    r->is_success = false;
    r->value = NULL;
    return r;
}

// Assembly:
pushq %rax
movl $0x10, %edi
callq 0x8080
testq %rax, %rax
je 0x10690
movw $0x1, 0xc(%rax)
movl $0x1, 0x8(%rax)
movq $0x0, (%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_result.c
// Function: as_result_destroy
void as_result_destroy(as_result *r) {
    // if we reach the last reference, call the destructor, and free
	if (as_aaf_uint32(&r->count, -1) == 0) {
        if (r->value) {
            as_val_destroy(r->value); 
            r->value = NULL;
        }
        if (r->is_malloc) {
            cf_free(r);
        }
    }
    return;
}

// Assembly:
pushq %rbx
lock
decl 0x8(%rdi)
jne 0x106c7
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x106b8
callq 0x84b0
movq $0x0, (%rbx)
cmpb $0x1, 0xc(%rbx)
jne 0x106c7
movq %rbx, %rdi
popq %rbx
jmp 0x8940
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_result.c
// Function: as_success_new
as_result * as_success_new(as_val * v) {
    as_result *r = as_result_new();
    r->is_success = true;
    r->value = v;
    return(r);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x10, %edi
callq 0x8080
testq %rax, %rax
je 0x106e7
movb $0x1, 0xc(%rax)
movl $0x1, 0x8(%rax)
movb $0x1, 0xd(%rax)
movq %rbx, (%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_result.c
// Function: as_failure_new
as_result * as_failure_new(as_val * v) {
    as_result *r = as_result_new();
    r->is_success = false;
    r->value = v;
    return(r);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x10, %edi
callq 0x8080
testq %rax, %rax
je 0x1070e
movb $0x1, 0xc(%rax)
movl $0x1, 0x8(%rax)
movb $0x0, 0xd(%rax)
movq %rbx, (%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_result.c
// Function: as_result_setsuccess
as_result * as_result_setsuccess(as_result * r, as_val * v) {
    if (r->value) as_val_destroy(r->value);
    r->value = v;
    r->is_success = true;
    return(r);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movq %rsi, %r14
testq %rdi, %rdi
je 0x1075a
callq 0x84b0
movq %r14, (%rbx)
movb $0x1, 0xd(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_result.c
// Function: as_result_setfailure
as_result * as_result_setfailure(as_result * r, as_val * v) {
    if (r->value) as_val_destroy(r->value);
    r->value = v;
    r->is_success = false;
    return(r);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movq %rsi, %r14
testq %rdi, %rdi
je 0x10783
callq 0x84b0
movq %r14, (%rbx)
movb $0x0, 0xd(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_string.c
// Function: as_string_val_hashcode
uint32_t as_string_val_hashcode(const as_val * v)
{
	as_string * string = as_string_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 0x10ace
cmpb $0x4, 0x4(%rdi)
jne 0x10ace
movq 0x10(%rdi), %rcx
testq %rcx, %rcx
je 0x10ace
movb (%rcx), %dl
testb %dl, %dl
je 0x10ace
incq %rcx
xorl %eax, %eax
movsbl %dl, %edx
imull $0x1003f, %eax, %eax    # imm = 0x1003F
addl %edx, %eax
movb (%rcx), %dl
incq %rcx
testb %dl, %dl
jne 0x10aba
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_string.c
// Function: as_string_val_tostring
char * as_string_val_tostring(const as_val * v)
{
	as_string * s = (as_string *) v;
	if (s->value == NULL) return(NULL);
	size_t sl = as_string_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
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x10b23
movq 0x18(%rbx), %r14
cmpq $-0x1, %r14
jne 0x10af6
callq 0x8260
movq %rax, %r14
movq %rax, 0x18(%rbx)
leaq 0x3(%r14), %rdi
callq 0x8080
testq %rax, %rax
je 0x10b23
movb $0x22, (%rax)
movq %rax, %rdi
movq %rax, %r15
movq 0x10(%rbx), %rsi
incq %rdi
callq 0x8180
movw $0x22, 0x1(%r15,%r14)
jmp 0x10b26
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_string.c
// Function: as_strncpy
bool
as_strncpy(char* trg, const char* src, int size)
{
	if (src) {
		int max = size - 1;
		int i = 0;
		
		while (*src) {
			if (i >= max) {
				*trg = 0;
				return true;
			}
			*trg++ = *src++;
			i++;
		}
	}
	*trg = 0;
	return false;
}

// Assembly:
testq %rsi, %rsi
je 0x10b60
movb (%rsi), %cl
xorl %eax, %eax
testb %cl, %cl
je 0x10b62
decl %edx
testl %edx, %edx
cmovgl %edx, %eax
incq %rsi
movl %eax, %edx
subl $0x1, %edx
setb %al
jb 0x10b62
movb %cl, (%rdi)
incq %rdi
movb (%rsi), %cl
incq %rsi
testb %cl, %cl
jne 0x10b48
jmp 0x10b62
xorl %eax, %eax
movb $0x0, (%rdi)
retq
nop
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_string_builder.c
// Function: as_string_builder_init
void
as_string_builder_init(as_string_builder* sb, uint32_t capacity, bool resize)
{
	sb->data = (char*)cf_malloc(capacity);
	sb->data[0] = 0;
	sb->capacity = capacity;
	sb->length = 0;
	sb->resize = resize;
	sb->free = true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movl %esi, %edi
movl %edx, %ebx
movl %esi, %ebp
callq 0x8080
movq %rax, (%r14)
movb $0x0, (%rax)
movl %ebp, 0x8(%r14)
movl $0x0, 0xc(%r14)
movb %bl, 0x10(%r14)
movb $0x1, 0x11(%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_string_builder.c
// Function: as_string_builder_append
bool
as_string_builder_append(as_string_builder* sb, const char* src)
{
	char* trg = &sb->data[sb->length];

	while (*src) {
		if (++sb->length < sb->capacity) {
			*trg++ = *src++;
			continue;
		}

		// Optimistic increase of length failed. Roll it back.
		sb->length--;

		if (sb->resize) {
			return as_sb_expand(sb, src);
		}
		else {
			*trg = 0;
			return false;
		}
	}
	*trg = 0;
	return true;
}

// Assembly:
movl 0xc(%rdi), %eax
addq (%rdi), %rax
cmpb $0x0, (%rsi)
je 0x10bdf
movl 0xc(%rdi), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0xc(%rdi)
cmpl 0x8(%rdi), %edx
jae 0x10be5
movb (%rsi), %cl
movb %cl, (%rax)
incq %rax
cmpb $0x0, 0x1(%rsi)
leaq 0x1(%rsi), %rsi
jne 0x10bc0
movb $0x0, (%rax)
movb $0x1, %al
retq
movl %ecx, 0xc(%rdi)
cmpb $0x1, 0x10(%rdi)
je 0x10bf4
movb $0x0, (%rax)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_string_builder.c
// Function: as_sb_expand
static bool
as_sb_expand(as_string_builder* sb, const char* src)
{
	uint32_t remaining_len = (uint32_t)strlen(src);
	uint32_t min_capacity = sb->length + remaining_len + 1;

	if (! as_sb_increase_capacity(sb, min_capacity)) {
		return false;
	}

	memcpy(&sb->data[sb->length], src, remaining_len);
	sb->length += remaining_len;
	sb->data[sb->length] = 0;
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, %rdi
movq %rsi, %r15
callq 0x8260
movq %rax, %r14
movl 0xc(%rbx), %eax
movq %rbx, %rdi
leal 0x1(%r14,%rax), %esi
callq 0x10de6
movl %eax, %ebp
testb %al, %al
je 0x10c43
movl 0xc(%rbx), %edi
movl %r14d, %edx
movq %r15, %rsi
addq (%rbx), %rdi
callq 0x85c0
movl 0xc(%rbx), %eax
addl %r14d, %eax
movl %eax, 0xc(%rbx)
movq (%rbx), %rcx
movb $0x0, (%rcx,%rax)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_string_builder.c
// Function: as_string_builder_append_char
bool
as_string_builder_append_char(as_string_builder* sb, char value)
{
	if (sb->length + 1 < sb->capacity) {
		sb->data[sb->length++] = value;
		sb->data[sb->length] = 0;
		return true;
	}
	
	if (sb->resize) {
		char buf[] = {value, '\0'};
		return as_sb_expand(sb, buf);
	}
	return false;
}

// Assembly:
movl 0xc(%rdi), %eax
leal 0x1(%rax), %ecx
cmpl 0x8(%rdi), %ecx
jae 0x10c72
movq (%rdi), %rdx
movl %ecx, 0xc(%rdi)
movb %sil, (%rdx,%rax)
movq (%rdi), %rax
movl 0xc(%rdi), %ecx
movb $0x0, (%rax,%rcx)
movb $0x1, %al
retq
cmpb $0x1, 0x10(%rdi)
jne 0x10c92
pushq %rax
leaq 0x6(%rsp), %rax
movb %sil, (%rax)
movq %rax, %rsi
movb $0x0, 0x1(%rax)
callq 0x10bf4
addq $0x8, %rsp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_string_builder.c
// Function: as_string_builder_append_bytes
bool
as_string_builder_append_bytes(as_string_builder* sb, uint8_t* src, uint32_t size)
{
	if (sb->resize) {
		// Ensure buffer is large enough to receive bytes.
		// min capacity = old length + 3 chars per byte including separator + 2 bracket chars
		// - 1 extra separator + 1 null byte.
		uint32_t min_capacity = sb->length + (size * 3) + 2;

		if (min_capacity > sb->capacity) {
			if (! as_sb_increase_capacity(sb, min_capacity)) {
				return false;
			}
		}

		char* trg = &sb->data[sb->length];
		*trg++ = '[';

		for (uint32_t i = 0; i < size; i++) {
			uint8_t b = src[i];
			*trg++ = as_hex_chars[(b >> 4) & 0xf];
			*trg++ = as_hex_chars[b & 0xf];
			*trg++ = ' ';
		}
		trg--; // truncate last separator
		*trg++ = ']';
		*trg = 0;
		sb->length = (int)(trg - sb->data);
	}
	else {
		if (! as_sb_append_char(sb, '[')) {
			return false;
		}

		for (uint32_t i = 0; i < size; i++) {
			if (! as_sb_append_byte(sb, src[i])) {
				return false;
			}
		}
		sb->length--; // truncate last separator

		if (! as_sb_append_char(sb, ']')) {
			return false;
		}
	}
	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl 0xc(%rdi), %eax
cmpb $0x1, 0x10(%rdi)
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
jne 0x10d26
leal (%r15,%r15,2), %ecx
leal 0x2(%rax,%rcx), %esi
cmpl 0x8(%rbx), %esi
jbe 0x10ccc
movq %rbx, %rdi
callq 0x10de6
testb %al, %al
je 0x10dde
movl 0xc(%rbx), %eax
movq (%rbx), %rcx
movl %eax, %eax
testl %r15d, %r15d
leaq 0x1(%rcx,%rax), %rax
movb $0x5b, -0x1(%rax)
je 0x10d14
movq 0xf2ea(%rip), %rdx      # 0x1ffd0
movl %r15d, %ecx
movzbl (%r14), %esi
incq %r14
movl %esi, %edi
andl $0xf, %esi
shrl $0x4, %edi
movb (%rdx,%rdi), %dil
movb %dil, (%rax)
movb (%rdx,%rsi), %sil
movb %sil, 0x1(%rax)
movb $0x20, 0x2(%rax)
addq $0x3, %rax
decq %rcx
jne 0x10ce9
movw $0x5d, -0x1(%rax)
subl (%rbx), %eax
movl %eax, 0xc(%rbx)
movb $0x1, %al
jmp 0x10de0
leal 0x1(%rax), %ecx
cmpl 0x8(%rbx), %ecx
jae 0x10dde
movq (%rbx), %rdx
movl %ecx, 0xc(%rbx)
testl %r15d, %r15d
movb $0x5b, (%rdx,%rax)
movq (%rbx), %rax
movl 0xc(%rbx), %ecx
movb $0x0, (%rax,%rcx)
je 0x10db5
movq 0xf27e(%rip), %rcx      # 0x1ffd0
movl %r15d, %eax
movl 0xc(%rbx), %edx
leal 0x3(%rdx), %esi
cmpl 0x8(%rbx), %esi
jae 0x10dde
movzbl (%r14), %esi
movq (%rbx), %r8
leal 0x1(%rdx), %r9d
incq %r14
movl %esi, %edi
andl $0xf, %esi
shrl $0x4, %edi
decq %rax
movb (%rcx,%rdi), %dil
movl %r9d, 0xc(%rbx)
movb %dil, (%r8,%rdx)
movl 0xc(%rbx), %edi
movb (%rcx,%rsi), %dl
movq (%rbx), %rsi
leal 0x1(%rdi), %r8d
movl %r8d, 0xc(%rbx)
movb %dl, (%rsi,%rdi)
movl 0xc(%rbx), %esi
movq (%rbx), %rdx
leal 0x1(%rsi), %edi
movl %edi, 0xc(%rbx)
movb $0x20, (%rdx,%rsi)
movq (%rbx), %rdx
movl 0xc(%rbx), %esi
movb $0x0, (%rdx,%rsi)
jne 0x10d55
movl 0xc(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rbx)
cmpl 0x8(%rbx), %eax
jae 0x10dde
movq (%rbx), %rdx
movl %eax, 0xc(%rbx)
movl %ecx, %eax
movb $0x5d, (%rdx,%rax)
movq (%rbx), %rax
movl 0xc(%rbx), %ecx
movb $0x0, (%rax,%rcx)
jmp 0x10d1f
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_string_builder.c
// Function: as_sb_increase_capacity
static bool
as_sb_increase_capacity(as_string_builder* sb, uint32_t min_capacity)
{
	uint32_t capacity = sb->capacity * 2;

	if (capacity < min_capacity) {
		capacity = min_capacity;
	}

	if (sb->free) {
		// String already allocated on heap.  Realloc.
		char* data = cf_realloc(sb->data, capacity);
		
		if (data) {
			sb->data = data;
			sb->capacity = capacity;
			return true;
		}
	}
	else {
		// String allocated on stack.  Transfer to heap.
		char* data = cf_malloc(capacity);
		
		if (data) {
			memcpy(data, sb->data, sb->length);
			data[sb->length] = 0;
			sb->data = data;
			sb->capacity = capacity;
			sb->free = true;
			return true;
		}
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x8(%rdi), %ebp
movq %rdi, %rbx
addl %ebp, %ebp
cmpl %esi, %ebp
cmovbel %esi, %ebp
cmpb $0x1, 0x11(%rdi)
jne 0x10e14
movq (%rbx), %rdi
movl %ebp, %esi
callq 0x8510
testq %rax, %rax
je 0x10e47
movq %rax, (%rbx)
movl %ebp, 0x8(%rbx)
jmp 0x10e43
movl %ebp, %edi
callq 0x8080
testq %rax, %rax
je 0x10e47
movq (%rbx), %rsi
movl 0xc(%rbx), %edx
movq %rax, %rdi
movq %rax, %r14
callq 0x85c0
movl 0xc(%rbx), %eax
movb $0x0, (%r14,%rax)
movq %r14, (%rbx)
movl %ebp, 0x8(%rbx)
movb $0x1, 0x11(%rbx)
movb $0x1, %al
jmp 0x10e49
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_thread_pool.c
// Function: as_thread_worker
void*
as_thread_worker(void* data)
{
	as_thread_pool* pool = data;

	as_thread_set_name("tpool");

	// Run variable tasks.
	as_thread_pool_task task;

	// Retrieve tasks from queue and execute.
	while (cf_queue_pop(pool->dispatch_queue, &task, CF_QUEUE_FOREVER) == CF_QUEUE_OK) {
		// A null task indicates thread should be shut down.
		if (! task.task_fn) {
			break;
		}

		// Run task
		task.task_fn(task.task_data);
	}

	// Run the finalization function, if present.
	if (pool->fini_fn) {
		pool->fini_fn();
	}
	return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x88a0
leaq 0x74bf(%rip), %rsi      # 0x18405
movq %rax, %rdi
callq 0x82d0
movq 0x8(%rbx), %rdi
leaq 0x8(%rsp), %r14
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rsi
callq 0x87c0
testl %eax, %eax
movq (%r14), %rax
sete %cl
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x10fa4
leaq 0x8(%rsp), %r14
movq 0x10(%rsp), %rdi
callq *%rax
movq 0x8(%rbx), %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x87c0
testl %eax, %eax
jne 0x10fa4
movq 0x8(%rsp), %rax
testq %rax, %rax
jne 0x10f7e
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x10faf
callq *%rax
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_thread_pool.c
// Function: as_thread_pool_init
int
as_thread_pool_init(as_thread_pool* pool, uint32_t thread_size)
{
	if (thread_size != 0) {
		pool->threads = cf_calloc(thread_size, sizeof(pthread_t));
		pool->dispatch_queue = cf_queue_create(sizeof(as_thread_pool_task), true);
	}
	else {
		pool->threads = NULL;
		pool->dispatch_queue = NULL;
	}
	pool->fini_fn = NULL;
	pool->thread_size = 0;

	// Start threads.
	for (uint32_t i = 0; i < thread_size; i++) {
		if (pthread_create(&pool->threads[i], NULL, as_thread_worker, pool) == 0) {
			pool->thread_size++;
		}
	}
	return (pool->thread_size == thread_size)? 0 : -3;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
testl %esi, %esi
je 0x11039
movl %ebx, %r15d
movl $0x8, %esi
movq %r15, %rdi
callq 0x88b0
movl $0x10, %edi
movl $0x1, %esi
movq %rax, (%r14)
callq 0x8780
movq 0xefe4(%rip), %r12      # 0x1ffd8
shlq $0x3, %r15
xorl %r13d, %r13d
movq %rax, 0x8(%r14)
movq $0x0, 0x10(%r14)
movl $0x0, 0x18(%r14)
movq (%r14), %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r14, %rcx
addq %r13, %rdi
callq 0x8830
testl %eax, %eax
jne 0x1102a
incl 0x18(%r14)
addq $0x8, %r13
cmpq %r13, %r15
jne 0x1100f
movl 0x18(%r14), %eax
jmp 0x1104e
xorl %eax, %eax
movl $0x0, 0x18(%r14)
movq %rax, 0x10(%r14)
movq %rax, 0x8(%r14)
movq %rax, (%r14)
xorl %ecx, %ecx
cmpl %ebx, %eax
sete %cl
leal -0x3(%rcx,%rcx,2), %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_thread_pool.c
// Function: as_thread_pool_queue_task
int
as_thread_pool_queue_task(as_thread_pool* pool, as_task_fn task_fn, void* task)
{
	if (pool->thread_size == 0) {
		// No threads are running to process task.
		return -1;
	}

	// Queue variable task.
	as_thread_pool_task vtask;
	vtask.task_fn = task_fn;
	vtask.task_data = task;

	if (cf_queue_push(pool->dispatch_queue, &vtask) != CF_QUEUE_OK) {
		return -2;
	}
	return 0;
}

// Assembly:
cmpl $0x0, 0x18(%rdi)
je 0x11095
subq $0x18, %rsp
leaq 0x8(%rsp), %rax
movq %rsi, (%rax)
movq %rdx, 0x8(%rax)
movq %rax, %rsi
movq 0x8(%rdi), %rdi
callq 0x8270
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
leal -0x2(%rcx,%rcx), %eax
addq $0x18, %rsp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_thread_pool.c
// Function: as_thread_pool_destroy
int
as_thread_pool_destroy(as_thread_pool* pool)
{
	// Prevent double destroy.
	uint32_t thread_size = as_fas_uint32(&pool->thread_size, 0);

	if (thread_size == 0) {
		return 0;
	}

	// Tells worker threads to stop by setting NULL task_fn. We do this to allow the
	// workers to "wait forever" on processing the work dispatch queue, which has
	// minimum impact when the queue is empty. This also means all queued requests
	// get processed before shutting down.
	as_thread_pool_task task;
	task.task_fn = NULL;
	task.task_data = NULL;

	// Send shutdown signal for variable tasks.
	for (uint32_t i = 0; i < thread_size; i++) {
		cf_queue_push(pool->dispatch_queue, &task);
	}

	// Wait till threads finish.
	for (uint32_t i = 0; i < thread_size; i++) {
		pthread_join(pool->threads[i], NULL);
	}

	cf_free(pool->threads);
	cf_queue_destroy(pool->dispatch_queue);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
xorl %ebp, %ebp
xchgl %ebp, 0x18(%rdi)
testl %ebp, %ebp
je 0x110fc
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %r14
movl %ebp, %r15d
movaps %xmm0, (%r14)
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x8270
decl %r15d
jne 0x110be
movl %ebp, %r14d
xorl %r15d, %r15d
movq (%rbx), %rax
xorl %esi, %esi
movq (%rax,%r15,8), %rdi
callq 0x8a30
incq %r15
cmpq %r15, %r14
jne 0x110d5
movq (%rbx), %rdi
callq 0x8940
movq 0x8(%rbx), %rdi
callq 0x8370
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_timer.c
// Function: as_timer_init
as_timer * as_timer_init(as_timer * timer, void * source, const as_timer_hooks * hooks) {
    if ( timer == NULL ) return timer;
    timer->source = source;
    timer->hooks = hooks;
    return timer;
}

// Assembly:
movq %rdi, %rax
testq %rdi, %rdi
je 0x1111c
movq %rsi, 0x8(%rax)
movq %rdx, 0x10(%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_timer.c
// Function: as_timer_new
as_timer * as_timer_new(void * source, const as_timer_hooks * hooks) {
    as_timer * timer = (as_timer *) cf_malloc(sizeof(as_timer));
    if (!timer) return timer;
    timer->source = source;
    timer->hooks = hooks;
    return timer;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x18, %edi
movq %rsi, %rbx
callq 0x8080
testq %rax, %rax
je 0x1113e
movq %r14, 0x8(%rax)
movq %rbx, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_timer.c
// Function: as_timer_destroy
int as_timer_destroy(as_timer * timer) {
    int rc = as_util_hook(destroy, 1, timer);
    if ( rc == 0 && timer->is_malloc ) {
        cf_free(timer);
    }
    return rc;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x1, %ebx
testq %rdi, %rdi
je 0x11183
movq 0x10(%rdi), %rax
movq %rdi, %r14
testq %rax, %rax
je 0x11183
movq (%rax), %rax
testq %rax, %rax
je 0x11183
movq %r14, %rdi
callq *%rax
movl %eax, %ebx
testl %eax, %eax
jne 0x11183
xorl %ebx, %ebx
cmpb $0x1, (%r14)
jne 0x11183
movq %r14, %rdi
callq 0x8940
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_val.c
// Function: as_val_val_destroy
as_val * as_val_val_destroy(as_val * v)
{
	if (v == NULL || !v->count) {
		return v;
	}

	// if we reach the last reference, call the destructor, and free
	if (as_aaf_uint32_rls(&v->count, -1) == 0) {
		// Subsequent destructor may require an 'acquire' barrier.
		as_fence_acq();

		as_val_destroy_callbacks[v->type](v);

		if (v->free) {
			cf_free(v);
		}
		v = NULL;
	}
	return v;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x11210
cmpl $0x0, (%rdi)
movq %rdi, %rbx
je 0x11212
lock
decl (%rbx)
jne 0x11212
movzbl 0x4(%rbx), %eax
leaq 0xea24(%rip), %rcx      # 0x1fc20
movq %rbx, %rdi
callq *(%rcx,%rax,8)
cmpb $0x1, 0x5(%rbx)
jne 0x11210
movq %rbx, %rdi
callq 0x8940
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_val.c
// Function: as_val_tobool
bool as_val_tobool(const as_val* v)
{
	if (!v) {
		return false;
	}

	if (v->type == AS_BOOLEAN) {
		return ((as_boolean*)v)->value;
	}

	if (v->type == AS_INTEGER) {
		return ((as_integer*)v)->value;
	}
	return false;
}

// Assembly:
testq %rdi, %rdi
je 0x1125a
movzbl 0x4(%rdi), %eax
cmpl $0x3, %eax
je 0x1125d
cmpl $0x2, %eax
jne 0x1125a
movb 0x8(%rdi), %al
retq
xorl %eax, %eax
retq
cmpq $0x0, 0x8(%rdi)
setne %al
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_vector.c
// Function: as_vector_init
void
as_vector_init(as_vector* vector, uint32_t item_size, uint32_t capacity)
{
	vector->list = cf_malloc(capacity * item_size);
	vector->capacity = capacity;
	vector->item_size = item_size;
	vector->size = 0;
	vector->flags = 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movl %edx, %edi
movl %edx, %ebx
movl %esi, %ebp
imull %esi, %edi
callq 0x8080
movq %rax, (%r14)
movl %ebx, 0x8(%r14)
movl %ebp, 0x10(%r14)
movl $0x0, 0xc(%r14)
movl $0x1, 0x14(%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_vector.c
// Function: as_vector_create
as_vector*
as_vector_create(uint32_t item_size, uint32_t capacity)
{
	as_vector* vector = cf_malloc(sizeof(as_vector));
	as_vector_init(vector, item_size, capacity);
	vector->flags = FLAGS_HEAP | FLAGS_CREATED;
	return vector;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebp
movl $0x18, %edi
movl %esi, %ebx
callq 0x8080
movl %ebx, %edi
movq %rax, %r14
imull %ebp, %edi
callq 0x8080
movq %rax, (%r14)
movl %ebx, 0x8(%r14)
movl %ebp, 0x10(%r14)
movl $0x0, 0xc(%r14)
movl $0x3, 0x14(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_vector.c
// Function: as_vector_destroy
void
as_vector_destroy(as_vector* vector)
{
	if (vector->flags & FLAGS_HEAP) {
		cf_free(vector->list);
		
		if (vector->flags & FLAGS_CREATED) {
			cf_free(vector);
		}
	}
}

// Assembly:
pushq %rbx
testb $0x1, 0x14(%rdi)
je 0x11307
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x8940
testb $0x2, 0x14(%rbx)
jne 0x11309
popq %rbx
retq
movq %rbx, %rdi
popq %rbx
jmp 0x8940
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_vector.c
// Function: as_vector_increase_capacity
void
as_vector_increase_capacity(as_vector* vector)
{
	if (vector->flags & FLAGS_HEAP) {
		vector->capacity *= 2;
		vector->list = cf_realloc(vector->list, vector->capacity * vector->item_size);
	}
	else {
		uint32_t capacity = vector->capacity * 2;
		void* tmp = cf_malloc(capacity * vector->item_size);
		memcpy(tmp, vector->list, vector->capacity * vector->item_size);
		vector->list = tmp;
		vector->capacity = capacity;
		vector->flags |= FLAGS_HEAP;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl 0x8(%rdi), %r14d
movq %rdi, %rbx
addl %r14d, %r14d
testb $0x1, 0x14(%rdi)
jne 0x11352
movl 0x10(%rbx), %edi
imull %r14d, %edi
callq 0x8080
movl 0x10(%rbx), %edx
movq (%rbx), %rsi
movq %rax, %rdi
movq %rax, %r15
imull 0x8(%rbx), %edx
callq 0x85c0
movl %r14d, 0x8(%rbx)
orb $0x1, 0x14(%rbx)
jmp 0x11369
movl %r14d, 0x8(%rbx)
imull 0x10(%rbx), %r14d
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x8510
movq %rax, %r15
movq %r15, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_vector.c
// Function: as_vector_append_unique
bool
as_vector_append_unique(as_vector* vector, void* value)
{
	char* item = vector->list;
	for (uint32_t i = 0; i < vector->size; i++) {
		if (memcmp(item, value, vector->item_size) == 0) {
			return false;
		}
		item += vector->item_size;
	}
	as_vector_append(vector, value);
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0xc(%rdi), %r15d
movq %rsi, %r14
movq %rdi, (%rsp)
testl %r15d, %r15d
je 0x113d7
movq (%rsp), %rax
movq %r14, %rsi
movq (%rax), %r12
movl 0x10(%rax), %r13d
movq %r12, %rdi
movq %r13, %rdx
callq 0x8770
xorl %ebp, %ebp
testl %eax, %eax
je 0x11408
addq %r13, %r12
leal -0x1(%r15), %ebx
cmpl %ebp, %ebx
je 0x113d7
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x8770
addq %r13, %r12
incl %ebp
testl %eax, %eax
jne 0x113b3
cmpl %r15d, %ebp
setae %bpl
jmp 0x11408
movq (%rsp), %rbx
cmpl 0x8(%rbx), %r15d
jb 0x113ed
movq %rbx, %rdi
callq 0x8030
movl 0xc(%rbx), %r15d
movl 0x10(%rbx), %edx
movq %r14, %rsi
imull %edx, %r15d
addq (%rbx), %r15
movq %r15, %rdi
callq 0x85c0
incl 0xc(%rbx)
movb $0x1, %bpl
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_O3/aerospike[P]aerospike-common/src/main/aerospike/as_vector.c
// Function: as_vector_to_array
void*
as_vector_to_array(as_vector* vector, uint32_t* size)
{
	size_t len = vector->size * vector->item_size;
	void* array = cf_malloc(len);
	memcpy(array, vector->list, len);
	*size = vector->size;
	return array;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl 0x10(%rdi), %r15d
movq %rdi, %r14
movq %rsi, %rbx
imull 0xc(%rdi), %r15d
movq %r15, %rdi
callq 0x8080
movq (%r14), %rsi
movq %rax, %rdi
movq %r15, %rdx
movq %rax, %r12
callq 0x85c0
movl 0xc(%r14), %eax
movl %eax, (%rbx)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/as_vector.c
// Function: as_vector_remove
bool
as_vector_remove(as_vector* vector, uint32_t index)
{
	if (index >= vector->size) {
		return false;
	}

	memmove((uint8_t*)vector->list + (index * vector->item_size),
		    (uint8_t*)vector->list + ((index + 1) * vector->item_size),
		    (vector->size - index - 1) * vector->item_size);

	vector->size--;
	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0xc(%rdi), %ebp
movl %esi, %ebx
cmpl %esi, %ebp
jbe 0x11497
movl 0x10(%rdi), %ecx
movq (%rdi), %rax
movl %ebx, %edx
leal 0x1(%rbx), %esi
movq %rdi, %r14
notl %edx
addl %ebp, %edx
movl %ecx, %edi
imull %ecx, %esi
imull %ecx, %edx
imull %ebx, %edi
addq %rax, %rsi
addq %rax, %rdi
callq 0x8850
decl 0xc(%r14)
cmpl %ebx, %ebp
seta %al
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/crypt_blowfish.c
// Function: crypt_gensalt_blowfish_rn
char *_crypt_gensalt_blowfish_rn(const char *prefix, unsigned long count,
	const char *input, int size, char *output, int output_size)
{
	if (size < 16 || output_size < 7 + 22 + 1 ||
	    (count && (count < 4 || count > 31)) ||
	    prefix[0] != '$' || prefix[1] != '2' ||
	    (prefix[2] != 'a' && prefix[2] != 'y')) {
		if (output_size > 0) output[0] = '\0';
		__set_errno((output_size < 7 + 22 + 1) ? ERANGE : EINVAL);
		return NULL;
	}

	if (!count) count = 5;

	output[0] = '$';
	output[1] = '2';
	output[2] = prefix[2];
	output[3] = '$';
	output[4] = '0' + (char)(count / 10);
	output[5] = '0' + (char)(count % 10);
	output[6] = '$';

	BF_encode(&output[7], (const BF_word *)input, 16);
	output[7 + 22] = '\0';

	return output;
}

// Assembly:
pushq %rbx
cmpl $0x10, %ecx
movq %r8, %rbx
setl %al
cmpl $0x1e, %r9d
setl %cl
orb %al, %cl
je 0x13753
testl %r9d, %r9d
jg 0x137da
jmp 0x137dd
testq %rsi, %rsi
leaq -0x20(%rsi), %rcx
setne %al
cmpq $-0x1c, %rcx
setb %cl
testb %cl, %al
jne 0x137da
cmpb $0x24, (%rdi)
jne 0x137da
cmpb $0x32, 0x1(%rdi)
jne 0x137da
movzbl 0x2(%rdi), %eax
cmpl $0x61, %eax
je 0x13781
cmpl $0x79, %eax
jne 0x137da
testq %rsi, %rsi
movl $0x5, %ecx
movw $0x3224, (%rbx)         # imm = 0x3224
cmovnel %esi, %ecx
movb 0x2(%rdi), %al
movzbl %cl, %ecx
imull $0xcd, %ecx, %esi
shrl $0xb, %esi
movl %esi, %edi
addl %esi, %esi
movb %al, 0x2(%rbx)
movb $0x24, %al
leal (%rsi,%rsi,4), %esi
orb $0x30, %dil
movb %al, 0x3(%rbx)
subb %sil, %cl
movb %dil, 0x4(%rbx)
movq %rdx, %rsi
leaq 0x7(%rbx), %rdi
movl $0x10, %edx
orb $0x30, %cl
movb %cl, 0x5(%rbx)
movb %al, 0x6(%rbx)
callq 0x137fc
movb $0x0, 0x1d(%rbx)
jmp 0x137f7
movb $0x0, (%rbx)
cmpl $0x1e, %r9d
movl $0x22, %eax
movl $0x16, %ebx
cmovll %eax, %ebx
callq 0x8150
movl %ebx, (%rax)
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/crypt_blowfish.c
// Function: BF_encode
static void BF_encode(char *dst, const BF_word *src, int size)
{
	const unsigned char *sptr = (const unsigned char *)src;
	const unsigned char *end = sptr + size;
	unsigned char *dptr = (unsigned char *)dst;
	unsigned int c1, c2;

	do {
		c1 = *sptr++;
		*dptr++ = BF_itoa64[c1 >> 2];
		c1 = (c1 & 0x03) << 4;
		if (sptr >= end) {
			*dptr++ = BF_itoa64[c1];
			break;
		}

		c2 = *sptr++;
		c1 |= c2 >> 4;
		*dptr++ = BF_itoa64[c1];
		c1 = (c2 & 0x0f) << 2;
		if (sptr >= end) {
			*dptr++ = BF_itoa64[c1];
			break;
		}

		c2 = *sptr++;
		c1 |= c2 >> 6;
		*dptr++ = BF_itoa64[c1];
		*dptr++ = BF_itoa64[c2 & 0x3f];
	} while (sptr < end);
}

// Assembly:
movl %edx, %ecx
incq %rdi
leaq 0x5d78(%rip), %rax      # 0x19580
addq %rsi, %rcx
movzbl (%rsi), %r8d
incq %rsi
movl %r8d, %edx
shll $0x4, %r8d
shrl $0x2, %edx
andl $0x30, %r8d
cmpq %rcx, %rsi
movb (%rdx,%rax), %dl
movb %dl, -0x1(%rdi)
jae 0x1387a
movzbl (%rsi), %edx
incq %rsi
movl %edx, %r9d
shll $0x2, %edx
shrl $0x4, %r9d
andl $0x3c, %edx
orq %r8, %r9
cmpq %rcx, %rsi
movb (%r9,%rax), %r8b
movb %r8b, (%rdi)
jae 0x1387f
movzbl (%rsi), %r8d
incq %rsi
movl %r8d, %r9d
andl $0x3f, %r8d
shrl $0x6, %r9d
orq %rdx, %r9
movb (%r9,%rax), %dl
movb %dl, 0x1(%rdi)
movb (%r8,%rax), %dl
movb %dl, 0x2(%rdi)
addq $0x4, %rdi
cmpq %rcx, %rsi
jb 0x1380b
retq
movl %r8d, %edx
jmp 0x13882
incq %rdi
movl %edx, %ecx
movb (%rcx,%rax), %al
movb %al, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/crypt_blowfish.c
// Function: BF_decode
static int BF_decode(BF_word *dst, const char *src, int size)
{
	unsigned char *dptr = (unsigned char *)dst;
	unsigned char *end = dptr + size;
	const unsigned char *sptr = (const unsigned char *)src;
	unsigned int tmp, c1, c2, c3, c4;

	do {
		BF_safe_atoi64(c1, *sptr++);
		BF_safe_atoi64(c2, *sptr++);
		*dptr++ = (c1 << 2) | ((c2 & 0x30) >> 4);
		if (dptr >= end) break;

		BF_safe_atoi64(c3, *sptr++);
		*dptr++ = ((c2 & 0x0F) << 4) | ((c3 & 0x3C) >> 2);
		if (dptr >= end) break;

		BF_safe_atoi64(c4, *sptr++);
		*dptr++ = ((c3 & 0x03) << 6) | c4;
	} while (dptr < end);

	return 0;
}

// Assembly:
movzbl (%rsi), %r8d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addl $-0x20, %r8d
cmpl $0x5f, %r8d
jbe 0x1389e
retq
addq $0x4, %rsi
xorl %ecx, %ecx
leaq 0x5c75(%rip), %rdx      # 0x19520
movl %r8d, %r8d
movb (%r8,%rdx), %r9b
cmpb $0x3f, %r9b
ja 0x1389d
movzbl -0x3(%rsi), %r8d
addl $-0x20, %r8d
cmpl $0x5f, %r8d
ja 0x1389d
movl %r8d, %r8d
movb (%r8,%rdx), %r8b
cmpb $0x3f, %r8b
ja 0x1389d
movl %r8d, %r10d
shlb $0x2, %r9b
shrb $0x4, %r10b
orb %r9b, %r10b
cmpq $0xe, %rcx
movb %r10b, (%rdi,%rcx)
ja 0x1396a
movzbl -0x2(%rsi), %r9d
addl $-0x20, %r9d
cmpl $0x5f, %r9d
ja 0x1389d
movl %r9d, %r9d
movb (%r9,%rdx), %r9b
cmpb $0x3f, %r9b
ja 0x1389d
movl %r9d, %r10d
shlb $0x4, %r8b
shrb $0x2, %r10b
orb %r8b, %r10b
movb %r10b, 0x1(%rdi,%rcx)
movzbl -0x1(%rsi), %r8d
addl $-0x20, %r8d
cmpl $0x5f, %r8d
ja 0x1389d
movl %r8d, %r8d
movb (%r8,%rdx), %r8b
cmpb $0x3f, %r8b
ja 0x1389d
shlb $0x6, %r9b
orb %r9b, %r8b
movb %r8b, 0x2(%rdi,%rcx)
addq $0x3, %rcx
movzbl (%rsi), %r8d
addq $0x4, %rsi
addl $-0x20, %r8d
cmpl $0x60, %r8d
jb 0x138ab
jmp 0x1389d
xorl %eax, %eax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/ssl_util.c
// Function: as_apr_array_push
static void * as_apr_array_push(apr_array_header_t * arr)
{
	// If we don't have enough space double up.
	if (arr->nelts == arr->nalloc) {
		if (arr->nalloc == 0) {
			arr->nalloc = 16;
		} else {
			arr->nalloc *= 2;
		}
		size_t newsz = arr->nalloc * arr->elt_size;
		arr->elts = cf_realloc(arr->elts, newsz);
	}

	// Point to the first unused location.
	void * ptr = arr->elts + (arr->nelts * arr->elt_size);

	// We'll have one more element now.
	++arr->nelts;
	
    return ptr;
}

// Assembly:
pushq %rbx
movl 0xc(%rdi), %edx
movq %rdi, %rbx
cmpl 0x10(%rdi), %edx
jne 0x13d96
leal (%rdx,%rdx), %eax
testl %edx, %edx
movl $0x10, %ecx
cmovnel %eax, %ecx
movl %ecx, 0x10(%rbx)
movslq %ecx, %rsi
movslq 0x8(%rbx), %rax
movq 0x18(%rbx), %rdi
imulq %rax, %rsi
callq 0x8510
movq %rax, 0x18(%rbx)
movl 0xc(%rbx), %edx
jmp 0x13d9a
movq 0x18(%rbx), %rax
movslq 0x8(%rbx), %rcx
movslq %edx, %rdx
imulq %rdx, %rcx
incl %edx
addq %rax, %rcx
movl %edx, 0xc(%rbx)
movq %rcx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/aerospike/ssl_util.c
// Function: asn1_string_to_utf8
static char *asn1_string_to_utf8(apr_pool_t *p, ASN1_STRING *asn1str)
{
    char *result = NULL;
    BIO *bio;
    int len;

    if ((bio = BIO_new(BIO_s_mem())) == NULL)
        return NULL;

    ASN1_STRING_print_ex(bio, asn1str, ASN1_STRFLGS_ESC_CTRL|
                                       ASN1_STRFLGS_UTF8_CONVERT);
    len = BIO_pending(bio);
    if (len > 0) {
		result = cf_malloc(len+1);
        len = BIO_read(bio, result, len);
        result[len] = NUL;
    }
    BIO_free(bio);
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x8ab0
movq %rax, %rdi
callq 0x86e0
testq %rax, %rax
je 0x13e27
movl $0x12, %edx
movq %rax, %rdi
movq %r14, %rsi
movq %rax, %rbx
callq 0x8350
movq %rbx, %rdi
movl $0xa, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r14d, %r14d
callq 0x86f0
movq %rax, %r15
testl %r15d, %r15d
jle 0x13e1d
movl %r15d, %edi
incl %edi
callq 0x8080
movq %rbx, %rdi
movq %rax, %rsi
movl %r15d, %edx
movq %rax, %r14
callq 0x8240
cltq
movb $0x0, (%r14,%rax)
movq %rbx, %rdi
callq 0x8720
jmp 0x13e2a
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/citrusleaf/cf_alloc.c
// Function: cf_rc_releaseandfree
uint32_t
cf_rc_releaseandfree(void* addr)
{
	cf_rc_hdr* head = (cf_rc_hdr*)addr - 1;
	uint32_t rc = as_aaf_uint32_rls(&head->count, -1);

	if (rc == 0) {
		free(head);
	}

	return rc;
}

// Assembly:
pushq %rbx
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
lock
xaddl %ebx, -0x8(%rdi)
decl %ebx
jne 0x13eb1
addq $-0x8, %rdi
callq 0x80f0
movl %ebx, %eax
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/aerospike[P]aerospike-common/src/main/citrusleaf/cf_b64.c
// Function: cf_b64_encode
void
cf_b64_encode(const uint8_t* in, uint32_t in_size, char* out)
{
	int i = 0;
	int j = 0;

	while (in_size >= 3) {
		uint8_t i0 = in[i];
		uint8_t i1 = in[i + 1];
		uint8_t i2 = in[i + 2];

		out[j]     = EA[ (i0 & 0xfc) >> 2];
		out[j + 1] = EA[((i0 & 0x03) << 4) + ((i1 & 0xf0) >> 4)];
		out[j + 2] = EA[((i1 & 0x0f) << 2) + ((i2 & 0xc0) >> 6)];
		out[j + 3] = EA[  i2 & 0x3f];

		i += 3;
		j += 4;

		in_size -= 3;
	}

	if (in_size == 1) {
		uint8_t i0 = in[i];

		out[j]     = EA[(i0 & 0xfc) >> 2];
		out[j + 1] = EA[(i0 & 0x03) << 4];
		out[j + 2] = '=';
		out[j + 3] = '=';
	}
	else if (in_size == 2) {
		uint8_t i0 = in[i];
		uint8_t i1 = in[i + 1];

		out[j]     = EA[ (i0 & 0xfc) >> 2];
		out[j + 1] = EA[((i0 & 0x03) << 4) + ((i1 & 0xf0) >> 4)];
		out[j + 2] = EA[ (i1 & 0x0f) << 2];
		out[j + 3] = '=';
	}
}

// Assembly:
cmpl $0x3, %esi
jb 0x13f3b
pushq %rbx
xorl %eax, %eax
leaq 0x5799(%rip), %r8       # 0x19660
xorl %ecx, %ecx
movzbl (%rdi,%rcx), %r9d
movzbl 0x1(%rdi,%rcx), %r10d
movzbl 0x2(%rdi,%rcx), %r11d
addl $-0x3, %esi
addq $0x3, %rcx
movl %r9d, %ebx
shll $0x4, %r9d
shrl $0x2, %ebx
andl $0x30, %r9d
movb (%rbx,%r8), %bl
movb %bl, (%rdx,%rax)
movl %r10d, %ebx
andl $0xf, %r10d
shrl $0x4, %ebx
orl %r9d, %ebx
movb (%rbx,%r8), %r9b
movb %r9b, 0x1(%rdx,%rax)
movl %r11d, %r9d
andl $0x3f, %r11d
shrl $0x6, %r9d
leal (%r9,%r10,4), %r9d
movb (%r9,%r8), %r9b
movb %r9b, 0x2(%rdx,%rax)
movb (%r11,%r8), %r9b
movb %r9b, 0x3(%rdx,%rax)
addq $0x4, %rax
cmpl $0x2, %esi
ja 0x13ec9
movl %ecx, %ecx
popq %rbx
jmp 0x13f3f
xorl %eax, %eax
xorl %ecx, %ecx
cmpl $0x2, %esi
movl %eax, %eax
je 0x13f74
cmpl $0x1, %esi
jne 0x13fb7
movzbl (%rdi,%rcx), %ecx
leaq 0x570a(%rip), %rdi      # 0x19660
movl %ecx, %esi
shll $0x4, %ecx
shrl $0x2, %esi
andl $0x30, %ecx
movb (%rsi,%rdi), %sil
movb %sil, (%rdx,%rax)
movb (%rcx,%rdi), %cl
movb %cl, 0x1(%rdx,%rax)
movb $0x3d, %cl
jmp 0x13fae
movzbl (%rdi,%rcx), %esi
movzbl 0x1(%rdi,%rcx), %ecx
leaq 0x56dc(%rip), %r8       # 0x19660
movl %esi, %edi
shll $0x4, %esi
shrl $0x2, %edi
andl $0x30, %esi
movb (%rdi,%r8), %dil
movb %dil, (%rdx,%rax)
movl %ecx, %edi
andl $0xf, %ecx
shrl $0x4, %edi
orl %esi, %edi
movb (%rdi,%r8), %sil
movb %sil, 0x1(%rdx,%rax)
movb (%r8,%rcx,4), %cl
movb %cl, 0x2(%rdx,%rax)
movb $0x3d, 0x3(%rdx,%rax)
retq