LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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
movq %r8, %r13
movq %rcx, %r12
movl %edx, %ebp
movq %rsi, (%rsp)
movq %rdi, %rbx
cmpb $0x1, 0x1c(%rdi)
jne 0xcb14
leaq 0x20(%rbx), %rdi
callq 0x23b0
leaq 0x8(%rbx), %rax
movq %rax, 0x10(%rsp)
movl %ebp, 0xc(%rsp)
movl %ebp, %eax
xorb $0x1, %al
movzbl %al, %ebp
movq (%rbx,%rbp,8), %r15
testq %r15, %r15
je 0xcb4a
shll $0x3, %ebp
movq %r15, %rdi
movq %r13, %rsi
callq *%r12
testl %eax, %eax
jne 0xcb92
movq (%r15,%rbp), %r15
testq %r15, %r15
jne 0xcb34
xorl %edi, %edi
movq %r13, %rsi
callq *%r12
movl %eax, %r14d
cmpl $0x2, %eax
jne 0xcc28
movq (%rbx), %rax
cmpb $0x0, 0xc(%rsp)
je 0xcbc8
testq %rax, %rax
je 0xcbe8
movq (%rsp), %rcx
movq $0x0, (%rcx)
movq 0x10(%rsp), %rdx
movq (%rdx), %rax
movq %rax, 0x8(%rcx)
movq (%rdx), %rax
movq %rcx, (%rax)
movq %rcx, (%rdx)
jmp 0xcc22
movl %eax, %r14d
cmpl $0x2, %eax
jne 0xcc28
cmpb $0x0, 0xc(%rsp)
je 0xcbfe
movq (%rsp), %rcx
movq %r15, (%rcx)
movq 0x8(%r15), %rax
movq %rax, 0x8(%rcx)
movq 0x8(%r15), %rax
testq %rax, %rax
cmoveq %rbx, %rax
movq %rcx, (%rax)
movq %rcx, 0x8(%r15)
jmp 0xcc22
testq %rax, %rax
je 0xcbe8
movq (%rsp), %rcx
movq %rax, (%rcx)
movq $0x0, 0x8(%rcx)
movq (%rbx), %rax
movq %rcx, 0x8(%rax)
movq %rcx, (%rbx)
jmp 0xcc22
movq (%rsp), %rcx
movq %rcx, (%rbx)
movq %rcx, 0x8(%rbx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rax, (%rcx)
jmp 0xcc22
movq (%r15), %rax
movq (%rsp), %rdx
movq %rax, (%rdx)
movq %r15, 0x8(%rdx)
movq (%r15), %rax
leaq 0x8(%rax), %rcx
testq %rax, %rax
cmoveq 0x10(%rsp), %rcx
movq %rdx, (%rcx)
movq %rdx, (%r15)
incl 0x18(%rbx)
xorl %r14d, %r14d
cmpb $0x1, 0x1c(%rbx)
jne 0xcc3a
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_O1/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
movq %rdi, %rbx
cmpb $0x1, 0x1c(%rdi)
jne 0xcc61
leaq 0x20(%rbx), %rdi
callq 0x23b0
movl 0x18(%rbx), %ebp
cmpb $0x1, 0x1c(%rbx)
jne 0xcc76
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_O1/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
movq %rax, 0x8(%rdi)
movq %rax, (%rdi)
movq %rsi, 0x10(%rdi)
movl $0x0, 0x18(%rdi)
movb %dl, 0x1c(%rdi)
testl %edx, %edx
je 0xccaa
pushq %rax
addq $0x20, %rdi
xorl %esi, %esi
callq 0x2400
addq $0x8, %rsp
xorl %eax, %eax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/sharpyfox[P]citrusleaf-client/src/cf_proto.c
// Function: cl_proto_swap
void
cl_proto_swap(cl_proto *p)
{
	uint8_t	 version = p->version;
	uint8_t  type = p->type;
	p->version = p->type = 0;
	p->sz = cf_byteswap64p(p);
	p->version = version;
	p->type = type;
}

// Assembly:
movzwl (%rdi), %eax
movw $0x0, (%rdi)
movq (%rdi), %rcx
bswapq %rcx
movl %ecx, 0x2(%rdi)
shrq $0x20, %rcx
movw %cx, 0x6(%rdi)
movw %ax, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/sharpyfox[P]citrusleaf-client/src/cf_proto.c
// Function: cl_msg_swap_header
void
cl_msg_swap_header(cl_msg *m)
{
	m->generation = ntohl(m->generation);
	m->record_ttl =  ntohl(m->record_ttl);
	m->transaction_ttl = ntohl(m->transaction_ttl);
	m->n_fields = ntohs(m->n_fields);
	m->n_ops= ntohs(m->n_ops);
}

// Assembly:
movl 0x6(%rdi), %eax
movl 0xa(%rdi), %ecx
bswapl %eax
movl %eax, 0x6(%rdi)
bswapl %ecx
movl %ecx, 0xa(%rdi)
movl 0xe(%rdi), %eax
bswapl %eax
movl %eax, 0xe(%rdi)
rolw $0x8, 0x12(%rdi)
rolw $0x8, 0x14(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xcd2a
leaq 0x16(%rdi), %rax
xorl %ecx, %ecx
movl (%rax), %edx
bswapl %edx
movl %edx, (%rax)
leaq 0x4(%rax,%rdx), %rax
incl %ecx
movzwl 0x12(%rdi), %edx
cmpl %edx, %ecx
jb 0xcd15
retq
// File: /workspace/github_c_makefile_star2_O1/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:
leaq 0x16(%rdi), %rax
cmpw $0x0, 0x12(%rdi)
je 0xcd4d
xorl %ecx, %ecx
movl (%rax), %edx
bswapl %edx
movl %edx, (%rax)
leaq 0x4(%rax,%rdx), %rax
incl %ecx
movzwl 0x12(%rdi), %edx
cmpl %edx, %ecx
jb 0xcd38
cmpw $0x0, 0x14(%rdi)
je 0xcd6b
xorl %ecx, %ecx
movl (%rax), %edx
bswapl %edx
movl %edx, (%rax)
leaq 0x4(%rax,%rdx), %rax
incl %ecx
movzwl 0x14(%rdi), %edx
cmpl %edx, %ecx
jb 0xcd56
retq
// File: /workspace/github_c_makefile_star2_O1/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
movq %rdi, %rbx
cmpb $0x1, (%rdi)
jne 0xce19
leaq 0x40(%rbx), %rdi
callq 0x2530
leaq 0x18(%rbx), %rdi
callq 0x22b0
movq 0x70(%rbx), %rdi
movl 0x4(%rbx), %edx
imulq 0x10(%rbx), %rdx
xorl %esi, %esi
callq 0x2140
movq 0x70(%rbx), %rdi
callq 0x22c0
movl $0x78, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2140
movq %rbx, %rdi
popq %rbx
jmp 0x22c0
// File: /workspace/github_c_makefile_star2_O1/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
movq %rdi, %rbx
cmpb $0x1, (%rdi)
jne 0xce62
leaq 0x18(%rbx), %rdi
callq 0x23b0
movl 0x8(%rbx), %ebp
movl 0xc(%rbx), %r14d
cmpb $0x1, (%rbx)
jne 0xce7a
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_O1/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 0x4(%rdi), %ebx
movl 0x8(%rdi), %ecx
movl 0xc(%rdi), %eax
subl %eax, %ecx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl %ebx, %ecx
jne 0xcf64
movq %rdi, %r14
xorl %edx, %edx
divl %ebx
testl %edx, %edx
movl %esi, 0x4(%rsp)
je 0xcf31
movl %edx, %r13d
movl %esi, %edi
movq 0x10(%r14), %r12
imulq %r12, %rdi
callq 0x22e0
testq %rax, %rax
je 0xcf64
movq %rax, %r15
movl %ebx, %eax
subl %r13d, %eax
movl %r12d, %ebp
imull %eax, %ebp
movq 0x70(%r14), %rax
movl %r13d, %esi
imulq %r12, %rsi
addq %rax, %rsi
movq %rax, %r13
movq %r15, %rdi
movq %rbp, %rdx
callq 0x21b0
movq %r15, %rdi
addq %rbp, %rdi
imulq %rbx, %r12
subq %rbp, %r12
movq %r13, %rsi
movq %r12, %rdx
callq 0x21b0
movq %r13, %rdi
callq 0x22c0
movq %r15, 0x70(%r14)
movl 0x4(%r14), %eax
movl %eax, 0x8(%r14)
movl $0x0, 0xc(%r14)
jmp 0xcf5a
movq 0x70(%r14), %rdi
movl %esi, %esi
imulq 0x10(%r14), %rsi
callq 0x2470
movq %rax, 0x70(%r14)
testq %rax, %rax
je 0xcf64
movl $0x0, 0xc(%r14)
movl 0x4(%r14), %eax
movl %eax, 0x8(%r14)
movl 0x4(%rsp), %eax
movl %eax, 0x4(%r14)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, (%rdi)
jne 0xcfa3
leaq 0x18(%rbx), %rdi
callq 0x23b0
movl 0x4(%rbx), %esi
movl 0x8(%rbx), %eax
subl 0xc(%rbx), %eax
cmpl %esi, %eax
jne 0xcfcb
addl $0x40, %esi
movq %rbx, %rdi
callq 0xce84
testl %eax, %eax
je 0xcfcb
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpb $0x0, (%rbx)
jne 0xd020
jmp 0xd02c
movl 0x8(%rbx), %eax
xorl %edx, %edx
divl 0x4(%rbx)
movl %edx, %edi
movq 0x10(%rbx), %rdx
imulq %rdx, %rdi
addq 0x70(%rbx), %rdi
movq %r14, %rsi
callq 0x21b0
movl 0x8(%rbx), %ecx
incl %ecx
movl %ecx, 0x8(%rbx)
cmpl $0x40000000, %ecx       # imm = 0x40000000
jb 0xd00b
movl 0xc(%rbx), %eax
subl %eax, %ecx
xorl %edx, %edx
divl 0x4(%rbx)
movl %edx, 0xc(%rbx)
addl %edx, %ecx
movl %ecx, 0x8(%rbx)
cmpb $0x1, (%rbx)
jne 0xd019
leaq 0x40(%rbx), %rdi
callq 0x2030
xorl %ebp, %ebp
cmpb $0x1, (%rbx)
jne 0xd02c
addq $0x18, %rbx
movq %rbx, %rdi
callq 0x2190
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, (%rdi)
jne 0xd04d
leaq 0x18(%rbx), %rdi
callq 0x23b0
movl 0x8(%rbx), %eax
subl 0xc(%rbx), %eax
cmpl %ebp, %eax
jae 0xd06d
movl 0x4(%rbx), %esi
cmpl %esi, %eax
jne 0xd087
addl $0x40, %esi
movq %rbx, %rdi
callq 0xce84
testl %eax, %eax
je 0xd087
xorl %ebp, %ebp
cmpb $0x0, (%rbx)
je 0xd080
addq $0x18, %rbx
movq %rbx, %rdi
callq 0x2190
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl 0x8(%rbx), %eax
xorl %edx, %edx
divl 0x4(%rbx)
movl %edx, %edi
movq 0x10(%rbx), %rdx
imulq %rdx, %rdi
addq 0x70(%rbx), %rdi
movq %r14, %rsi
callq 0x21b0
movl 0x8(%rbx), %ecx
incl %ecx
movl %ecx, 0x8(%rbx)
cmpl $0x40000000, %ecx       # imm = 0x40000000
jb 0xd0c7
movl 0xc(%rbx), %eax
subl %eax, %ecx
xorl %edx, %edx
divl 0x4(%rbx)
movl %edx, 0xc(%rbx)
addl %edx, %ecx
movl %ecx, 0x8(%rbx)
cmpb $0x1, (%rbx)
jne 0xd0d5
leaq 0x40(%rbx), %rdi
callq 0x2030
movb $0x1, %bpl
cmpb $0x1, (%rbx)
je 0xd074
jmp 0xd080
// File: /workspace/github_c_makefile_star2_O1/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 %esi, %eax
movq %rdi, %rbx
movl 0x4(%rdi), %r9d
movl 0x8(%rdi), %edi
xorl %edx, %edx
divl %r9d
movl %edx, %ecx
movl 0xc(%rbx), %r8d
movl %r8d, %eax
xorl %edx, %edx
divl %r9d
movl %edx, %esi
movl %edi, %eax
xorl %edx, %edx
divl %r9d
cmpl %esi, %ecx
jne 0xd297
incl %r8d
movl %r8d, 0xc(%rbx)
jmp 0xd312
movl %edx, %eax
addl $-0x1, %eax
setae %r8b
cmpl %eax, %ecx
setne %al
orb %r8b, %al
jne 0xd2b1
decl %edi
movl %edi, 0x8(%rbx)
jmp 0xd312
movl %ecx, %eax
subl %esi, %eax
jbe 0xd2e3
movq 0x10(%rbx), %rcx
movq 0x70(%rbx), %rdx
leal 0x1(%rsi), %edi
imulq %rcx, %rdi
addq %rdx, %rdi
movl %esi, %esi
imulq %rcx, %rsi
addq %rdx, %rsi
imulq %rcx, %rax
movq %rax, %rdx
callq 0x2460
incl 0xc(%rbx)
jmp 0xd312
cmpl %edx, %ecx
jae 0xd312
movq 0x10(%rbx), %rax
movq 0x70(%rbx), %r8
movl %ecx, %edi
imulq %rax, %rdi
addq %r8, %rdi
leal 0x1(%rcx), %esi
imulq %rax, %rsi
addq %r8, %rsi
notl %ecx
addl %ecx, %edx
imulq %rax, %rdx
callq 0x2460
decl 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xd37f
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
cmpb $0x1, (%rdi)
jne 0xd337
leaq 0x18(%rbx), %rdi
callq 0x23b0
movl 0xc(%rbx), %ebp
cmpl %ebp, 0x8(%rbx)
jne 0xd354
xorl %ebp, %ebp
cmpb $0x1, (%rbx)
jne 0xd384
addq $0x18, %rbx
movq %rbx, %rdi
callq 0x2190
jmp 0xd384
cmpl 0x8(%rbx), %ebp
jae 0xd33f
movl %ebp, %eax
xorl %edx, %edx
divl 0x4(%rbx)
movl %edx, %edi
imulq 0x10(%rbx), %rdi
addq 0x70(%rbx), %rdi
movq %r14, %rsi
callq *%r15
cmpl $-0x1, %eax
je 0xd33f
cmpl $-0x2, %eax
je 0xd391
incl %ebp
jmp 0xd354
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movl %ebp, %esi
callq 0xd261
jmp 0xd33f
// File: /workspace/github_c_makefile_star2_O1/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:
testq %rdi, %rdi
je 0xd3d2
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, (%rdi)
jne 0xd3c3
leaq 0x18(%rbx), %rdi
callq 0x23b0
movl 0xc(%rbx), %r15d
cmpl %r15d, 0x8(%rbx)
jne 0xd3d8
xorl %r12d, %r12d
jmp 0xd44f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
movl $0x2, %eax
cmpl 0x8(%rbx), %r15d
jae 0xd442
movzbl %bpl, %eax
xorb $0x1, %bpl
leal (%rax,%rax,4), %r13d
xorl %r12d, %r12d
movl %r15d, %eax
xorl %edx, %edx
divl 0x4(%rbx)
movl %edx, %edi
movq 0x10(%rbx), %rdx
imulq %rdx, %rdi
addq 0x70(%rbx), %rdi
movq %r14, %rsi
callq 0x2260
movb $0x1, %cl
testl %eax, %eax
movl $0x0, %eax
jne 0xd42e
movq %rbx, %rdi
movl %r15d, %esi
callq 0xd261
movb $0x1, %r12b
movl %ebp, %ecx
movl %r13d, %eax
testb %cl, %cl
je 0xd445
incl %r15d
cmpl 0x8(%rbx), %r15d
jb 0xd3f2
movl $0x2, %eax
jmp 0xd445
xorl %r12d, %r12d
cmpl $0x5, %eax
je 0xd44f
cmpl $0x2, %eax
jne 0xd46b
cmpb $0x1, (%rbx)
jne 0xd460
addq $0x18, %rbx
movq %rbx, %rdi
callq 0x2190
movzbl %r12b, %eax
andl $0x1, %eax
leal -0x2(%rax,%rax), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movl $0x78, %edi
callq 0x22e0
testq %rax, %rax
je 0xd529
movq %rax, %rbx
movb %bpl, (%rax)
movq %r14, %rdi
xorl %esi, %esi
callq 0xcd6c
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0xd521
movq %r14, %rdi
xorl %esi, %esi
callq 0xcd6c
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0xd518
movq %r14, %rdi
xorl %esi, %esi
callq 0xcd6c
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0xd50f
testb %bpl, %bpl
je 0xd52b
leaq 0x20(%rbx), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x2400
testl %eax, %eax
jne 0xd506
movq %rbx, %rdi
addq $0x48, %rdi
xorl %esi, %esi
callq 0x22d0
testl %eax, %eax
je 0xd52b
movq %r14, %rdi
callq 0x22b0
movq 0x18(%rbx), %rdi
callq 0xcdfe
movq 0x10(%rbx), %rdi
callq 0xcdfe
movq 0x8(%rbx), %rdi
callq 0xcdfe
movq %rbx, %rdi
callq 0x22c0
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xcdfe
movq 0x10(%rbx), %rdi
callq 0xcdfe
movq 0x8(%rbx), %rdi
callq 0xcdfe
cmpb $0x1, (%rbx)
jne 0xd569
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_O1/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
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, (%rdi)
jne 0xd590
leaq 0x20(%rbx), %rdi
callq 0x23b0
decl %r15d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x2, %r15d
ja 0xd5b6
shll $0x3, %r15d
movq %rbx, %rax
subq %r15, %rax
movq 0x18(%rax), %rdi
movq %r14, %rsi
callq 0xcf8b
movl %eax, %ebp
testl %ebp, %ebp
jne 0xd5c8
cmpb $0x1, (%rbx)
jne 0xd5c8
leaq 0x48(%rbx), %rdi
callq 0x2030
cmpb $0x1, (%rbx)
jne 0xd5d9
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_O1/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
movq %rdi, %rbx
cmpb $0x1, (%rdi)
jne 0xd773
leaq 0x20(%rbx), %rdi
callq 0x23b0
movq 0x18(%rbx), %rdi
callq 0xce4d
movl %eax, %ebp
movq 0x10(%rbx), %rdi
callq 0xce4d
movl %eax, %r14d
movq 0x8(%rbx), %rdi
callq 0xce4d
movl %eax, %r15d
cmpb $0x1, (%rbx)
jne 0xd7a7
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_O1/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 0xd82c
movl %eax, %ebx
movl %eax, %edi
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2450
testl %eax, %eax
js 0xd861
orl $0x800, %eax            # imm = 0x800
movl %ebx, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x2450
testl %eax, %eax
js 0xd880
leaq 0x4(%rsp), %rcx
movl $0x1, (%rcx)
movl %ebx, %edi
movl $0x6, %esi
movl $0x1, %edx
movl $0x4, %r8d
callq 0x24d0
jmp 0xd8b2
leaq 0x9a95(%rip), %rax      # 0x172c8
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x0, (%rax)
jle 0xd8b2
leaq 0x9a8c(%rip), %rax      # 0x172d0
movq (%rax), %r14
callq 0x2040
movl (%rax), %edx
leaq 0x3f6a(%rip), %rsi      # 0x117bf
movl $0x1, %edi
xorl %eax, %eax
callq *%r14
jmp 0xd8b2
leaq 0x9a60(%rip), %rax      # 0x172c8
cmpl $0x0, (%rax)
jle 0xd8a6
leaq 0x9a5c(%rip), %rax      # 0x172d0
movq (%rax), %rcx
leaq 0x3f65(%rip), %rsi      # 0x117e3
jmp 0xd89d
leaq 0x9a41(%rip), %rax      # 0x172c8
cmpl $0x0, (%rax)
jle 0xd8a6
leaq 0x9a3d(%rip), %rax      # 0x172d0
movq (%rax), %rcx
leaq 0x3f62(%rip), %rsi      # 0x117ff
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_O1/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 %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
xorl %r15d, %r15d
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2450
cmpl $-0x1, %eax
cmovel %r15d, %eax
btl $0xb, %eax
jae 0xe5b4
andl $0xfffff7ff, %eax       # imm = 0xFFFFF7FF
movl %ebp, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x2450
cmpl $-0x1, %eax
je 0xe603
xorl %r12d, %r12d
leaq (%r14,%r12), %rsi
movq %rbx, %rdx
subq %r12, %rdx
movl %ebp, %edi
callq 0x2390
testl %eax, %eax
js 0xe5da
je 0xe5ed
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq %rax, %r12
movb $0x1, %al
jmp 0xe5f5
callq 0x2040
movl (%rax), %ecx
cmpl $0x6e, %ecx
sete %al
cmovnel %ecx, %r15d
jmp 0xe5f5
movl $0x9, %r15d
xorl %eax, %eax
testb %al, %al
je 0xe609
cmpq %rbx, %r12
jb 0xe5b7
xorl %r15d, %r15d
jmp 0xe609
movl $0x2, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebx
xorl %ebp, %ebp
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2450
cmpl $-0x1, %eax
cmovel %ebp, %eax
movl %eax, %ebp
andl $0x800, %ebp            # imm = 0x800
je 0xe662
andl $0xfffff7ff, %eax       # imm = 0xFFFFF7FF
movl %ebx, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x2450
cmpl $-0x1, %eax
je 0xe6bf
xorl %r13d, %r13d
leaq (%r15,%r13), %rsi
movq %r14, %rdx
subq %r13, %rdx
movl %ebx, %edi
callq 0x20c0
testl %eax, %eax
js 0xe686
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq %rax, %r13
movb $0x1, %al
jmp 0xe697
callq 0x2040
movl (%rax), %ecx
cmpl $0x6e, %ecx
sete %al
cmovnel %ecx, %r12d
testb %al, %al
je 0xe6c5
cmpq %r14, %r13
jb 0xe665
movl %ebx, %edi
movl $0x4, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2450
xorl %r12d, %r12d
cmpl $-0x1, %eax
sete %r12b
addl %r12d, %r12d
jmp 0xe6c5
movl $0x2, %r12d
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_O1/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 %edi, %ebp
movl $0x10, %edx
callq 0x21d0
xorl %ebx, %ebx
testl %eax, %eax
je 0xe7b7
callq 0x2040
movl (%rax), %ecx
cmpl $0x73, %ecx
je 0xe7b7
leaq 0x8b67(%rip), %rax      # 0x172c8
cmpl $0x6f, %ecx
jne 0xe78e
movl (%rax), %eax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, %eax
jl 0xe7b7
leaq 0x8b57(%rip), %rax      # 0x172d0
movq (%rax), %rcx
leaq 0x3468(%rip), %rsi      # 0x11beb
movl $0x3, %edi
xorl %eax, %eax
callq *%rcx
jmp 0xe7b7
movl (%rax), %eax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x2, %eax
jl 0xe7b7
leaq 0x8b2f(%rip), %rax      # 0x172d0
movq (%rax), %r8
leaq 0x345f(%rip), %rsi      # 0x11c0a
movl $0x2, %edi
movl %ebp, %edx
xorl %eax, %eax
callq *%r8
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %edx, %ebp
movl %esi, %r14d
movl %edi, %r15d
movl $0x48, %edi
callq 0x22e0
testq %rax, %rax
je 0xe84e
movq %rax, %rbx
movl %r15d, (%rax)
movl %ebp, 0x4(%rax)
movl %r14d, 0x8(%rax)
movl $0x0, 0xc(%rax)
movw $0x0, 0x18(%rax)
testl %r14d, %r14d
je 0xe852
movl %r14d, %edi
imull %r15d, %edi
callq 0x22e0
movq %rax, 0x10(%rbx)
testq %rax, %rax
jne 0xe85a
movq %rbx, %rdi
callq 0x22c0
xorl %ebx, %ebx
jmp 0xe886
movq $0x0, 0x10(%rbx)
testb $0x2, %bpl
je 0xe872
movq 0x10(%rbx), %rdi
imull %r15d, %r14d
xorl %esi, %esi
movq %r14, %rdx
callq 0x2140
testb $0x1, %bpl
je 0xe886
movq %rbx, %rdi
addq $0x20, %rdi
xorl %esi, %esi
callq 0x2400
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl %esi, (%rdi)
movl %ecx, 0x4(%rdi)
movl %edx, 0x8(%rdi)
movl $0x0, 0xc(%rdi)
movw $0x1, 0x18(%rdi)
testl %edx, %edx
je 0xe8dc
movl %r14d, %edi
imull %r15d, %edi
callq 0x22e0
movq %rax, 0x10(%rbx)
testq %rax, %rax
jne 0xe8e4
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0xe916
movq $0x0, 0x10(%rbx)
testb $0x2, %bpl
je 0xe8fc
movq 0x10(%rbx), %rdi
imull %r15d, %r14d
xorl %esi, %esi
movq %r14, %rdx
callq 0x2140
xorl %r14d, %r14d
testb $0x1, %bpl
je 0xe916
addq $0x20, %rbx
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2400
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movq %rdi, %rbx
movl %esi, (%rdi)
movl %ebp, 0x4(%rdi)
movl %r8d, %eax
xorl %edx, %edx
divl %esi
movl %eax, 0x8(%rdi)
movl $0x0, 0xc(%rdi)
movw $0x101, 0x18(%rdi)      # imm = 0x101
movq %rcx, 0x10(%rdi)
testb $0x2, %bpl
je 0xe966
movslq %r8d, %rdx
movq %rcx, %rdi
xorl %esi, %esi
callq 0x2140
testb $0x1, %bpl
jne 0xe973
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
addq $0x20, %rbx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2400
// File: /workspace/github_c_makefile_star2_O1/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
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
testb $0x1, 0x4(%rdi)
je 0xe9a4
leaq 0x20(%rbx), %rdi
callq 0x23b0
movl (%rbx), %eax
movl %eax, (%r14)
movl 0x4(%rbx), %eax
movl %eax, 0x4(%r14)
movl 0xc(%rbx), %eax
movl %eax, 0x8(%r14)
movl 0xc(%rbx), %eax
movl %eax, 0xc(%r14)
movw $0x101, 0x18(%r14)      # imm = 0x101
movq %r15, 0x10(%r14)
movq 0x10(%rbx), %rsi
movl 0xc(%rbx), %edx
imull (%rbx), %edx
movq %r15, %rdi
callq 0x21b0
testb $0x1, 0x4(%r14)
je 0xe9f0
addq $0x20, %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x2400
testb $0x1, 0x4(%rbx)
jne 0xe9fc
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_O1/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
movq %rdi, %rbx
testb $0x1, 0x4(%rdi)
je 0xea20
leaq 0x20(%rbx), %rdi
callq 0x22b0
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0xea34
cmpb $0x0, 0x19(%rbx)
jne 0xea34
callq 0x22c0
cmpb $0x0, 0x18(%rbx)
je 0xea3c
popq %rbx
retq
movq %rbx, %rdi
popq %rbx
jmp 0x22c0
// File: /workspace/github_c_makefile_star2_O1/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
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
testb $0x1, 0x4(%rdi)
je 0xea63
leaq 0x20(%rbx), %rdi
callq 0x23b0
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmpl %ebp, 0x8(%rbx)
jbe 0xea9e
movl (%rbx), %edx
movl %edx, %edi
imull %ebp, %edi
addq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x21b0
cmpl %ebp, 0xc(%rbx)
jae 0xea89
movl %ebp, 0xc(%rbx)
xorl %r15d, %r15d
testb $0x1, 0x4(%rbx)
je 0xea9e
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_O1/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
pushq %rax
movq %rsi, %r13
movq %rdi, %rbx
movl 0x8(%rdi), %r14d
movl 0xc(%rdi), %eax
leal 0x1(%rax), %ecx
cmpl %r14d, %ecx
jb 0xeb6d
addl %eax, %eax
cmpl $0x33, %eax
movl $0x32, %ebp
cmovael %eax, %ebp
testb $0x4, 0x4(%rbx)
cmovel %eax, %ebp
movq 0x10(%rbx), %r12
testq %r12, %r12
je 0xeaf3
cmpb $0x1, 0x19(%rbx)
jne 0xeb2f
movq %r13, (%rsp)
movl (%rbx), %r13d
movl %r13d, %edi
imull %ebp, %edi
callq 0x22e0
testq %rax, %rax
je 0xeb88
movq %rax, %r15
cmpb $0x1, 0x19(%rbx)
jne 0xeb29
imull %r14d, %r13d
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x21b0
movb $0x0, 0x19(%rbx)
movq (%rsp), %r13
jmp 0xeb3f
movl (%rbx), %esi
imull %ebp, %esi
movq %r12, %rdi
callq 0x2470
movq %rax, %r15
testq %r15, %r15
je 0xeb88
movq %r15, 0x10(%rbx)
testb $0x2, 0x4(%rbx)
je 0xeb6a
movl 0x8(%rbx), %eax
movl (%rbx), %ecx
imull %eax, %ecx
addq %rcx, %r15
movl %ebp, %edx
subl %eax, %edx
addl $0x2, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x2140
movl %ebp, 0x8(%rbx)
movl (%rbx), %edx
movl 0xc(%rbx), %edi
imull %edx, %edi
addq 0x10(%rbx), %rdi
movq %r13, %rsi
callq 0x21b0
incl 0xc(%rbx)
xorl %eax, %eax
jmp 0xeb8d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movq %rsi, %r14
movq %rdi, %rbx
testb $0x1, 0x4(%rdi)
je 0xebb5
leaq 0x20(%rbx), %rdi
callq 0x23b0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xeaac
movl %eax, %ebp
testb $0x1, 0x4(%rbx)
je 0xebd4
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x2190
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
testb $0x1, 0x4(%rdi)
je 0xebfb
leaq 0x20(%rbx), %rdi
callq 0x23b0
movl 0xc(%rbx), %r13d
movl $0x2, %ebp
testl %r13d, %r13d
je 0xec31
movl (%rbx), %r15d
movq 0x10(%rbx), %r12
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x2260
testl %eax, %eax
je 0xec2c
addq %r15, %r12
decl %r13d
jne 0xec10
jmp 0xec31
movl $0x5, %ebp
cmpl $0x5, %ebp
je 0xec4a
cmpl $0x2, %ebp
jne 0xec5e
movq %rbx, %rdi
movq %r14, %rsi
callq 0xeaac
movl %eax, %ebp
jmp 0xec4c
xorl %ebp, %ebp
testb $0x1, 0x4(%rbx)
je 0xec5e
addq $0x20, %rbx
movq %rbx, %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_O1/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
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %rbx
testb $0x1, 0x4(%rdi)
je 0xec8e
leaq 0x20(%rbx), %rdi
callq 0x23b0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl %r15d, 0x8(%rbx)
jbe 0xecc2
movl (%rbx), %edx
imull %edx, %r15d
addq 0x10(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x21b0
xorl %ebp, %ebp
testb $0x1, 0x4(%rbx)
je 0xecc2
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_O1/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
movl %esi, %ebx
movq %rdi, %r14
testb $0x1, 0x4(%rdi)
je 0xece7
leaq 0x20(%r14), %rdi
callq 0x23b0
cmpl %ebx, 0x8(%r14)
jbe 0xed0a
imull (%r14), %ebx
addq 0x10(%r14), %rbx
testb $0x1, 0x4(%r14)
je 0xed0c
addq $0x20, %r14
movq %r14, %rdi
callq 0x2190
jmp 0xed0c
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xed4b
movl %esi, %ebx
movq %rdi, %r14
cmpl %esi, 0x8(%rdi)
jbe 0xed4b
movq %rdx, %r15
leaq 0x20(%r14), %r12
movq %r12, %rdi
callq 0x23b0
movq %r12, (%r15)
imull (%r14), %ebx
addq 0x10(%r14), %rbx
jmp 0xed4d
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/sharpyfox[P]citrusleaf-client/src/cf_vector.c
// Function: cf_vector_delete
int
cf_vector_delete(cf_vector *v, uint32_t index)
{
	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_LOCK(v);
	// check bounds
	if (index >= v->len)
		return (-1);
	// check for last - no copy
	if (index != v->len - 1) {
		memmove(v->vector + (index * v->value_len), 
				v->vector + ((index+1) * v->value_len),
				(v->len - (index+1)) * v->value_len );
	}
	v->len --;
	
	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_UNLOCK(v);
	return(0);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
testb $0x1, 0x4(%rdi)
je 0xed74
leaq 0x20(%rbx), %rdi
callq 0x23b0
movl 0xc(%rbx), %edx
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpl %ebp, %edx
jbe 0xedc2
leal -0x1(%rdx), %eax
cmpl %ebp, %eax
je 0xedaa
movq 0x10(%rbx), %rax
movl (%rbx), %ecx
movl %ecx, %edi
imull %ebp, %edi
addq %rax, %rdi
incl %ebp
subl %ebp, %edx
imull %ecx, %edx
movl %ecx, %esi
imull %ebp, %esi
addq %rax, %rsi
callq 0x2460
decl 0xc(%rbx)
xorl %r14d, %r14d
testb $0x1, 0x4(%rbx)
je 0xedc2
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x2190
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sharpyfox[P]citrusleaf-client/src/cf_vector.c
// Function: cf_vector_delete_range
int
cf_vector_delete_range(cf_vector *v, uint32_t idx_start, uint32_t idx_end)
{
	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_LOCK(v);
	// check bounds
	if (idx_start >= idx_end)
		return (-1);
	if (idx_start >= v->len)
		return(-1);
	if (idx_end >= v->len)
		return(-1);
	
	// Copy down if not at end
	if (idx_end != v->len - 1) {
		memmove( v->vector + (idx_start * v->value_len),
				v->vector + ((idx_end+1) * v->value_len),
			    (v->len - (idx_end+1)) * v->value_len );
	
	}
	v->len -= (idx_end - idx_start) + 1;
	
	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_UNLOCK(v);
	return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
testb $0x1, 0x4(%rdi)
je 0xede8
leaq 0x20(%rbx), %rdi
callq 0x23b0
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmpl %r14d, %ebp
jae 0xee52
movl 0xc(%rbx), %edx
cmpl %ebp, %edx
setbe %al
cmpl %r14d, %edx
setbe %cl
orb %al, %cl
jne 0xee52
leal -0x1(%rdx), %eax
cmpl %r14d, %eax
je 0xee33
movq 0x10(%rbx), %rax
movl (%rbx), %ecx
leal 0x1(%r14), %r8d
movl %ecx, %esi
subl %r8d, %edx
imull %ecx, %edx
movl %ecx, %edi
imull %ebp, %edi
addq %rax, %rdi
imull %r8d, %esi
addq %rax, %rsi
callq 0x2460
notl %r14d
addl %ebp, %r14d
addl %r14d, 0xc(%rbx)
xorl %r15d, %r15d
testb $0x1, 0x4(%rbx)
je 0xee52
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_O1/sharpyfox[P]citrusleaf-client/src/cf_vector.c
// Function: cf_vector_compact
void
cf_vector_compact(cf_vector *v)
{
	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_LOCK(v);
	if (v->alloc_len && (v->len != v->alloc_len)) {
		v->vector = (uint8_t*)realloc(v->vector, v->len * v->alloc_len);
		v->alloc_len = v->len;
	}
	if (v->flags & VECTOR_FLAG_BIGLOCK)
		VECTOR_UNLOCK(v);
	return;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testb $0x1, 0x4(%rdi)
je 0xee73
leaq 0x20(%rbx), %rdi
callq 0x23b0
movl 0x8(%rbx), %eax
testl %eax, %eax
je 0xee97
movl 0xc(%rbx), %esi
cmpl %eax, %esi
je 0xee97
movq 0x10(%rbx), %rdi
imull %eax, %esi
callq 0x2470
movq %rax, 0x10(%rbx)
movl 0xc(%rbx), %eax
movl %eax, 0x8(%rbx)
testb $0x1, 0x4(%rbx)
jne 0xee9f
popq %rbx
retq
addq $0x20, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0x2190