LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/aerospike/as_queue.c
// Function: as_queue_destroy
void
as_queue_destroy(as_queue* queue)
{
	if (queue->flags & ITEMS_ON_HEAP) {
		cf_free(queue->data);
		
		if (queue->flags & ALL_ON_HEAP) {
			cf_free(queue);
		}
	}
}

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

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

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x8(%rdi), %ecx
leal (%rcx,%rcx), %ebp
testb $0x1, 0x1c(%rdi)
jne 0xfe05
xorl %r14d, %r14d
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0xffa1
testb %al, %al
je 0xfe4c
orb $0x1, 0x1c(%rbx)
jmp 0xfe49
movl 0xc(%rbx), %eax
xorl %edx, %edx
divl %ecx
testl %edx, %edx
je 0xfe23
movq %rbx, %rdi
movl %ebp, %esi
movl $0x1, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0xffa1
movq (%rbx), %rdi
movl 0x14(%rbx), %esi
imull %ebp, %esi
callq 0x8510
movq %rax, (%rbx)
testq %rax, %rax
je 0xfe54
movl $0x0, 0xc(%rbx)
movl 0x8(%rbx), %eax
movl %eax, 0x10(%rbx)
movl %ebp, 0x8(%rbx)
movb $0x1, %r14b
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
xorl %r14d, %r14d
jmp 0xfe4c
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/aerospike/as_queue.c
// Function: as_queue_push_limit
bool
as_queue_push_limit(as_queue* queue, const void* ptr)
{
	if (as_queue_size(queue) >= queue->capacity) {
		return false;
	}

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

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

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

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x10(%rdi), %eax
subl 0xc(%rdi), %eax
cmpl 0x8(%rdi), %eax
jne 0xfed4
movq %rbx, %rdi
callq 0xfdd9
testb %al, %al
je 0xff27
cmpl $0x0, 0xc(%rbx)
jne 0xfee3
movl 0x8(%rbx), %eax
movl %eax, 0xc(%rbx)
addl %eax, 0x10(%rbx)
movl 0xc(%rbx), %eax
movl 0x14(%rbx), %ecx
decl %eax
movl %eax, 0xc(%rbx)
xorl %edx, %edx
divl 0x8(%rbx)
movl %edx, %edi
imull %ecx, %edi
addq (%rbx), %rdi
movq %r14, %rsi
movq %rcx, %rdx
callq 0x85c0
movl 0x10(%rbx), %esi
movb $0x1, %cl
cmpl $0x40000000, %esi       # imm = 0x40000000
jb 0xff29
movl 0xc(%rbx), %eax
subl %eax, %esi
xorl %edx, %edx
divl 0x8(%rbx)
movl %edx, 0xc(%rbx)
addl %edx, %esi
movl %esi, 0x10(%rbx)
jmp 0xff29
xorl %ecx, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/aerospike/as_queue.c
// Function: as_queue_push_head_limit
bool
as_queue_push_head_limit(as_queue *queue, const void* ptr)
{
	if (as_queue_size(queue) >= queue->capacity) {
		return false;
	}

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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %r14
movl 0x14(%rdi), %edi
imull %esi, %edi
callq 0x8080
movq %rax, %r15
testq %rax, %rax
je 0x10028
movl 0x8(%r14), %r12d
movl 0xc(%r14), %eax
xorl %edx, %edx
divl %r12d
subl %edx, %r12d
movl 0x14(%r14), %esi
imull %esi, %r12d
imull %edx, %esi
addq (%r14), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x85c0
leaq (%r15,%r12), %rdi
movq (%r14), %rsi
movl 0x14(%r14), %edx
imull 0x8(%r14), %edx
subq %r12, %rdx
callq 0x85c0
testb %bpl, %bpl
je 0x10011
movq (%r14), %rdi
callq 0x8940
movq %r15, (%r14)
movl $0x0, 0xc(%r14)
movl 0x8(%r14), %eax
movl %eax, 0x10(%r14)
movl %ebx, 0x8(%r14)
testq %r15, %r15
setne %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x10079
leaq 0x20(%rbx), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x8a90
testl %eax, %eax
jne 0x10071
leaq 0x48(%rbx), %rdi
xorl %esi, %esi
callq 0x85f0
testl %eax, %eax
je 0x10083
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 0x1007b
// File: /workspace/github_c_makefile_star2_O1/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 %esi, %ebp
movl %edi, %r14d
movl $0x78, %edi
callq 0x8080
testq %rax, %rax
je 0x100c4
movq %rax, %rbx
movq %rax, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x80c0
testb %al, %al
je 0x100bc
movl $0x3, 0x1c(%rbx)
jmp 0x100c6
movq %rbx, %rdi
callq 0x8940
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x20(%rdi), %rbx
movq %rbx, %rdi
callq 0x8ad0
movq %r14, %rdi
movl %ebp, %esi
callq 0x10153
movl 0xc(%r14), %ebp
movl 0x10(%r14), %r12d
cmpl %ebp, %r12d
je 0x10139
movl %ebp, %eax
xorl %edx, %edx
divl 0x8(%r14)
movl 0x14(%r14), %eax
imull %eax, %edx
addq (%r14), %rdx
movq %r15, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x85c0
movl 0xc(%r14), %eax
incl %eax
movl %eax, 0xc(%r14)
cmpl 0x10(%r14), %eax
jne 0x10139
movq $0x0, 0xc(%r14)
cmpl %ebp, %r12d
setne %bpl
movq %rbx, %rdi
callq 0x8630
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1021f
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x10(%rdi), %eax
cmpl 0xc(%rdi), %eax
jne 0x10215
movl %esi, %ebp
cmpl $-0x1, %esi
je 0x101fa
leaq 0x8(%rsp), %r14
xorl %edi, %edi
movq %r14, %rsi
callq 0x81d0
movslq %ebp, %rax
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x26, %rax
addl %ecx, %eax
movslq %eax, %rcx
movq (%r14), %rax
addq %rcx, %rax
movq %rax, (%r14)
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
subl %ecx, %ebp
imull $0xf4240, %ebp, %ecx    # imm = 0xF4240
movslq %ecx, %rcx
addq 0x8(%r14), %rcx
movq %rcx, 0x8(%r14)
cmpq $0x3b9aca01, %rcx       # imm = 0x3B9ACA01
jl 0x101e3
addq $-0x3b9aca00, %rcx      # imm = 0xC4653600
movq %rcx, 0x10(%rsp)
incq %rax
movq %rax, 0x8(%rsp)
leaq 0x48(%rbx), %rdi
addq $0x20, %rbx
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x88c0
jmp 0x10215
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 0x10202
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x20(%rdi), %rbx
movq %rbx, %rdi
callq 0x8ad0
movq %r14, %rdi
movl %ebp, %esi
callq 0x10153
movl 0xc(%r14), %ebp
movl 0x10(%r14), %r12d
cmpl %ebp, %r12d
je 0x1028c
leal -0x1(%r12), %eax
movl %eax, 0x10(%r14)
xorl %edx, %edx
divl 0x8(%r14)
movl 0x14(%r14), %eax
imull %eax, %edx
addq (%r14), %rdx
movq %r15, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x85c0
movl 0xc(%r14), %eax
cmpl 0x10(%r14), %eax
jne 0x1028c
movq $0x0, 0xc(%r14)
cmpl %ebp, %r12d
setne %bpl
movq %rbx, %rdi
callq 0x8630
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0xfc9c(%rip), %rdi      # 0x1ff68
callq 0x84c0
movq %rax, %rbx
cmpb $0x0, 0x10(%rax)
jne 0x102f2
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_O1/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 0x10306
movq %rsi, %rcx
jmp 0x10348
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
movq %rdx, (%rdi)
movq %rcx, %r8
shlq $0x17, %r8
xorq %rcx, %r8
movq %rdx, %rcx
shrq $0x5, %rcx
xorq %rdx, %rcx
xorq %r8, %rcx
shrq $0x12, %r8
xorq %rcx, %r8
movq %r8, 0x8(%rdi)
addq %rdx, %r8
movq %r8, (%rsi)
leaq 0x8(%rsi), %rcx
addq $0x10, %rsi
cmpq %rax, %rsi
movq %rcx, %rsi
jbe 0x10306
cmpq %rax, %rcx
jae 0x10399
movq (%rdi), %rdx
movq 0x8(%rdi), %rsi
movq %rsi, (%rdi)
movq %rdx, %r8
shlq $0x17, %r8
xorq %rdx, %r8
movq %rsi, %rdx
shrq $0x5, %rdx
xorq %rsi, %rdx
xorq %r8, %rdx
shrq $0x12, %r8
xorq %rdx, %r8
movq %r8, 0x8(%rdi)
addq %rsi, %r8
movq %r8, -0x8(%rsp)
xorl %edx, %edx
movb -0x8(%rsp,%rdx), %sil
leaq 0x1(%rcx,%rdx), %rdi
movb %sil, -0x1(%rdi)
incq %rdx
cmpq %rax, %rdi
jb 0x10383
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl %ebp, %eax
je 0x103f3
leaq 0x7ffc(%rip), %rcx      # 0x183b0
movq %rax, %rdx
movq %rbx, %rsi
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 0x103ba
movb $0x0, (%rbx,%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x1041e
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_O1/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 0x1051c
movw $0x1, 0xc(%rax)
movl $0x1, 0x8(%rax)
movq $0x0, (%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x10553
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x10544
callq 0x84b0
movq $0x0, (%rbx)
cmpb $0x1, 0xc(%rbx)
jne 0x10553
movq %rbx, %rdi
popq %rbx
jmp 0x8940
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1057c
movw $0x1, 0xc(%rax)
movl $0x1, 0x8(%rax)
movq $0x0, (%rax)
movb $0x1, 0xd(%rax)
movq %rbx, (%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x105ac
movw $0x1, 0xc(%rax)
movl $0x1, 0x8(%rax)
movq $0x0, (%rax)
movb $0x0, 0xd(%rax)
movq %rbx, (%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/aerospike/as_result.c
// Function: as_success_init
as_result * as_success_init(as_result *r, as_val *v) {
    as_result_init(r);
    r->is_success = true;
    r->value = v;
    return(r);
}

// Assembly:
movq %rdi, %rax
movw $0x100, 0xc(%rdi)       # imm = 0x100
movl $0x1, 0x8(%rdi)
movq %rsi, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/aerospike/as_result.c
// Function: as_failure_init
as_result * as_failure_init(as_result *r, as_val *v) {
    as_result_init(r);
    r->is_success = false;
    r->value = v;
    return(r);
}

// Assembly:
movq %rdi, %rax
movw $0x0, 0xc(%rdi)
movl $0x1, 0x8(%rdi)
movq %rsi, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x105f8
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_O1/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 %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x10621
callq 0x84b0
movq %r14, (%rbx)
movb $0x0, 0xd(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/aerospike/as_string.c
// Function: as_string_len
size_t as_string_len(as_string * string)
{
	if (string->value == NULL) {
		return 0;
	}
	if (string->len == SIZE_MAX) {
		string->len = strlen(string->value);
	}
	return string->len;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x10797
cmpq $-0x1, 0x18(%rbx)
jne 0x10791
callq 0x8260
movq %rax, 0x18(%rbx)
movq 0x18(%rbx), %rax
jmp 0x10799
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/aerospike/as_string.c
// Function: as_basename
const char* as_basename(as_string * filename, const char* path)
{
	if (path == 0 || *path == 0) {
		// Found empty string.  Return current directory constant.
		char* value = ".";
		as_string_cons(filename, false, value, 1, false);
		return value;
	}

	const char* p = path;
	const char* begin = 0;

	// Skip till end of string.
	while (*p) {
		if (as_is_file_separator(*p)) {
			begin = p + 1;
		}
		p++;
	}

	if (begin == 0) {
		// No slashes found.  Return original string.
		as_string_cons(filename, false, (char*)path, p - path, false);
		return path;
	}

	if (begin == p) {
		// Found trailing slashes.
		// Create new string to hold filename without slashes.
		p--;

		while (as_is_file_separator(*p)) {
			if (p == path) {
				// String contains all slashes. Return slash constant.
				char* value = "/";
				as_string_cons(filename, false, value, 1, false);
				return value;
			}
			p--;
		}
		const char* end = p;

		while (p != path && !as_is_file_separator(*p)) {
			p--;
		}

		if (as_is_file_separator(*p)) {
			p++;
		}

		size_t len = (end - p) + 1;
		char* str = cf_malloc(len + 1);
		memcpy(str, p, len);
		*(str + len) = 0;
		as_string_cons(filename, false, str, len, true);
		return str;
	}

	// Return begin of filename.
	as_string_cons(filename, false, (char*)begin, p - begin, false);
	return begin;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
testq %rsi, %rsi
je 0x107de
movq %rsi, %r15
cmpb $0x0, (%rsi)
je 0x107de
movb (%r15), %cl
testb %cl, %cl
je 0x10816
leaq 0x1(%r15), %r14
xorl %eax, %eax
cmpb $0x5c, %cl
cmoveq %r14, %rax
cmpb $0x2f, %cl
cmoveq %r14, %rax
movb (%r14), %cl
incq %r14
testb %cl, %cl
jne 0x107c1
decq %r14
jmp 0x1081b
leaq 0x7c12(%rip), %r15      # 0x183f7
testq %rbx, %rbx
je 0x10809
movl $0x1, %r14d
xorl %ecx, %ecx
movw $0x4, 0x4(%rbx)
movl $0x1, (%rbx)
movb %cl, 0x8(%rbx)
movq %r15, 0x10(%rbx)
movq %r14, 0x18(%rbx)
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
xorl %eax, %eax
movq %r15, %r14
testq %rax, %rax
je 0x10834
cmpq %r14, %rax
je 0x1083e
testq %rbx, %rbx
je 0x1080c
subq %rax, %r14
xorl %ecx, %ecx
movq %rax, %r15
jmp 0x107f2
testq %rbx, %rbx
je 0x10809
subq %r15, %r14
jmp 0x107f0
leaq -0x1(%r14), %rax
movq %r14, %r13
negq %r14
movzbl (%rax), %ecx
cmpl $0x2f, %ecx
je 0x10855
cmpl $0x5c, %ecx
jne 0x10870
incq %r14
decq %r13
cmpq %r15, %rax
leaq -0x1(%rax), %rax
jne 0x10848
leaq 0x7b8e(%rip), %r15      # 0x183f9
jmp 0x107e5
cmpq %r15, %rax
je 0x1088d
movzbl (%rax), %ecx
cmpl $0x2f, %ecx
je 0x1088d
cmpl $0x5c, %ecx
je 0x1088d
decq %rax
cmpq %r15, %rax
jne 0x10875
movq %r15, %rax
movb (%rax), %cl
cmpb $0x2f, %cl
sete %dl
cmpb $0x5c, %cl
sete %cl
orb %dl, %cl
movzbl %cl, %r12d
addq %rax, %r12
addq %r12, %r14
movl $0x1, %edi
subq %r14, %rdi
negq %r14
callq 0x8080
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x85c0
movq %r15, %rax
subq %r12, %rax
movb $0x0, (%rax,%r13)
movb $0x1, %cl
testq %rbx, %rbx
movq %r15, %rax
jne 0x107f2
jmp 0x1080c
// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/aerospike/as_string.c
// Function: as_string_val_destroy
void as_string_val_destroy(as_val * v)
{
	as_string * string = as_string_fromval(v);
	if ( !string ) return;

	if ( string->value && string->free ) {
		cf_free(string->value);
	}
	
	string->value = NULL;
	string->free = false;
}

// Assembly:
pushq %rbx
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x108f6
cmpb $0x4, 0x4(%rdi)
cmoveq %rdi, %rbx
testq %rbx, %rbx
je 0x1091b
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x1090f
cmpb $0x1, 0x8(%rbx)
jne 0x1090f
callq 0x8940
movq $0x0, 0x10(%rbx)
movb $0x0, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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
xorl %ecx, %ecx
testq %rdi, %rdi
je 0x1092e
cmpb $0x4, 0x4(%rdi)
cmoveq %rdi, %rcx
testq %rcx, %rcx
je 0x1095b
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
je 0x1095b
movb (%rcx), %dl
testb %dl, %dl
je 0x1095b
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 0x10947
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x109af
cmpq $-0x1, 0x18(%rbx)
jne 0x1097d
callq 0x8260
movq %rax, 0x18(%rbx)
movq 0x18(%rbx), %r15
leaq 0x3(%r15), %rdi
callq 0x8080
movq %rax, %r14
testq %rax, %rax
je 0x109b2
movb $0x22, (%r14)
movq %r14, %rdi
incq %rdi
movq 0x10(%rbx), %rsi
callq 0x8180
movw $0x22, 0x1(%r14,%r15)
jmp 0x109b2
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x109f8
movb (%rsi), %al
testb %al, %al
sete %r8b
je 0x109f8
decl %edx
xorl %ecx, %ecx
testl %edx, %edx
cmovgl %edx, %ecx
jle 0x109ee
incq %rsi
movb %al, (%rdi)
incq %rdi
movb (%rsi), %al
testb %al, %al
sete %r8b
je 0x109f8
incq %rsi
decl %ecx
jne 0x109d8
movb $0x0, (%rdi)
movb $0x1, %al
testb %r8b, %r8b
je 0x109fd
movb $0x0, (%rdi)
xorl %eax, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movl %esi, %edi
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_O1/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 0x10a77
movl 0xc(%rdi), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0xc(%rdi)
cmpl 0x8(%rdi), %edx
jae 0x10a7d
movb (%rsi), %cl
movb %cl, (%rax)
incq %rax
cmpb $0x0, 0x1(%rsi)
leaq 0x1(%rsi), %rsi
jne 0x10a58
movb $0x0, (%rax)
movb $0x1, %al
retq
movl %ecx, 0xc(%rdi)
cmpb $0x1, 0x10(%rdi)
je 0x10a8c
movb $0x0, (%rax)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x8260
movq %rax, %r14
movl 0xc(%rbx), %eax
leal 0x1(%r14,%rax), %esi
movq %rbx, %rdi
callq 0x10cb0
movl %eax, %ebp
testb %al, %al
je 0x10adb
movl 0xc(%rbx), %edi
addq (%rbx), %rdi
movl %r14d, %edx
movq %r15, %rsi
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_O1/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 0x10b0a
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 0x10b2a
pushq %rax
leaq 0x6(%rsp), %rax
movb %sil, (%rax)
movb $0x0, 0x1(%rax)
movq %rax, %rsi
callq 0x10a8c
addq $0x8, %rsp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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
movq %rdi, %rbx
movl 0x8(%rdi), %ebp
addl %ebp, %ebp
cmpl %esi, %ebp
cmovbel %esi, %ebp
cmpb $0x1, 0x11(%rdi)
jne 0x10cde
movq (%rbx), %rdi
movl %ebp, %esi
callq 0x8510
testq %rax, %rax
je 0x10d11
movq %rax, (%rbx)
movl %ebp, 0x8(%rbx)
jmp 0x10d0d
movl %ebp, %edi
callq 0x8080
testq %rax, %rax
je 0x10d11
movq %rax, %r14
movq (%rbx), %rsi
movl 0xc(%rbx), %edx
movq %rax, %rdi
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 0x10d13
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x75f3(%rip), %rsi      # 0x18405
movq %rax, %rdi
callq 0x82d0
movq 0x8(%rbx), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x87c0
testl %eax, %eax
sete %cl
movq (%r14), %rax
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x10e70
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 0x10e70
movq 0x8(%rsp), %rax
testq %rax, %rax
jne 0x10e4a
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x10e7b
callq *%rax
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl %esi, %r15d
je 0x10ebf
movl $0x8, %esi
movq %r15, %rdi
callq 0x88b0
movq %rax, (%r14)
movl $0x10, %edi
movl $0x1, %esi
callq 0x8780
movq %rax, 0x8(%r14)
jmp 0x10ec8
xorl %eax, %eax
movq %rax, 0x8(%r14)
movq %rax, (%r14)
movq $0x0, 0x10(%r14)
movl $0x0, 0x18(%r14)
testl %ebx, %ebx
je 0x10f0e
shlq $0x3, %r15
xorl %r13d, %r13d
movq 0xf0ee(%rip), %r12      # 0x1ffd8
movq (%r14), %rdi
addq %r13, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r14, %rcx
callq 0x8830
testl %eax, %eax
jne 0x10f05
incl 0x18(%r14)
addq $0x8, %r13
cmpq %r13, %r15
jne 0x10eea
xorl %eax, %eax
cmpl %ebx, 0x18(%r14)
sete %al
leal -0x3(%rax,%rax,2), %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x10f57
subq $0x18, %rsp
leaq 0x8(%rsp), %rax
movq %rsi, (%rax)
movq %rdx, 0x8(%rax)
movq 0x8(%rdi), %rdi
movq %rax, %rsi
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_O1/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 0x10fbe
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, (%r14)
movl %ebp, %r15d
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x8270
decl %r15d
jne 0x10f80
movl %ebp, %r14d
xorl %r15d, %r15d
movq (%rbx), %rax
movq (%rax,%r15,8), %rdi
xorl %esi, %esi
callq 0x8a30
incq %r15
cmpq %r15, %r14
jne 0x10f97
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
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x10fdc
movq %rsi, 0x8(%rax)
movq %rdx, 0x10(%rax)
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rsi, %rbx
movq %rdi, %r14
movl $0x18, %edi
callq 0x8080
testq %rax, %rax
je 0x10ffe
movq %r14, 0x8(%rax)
movq %rbx, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %ebp
testq %rdi, %rdi
je 0x1102e
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x1102e
movq (%rax), %rax
testq %rax, %rax
je 0x1102e
movq %rbx, %rdi
callq *%rax
movl %eax, %ebp
testl %ebp, %ebp
jne 0x1103f
cmpb $0x1, (%rbx)
jne 0x1103f
movq %rbx, %rdi
callq 0x8940
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movq %rdi, %rbx
testq %rdi, %rdi
je 0x110ca
cmpl $0x0, (%rbx)
je 0x110ca
lock
decl (%rbx)
jne 0x110ca
movzbl 0x4(%rbx), %eax
leaq 0xeb6c(%rip), %rcx      # 0x1fc20
movq %rbx, %rdi
callq *(%rcx,%rax,8)
cmpb $0x1, 0x5(%rbx)
jne 0x110c8
movq %rbx, %rdi
callq 0x8940
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x11112
movzbl 0x4(%rdi), %eax
cmpl $0x3, %eax
je 0x11115
cmpl $0x2, %eax
jne 0x11112
movb 0x8(%rdi), %al
retq
xorl %eax, %eax
retq
cmpq $0x0, 0x8(%rdi)
setne %al
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movl %edx, %edi
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_O1/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 %esi, %ebx
movl %edi, %ebp
movl $0x18, %edi
callq 0x8080
movq %rax, %r14
movl %ebx, %edi
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_O1/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 0x111bf
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x8940
testb $0x2, 0x14(%rbx)
jne 0x111c1
popq %rbx
retq
movq %rbx, %rdi
popq %rbx
jmp 0x8940
// File: /workspace/github_c_makefile_star2_O1/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
movq %rdi, %rbx
movl 0x8(%rdi), %r14d
addl %r14d, %r14d
testb $0x1, 0x14(%rdi)
jne 0x1120d
movl 0x10(%rbx), %edi
imull %r14d, %edi
callq 0x8080
movq %rax, %r15
movq (%rbx), %rsi
movl 0x10(%rbx), %edx
imull 0x8(%rbx), %edx
movq %rax, %rdi
callq 0x85c0
movq %r15, (%rbx)
movl %r14d, 0x8(%rbx)
orb $0x1, 0x14(%rbx)
jmp 0x11224
movl %r14d, 0x8(%rbx)
movq (%rbx), %rdi
imull 0x10(%rbx), %r14d
movq %r14, %rsi
callq 0x8510
movq %rax, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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
movq %rsi, %r14
movq %rdi, %rbx
movl 0xc(%rdi), %r13d
testl %r13d, %r13d
sete %bpl
je 0x11299
movq (%rbx), %r15
movl 0x10(%rbx), %r12d
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x8770
testl %eax, %eax
je 0x112be
addq %r12, %r15
movq %r13, (%rsp)
decl %r13d
xorl %ebp, %ebp
cmpl %ebp, %r13d
je 0x11292
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x8770
addq %r12, %r15
incl %ebp
testl %eax, %eax
jne 0x1126d
cmpl (%rsp), %ebp
setae %bpl
jmp 0x112be
movb $0x1, %bpl
movq (%rsp), %r13
cmpl 0x8(%rbx), %r13d
jb 0x112a7
movq %rbx, %rdi
callq 0x8030
movl 0x10(%rbx), %edx
movl 0xc(%rbx), %edi
imull %edx, %edi
addq (%rbx), %rdi
movq %r14, %rsi
callq 0x85c0
incl 0xc(%rbx)
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_O1/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
movq %rsi, %rbx
movq %rdi, %r14
movl 0x10(%rdi), %r15d
imull 0xc(%rdi), %r15d
movq %r15, %rdi
callq 0x8080
movq %rax, %r12
movq (%r14), %rsi
movq %rax, %rdi
movq %r15, %rdx
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_O1/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 %esi, %ebx
movl 0xc(%rdi), %ebp
cmpl %esi, %ebp
jbe 0x1134d
movq %rdi, %r14
movq (%rdi), %rax
movl 0x10(%rdi), %ecx
leal 0x1(%rbx), %esi
imull %ecx, %esi
movl %ebx, %edx
notl %edx
addl %ebp, %edx
imull %ecx, %edx
movl %ecx, %edi
imull %ebx, %edi
addq %rax, %rdi
addq %rax, %rsi
callq 0x8850
decl 0xc(%r14)
cmpl %ebx, %ebp
seta %al
popq %rbx
popq %r14
popq %rbp
retq
nop