LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/aerospike[P]aerospike-common/src/main/aerospike/as_password.c
// Function: as_set_echo
static void
as_set_echo(bool echo)
{
	struct termios tty;
	tcgetattr(STDIN_FILENO, &tty);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %dil, %al
andb $0x1, %al
movb %al, -0x1(%rbp)
xorl %edi, %edi
leaq -0x40(%rbp), %rsi
callq 0x8a30
testb $0x1, -0x1(%rbp)
je 0x14fbc
movl -0x34(%rbp), %eax
orl $0x8, %eax
movl %eax, -0x34(%rbp)
jmp 0x14fc5
movl -0x34(%rbp), %eax
andl $-0x9, %eax
movl %eax, -0x34(%rbp)
xorl %esi, %esi
leaq -0x40(%rbp), %rdx
movl %esi, %edi
callq 0x8a40
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aerospike[P]aerospike-common/src/main/aerospike/as_queue.c
// Function: as_queue_init
bool
as_queue_init(as_queue* queue, uint32_t item_size, uint32_t capacity)
{
	queue->data = cf_malloc(capacity * item_size);
	
	if (! queue->data) {
		return false;
	}
	queue->capacity = capacity;
	queue->head = queue->tail = 0;
	queue->item_size = item_size;
	queue->total = 0;
	queue->flags = ITEMS_ON_HEAP;
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl -0x18(%rbp), %eax
imull -0x14(%rbp), %eax
movl %eax, %eax
movl %eax, %edi
callq 0x8090
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x1501c
movb $0x0, -0x1(%rbp)
jmp 0x15060
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0xc(%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x1c(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aerospike[P]aerospike-common/src/main/aerospike/as_queue.c
// Function: as_queue_create
as_queue*
as_queue_create(uint32_t item_size, uint32_t capacity)
{
	as_queue* queue = (as_queue*)cf_malloc(sizeof(as_queue));
	
	if (! queue) {
		return 0;
	}

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movl $0x20, %edi
callq 0x8090
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x1509d
movq $0x0, -0x8(%rbp)
jmp 0x150d6
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
callq 0x8ad0
testb $0x1, %al
jne 0x150c3
movq -0x18(%rbp), %rdi
callq 0x8aa0
movq $0x0, -0x8(%rbp)
jmp 0x150d6
movq -0x18(%rbp), %rax
movl $0x3, 0x1c(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x15121
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x8aa0
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1511f
movq -0x8(%rbp), %rdi
callq 0x8aa0
jmp 0x15121
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x151c0
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x15167
movq -0x10(%rbp), %rdi
callq 0x151e0
testb $0x1, %al
jne 0x15165
movb $0x0, -0x1(%rbp)
jmp 0x151a6
jmp 0x15167
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
callq 0x152d0
movq %rax, %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, %edx
callq 0x86b0
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
callq 0x15310
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
shll %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x15296
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divl 0x8(%rcx)
cmpl $0x0, %edx
jne 0x1527e
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
imull 0x14(%rcx), %eax
movl %eax, %eax
movl %eax, %esi
callq 0x85b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x15255
movb $0x0, -0x1(%rbp)
jmp 0x152bf
movq -0x10(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x152bf
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl $0x1, %edx
callq 0x15540
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x152bf
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
xorl %edx, %edx
callq 0x15540
testb $0x1, %al
jne 0x152ae
movb $0x0, -0x1(%rbp)
jmp 0x152bf
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x1c(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aerospike[P]aerospike-common/src/main/aerospike/as_queue.c
// Function: as_queue_unwrap
static inline void
as_queue_unwrap(as_queue* queue)
{
	if ((queue->tail & 0xC0000000) != 0) {
		uint32_t sz = as_queue_size(queue);
		queue->head %= queue->capacity;
		queue->tail = queue->head + sz;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
andl $0xc0000000, %eax       # imm = 0xC0000000
cmpl $0x0, %eax
je 0x15367
movq -0x8(%rbp), %rdi
callq 0x151c0
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl 0xc(%rax), %eax
xorl %edx, %edx
divl %ecx
movq -0x18(%rbp), %rax
movl %edx, 0xc(%rax)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %ecx
addl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x151c0
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jb 0x15398
movb $0x0, -0x1(%rbp)
jmp 0x153d7
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
callq 0x152d0
movq %rax, %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, %edx
callq 0x86b0
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
callq 0x15310
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x151c0
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x15427
movq -0x10(%rbp), %rdi
callq 0x151e0
testb $0x1, %al
jne 0x15425
movb $0x0, -0x1(%rbp)
jmp 0x15492
jmp 0x15427
movq -0x10(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x15453
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x10(%rax), %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %esi
callq 0x152d0
movq %rax, %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, %edx
callq 0x86b0
movq -0x10(%rbp), %rdi
callq 0x15310
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x151c0
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jb 0x154c8
movb $0x0, -0x1(%rbp)
jmp 0x15533
movq -0x10(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x154f4
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x10(%rax), %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %esi
callq 0x152d0
movq %rax, %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, %edx
callq 0x86b0
movq -0x10(%rbp), %rdi
callq 0x15310
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
andb $0x1, %al
movb %al, -0x15(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
imull 0x14(%rcx), %eax
movl %eax, %eax
movl %eax, %edi
callq 0x8090
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1557e
movb $0x0, -0x1(%rbp)
jmp 0x15642
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divl 0x8(%rcx)
movl -0x34(%rbp), %eax
subl %edx, %eax
movq -0x10(%rbp), %rcx
imull 0x14(%rcx), %eax
movl %eax, %eax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %esi
callq 0x152d0
movq -0x30(%rbp), %rdi
movq %rax, %rsi
movq -0x28(%rbp), %rdx
callq 0x86b0
movq -0x20(%rbp), %rdi
addq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
imull 0x14(%rcx), %eax
movl %eax, %eax
movl %eax, %edx
subq -0x28(%rbp), %rdx
callq 0x86b0
testb $0x1, -0x15(%rbp)
je 0x15610
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x8aa0
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x8ad0
testb $0x1, %al
jne 0x1567b
movb $0x0, -0x1(%rbp)
jmp 0x156d6
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8c20
cmpl $0x0, %eax
je 0x156a0
movq -0x10(%rbp), %rdi
callq 0x8220
movb $0x0, -0x1(%rbp)
jmp 0x156d6
movq -0x10(%rbp), %rdi
addq $0x48, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x86f0
cmpl $0x0, %eax
je 0x156d2
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
callq 0x8350
movq -0x10(%rbp), %rdi
callq 0x8220
movb $0x0, -0x1(%rbp)
jmp 0x156d6
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movl $0x78, %edi
callq 0x8090
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x1571d
movq $0x0, -0x8(%rbp)
jmp 0x15756
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
callq 0x80d0
testb $0x1, %al
jne 0x15743
movq -0x18(%rbp), %rdi
callq 0x8aa0
movq $0x0, -0x8(%rbp)
jmp 0x15756
movq -0x18(%rbp), %rax
movl $0x3, 0x1c(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
addq $0x20, %rdi
callq 0x8c60
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x157c0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x15840
andb $0x1, %al
movb %al, -0x15(%rbp)
movq -0x8(%rbp), %rdi
addq $0x20, %rdi
callq 0x8740
movb -0x15(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x157e2
movq -0x8(%rbp), %rdi
callq 0x159e0
testb $0x1, %al
jne 0x157e4
jmp 0x15835
cmpl $-0x1, -0xc(%rbp)
jne 0x15810
jmp 0x157ec
movq -0x8(%rbp), %rdi
addq $0x48, %rdi
movq -0x8(%rbp), %rsi
addq $0x20, %rsi
callq 0x8240
movq -0x8(%rbp), %rdi
callq 0x159e0
testb $0x1, %al
jne 0x157ec
jmp 0x15835
movl -0xc(%rbp), %edi
leaq -0x20(%rbp), %rsi
callq 0x15a00
movq -0x8(%rbp), %rdi
addq $0x48, %rdi
movq -0x8(%rbp), %rsi
addq $0x20, %rsi
leaq -0x20(%rbp), %rdx
callq 0x8a10
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aerospike[P]aerospike-common/src/include/aerospike/as_queue.h
// Function: as_queue_pop
static inline bool
as_queue_pop(as_queue* queue, void* ptr)
{
	if (as_queue_empty(queue)) {
		return false;
	}

	memcpy(ptr, as_queue_get(queue, queue->head), queue->item_size);
	queue->head++;

	// This probably keeps the cache fresher because the queue is fully empty.
	if (queue->head == queue->tail) {
		queue->head = queue->tail = 0;
	}
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x159e0
testb $0x1, %al
jne 0x1585f
jmp 0x15865
movb $0x0, -0x1(%rbp)
jmp 0x158c9
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %esi
callq 0x15a90
movq -0x20(%rbp), %rdi
movq %rax, %rsi
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, %edx
callq 0x86b0
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jne 0x158c5
movq -0x10(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0xc(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/aerospike[P]aerospike-common/src/include/aerospike/as_queue.h
// Function: as_queue_pop_tail
static inline bool
as_queue_pop_tail(as_queue* queue, void* ptr)
{
	if (as_queue_empty(queue)) {
		return false;
	}

	queue->tail--;
	memcpy(ptr, as_queue_get(queue, queue->tail), queue->item_size);

	if (queue->head == queue->tail) {
		queue->head = queue->tail = 0;
	}
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x159e0
testb $0x1, %al
jne 0x1595f
jmp 0x15965
movb $0x0, -0x1(%rbp)
jmp 0x159c9
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
callq 0x15a90
movq -0x20(%rbp), %rdi
movq %rax, %rsi
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, %edx
callq 0x86b0
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jne 0x159c5
movq -0x10(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0xc(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/aerospike[P]aerospike-common/src/include/citrusleaf/cf_clock.h
// Function: cf_set_wait_timespec
static inline void
cf_set_wait_timespec(int ms_wait, struct timespec* out)
{
	clock_gettime(CLOCK_REALTIME, out);
	out->tv_sec += ms_wait / 1000;
	out->tv_nsec += (ms_wait % 1000) * 1000 * 1000;

	if (out->tv_nsec > (1000 * 1000 * 1000)) {
		out->tv_nsec -= 1000 * 1000 * 1000;
		out->tv_sec++;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
xorl %edi, %edi
callq 0x8210
movl -0x4(%rbp), %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
movslq %eax, %rcx
movq -0x10(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movl -0x4(%rbp), %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
imull $0x3e8, %edx, %eax      # imm = 0x3E8
imull $0x3e8, %eax, %eax      # imm = 0x3E8
movslq %eax, %rcx
movq -0x10(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpq $0x3b9aca00, 0x8(%rax)  # imm = 0x3B9ACA00
jle 0x15a87
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
subq $0x3b9aca00, %rcx       # imm = 0x3B9ACA00
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x1a450(%rip), %rdi     # 0x2ff70
callq 0x8560
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
testb $0x1, 0x10(%rax)
jne 0x15b3f
movq -0x8(%rbp), %rdi
callq 0x85c0
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
cmpq -0x28(%rbp), %rax
ja 0x15ba8
movq -0x8(%rbp), %rdi
callq 0x15c10
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
jmp 0x15b79
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x15bfd
leaq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x15c10
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x15bfb
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb (%rax), %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
jmp 0x15bcd
jmp 0x15bfd
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aerospike[P]aerospike-common/src/include/aerospike/as_random.h
// Function: as_random_next_uint64
static inline uint64_t
as_random_next_uint64(as_random* random)
{
	// Use xorshift128+ algorithm.
	uint64_t s1 = random->seed0;
	const uint64_t s0 = random->seed1;
	random->seed0 = s0;
	s1 ^= s1 << 23;
	random->seed1 = (s1 ^ s0 ^ (s1 >> 18) ^ (s0 >> 5));
	return random->seed1 + s0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
shlq $0x17, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rcx
xorq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
shrq $0x12, %rax
xorq %rax, %rcx
movq -0x18(%rbp), %rax
shrq $0x5, %rax
xorq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
addq -0x18(%rbp), %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x85e0
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x15cee
movq -0x20(%rbp), %rax
movl -0x24(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cltd
idivl 0x1a9ec(%rip)           # 0x306b8
movslq %edx, %rcx
leaq 0x116ca(%rip), %rax     # 0x273a0
movb (%rax,%rcx), %dl
movq -0x20(%rbp), %rax
movl -0x24(%rbp), %ecx
movb %dl, (%rax,%rcx)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x15cb2
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
movb $0x0, (%rax,%rcx)
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x15d2d
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x15d63
movq -0x10(%rbp), %rdi
movb -0x11(%rbp), %al
movl $0x7, %esi
andb $0x1, %al
movzbl %al, %edx
callq 0x15d70
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aerospike[P]aerospike-common/src/main/aerospike/as_result.c
// Function: as_result_init
as_result * as_result_init(as_result * r) {
    r->is_malloc = false;
    r->count = 1;
    r->is_success = false;
    r->value = NULL;
    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movb $0x0, 0xc(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x8(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0xd(%rax)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x10, %edi
callq 0x8090
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x15fc7
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x15ff5
movq -0x10(%rbp), %rax
movb $0x1, 0xc(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x8(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0xd(%rax)
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x160b0
cmpl $0x0, %eax
jne 0x160a9
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x16094
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x8550
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
testb $0x1, 0xc(%rax)
je 0x160a7
movq -0x8(%rbp), %rdi
callq 0x8aa0
jmp 0x160a9
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
callq 0x8700
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movb $0x1, 0xd(%rax)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x82c0
movq -0x8(%rbp), %rax
movb $0x1, 0xd(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x82c0
movq -0x8(%rbp), %rax
movb $0x0, 0xd(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x16226
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x8550
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0xd(%rax)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x16276
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x8550
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0xd(%rax)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aerospike[P]aerospike-common/src/main/aerospike/as_serializer.c
// Function: as_serializer_cons
as_serializer *as_serializer_cons(as_serializer *serializer, bool free, const as_serializer_hooks *hooks)
{
	if (! serializer) {
		return serializer;
	}

	serializer->free = free;
	serializer->hooks = hooks;

	return serializer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x162c5
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x162e5
movb -0x11(%rbp), %cl
movq -0x10(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aerospike[P]aerospike-common/src/main/aerospike/as_string.c
// Function: as_string_cons
static inline as_string * as_string_cons(as_string * string, bool free, char * value, size_t len, bool value_free)
{
	if ( !string ) return string;

	as_val_cons((as_val *) string, AS_STRING, free);
	string->free = value_free;
	string->value = value;
	string->len = len;
	return string;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %r8b, %al
movq %rdi, -0x10(%rbp)
andb $0x1, %sil
movb %sil, -0x11(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
andb $0x1, %al
movb %al, -0x29(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x16445
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x16488
movq -0x10(%rbp), %rdi
movb -0x11(%rbp), %al
movl $0x4, %esi
andb $0x1, %al
movzbl %al, %edx
callq 0x16af0
movb -0x29(%rbp), %cl
movq -0x10(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x8(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x165d1
movq $0x0, -0x8(%rbp)
jmp 0x16600
movq -0x10(%rbp), %rax
cmpq $-0x1, 0x18(%rax)
jne 0x165f4
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x82b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x168d0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x16892
jmp 0x168c8
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x168b4
movq -0x10(%rbp), %rax
testb $0x1, 0x8(%rax)
je 0x168b4
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x8aa0
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x8(%rax)
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x168d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1694b
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x16954
movl $0x0, -0x4(%rbp)
jmp 0x169a2
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movsbl (%rax), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, %eax
je 0x1699c
movl -0x20(%rbp), %eax
movl -0x1c(%rbp), %ecx
shll $0x6, %ecx
addl %ecx, %eax
movl -0x1c(%rbp), %ecx
shll $0x10, %ecx
addl %ecx, %eax
subl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x16967
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x169d9
movq $0x0, -0x8(%rbp)
jmp 0x16a52
movq -0x18(%rbp), %rdi
callq 0x8370
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
shlq $0x0, %rdi
callq 0x8090
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x16a14
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x16a52
movq -0x30(%rbp), %rax
movb $0x22, (%rax)
movq -0x30(%rbp), %rdi
addq $0x1, %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x81b0
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
movb $0x22, 0x1(%rax,%rcx)
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
movb $0x0, 0x2(%rax,%rcx)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x16ad3
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0x16ad1
movl -0x24(%rbp), %eax
cmpl -0x20(%rbp), %eax
jl 0x16aa4
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x16ade
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb (%rax), %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x16a86
jmp 0x16ad3
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
andb $0x1, %al
movb %al, -0xd(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %edi
callq 0x8090
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movb $0x0, (%rax)
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0xc(%rax)
movb -0xd(%rbp), %cl
movq -0x8(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x10(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x11(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movl 0xc(%rcx), %ecx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0x16ca0
movq -0x10(%rbp), %rcx
movl 0xc(%rcx), %eax
addl $0x1, %eax
movl %eax, 0xc(%rcx)
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jae 0x16c68
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb (%rax), %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
jmp 0x16c25
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x10(%rax)
je 0x16c93
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x16cc0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x16cab
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x16cab
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x82b0
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
addl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x16fc0
testb $0x1, %al
jne 0x16d02
movb $0x0, -0x1(%rbp)
jmp 0x16d44
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %eax
movl %eax, %edx
callq 0x86b0
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movl 0xc(%rcx), %ecx
movb $0x0, (%rax,%rcx)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
addl $0x1, %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jae 0x16dab
movb -0x11(%rbp), %dl
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rsi
movl 0xc(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0xc(%rsi)
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movl 0xc(%rcx), %ecx
movb $0x0, (%rax,%rcx)
movb $0x1, -0x1(%rbp)
jmp 0x16dd7
movq -0x10(%rbp), %rax
testb $0x1, 0x10(%rax)
je 0x16dd3
movb -0x11(%rbp), %al
movb %al, -0x13(%rbp)
movb $0x0, -0x12(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x13(%rbp), %rsi
callq 0x16cc0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x16dd7
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)