LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_digest.c
// Function: cf_digest_string
void
cf_digest_string(cf_digest *digest, char* output)
{
	uint8_t *d = (uint8_t *) digest;
	char* p = output;

	*p++ = '0';
	*p++ = 'x';

	for (int i = 0; i < CF_DIGEST_KEY_SZ; i++) {
		sprintf(p, "%02x", d[i]);
		p += 2;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq $-0x14, %r12
leaq 0x454d(%rip), %r15      # 0x107b5
movw $0x7830, (%rsi)         # imm = 0x7830
addq $0x2, %rbx
movzbl 0x14(%r14,%r12), %edx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addq $0x2, %rbx
incq %r12
jne 0xc271
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_ll.c
// Function: cf_ll_delete_lockfree
void
cf_ll_delete_lockfree(cf_ll *ll, cf_ll_element *e )
{
	// make empty
	if (ll->sz == 1) {
		ll->head = 0;
		ll->tail = 0;
	}
	
	// head delete
	else if (e == ll->head) {
		ll->head = e->next;
		e->next->prev = 0;
	}
	// tail delete
	else if (e == ll->tail) {
		ll->tail = e->prev;
		e->prev->next = 0;
	}
	// we're in the middle somewhere
	else {
		e->prev->next = e->next;
		e->next->prev = e->prev;
	}
	
	ll->sz --;
	
	if (ll->destroy_fn)
		(ll->destroy_fn) (e);
}

// Assembly:
cmpl $0x1, 0x18(%rdi)
jne 0xc5bf
xorl %eax, %eax
movq %rax, 0x8(%rdi)
movq %rax, (%rdi)
jmp 0xc5fd
cmpq %rsi, (%rdi)
je 0xc5de
cmpq %rsi, 0x8(%rdi)
je 0xc5ee
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
movq %rax, (%rcx)
movq 0x8(%rsi), %rcx
movq %rcx, 0x8(%rax)
jmp 0xc5fd
movq (%rsi), %rax
movq %rax, (%rdi)
movq $0x0, 0x8(%rax)
jmp 0xc5fd
movq 0x8(%rsi), %rax
movq %rax, 0x8(%rdi)
movq $0x0, (%rax)
decl 0x18(%rdi)
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0xc60e
movq %rsi, %rdi
jmpq *%rax
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_ll.c
// Function: cf_ll_delete
void
cf_ll_delete(cf_ll *ll, cf_ll_element *e )
{
	// extra check for fun
	if (ll->sz == 0)	return;

	LL_LOCK(ll);

	cf_ll_delete_lockfree(ll, e);
	
	LL_UNLOCK(ll);
	
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0x18(%rdi)
je 0xc652
cmpb $0x1, 0x1c(%rdi)
movq %rsi, %r14
movq %rdi, %rbx
jne 0xc62e
leaq 0x20(%rbx), %rdi
callq 0x23b0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc5ae
cmpb $0x1, 0x1c(%rbx)
jne 0xc652
addq $0x20, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2190
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_ll.c
// Function: cf_ll_reduce
int
cf_ll_reduce( cf_ll *ll, bool forward, cf_ll_reduce_fn fn, void *udata)
{
	int rv = 0;
	
	LL_LOCK(ll);
	
	cf_ll_element *cur = forward ? ll->head : ll->tail;
	
	while (cur) {
		
		if ( (rv = (*fn) (cur, udata) ) ) {
			
			if (rv == CF_LL_REDUCE_DELETE) {

				cf_ll_element *next = forward ? cur->next : cur->prev;
				// Calls the destructor on cur, can't touch it after that
				cf_ll_delete_lockfree(ll, cur);
				cur = next;
				
			}
			else
				goto Exit;
		}
		else {
			cur = forward ? cur->next : cur->prev;
		}
	}

Exit:		
	LL_UNLOCK(ll);
	return(rv);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x1, 0x1c(%rdi)
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %rbx
jne 0xc67f
leaq 0x20(%rbx), %rdi
callq 0x23b0
xorb $0x1, %bpl
movq %rbx, (%rsp)
movzbl %bpl, %r13d
shll $0x3, %r13d
movq (%rbx,%r13), %r12
testq %r12, %r12
je 0xc6cc
movq %r12, %rdi
movq %r14, %rsi
callq *%r15
movl %eax, %ebp
testl %eax, %eax
je 0xc6c1
cmpl $0x1, %ebp
jne 0xc6ce
movq (%rsp), %rdi
movq (%r12,%r13), %rbx
movq %r12, %rsi
callq 0xc5ae
movq %rbx, %r12
jmp 0xc6c5
movq (%r12,%r13), %r12
testq %r12, %r12
jne 0xc698
jmp 0xc6ce
xorl %ebp, %ebp
movq (%rsp), %rdi
cmpb $0x1, 0x1c(%rdi)
jne 0xc6e1
addq $0x20, %rdi
callq 0x2190
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_ll.c
// Function: cf_ll_insert_reduce
int
cf_ll_insert_reduce(cf_ll *ll, cf_ll_element *e, bool forward, cf_ll_reduce_fn fn, void *udata)
{
	int rv = 0;
	LL_LOCK(ll);

	cf_ll_element *cur = forward ? ll->head : ll->tail;
	
	while (cur) {
		
		if ( (rv = (*fn) (cur, udata) ) ) {
			
			if (rv == CF_LL_REDUCE_INSERT) {

				if (forward)
					cf_ll_insert_before_lockfree(ll, cur, e);
				else
					cf_ll_insert_after_lockfree(ll, cur, e);
				rv = 0;
				
			}
			
			goto Exit;
			
		}
		else {
			cur = forward ? cur->next : cur->prev;
		}
	}
	
	// give chance to insert at "end"
	if ( (rv = (*fn) (cur, udata) ) ) {
		if (rv == CF_LL_REDUCE_INSERT) {
			if (forward)
				cf_ll_append_lockfree(ll, e);
			else
				cf_ll_prepend_lockfree(ll, e);
			rv = 0;
		}
	}

Exit:
	LL_UNLOCK(ll);
	return(rv);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpb $0x1, 0x1c(%rdi)
movq %r8, %r13
movq %rcx, %r12
movl %edx, %ebp
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
jne 0xc71f
leaq 0x20(%rbx), %rdi
callq 0x23b0
movl %ebp, %eax
movl %ebp, 0x14(%rsp)
xorb $0x1, %al
movzbl %al, %ebp
movq (%rbx,%rbp,8), %r15
testq %r15, %r15
je 0xc74c
shll $0x3, %ebp
movq %r15, %rdi
movq %r13, %rsi
callq *%r12
testl %eax, %eax
jne 0xc78f
movq (%r15,%rbp), %r15
testq %r15, %r15
jne 0xc736
xorl %edi, %edi
movq %r13, %rsi
callq *%r12
movl %eax, %r14d
cmpl $0x2, %eax
jne 0xc820
movq (%rbx), %rax
cmpb $0x0, 0x14(%rsp)
je 0xc7c2
testq %rax, %rax
je 0xc7e3
movq 0x8(%rsp), %rcx
movq $0x0, (%rcx)
movq 0x8(%rbx), %rax
movq %rax, 0x8(%rcx)
movq %rcx, (%rax)
movq %rcx, 0x8(%rbx)
jmp 0xc81a
movl %eax, %r14d
cmpl $0x2, %eax
jne 0xc820
cmpb $0x0, 0x14(%rsp)
je 0xc7fa
movq 0x8(%rsp), %rcx
movq %r15, (%rcx)
movq 0x8(%r15), %rax
testq %rax, %rax
movq %rax, 0x8(%rcx)
cmoveq %rbx, %rax
movq %rcx, (%rax)
movq %rcx, 0x8(%r15)
jmp 0xc81a
testq %rax, %rax
je 0xc7e3
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq $0x0, 0x8(%rcx)
movq (%rbx), %rax
movq %rcx, 0x8(%rax)
movq %rcx, (%rbx)
jmp 0xc81a
movq 0x8(%rsp), %rcx
xorl %eax, %eax
movq %rcx, (%rbx)
movq %rcx, 0x8(%rbx)
movq %rax, 0x8(%rcx)
movq %rax, (%rcx)
jmp 0xc81a
movq (%r15), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq %r15, 0x8(%rcx)
movq (%r15), %rax
testq %rax, %rax
cmoveq %rbx, %rax
movq %rcx, 0x8(%rax)
movq %rcx, (%r15)
incl 0x18(%rbx)
xorl %r14d, %r14d
cmpb $0x1, 0x1c(%rbx)
jne 0xc832
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x2190
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_ll.c
// Function: cf_ll_size
uint32_t
cf_ll_size(cf_ll *ll)
{
	LL_LOCK(ll);
	
	uint32_t sz = ll->sz;
	
	LL_UNLOCK(ll);
	
	return(sz);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movb 0x1c(%rdi), %al
movq %rdi, %rbx
cmpb $0x1, %al
jne 0xc85d
leaq 0x20(%rbx), %rdi
callq 0x23b0
movb 0x1c(%rbx), %al
movl 0x18(%rbx), %ebp
testb $0x1, %al
je 0xc870
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x2190
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_ll.c
// Function: cf_ll_init
int 
cf_ll_init(cf_ll *ll, cf_ll_destructor destroy_fn, bool uselock)
{
	ll->head = 0;
	ll->tail = 0;
	ll->destroy_fn = destroy_fn;
	ll->sz = 0;
	ll->uselock = uselock;
	if (uselock) {
#ifdef EXTERNAL_LOCKS
		ll->LOCK = cf_hooked_mutex_alloc();
#else
		pthread_mutex_init(&ll->LOCK, 0);
#endif 
	}
	return(0);	
}

// Assembly:
xorl %eax, %eax
testl %edx, %edx
movq %rax, 0x8(%rdi)
movq %rax, (%rdi)
movq %rsi, 0x10(%rdi)
movl $0x0, 0x18(%rdi)
movb %dl, 0x1c(%rdi)
je 0xc8a4
pushq %rax
addq $0x20, %rdi
xorl %esi, %esi
callq 0x2400
addq $0x8, %rsp
xorl %eax, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_proto.c
// Function: cl_msg_swap_fields
void
cl_msg_swap_fields(cl_msg *m)
{
	cl_msg_field *mf = (cl_msg_field *) m->data;

	for (int i=0;i<m->n_fields;i++) {
		cl_msg_swap_field(mf);
		mf = cl_msg_field_get_next(mf);
	}
}

// Assembly:
cmpw $0x0, 0x12(%rdi)
je 0xc922
leaq 0x16(%rdi), %rax
xorl %ecx, %ecx
movl (%rax), %edx
incl %ecx
bswapl %edx
movl %edx, (%rax)
leaq 0x4(%rax,%rdx), %rax
movzwl 0x12(%rdi), %edx
cmpl %edx, %ecx
jb 0xc90d
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_proto.c
// Function: cl_msg_swap_fields_and_ops
void
cl_msg_swap_fields_and_ops(cl_msg *m)
{
	cl_msg_field *mf = (cl_msg_field *) m->data;

	for (int i=0;i<m->n_fields;i++) {
		cl_msg_swap_field(mf);
		mf = cl_msg_field_get_next(mf);
	}

	cl_msg_op *op = (cl_msg_op *)mf;
	for (int i=0;i<m->n_ops;i++) {
		cl_msg_swap_op(op);
		op = cl_msg_op_get_next(op);
	}
}

// Assembly:
cmpw $0x0, 0x12(%rdi)
leaq 0x16(%rdi), %rax
je 0xc945
xorl %ecx, %ecx
movl (%rax), %edx
incl %ecx
bswapl %edx
movl %edx, (%rax)
leaq 0x4(%rax,%rdx), %rax
movzwl 0x12(%rdi), %edx
cmpl %edx, %ecx
jb 0xc930
cmpw $0x0, 0x14(%rdi)
je 0xc963
xorl %ecx, %ecx
movl (%rax), %edx
incl %ecx
bswapl %edx
movl %edx, (%rax)
leaq 0x4(%rax,%rdx), %rax
movzwl 0x14(%rdi), %edx
cmpl %edx, %ecx
jb 0xc94e
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_queue.c
// Function: cf_queue_destroy
void
cf_queue_destroy(cf_queue *q)
{
	if (q->threadsafe) {
#ifdef EXTERNAL_LOCKS
		cf_hooked_mutex_free(q->LOCK);
#else
		pthread_cond_destroy(&q->CV);
		pthread_mutex_destroy(&q->LOCK);
#endif // EXTERNAL_LOCKS
	}
	memset((void*)q->queue, 0, q->allocsz * q->elementsz);
	free(q->queue);
	memset((void*)q, 0, sizeof(cf_queue) );
	free(q);
}

// Assembly:
pushq %rbx
cmpb $0x1, (%rdi)
movq %rdi, %rbx
jne 0xca11
leaq 0x40(%rbx), %rdi
callq 0x2530
leaq 0x18(%rbx), %rdi
callq 0x22b0
movl 0x4(%rbx), %edx
movq 0x70(%rbx), %rdi
xorl %esi, %esi
imulq 0x10(%rbx), %rdx
callq 0x2140
movq 0x70(%rbx), %rdi
callq 0x22c0
movq %rbx, %rdi
popq %rbx
jmp 0x22c0
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_queue.c
// Function: cf_queue_sz
int
cf_queue_sz(cf_queue *q)
{
	int rv;

	QUEUE_LOCK(q);
	rv = CF_Q_SZ(q);
	QUEUE_UNLOCK(q);

	return(rv);
	
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movb (%rdi), %al
movq %rdi, %rbx
cmpb $0x1, %al
jne 0xca4e
leaq 0x18(%rbx), %rdi
callq 0x23b0
movb (%rbx), %al
movl 0x8(%rbx), %ebp
movl 0xc(%rbx), %r14d
testb $0x1, %al
je 0xca65
addq $0x18, %rbx
movq %rbx, %rdi
callq 0x2190
subl %r14d, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_queue.c
// Function: cf_queue_resize
int
cf_queue_resize(cf_queue *q, uint32_t new_sz)
{
	// check - a lot of the code explodes badly if queue is not full
	if (CF_Q_SZ(q) != q->allocsz) {
//		cf_debug(CF_QUEUE,"cf_queue: internal error: resize on non-full queue");
		return(-1);
	}
	
	// the rare case where the queue is not fragmented, and realloc makes sense
	// and none of the offsets need to move
	if (0 == q->read_offset % q->allocsz) {
		q->queue = (uint8_t*)realloc(q->queue, new_sz * q->elementsz);
		if (!q->queue) {
//			cf_debug(CF_QUEUE," pfft! out of memory! crash!");
			return(-1);
		}
		q->read_offset = 0;
		q->write_offset = q->allocsz;
	}
	else {
		
		uint8_t *newq = (uint8_t*)malloc(new_sz * q->elementsz);
		if (!newq) {
//			cf_debug(CF_QUEUE," pffth! out of memory! crash!");
			return(-1);
		}
		// endsz is used uint8_ts in the old queue from the insert point to the end
		uint32_t endsz = (uint32_t)((q->allocsz - (q->read_offset % q->allocsz)) * q->elementsz);
		memcpy(&newq[0], CF_Q_ELEM_PTR(q, q->read_offset), endsz);
		memcpy(&newq[endsz], &q->queue[0], (q->allocsz * q->elementsz) - endsz); 
		
		free(q->queue);
		q->queue = newq;

		q->write_offset = q->allocsz;
		q->read_offset = 0;
	}

	q->allocsz = new_sz;
	return(0);	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x8(%rdi), %ebx
movl 0xc(%rdi), %eax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
subl %eax, %ebx
cmpl 0x4(%rdi), %ebx
jne 0xcb55
xorl %edx, %edx
movl %esi, %r13d
movq %rdi, %r14
divl %ebx
testl %edx, %edx
je 0xcb25
movq 0x10(%r14), %r15
movl %r13d, %edi
movl %edx, %r12d
imulq %r15, %rdi
callq 0x22e0
testq %rax, %rax
je 0xcb55
movq 0x70(%r14), %rbp
movl %ebx, %ecx
movl %r12d, %esi
movl %r13d, 0x4(%rsp)
movl %r15d, %r13d
movq %rax, %rdi
subl %r12d, %ecx
imulq %r15, %rsi
movq %rax, %r12
imull %ecx, %r13d
movq %r13, %rdx
addq %rbp, %rsi
callq 0x21b0
movl %ebx, %edx
movq %r12, %rdi
movq %rbp, %rsi
imulq %r15, %rdx
addq %r13, %rdi
subq %r13, %rdx
movl 0x4(%rsp), %r13d
callq 0x21b0
movq %rbp, %rdi
callq 0x22c0
movq %r12, 0x70(%r14)
movl 0x4(%r14), %eax
movl %eax, 0x8(%r14)
movl $0x0, 0xc(%r14)
jmp 0xcb4f
movl %r13d, %esi
movq 0x70(%r14), %rdi
imulq 0x10(%r14), %rsi
callq 0x2470
testq %rax, %rax
movq %rax, 0x70(%r14)
je 0xcb55
movl $0x0, 0xc(%r14)
movl 0x4(%r14), %eax
movl %eax, 0x8(%r14)
xorl %ebp, %ebp
movl %r13d, 0x4(%r14)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_queue.c
// Function: cf_queue_push
int
cf_queue_push(cf_queue *q, void *ptr)
{
	/* FIXME arg check - and how do you do that, boyo? Magic numbers? */

	/* FIXME error */

	QUEUE_LOCK(q);

	/* Check queue length */
	if (CF_Q_SZ(q) == q->allocsz) {
		/* resize is a pain for circular buffers */
		if (0 != cf_queue_resize(q, q->allocsz + CF_QUEUE_ALLOCSZ)) {
			QUEUE_UNLOCK(q);
			return(-1);
		}
	}

	// todo: if queues are power of 2, this can be a shift
	memcpy(CF_Q_ELEM_PTR(q,q->write_offset), ptr, q->elementsz);
	q->write_offset++;
	// we're at risk of overflow if the write offset is that high
	if (q->write_offset & 0xC0000000) cf_queue_unwrap(q);

#ifndef EXTERNAL_LOCKS	
	if (q->threadsafe)
		pthread_cond_signal(&q->CV);
#endif 

	QUEUE_UNLOCK(q);

	return(0);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpb $0x1, (%rdi)
movq %rsi, %r14
movq %rdi, %rbx
jne 0xcb94
leaq 0x18(%rbx), %rdi
callq 0x23b0
movl 0x8(%rbx), %eax
movl 0x4(%rbx), %ecx
movl %eax, %esi
subl 0xc(%rbx), %esi
cmpl %ecx, %esi
jne 0xcbc4
addl $0x40, %esi
movq %rbx, %rdi
callq 0xca6f
testl %eax, %eax
je 0xcbbe
cmpb $0x0, (%rbx)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jne 0xcc17
jmp 0xcc23
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %eax
xorl %edx, %edx
movq %r14, %rsi
divl %ecx
movl %edx, %edi
movq 0x10(%rbx), %rdx
imulq %rdx, %rdi
addq 0x70(%rbx), %rdi
callq 0x21b0
movl 0x8(%rbx), %ecx
incl %ecx
cmpl $0x40000000, %ecx       # imm = 0x40000000
movl %ecx, 0x8(%rbx)
jb 0xcc00
movl 0xc(%rbx), %eax
xorl %edx, %edx
subl %eax, %ecx
divl 0x4(%rbx)
addl %edx, %ecx
movl %edx, 0xc(%rbx)
movl %ecx, 0x8(%rbx)
movb (%rbx), %al
cmpb $0x1, %al
jne 0xcc11
leaq 0x40(%rbx), %rdi
callq 0x2030
movb (%rbx), %al
xorl %ebp, %ebp
testb $0x1, %al
je 0xcc23
addq $0x18, %rbx
movq %rbx, %rdi
callq 0x2190
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_queue.c
// Function: cf_queue_push_limit
bool
cf_queue_push_limit(cf_queue *q, void *ptr, uint32_t limit)
{
	QUEUE_LOCK(q);
	uint32_t size = CF_Q_SZ(q);

	if (size >= limit) {
		QUEUE_UNLOCK(q);
		return false;
	}

	/* Check queue length */
	if (size == q->allocsz) {
		/* resize is a pain for circular buffers */
		if (0 != cf_queue_resize(q, q->allocsz + CF_QUEUE_ALLOCSZ)) {
			QUEUE_UNLOCK(q);
			return false;
		}
	}

	memcpy(CF_Q_ELEM_PTR(q,q->write_offset), ptr, q->elementsz);
	q->write_offset++;
	// we're at risk of overflow if the write offset is that high
	if (q->write_offset & 0xC0000000) cf_queue_unwrap(q);

#ifndef EXTERNAL_LOCKS
	if (q->threadsafe)
		pthread_cond_signal(&q->CV);
#endif

	QUEUE_UNLOCK(q);
	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpb $0x1, (%rdi)
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
jne 0xcc44
leaq 0x18(%rbx), %rdi
callq 0x23b0
movl 0x8(%rbx), %eax
movl %eax, %esi
subl 0xc(%rbx), %esi
cmpl %ebp, %esi
jae 0xcc66
movl 0x4(%rbx), %ecx
cmpl %ecx, %esi
jne 0xcc86
addl $0x40, %esi
movq %rbx, %rdi
callq 0xca6f
testl %eax, %eax
je 0xcc80
xorl %ebp, %ebp
cmpb $0x0, (%rbx)
je 0xcc79
addq $0x18, %rbx
movq %rbx, %rdi
callq 0x2190
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %eax
xorl %edx, %edx
movq %r14, %rsi
divl %ecx
movl %edx, %edi
movq 0x10(%rbx), %rdx
imulq %rdx, %rdi
addq 0x70(%rbx), %rdi
callq 0x21b0
movl 0x8(%rbx), %ecx
incl %ecx
cmpl $0x40000000, %ecx       # imm = 0x40000000
movl %ecx, 0x8(%rbx)
jb 0xccc2
movl 0xc(%rbx), %eax
xorl %edx, %edx
subl %eax, %ecx
divl 0x4(%rbx)
addl %edx, %ecx
movl %edx, 0xc(%rbx)
movl %ecx, 0x8(%rbx)
movb (%rbx), %al
cmpb $0x1, %al
jne 0xccd3
leaq 0x40(%rbx), %rdi
callq 0x2030
movb (%rbx), %al
movb $0x1, %bpl
testb $0x1, %al
jne 0xcc6d
jmp 0xcc79
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_queue.c
// Function: cf_queue_delete_offset
void
cf_queue_delete_offset(cf_queue *q, uint32_t index)
{
	index %= q->allocsz;
	uint32_t r_index = q->read_offset % q->allocsz;
	uint32_t w_index = q->write_offset % q->allocsz;
	
	// assumes index is validated!
	
	// if we're deleting the one at the head, just increase the readoffset
	if (index == r_index) {
		q->read_offset++;
		return;
	}
	// if we're deleting the tail just decrease the write offset
	if (w_index && (index == w_index - 1)) {
		q->write_offset--;
		return;
	}
	// and the memory copy is overlapping, so must use memmove
	if (index > r_index) {
		memmove( &q->queue[ (r_index + 1) * q->elementsz ],
			     &q->queue[ r_index * q->elementsz ],
				 (index - r_index) * q->elementsz );
		q->read_offset++;
		return;
	}
	
	if (index < w_index) {
		memmove( &q->queue[ index * q->elementsz ],
			     &q->queue[ (index + 1) * q->elementsz ],
			     (w_index - index - 1) * q->elementsz);
		q->write_offset--;
		return;
	}
	
//	cf_debug(CF_QUEUE,"QUEUE_DELETE_OFFSET: FAIL FAIL FAIL FAIL");

}

// Assembly:
pushq %rbx
movl 0x4(%rdi), %r9d
movq %rdi, %rbx
movl %esi, %eax
xorl %edx, %edx
movl 0x8(%rdi), %edi
divl %r9d
movl 0xc(%rbx), %r8d
movl %edx, %ecx
xorl %edx, %edx
movl %r8d, %eax
divl %r9d
movl %edi, %eax
movl %edx, %esi
xorl %edx, %edx
divl %r9d
cmpl %esi, %ecx
jne 0xceab
incl %r8d
movl %r8d, 0xc(%rbx)
jmp 0xcf26
movl %edx, %eax
addl $-0x1, %eax
setae %r8b
cmpl %eax, %ecx
setne %al
orb %r8b, %al
jne 0xcec5
decl %edi
movl %edi, 0x8(%rbx)
jmp 0xcf26
movl %ecx, %eax
subl %esi, %eax
jbe 0xcef7
movq 0x10(%rbx), %rcx
movq 0x70(%rbx), %rdx
leal 0x1(%rsi), %edi
movl %esi, %esi
imulq %rcx, %rdi
imulq %rcx, %rsi
imulq %rcx, %rax
addq %rdx, %rdi
addq %rdx, %rsi
movq %rax, %rdx
callq 0x2460
incl 0xc(%rbx)
jmp 0xcf26
cmpl %edx, %ecx
jae 0xcf26
movq 0x10(%rbx), %rax
movq 0x70(%rbx), %r8
movl %ecx, %edi
leal 0x1(%rcx), %esi
notl %ecx
addl %ecx, %edx
imulq %rax, %rdi
imulq %rax, %rsi
imulq %rax, %rdx
addq %r8, %rdi
addq %r8, %rsi
callq 0x2460
decl 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_queue.c
// Function: cf_queue_reduce
int 
cf_queue_reduce(cf_queue *q,  cf_queue_reduce_fn cb, void *udata)
{
	if (NULL == q)
		return(-1);

	QUEUE_LOCK(q);	

	if (CF_Q_SZ(q)) {
		
		// it would be faster to have a local variable to hold the index,
		// and do it in uint8_ts or something, but a delete
		// will change the read and write offset, so this is simpler for now
		// can optimize if necessary later....
		
		for (uint32_t i = q->read_offset ;
			 i < q->write_offset ;
			 i++)
		{
			
			int rv = cb(CF_Q_ELEM_PTR(q, i), udata);
			
			// rv == 0 i snormal case, just increment to next point
			if (rv == -1) {
				break; // found what it was looking for
			}
			else if (rv == -2) { // delete!
				cf_queue_delete_offset(q, i);
				goto Found;
			}
		};
	}
	
Found:	
	QUEUE_UNLOCK(q);

	return(0);
	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xcf79
cmpb $0x1, (%rdi)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
jne 0xcf4b
leaq 0x18(%rbx), %rdi
callq 0x23b0
movl 0xc(%rbx), %ebp
cmpl 0x8(%rbx), %ebp
jae 0xcf8a
movl %ebp, %eax
xorl %edx, %edx
movq %r14, %rsi
divl 0x4(%rbx)
movl %edx, %edi
imulq 0x10(%rbx), %rdi
addq 0x70(%rbx), %rdi
callq *%r15
cmpl $-0x1, %eax
je 0xcf8a
cmpl $-0x2, %eax
je 0xcf80
incl %ebp
jmp 0xcf4e
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xcf9d
movq %rbx, %rdi
movl %ebp, %esi
callq 0xce75
xorl %ebp, %ebp
cmpb $0x1, (%rbx)
jne 0xcf9d
addq $0x18, %rbx
movq %rbx, %rdi
callq 0x2190
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_queue.c
// Function: cf_queue_delete
int
cf_queue_delete(cf_queue *q, void *buf, bool only_one)
{
	if (NULL == q)
		return(CF_QUEUE_ERR);

	QUEUE_LOCK(q);
	
	bool found = false;
	
	if (CF_Q_SZ(q)) {

		for (uint32_t i = q->read_offset ;
			 i < q->write_offset ;
			 i++)
		{
			
			int rv = memcmp(CF_Q_ELEM_PTR(q,i), buf, q->elementsz);
			
			if (rv == 0) { // delete!
				cf_queue_delete_offset(q, i);
				found = true;
				if (only_one == true)	goto Done;
			}
		};
	}

Done:
	QUEUE_UNLOCK(q);

	if (found == false)
		return(CF_QUEUE_EMPTY);
	else
		return(CF_QUEUE_OK);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xd029
cmpb $0x1, (%rdi)
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
jne 0xcfd0
leaq 0x18(%rbx), %rdi
callq 0x23b0
movl 0x8(%rbx), %r13d
movl 0xc(%rbx), %r15d
movl $0xfffffffe, %r12d      # imm = 0xFFFFFFFE
cmpl %r13d, %r15d
jae 0xd040
xorl %r12d, %r12d
movl %r15d, %eax
xorl %edx, %edx
movq %r14, %rsi
divl 0x4(%rbx)
movl %edx, %edi
movq 0x10(%rbx), %rdx
imulq %rdx, %rdi
addq 0x70(%rbx), %rdi
callq 0x2260
testl %eax, %eax
jne 0xd01f
movq %rbx, %rdi
movl %r15d, %esi
callq 0xce75
testb %bpl, %bpl
jne 0xd031
movl 0x8(%rbx), %r13d
movb $0x1, %r12b
incl %r15d
cmpl %r13d, %r15d
jb 0xcfe6
jmp 0xd034
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0xd051
movb $0x1, %r12b
movzbl %r12b, %eax
andl $0x1, %eax
leal -0x2(%rax,%rax), %r12d
cmpb $0x1, (%rbx)
jne 0xd051
addq $0x18, %rbx
movq %rbx, %rdi
callq 0x2190
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_queue.c
// Function: cf_queue_priority_create
cf_queue_priority *
cf_queue_priority_create(size_t elementsz, bool threadsafe)
{
	cf_queue_priority *q = (cf_queue_priority*)malloc(sizeof(cf_queue_priority));
	if (!q)	return(0);
	
	q->threadsafe = threadsafe;
	q->low_q = cf_queue_create(elementsz, false);
	if (!q->low_q) 		goto Fail1;
	q->medium_q = cf_queue_create(elementsz, false);
	if (!q->medium_q)	goto Fail2;
	q->high_q = cf_queue_create(elementsz, false);
	if (!q->high_q)		goto Fail3;
	
	if (threadsafe == false)
		return(q);
#ifdef EXTERNAL_LOCKS
	q->LOCK = cf_hooked_mutex_alloc();
	if (!q->LOCK ) goto Fail5;
#else	
	if (0 != pthread_mutex_init(&q->LOCK, NULL))
		goto Fail4;

	if (0 != pthread_cond_init(&q->CV, NULL))
		goto Fail5;
#endif // EXTERNAL_LOCKS
	
	return(q);
	
Fail5:	
#ifdef EXTERNAL_LOCKS
	cf_hooked_mutex_free(q->LOCK);
#else
	pthread_mutex_destroy(&q->LOCK);
Fail4:	
#endif // EXTERNAL_LOCKS
	cf_queue_destroy(q->high_q);
Fail3:	
	cf_queue_destroy(q->medium_q);
Fail2:	
	cf_queue_destroy(q->low_q);
Fail1:	
	free(q);
	return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movl $0x78, %edi
movl %esi, %ebp
callq 0x22e0
testq %rax, %rax
je 0xd122
movq %r14, %rdi
xorl %esi, %esi
movq %rax, %rbx
movb %bpl, (%rax)
callq 0xc964
testq %rax, %rax
movq %rax, 0x8(%rbx)
je 0xd11a
movq %r14, %rdi
xorl %esi, %esi
movq %rax, %r15
callq 0xc964
testq %rax, %rax
movq %rax, 0x10(%rbx)
je 0xd112
movq %r14, %rdi
xorl %esi, %esi
movq %rax, %r12
callq 0xc964
testq %rax, %rax
movq %rax, 0x18(%rbx)
je 0xd106
testb %bpl, %bpl
je 0xd124
leaq 0x20(%rbx), %r14
xorl %esi, %esi
movq %r14, %rdi
callq 0x2400
testl %eax, %eax
jne 0xd0f9
movq %rbx, %rdi
xorl %esi, %esi
addq $0x48, %rdi
callq 0x22d0
testl %eax, %eax
je 0xd124
movq %r14, %rdi
callq 0x22b0
movq 0x18(%rbx), %rdi
callq 0xc9f6
movq 0x10(%rbx), %r12
movq %r12, %rdi
callq 0xc9f6
movq 0x8(%rbx), %r15
movq %r15, %rdi
callq 0xc9f6
movq %rbx, %rdi
callq 0x22c0
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_queue.c
// Function: cf_queue_priority_destroy
void 
cf_queue_priority_destroy(cf_queue_priority *q)
{
	cf_queue_destroy(q->high_q);
	cf_queue_destroy(q->medium_q);
	cf_queue_destroy(q->low_q);
	if (q->threadsafe) {
#ifdef EXTERNAL_LOCKS
		cf_hooked_mutex_free(q->LOCK);
#else
		pthread_mutex_destroy(&q->LOCK);
		pthread_cond_destroy(&q->CV);
#endif // EXTERNAL_LOCKS
	}
	free(q);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0xc9f6
movq 0x10(%rbx), %rdi
callq 0xc9f6
movq 0x8(%rbx), %rdi
callq 0xc9f6
cmpb $0x1, (%rbx)
jne 0xd166
leaq 0x20(%rbx), %rdi
callq 0x22b0
leaq 0x48(%rbx), %rdi
callq 0x2530
movq %rbx, %rdi
popq %rbx
jmp 0x22c0
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_queue.c
// Function: cf_queue_priority_push
int 
cf_queue_priority_push(cf_queue_priority *q, void *ptr, int pri)
{
	
	QUEUE_LOCK(q);
	
	int rv;
	if (pri == CF_QUEUE_PRIORITY_HIGH)
		rv = cf_queue_push(q->high_q, ptr);
	else if (pri == CF_QUEUE_PRIORITY_MEDIUM)
		rv = cf_queue_push(q->medium_q, ptr);
	else if (pri == CF_QUEUE_PRIORITY_LOW)
		rv = cf_queue_push(q->low_q, ptr);
	else {
		rv = -1;
	}

#ifndef EXTERNAL_LOCKS
	if (rv == 0 && q->threadsafe)
		pthread_cond_signal(&q->CV);
#endif 

	QUEUE_UNLOCK(q);
		
	return(rv);	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x1, (%rdi)
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
jne 0xd18d
leaq 0x20(%rbx), %rdi
callq 0x23b0
decl %r15d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x2, %r15d
ja 0xd1c5
shll $0x3, %r15d
movq %rbx, %rax
movq %r14, %rsi
subq %r15, %rax
movq 0x18(%rax), %rdi
callq 0xcb7c
testl %eax, %eax
jne 0xd1c5
xorl %ebp, %ebp
cmpb $0x1, (%rbx)
jne 0xd1c5
leaq 0x48(%rbx), %rdi
callq 0x2030
cmpb $0x1, (%rbx)
jne 0xd1d6
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x2190
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_queue.c
// Function: cf_queue_priority_sz
int
cf_queue_priority_sz(cf_queue_priority *q)
{
	int rv = 0;
	QUEUE_LOCK(q);
	rv += cf_queue_sz(q->high_q);
	rv += cf_queue_sz(q->medium_q);
	rv += cf_queue_sz(q->low_q);
	QUEUE_UNLOCK(q);
	return(rv);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x1, (%rdi)
movq %rdi, %rbx
jne 0xd37f
leaq 0x20(%rbx), %rdi
callq 0x23b0
movq 0x18(%rbx), %rdi
callq 0xca36
movq 0x10(%rbx), %rdi
movl %eax, %ebp
callq 0xca36
movq 0x8(%rbx), %rdi
movl %eax, %r14d
callq 0xca36
cmpb $0x1, (%rbx)
movl %eax, %r15d
jne 0xd3b3
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x2190
addl %ebp, %r14d
addl %r15d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_socket.c
// Function: cf_socket_create_nb
int
cf_socket_create_nb()
{
	// Create the socket.
	int fd = socket(AF_INET, SOCK_STREAM, 0);

	if (-1 == fd) {
		cf_warn("could not allocate socket, errno %d", errno);
		return -1;
	}

    // Make the socket nonblocking.
	int flags = fcntl(fd, F_GETFL, 0);

    if (flags < 0) {
		cf_warn("could not read socket flags");
		close(fd);
        return -1;
	}

    if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) {
		cf_warn("could not set socket nonblocking");
		close(fd);
        return -1;
	}

	int f = 1;
	setsockopt(fd, SOL_TCP, TCP_NODELAY, &f, sizeof(f));

	return fd;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x20a0
cmpl $-0x1, %eax
je 0xd438
movl %eax, %ebx
movl %eax, %edi
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2450
testl %eax, %eax
js 0xd46d
orl $0x800, %eax            # imm = 0x800
movl %ebx, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x2450
testl %eax, %eax
js 0xd489
leaq 0x4(%rsp), %rcx
movl %ebx, %edi
movl $0x6, %esi
movl $0x1, %edx
movl $0x4, %r8d
movl $0x1, (%rcx)
callq 0x24d0
jmp 0xd4bb
leaq 0x8e89(%rip), %rax      # 0x162c8
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x0, (%rax)
jle 0xd4bb
leaq 0x8e80(%rip), %rax      # 0x162d0
movq (%rax), %r14
callq 0x2040
movl (%rax), %edx
leaq 0x337e(%rip), %rsi      # 0x107df
movl $0x1, %edi
xorl %eax, %eax
callq *%r14
jmp 0xd4bb
leaq 0x8e54(%rip), %rax      # 0x162c8
cmpl $0x0, (%rax)
jle 0xd4af
leaq 0x8e50(%rip), %rax      # 0x162d0
leaq 0x337c(%rip), %rsi      # 0x10803
jmp 0xd4a3
leaq 0x8e38(%rip), %rax      # 0x162c8
cmpl $0x0, (%rax)
jle 0xd4af
leaq 0x8e34(%rip), %rax      # 0x162d0
leaq 0x337c(%rip), %rsi      # 0x1081f
movq (%rax), %rcx
movl $0x1, %edi
xorl %eax, %eax
callq *%rcx
movl %ebx, %edi
callq 0x2550
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_socket.c
// Function: cf_socket_read_forever
int
cf_socket_read_forever(int fd, uint8_t *buf, size_t buf_len)
{
	// one way is to make sure the fd is blocking, and block
	int flags;
	if (-1 == (flags = fcntl(fd, F_GETFL, 0)))
		flags = 0;
	if (flags & O_NONBLOCK) {
		if (-1 == fcntl(fd, F_SETFL, flags & ~O_NONBLOCK)) {
			return(ENOENT);
		}
	}

	size_t pos = 0;
	do {
		int r_bytes = read(fd, buf + pos, buf_len - pos );
		if (r_bytes < 0) { // don't combine these into one line! think about it!
			if (errno != ETIMEDOUT) {
				return(errno);
			}
		}
		else if (r_bytes == 0) {
			// blocking read returns 0 bytes socket timedout at server side
			// is closed
			return EBADF;
		}
		else {
			pos += r_bytes;
		}
	} while (pos < buf_len);

	return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
movl %edi, %ebp
xorl %r15d, %r15d
callq 0x2450
cmpl $-0x1, %eax
cmovel %r15d, %eax
btl $0xb, %eax
jae 0xe154
andl $0xfffff7ff, %eax       # imm = 0xFFFFF7FF
movl %ebp, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x2450
cmpl $-0x1, %eax
je 0xe194
xorl %r15d, %r15d
movq %rbx, %rdx
leaq (%r14,%r15), %rsi
movl %ebp, %edi
subq %r15, %rdx
callq 0x2390
testl %eax, %eax
js 0xe178
je 0xe18d
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq %rax, %r15
jmp 0xe184
callq 0x2040
movl (%rax), %eax
cmpl $0x6e, %eax
jne 0xe199
cmpq %rbx, %r15
jb 0xe157
xorl %eax, %eax
jmp 0xe199
movl $0x9, %eax
jmp 0xe199
movl $0x2, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_socket.c
// Function: cf_socket_write_forever
int
cf_socket_write_forever(int fd, uint8_t *buf, size_t buf_len)
{
	// one way is to make sure the fd is blocking, and block
	int flags;
	if (-1 == (flags = fcntl(fd, F_GETFL, 0)))
		flags = 0;
	if (flags & O_NONBLOCK) {
		if (-1 == fcntl(fd, F_SETFL, flags & ~O_NONBLOCK)) {
			return(ENOENT);
		}
	}

	size_t pos = 0;
	do {
		int r_bytes = write(fd, buf + pos, buf_len - pos );
		if (r_bytes < 0) { // don't combine these into one line! think about it!
			if (errno != ETIMEDOUT) {
				return(errno);
			}
		}
		else {
			pos += r_bytes;
		}
	} while (pos < buf_len);

	if (-1 == fcntl(fd, F_SETFL, flags & O_NONBLOCK)) {
		return(ENOENT);
	}

	return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
movl %edi, %ebx
xorl %ebp, %ebp
callq 0x2450
cmpl $-0x1, %eax
cmovel %ebp, %eax
movl %eax, %ebp
andl $0x800, %ebp            # imm = 0x800
je 0xe1ee
andl $0xfffff7ff, %eax       # imm = 0xFFFFF7FF
movl %ebx, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x2450
cmpl $-0x1, %eax
je 0xe23f
xorl %r12d, %r12d
movq %r14, %rdx
leaq (%r15,%r12), %rsi
movl %ebx, %edi
subq %r12, %rdx
callq 0x20c0
testl %eax, %eax
js 0xe210
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq %rax, %r12
jmp 0xe21c
callq 0x2040
movl (%rax), %eax
cmpl $0x6e, %eax
jne 0xe244
cmpq %r14, %r12
jb 0xe1f1
movl %ebx, %edi
movl $0x4, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2450
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
sete %al
addl %eax, %eax
jmp 0xe244
movl $0x2, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_socket.c
// Function: cf_socket_start_connect_nb
int
cf_socket_start_connect_nb(int fd, struct sockaddr_in* sa)
{
	if (0 != connect(fd, (struct sockaddr*)sa, sizeof(*sa))) {
        if (! IS_CONNECTING()) {
        	if (errno == ECONNREFUSED) {
        		cf_debug("host refused socket connection");
        	}
        	else {
        		cf_info("could not connect nonblocking socket %d, errno %d", fd, errno);
        	}

        	return -1;
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl $0x10, %edx
movl %edi, %ebp
callq 0x21d0
xorl %ebx, %ebx
testl %eax, %eax
je 0xe32d
callq 0x2040
movl (%rax), %ecx
cmpl $0x73, %ecx
je 0xe32d
leaq 0x7ff1(%rip), %rax      # 0x162c8
cmpl $0x6f, %ecx
jne 0xe304
movl (%rax), %eax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, %eax
jl 0xe32d
leaq 0x7fe1(%rip), %rax      # 0x162d0
leaq 0x2915(%rip), %rsi      # 0x10c0b
movl $0x3, %edi
movq (%rax), %rcx
xorl %eax, %eax
callq *%rcx
jmp 0xe32d
movl (%rax), %eax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x2, %eax
jl 0xe32d
leaq 0x7fb9(%rip), %rax      # 0x162d0
leaq 0x290c(%rip), %rsi      # 0x10c2a
movl $0x2, %edi
movl %ebp, %edx
movq (%rax), %r8
xorl %eax, %eax
callq *%r8
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_socket.c
// Function: cf_socket_create_and_connect_nb
int
cf_socket_create_and_connect_nb(struct sockaddr_in* sa)
{
	// Create the socket.
	int fd = cf_socket_create_nb();

	// Initiate non-blocking connect.
	if (0 != cf_socket_start_connect_nb(fd, sa)) {
		cf_close(fd);
		return -1;
	}

	return fd;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0xd3c8
movl %eax, %edi
movq %r14, %rsi
movl %eax, %ebx
callq 0xe2af
testl %eax, %eax
je 0xe35e
movl %ebx, %edi
callq 0x2550
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_vector.c
// Function: cf_vector_create
cf_vector *
cf_vector_create( uint32_t value_len, uint32_t init_sz, unsigned int flags)
{
	cf_vector *v;

	v = (cf_vector*)malloc(sizeof(cf_vector));
	if (!v)	return(0);

	v->value_len = value_len;
	v->flags = flags;
	v->alloc_len = init_sz;
	v->len = 0;
	v->stack_struct = false;
	v->stack_vector = false;
	if (init_sz) {
		v->vector = (uint8_t*)malloc(init_sz * value_len);
		if (!v->vector)	{
			free(v);
			return(0);
		}
	}
	else
		v->vector = 0;
	if (flags & VECTOR_FLAG_INITZERO)
		memset((void*)v->vector, 0, init_sz * value_len);
	if (flags & VECTOR_FLAG_BIGLOCK){
#ifdef EXTERNAL_LOCKS
		v->LOCK = cf_hooked_mutex_alloc();
#else
		pthread_mutex_init(&v->LOCK, 0);
#endif // EXTERNAL_LOCKS
	}
	return(v);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %r15d
movl $0x48, %edi
movl %edx, %ebp
movl %esi, %r14d
callq 0x22e0
testq %rax, %rax
je 0xe3c2
movq %rax, %rbx
testl %r14d, %r14d
movl %r15d, (%rax)
movl %ebp, 0x4(%rax)
movl %r14d, 0x8(%rax)
movl $0x0, 0xc(%rax)
movw $0x0, 0x18(%rax)
je 0xe3c6
movl %r14d, %edi
imull %r15d, %edi
callq 0x22e0
testq %rax, %rax
movq %rax, 0x10(%rbx)
jne 0xe3d0
movq %rbx, %rdi
callq 0x22c0
xorl %ebx, %ebx
jmp 0xe3fb
xorl %eax, %eax
movq $0x0, 0x10(%rbx)
testb $0x2, %bpl
je 0xe3e7
imull %r15d, %r14d
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2140
testb $0x1, %bpl
je 0xe3fb
movq %rbx, %rdi
xorl %esi, %esi
addq $0x20, %rdi
callq 0x2400
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_vector.c
// Function: cf_vector_init
int
cf_vector_init(cf_vector *v, uint32_t value_len, uint32_t init_sz, unsigned int flags)
{
	v->value_len = value_len;
	v->flags = flags;
	v->alloc_len = init_sz;
	v->len = 0;
	v->stack_struct = true;
	v->stack_vector = false;
	if (init_sz) {
		v->vector = (uint8_t*)malloc(init_sz * value_len);
		if (!v->vector)	return(-1);
	}
	else
		v->vector = 0;
	if (flags & VECTOR_FLAG_INITZERO)
		memset((void*)v->vector, 0, init_sz * value_len);
	if (flags & VECTOR_FLAG_BIGLOCK){
#ifdef EXTERNAL_LOCKS
		v->LOCK = cf_hooked_mutex_alloc();
#else
		pthread_mutex_init(&v->LOCK, 0);
#endif // EXTERNAL_LOCKS
	}
	return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
testl %edx, %edx
movl %esi, (%rdi)
movl %ecx, 0x4(%rdi)
movl %edx, 0x8(%rdi)
movl $0x0, 0xc(%rdi)
movw $0x1, 0x18(%rdi)
je 0xe451
movl %r14d, %edi
imull %r15d, %edi
callq 0x22e0
testq %rax, %rax
movq %rax, 0x10(%rbx)
jne 0xe45b
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0xe48c
xorl %eax, %eax
movq $0x0, 0x10(%rbx)
testb $0x2, %bpl
je 0xe472
imull %r15d, %r14d
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2140
xorl %r14d, %r14d
testb $0x1, %bpl
je 0xe48c
addq $0x20, %rbx
xorl %esi, %esi
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x2400
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_vector.c
// Function: cf_vector_init_smalloc
void
cf_vector_init_smalloc(cf_vector *v, uint32_t value_len, uint8_t *sbuf, int sbuf_sz, unsigned int flags)
{
	v->value_len = value_len;
	v->flags = flags;
	v->alloc_len = sbuf_sz / value_len;
	v->len = 0;
	v->stack_struct = true;
	v->stack_vector = true;
	v->vector = sbuf;
	if (flags & VECTOR_FLAG_INITZERO)
		memset((void*)v->vector, 0, sbuf_sz);
	if (flags & VECTOR_FLAG_BIGLOCK){
#ifdef EXTERNAL_LOCKS
	v->LOCK = cf_hooked_mutex_alloc();
#else
		pthread_mutex_init(&v->LOCK, 0);
#endif
	}
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %ecx, %r8d
movq %rdx, %rcx
xorl %edx, %edx
movl %esi, (%rdi)
movq %rdi, %rbx
movl %r8d, %eax
movl %ebp, 0x4(%rdi)
divl %esi
testb $0x2, %bpl
movl %eax, 0x8(%rdi)
movl $0x0, 0xc(%rdi)
movw $0x101, 0x18(%rdi)      # imm = 0x101
movq %rcx, 0x10(%rdi)
je 0xe4dc
movslq %r8d, %rdx
movq %rcx, %rdi
xorl %esi, %esi
callq 0x2140
testb $0x1, %bpl
jne 0xe4e9
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
addq $0x20, %rbx
xorl %esi, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2400
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_vector.c
// Function: cf_vector_clone_stack
void
cf_vector_clone_stack(cf_vector *v, cf_vector *target, uint8_t *target_buf)
{
	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_LOCK(v);

	target->value_len = v->value_len;
	target->flags = v->flags;
	target->alloc_len = v->len;
	target->len = v->len;
	target->stack_struct = true;
	target->stack_vector = true;
	target->vector = target_buf;
	memcpy(target->vector, v->vector, v->value_len * v->len);

	if (target->flags & VECTOR_FLAG_BIGLOCK){
#ifdef EXTERNAL_LOCKS
		target->LOCK = cf_hooked_mutex_alloc();
#else
		pthread_mutex_init(&target->LOCK, 0);
#endif
	}

	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_UNLOCK(v);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testb $0x1, 0x4(%rdi)
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
je 0xe51a
leaq 0x20(%rbx), %rdi
callq 0x23b0
movl (%rbx), %eax
movq %r15, %rdi
movl %eax, (%r14)
movl 0x4(%rbx), %eax
movl %eax, 0x4(%r14)
movl 0xc(%rbx), %eax
movl %eax, 0x8(%r14)
movl %eax, 0xc(%r14)
movw $0x101, 0x18(%r14)      # imm = 0x101
movq %r15, 0x10(%r14)
movl 0xc(%rbx), %edx
movq 0x10(%rbx), %rsi
imull (%rbx), %edx
callq 0x21b0
testb $0x1, 0x4(%r14)
je 0xe563
addq $0x20, %r14
xorl %esi, %esi
movq %r14, %rdi
callq 0x2400
testb $0x1, 0x4(%rbx)
jne 0xe56f
popq %rbx
popq %r14
popq %r15
retq
addq $0x20, %rbx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2190
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_vector.c
// Function: cf_vector_destroy
void
cf_vector_destroy(cf_vector *v)
{
	if (v->flags & VECTOR_FLAG_BIGLOCK){
#ifdef EXTERNAL_LOCKS
		cf_hooked_mutex_free(v->LOCK);
#else
		pthread_mutex_destroy(&v->LOCK);
#endif // EXTERNAL_LOCKS
	}
	if (v->vector && (v->stack_vector == false))	free(v->vector);
	if (v->stack_struct == false) free(v);
}

// Assembly:
pushq %rbx
testb $0x1, 0x4(%rdi)
movq %rdi, %rbx
je 0xe593
leaq 0x20(%rbx), %rdi
callq 0x22b0
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0xe5a7
cmpb $0x0, 0x19(%rbx)
jne 0xe5a7
callq 0x22c0
cmpb $0x0, 0x18(%rbx)
je 0xe5af
popq %rbx
retq
movq %rbx, %rdi
popq %rbx
jmp 0x22c0
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_vector.c
// Function: cf_vector_set
int
cf_vector_set(cf_vector *v, uint32_t index, void *value)
{
	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_LOCK(v);

	// Return error if index is not within current array bounds.
	if (index >= v->alloc_len)
		return(-1);

	memcpy(v->vector + (index * v->value_len), value, v->value_len);
	if (index > v->len)	v->len = index;
	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_UNLOCK(v);
	return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testb $0x1, 0x4(%rdi)
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
je 0xe5d6
leaq 0x20(%rbx), %rdi
callq 0x23b0
cmpl %ebp, 0x8(%rbx)
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jbe 0xe611
movl (%rbx), %edx
movq %r14, %rsi
movl %edx, %edi
imull %ebp, %edi
addq 0x10(%rbx), %rdi
callq 0x21b0
cmpl %ebp, 0xc(%rbx)
jae 0xe5fc
movl %ebp, 0xc(%rbx)
xorl %r15d, %r15d
testb $0x1, 0x4(%rbx)
je 0xe611
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x2190
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_vector.c
// Function: cf_vector_append_lockfree
int
cf_vector_append_lockfree(cf_vector *v, void *value)
{
	if (v->len + 1 >= v->alloc_len)
		if (0 != cf_vector_resize(v, v->len * 2))	return(-1);
	memcpy(v->vector + (v->len * v->value_len), value, v->value_len);
	v->len ++;
	return(0);
	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x8(%rdi), %r14d
movl 0xc(%rdi), %edi
movq %rsi, %r13
leal 0x1(%rdi), %eax
cmpl %r14d, %eax
jae 0xe64b
movq 0x10(%rbx), %r15
jmp 0xe6f8
movl 0x4(%rbx), %eax
movq 0x10(%rbx), %r12
addl %edi, %edi
movl $0x32, %ebp
cmpl $0x33, %edi
cmovael %edi, %ebp
testb $0x4, %al
cmovel %edi, %ebp
testq %r12, %r12
je 0xe66f
cmpb $0x1, 0x19(%rbx)
jne 0xe6b9
movq %r13, 0x10(%rsp)
movl (%rbx), %r13d
movl %eax, 0xc(%rsp)
movl %r13d, %edi
imull %ebp, %edi
callq 0x22e0
testq %rax, %rax
je 0xe71c
cmpb $0x1, 0x19(%rbx)
movq %rax, %r15
jne 0xe6ae
imull %r14d, %r13d
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x21b0
movb $0x0, 0x19(%rbx)
movq 0x10(%rsp), %r13
movl 0xc(%rsp), %eax
jmp 0xe6d1
movl (%rbx), %esi
movq %r12, %rdi
imull %ebp, %esi
callq 0x2470
testq %rax, %rax
je 0xe71c
movq %rax, %r15
movl 0x4(%rbx), %eax
testb $0x2, %al
movq %r15, 0x10(%rbx)
je 0xe6f2
movl 0x8(%rbx), %eax
movl (%rbx), %edi
movl %ebp, %edx
xorl %esi, %esi
subl %eax, %edx
imull %eax, %edi
addq %r15, %rdi
addl $0x2, %edx
callq 0x2140
movl %ebp, 0x8(%rbx)
movl 0xc(%rbx), %edi
movl (%rbx), %edx
movq %r13, %rsi
imull %edx, %edi
addq %r15, %rdi
callq 0x21b0
incl 0xc(%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xe70d
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_vector.c
// Function: cf_vector_append
int
cf_vector_append(cf_vector *v, void *value)
{
	int rv;
	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_LOCK(v);
	rv = cf_vector_append_lockfree(v, value);
	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_UNLOCK(v);
	return(rv);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testb $0x1, 0x4(%rdi)
movq %rsi, %r14
movq %rdi, %rbx
je 0xe73c
leaq 0x20(%rbx), %rdi
callq 0x23b0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe61f
testb $0x1, 0x4(%rbx)
movl %eax, %ebp
je 0xe75b
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x2190
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_vector.c
// Function: cf_vector_append_unique
int
cf_vector_append_unique(cf_vector *v, void *value)
{
	int rv=0;
	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_LOCK(v);
	uint8_t	*_b = v->vector;
	uint32_t	_l = v->value_len;
	for (unsigned int i=0;i<v->len;i++) {
		if (0 == memcmp(value, _b, _l)) {
			goto Found;
		}
		_b += _l;
	}
	rv = cf_vector_append_lockfree(v, value);
Found:	
	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_UNLOCK(v);
	return(rv);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testb $0x1, 0x4(%rdi)
movq %rsi, %r14
movq %rdi, %rbx
je 0xe77f
leaq 0x20(%rbx), %rdi
callq 0x23b0
movl 0xc(%rbx), %ebp
testl %ebp, %ebp
je 0xe7a6
movl (%rbx), %r15d
movq 0x10(%rbx), %r12
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x2260
testl %eax, %eax
je 0xe7b5
addq %r15, %r12
decl %ebp
jne 0xe78d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe61f
movl %eax, %ebp
jmp 0xe7b7
xorl %ebp, %ebp
testb $0x1, 0x4(%rbx)
je 0xe7c9
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x2190
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_vector.c
// Function: cf_vector_get
int
cf_vector_get(cf_vector *v, uint32_t index, void *value_p)
{
	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_LOCK(v);
	if (index >= v->alloc_len)
		return(-1);
	memcpy(value_p, v->vector + (index * v->value_len), v->value_len);
	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_UNLOCK(v);
	return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testb $0x1, 0x4(%rdi)
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %rbx
je 0xe7f3
leaq 0x20(%rbx), %rdi
callq 0x23b0
cmpl %r15d, 0x8(%rbx)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jbe 0xe827
movl (%rbx), %edx
movq %r14, %rdi
imull %edx, %r15d
addq 0x10(%rbx), %r15
movq %r15, %rsi
callq 0x21b0
xorl %ebp, %ebp
testb $0x1, 0x4(%rbx)
je 0xe827
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x2190
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_vector.c
// Function: cf_vector_getp
void *
cf_vector_getp(cf_vector *v, uint32_t index)
{
	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_LOCK(v);
	if (index >= v->alloc_len)
		return(0);
	void *r = v->vector + (index * v->value_len);
	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_UNLOCK(v);
	return( r );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testb $0x1, 0x4(%rdi)
movl %esi, %ebx
movq %rdi, %r14
je 0xe84c
leaq 0x20(%r14), %rdi
callq 0x23b0
cmpl %ebx, 0x8(%r14)
jbe 0xe86f
imull (%r14), %ebx
addq 0x10(%r14), %rbx
testb $0x1, 0x4(%r14)
je 0xe871
addq $0x20, %r14
movq %r14, %rdi
callq 0x2190
jmp 0xe871
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/sharpyfox[P]citrusleaf-client/src/cf_vector.c
// Function: cf_vector_getp_vlock
void *
cf_vector_getp_vlock(cf_vector *v, uint32_t index, pthread_mutex_t **vlock)
{
	if (!v->flags & VECTOR_FLAG_BIGLOCK)
		return(0);
	if (index >= v->alloc_len)
		return(0);
	VECTOR_LOCK(v);
	*vlock = &v->LOCK;
	return(v->vector + (index * v->value_len));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x4(%rdi)
je 0xe8b0
cmpl %esi, 0x8(%rdi)
movl %esi, %ebx
movq %rdi, %r14
jbe 0xe8b0
leaq 0x20(%r14), %r12
movq %rdx, %r15
movq %r12, %rdi
callq 0x23b0
movq %r12, (%r15)
imull (%r14), %ebx
addq 0x10(%r14), %rbx
jmp 0xe8b2
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq