LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/citrusleaf.c
// Function: citrusleaf_operate
extern cl_rv
citrusleaf_operate(cl_cluster *asc, const char *ns, const char *set, const cl_object *key, cl_operation *operations, int n_operations, const cl_write_parameters *cl_w_p,  int replace, uint32_t *generation)
{
    if (!g_initialized) return(-1);
    
	// see if there are any read or write bits ---
	//   (this is slightly obscure c usage....)
	int info1 = 0, info2 = 0, info3 = 0;
	uint64_t trid=0;

	for (int i=0;i<n_operations;i++) {
		switch (operations[i].op) {
		case CL_OP_WRITE:
		case CL_OP_MC_INCR:
		case CL_OP_INCR:
		case CL_OP_APPEND:
		case CL_OP_PREPEND:
		case CL_OP_MC_APPEND:
		case CL_OP_MC_PREPEND:
		case CL_OP_MC_TOUCH:
		case CL_OP_TOUCH:
			info2 = CL_MSG_INFO2_WRITE;
			break;
		case CL_OP_READ:
			info1 = CL_MSG_INFO1_READ;
			break;
		default:
			break;
		}
		
		if (info1 && info2) break;
	}
	

	if (replace)
		info3 = CL_MSG_INFO3_REPLACE;

	return( do_the_full_monte( asc, info1, info2, info3, ns, set, key, 0, 0, 0, 
			&operations, &n_operations, generation, cl_w_p, &trid, NULL) );
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq 0xd0(%rsp), %rax
movl 0xc8(%rsp), %eax
movq 0xc0(%rsp), %rax
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movq %rcx, 0x78(%rsp)
movq %r8, 0x70(%rsp)
movl %r9d, 0x6c(%rsp)
testb $0x1, 0x16bff(%rip)     # 0x203b0
jne 0x97c3
movl $0xffffffff, 0x9c(%rsp) # imm = 0xFFFFFFFF
jmp 0x990a
movl $0x0, 0x68(%rsp)
movl $0x0, 0x64(%rsp)
movl $0x0, 0x60(%rsp)
movq $0x0, 0x58(%rsp)
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
cmpl 0x6c(%rsp), %eax
jge 0x9860
movq 0x70(%rsp), %rax
movslq 0x54(%rsp), %rcx
leaq (%rcx,%rcx,8), %rcx
movl 0x40(%rax,%rcx,8), %eax
movl %eax, 0x50(%rsp)
testl %eax, %eax
je 0x982b
jmp 0x9812
movl 0x50(%rsp), %eax
subl $0x1, %eax
je 0x9835
jmp 0x981d
movl 0x50(%rsp), %eax
addl $-0x2, %eax
subl $0x7, %eax
ja 0x983f
jmp 0x982b
movl $0x1, 0x64(%rsp)
jmp 0x9841
movl $0x1, 0x68(%rsp)
jmp 0x9841
jmp 0x9841
cmpl $0x0, 0x68(%rsp)
je 0x9851
cmpl $0x0, 0x64(%rsp)
je 0x9851
jmp 0x9860
jmp 0x9853
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x97ec
cmpl $0x0, 0xc8(%rsp)
je 0x9872
movl $0x8, 0x60(%rsp)
movq 0x90(%rsp), %rdi
movl 0x68(%rsp), %esi
movl 0x64(%rsp), %edx
movl 0x60(%rsp), %ecx
movq 0x88(%rsp), %r8
movq 0x80(%rsp), %r9
movq 0x78(%rsp), %r15
movq 0xd0(%rsp), %r11
movq 0xc0(%rsp), %r10
xorl %eax, %eax
xorl %eax, %eax
leaq 0x70(%rsp), %r14
leaq 0x6c(%rsp), %rbx
leaq 0x58(%rsp), %rax
movq %r15, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
movq %r14, 0x20(%rsp)
movq %rbx, 0x28(%rsp)
movq %r11, 0x30(%rsp)
movq %r10, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movq $0x0, 0x48(%rsp)
callq 0x74b0
movl %eax, 0x9c(%rsp)
movl 0x9c(%rsp), %eax
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/citrusleaf.c
// Function: citrusleaf_init
int citrusleaf_init() 
{
	extern char *citrusleaf_build_string;
	cf_info("Aerospike client version %s", citrusleaf_build_string);

	// remember the process id which is spawning the background threads.
	// only this process can call a pthread_join() on the threads that it spawned.
	g_init_pid = getpid();

	citrusleaf_cluster_init();

#ifdef DEBUG_HISTOGRAM	
    if (NULL == (cf_hist = cf_histogram_create("transaction times")))
        cf_error("couldn't create histogram for client");
#endif	

    g_initialized = true;
    
	return(0);
}

// Assembly:
pushq %rax
leaq 0x14960(%rip), %rax     # 0x1e2d8
movl (%rax), %ecx
movl $0x2, %eax
cmpl %ecx, %eax
jg 0x99a7
leaq 0x14956(%rip), %rax     # 0x1e2e0
movq (%rax), %rcx
leaq 0x14954(%rip), %rax     # 0x1e2e8
movq (%rax), %rdx
movl $0x2, %edi
leaq 0xef8c(%rip), %rsi      # 0x1892f
movb $0x0, %al
callq *%rcx
callq 0x23d0
movl %eax, %ecx
leaq 0x169ff(%rip), %rax     # 0x203b4
movl %ecx, (%rax)
movb $0x0, %al
callq 0xc3c0
movb $0x1, 0x169eb(%rip)     # 0x203b0
xorl %eax, %eax
popq %rcx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/citrusleaf.c
// Function: citrusleaf_shutdown
void citrusleaf_shutdown(void) {

	if (g_initialized == false)
		return;

	citrusleaf_cluster_shutdown();
	citrusleaf_batch_shutdown();
	citrusleaf_async_shutdown();

	if (g_shared_memory) {
		citrusleaf_shm_free();
	}

	g_initialized = false;
}

// Assembly:
pushq %rax
movb 0x169d9(%rip), %al      # 0x203b0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x99e3
jmp 0x9a10
callq 0xaa70
movb $0x0, %al
callq 0xe7d0
movb $0x0, %al
callq 0x10fc0
leaq 0x16beb(%rip), %rax     # 0x205e8
testb $0x1, (%rax)
je 0x9a09
movb $0x0, %al
callq 0x11c50
movb $0x0, 0x169a0(%rip)     # 0x203b0
popq %rax
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/citrusleaf.c
// Function: op_to_value_int
static int
op_to_value_int(uint8_t	*buf, int sz, int64_t *value)
{
	if (sz > 8)	return(-1);
	if (sz == 8) {
		// no need to worry about sign extension - blast it
#ifdef OSX
		*value = OSSwapHostToBigInt64(*(uint64_t *) buf);
#else //Linux
		*value = __cpu_to_be64(*(__u64 *) buf);
#endif	
		return(0);
	}
	if (sz == 0) {
		*value = 0;
		return(0);
	}
	if (sz == 1 && *buf < 0x7f) {
		*value = *buf;
		return(0);
	}
	
	// negative numbers must be sign extended; yuck
	if (*buf & 0x80) {
		uint8_t	lg_buf[8];
		int i;
		for (i=0;i<8-sz;i++)	lg_buf[i]=0xff;
		memcpy(&lg_buf[i],buf,sz);
#ifdef OSX
		*value = OSSwapHostToBigInt64(*(uint64_t *) buf);
#else //Linux
		*value = __cpu_to_be64((__u64) *buf);
#endif
		return(0);
	}
	// positive numbers don't
	else {
		int64_t	v = 0;
		for (int i=0;i<sz;i++,buf++) {
			v <<= 8;
			v |= *buf;
		}
		*value = v;
		return(0);
	}
	
	
	return(0);
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movl %esi, 0x44(%rsp)
movq %rdx, 0x38(%rsp)
cmpl $0x8, 0x44(%rsp)
jle 0x9a56
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x9bd0
cmpl $0x8, 0x44(%rsp)
jne 0x9a89
movq 0x48(%rsp), %rax
movq (%rax), %rdi
callq 0x7210
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x54(%rsp)
jmp 0x9bd0
cmpl $0x0, 0x44(%rsp)
jne 0x9aa9
movq 0x38(%rsp), %rax
movq $0x0, (%rax)
movl $0x0, 0x54(%rsp)
jmp 0x9bd0
cmpl $0x1, 0x44(%rsp)
jne 0x9adc
movq 0x48(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x7f, %eax
jge 0x9adc
movq 0x48(%rsp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
movq 0x38(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x54(%rsp)
jmp 0x9bd0
movq 0x48(%rsp), %rax
movzbl (%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x9b65
movl $0x0, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
movl $0x8, %ecx
subl 0x44(%rsp), %ecx
cmpl %ecx, %eax
jge 0x9b1e
movslq 0x2c(%rsp), %rax
movb $-0x1, 0x30(%rsp,%rax)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x9af6
movslq 0x2c(%rsp), %rax
leaq 0x30(%rsp), %rdi
addq %rax, %rdi
movq 0x48(%rsp), %rsi
movslq 0x44(%rsp), %rdx
callq 0x21e0
movq 0x48(%rsp), %rax
movzbl (%rax), %eax
movl %eax, %edi
callq 0x7210
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x54(%rsp)
jmp 0x9bd0
movq $0x0, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x44(%rsp), %eax
jge 0x9bbb
movq 0x20(%rsp), %rax
shlq $0x8, %rax
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rax
movzbl (%rax), %eax
orq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x9b76
movq 0x20(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/../include/citrusleaf/cf_clock.h
// Function: TIMESPEC_TO_MS
inline static uint64_t 
TIMESPEC_TO_MS( struct timespec *ts )
{
	uint64_t r1 = ts->tv_nsec;
	r1 /= 1000000;
	uint64_t r2 = ts->tv_sec;
	r2 *= 1000;
	return( r1 + r2 );
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rsp)
movq -0x10(%rsp), %rax
movl $0xf4240, %ecx          # imm = 0xF4240
xorl %edx, %edx
divq %rcx
movq %rax, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rsp)
imulq $0x3e8, -0x18(%rsp), %rax # imm = 0x3E8
movq %rax, -0x18(%rsp)
movq -0x10(%rsp), %rax
addq -0x18(%rsp), %rax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: cl_cluster_node_get_byaddr
cl_cluster_node *
cl_cluster_node_get_byaddr(cl_cluster *asc, struct sockaddr_in *sa_in)
{
	// No need to lock nodes list because this function is only called by
	// cluster_tend() thread which has exclusive write access.
	for (uint i=0;i<cf_vector_size(&asc->node_v);i++) {
		cl_cluster_node *cn = cf_vector_pointer_get(&asc->node_v, i);
		for (uint j=0;j<cf_vector_size(&cn->sockaddr_in_v);j++) {
			struct sockaddr_in *node_sa_in = cf_vector_getp(&cn->sockaddr_in_v, j);
			if (memcmp(sa_in, node_sa_in, sizeof(struct sockaddr_in) ) == 0 ) {
				return(cn);
			}
		}
	}
	return(0);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movl $0x0, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x38(%rsp), %rdi
addq $0xf8, %rdi
callq 0x9da0
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jae 0x9d8b
movq 0x38(%rsp), %rdi
addq $0xf8, %rdi
movl 0x2c(%rsp), %esi
callq 0x9db0
movq %rax, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
addq $0x20, %rdi
callq 0x9da0
movl %eax, %ecx
movl 0x8(%rsp), %eax
cmpl %ecx, %eax
jae 0x9d79
movq 0x20(%rsp), %rdi
addq $0x20, %rdi
movl 0x1c(%rsp), %esi
callq 0x17340
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rax
movq 0x10(%rsp), %rcx
movups (%rcx), %xmm1
movups (%rax), %xmm0
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
subl $0xffff, %eax           # imm = 0xFFFF
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x9d6a
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x9d94
jmp 0x9d6c
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x9cff
jmp 0x9d7b
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x9cb6
movq $0x0, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: citrusleaf_cluster_create
cl_cluster *
citrusleaf_cluster_create(void)
{
    if (! g_clust_initialized )    return(0);
    
	cl_cluster *asc = malloc(sizeof(cl_cluster));
	if (!asc)	return(0);
	
	asc->state = 0;
	asc->follow = true;
	asc->nbconnect = false;
	asc->found_all = false;
	asc->last_node = 0;
	asc->ref_count = 1;
	// Default is 0 so the cluster uses global tend period.
	// For the cluster user has to specifically set the own
	// value
	asc->tend_speed = 0;
	
	pthread_mutex_init(&asc->LOCK, 0);
	
	cf_vector_pointer_init(&asc->host_str_v, 10, 0);
	cf_vector_integer_init(&asc->host_port_v, 10, 0);
	cf_vector_pointer_init(&asc->host_addr_map_v, 10, 0);
	cf_vector_pointer_init(&asc->node_v, 10, 0);
	
	pthread_mutex_lock(&cluster_ll_LOCK);
	cf_ll_append(&cluster_ll, (cf_ll_element *) asc);
	pthread_mutex_unlock(&cluster_ll_LOCK);
	
	asc->n_partitions = 0;
	asc->partition_table_head = 0;
	
	return(asc);
}

// Assembly:
subq $0x18, %rsp
leaq 0x165cd(%rip), %rax     # 0x203b8
cmpl $0x0, (%rax)
jne 0x9dfe
movq $0x0, 0x10(%rsp)
jmp 0x9f37
movl $0x180, %edi            # imm = 0x180
callq 0x2310
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x9e23
movq $0x0, 0x10(%rsp)
jmp 0x9f37
movq 0x8(%rsp), %rax
movl $0x0, 0x10(%rax)
movq 0x8(%rsp), %rax
movb $0x1, 0x14(%rax)
movq 0x8(%rsp), %rax
movb $0x0, 0x15(%rax)
movq 0x8(%rsp), %rax
movb $0x0, 0x16(%rax)
movq 0x8(%rsp), %rax
movl $0x0, 0xf0(%rax)
movq 0x8(%rsp), %rax
movl $0x1, 0x150(%rax)
movq 0x8(%rsp), %rax
movl $0x0, 0x154(%rax)
movq 0x8(%rsp), %rdi
addq $0x158, %rdi            # imm = 0x158
xorl %eax, %eax
movl %eax, %esi
callq 0x2430
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
movl $0xa, %esi
xorl %edx, %edx
callq 0x9f50
movq 0x8(%rsp), %rdi
addq $0x60, %rdi
movl $0xa, %esi
xorl %edx, %edx
callq 0x9f80
movq 0x8(%rsp), %rdi
addq $0xa8, %rdi
movl $0xa, %esi
xorl %edx, %edx
callq 0x9f50
movq 0x8(%rsp), %rdi
addq $0xf8, %rdi
movl $0xa, %esi
xorl %edx, %edx
callq 0x9f50
leaq 0x164d3(%rip), %rdi     # 0x203c0
callq 0x23e0
movq 0x8(%rsp), %rsi
leaq 0x164ea(%rip), %rdi     # 0x203e8
callq 0x13260
leaq 0x164b6(%rip), %rdi     # 0x203c0
callq 0x21c0
movq 0x8(%rsp), %rax
movw $0x0, 0x140(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x148(%rax)
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: citrusleaf_cluster_release_or_destroy
void
citrusleaf_cluster_release_or_destroy(cl_cluster **asc) {
#ifdef DEBUG
	if (asc && *asc) {
		cf_debug("release or destroy for cluster object - %p. ref_count = %d", *asc, (*asc)->ref_count);
	} else {
		cf_debug("release or destroy - asc is  NULL");
	}
#endif

	if (!asc || !(*asc))
		return;

	pthread_mutex_lock(&(*asc)->LOCK);
	if ((*asc)->ref_count > 0) {
		(*asc)->ref_count--;

		if (0 == (*asc)->ref_count) {
			pthread_mutex_unlock(&(*asc)->LOCK);
			// Destroy the object as reference count is 0
			#ifdef DEBUG
			cf_debug("destroying the cluster object as reference count is 0");
			#endif
			citrusleaf_cluster_destroy(*asc);
			*asc = NULL;
			return;
		}
	}
	pthread_mutex_unlock(&(*asc)->LOCK);
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
cmpq $0x0, (%rsp)
je 0xa636
movq (%rsp), %rax
cmpq $0x0, (%rax)
jne 0xa63b
jmp 0xa6c6
movq (%rsp), %rax
movq (%rax), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x23e0
movq (%rsp), %rax
movq (%rax), %rax
cmpl $0x0, 0x150(%rax)
jbe 0xa6b3
movq (%rsp), %rax
movq (%rax), %rax
movl 0x150(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x150(%rax)
movq (%rsp), %rax
movq (%rax), %rcx
xorl %eax, %eax
cmpl 0x150(%rcx), %eax
jne 0xa6b1
movq (%rsp), %rax
movq (%rax), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x21c0
movq (%rsp), %rax
movq (%rax), %rdi
callq 0xa6d0
movq (%rsp), %rax
movq $0x0, (%rax)
jmp 0xa6c6
jmp 0xa6b3
movq (%rsp), %rax
movq (%rax), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x21c0
popq %rax
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: cl_cluster_node_release
void
cl_cluster_node_release(cl_cluster_node *cn)
{
	int i;
	cl_async_work *aw;
	if (0 == cf_client_rc_release(cn)) {
		
		cf_vector_destroy(&cn->sockaddr_in_v);
		
		// Drain out the queue and close the FDs
		int rv;
		do {
			int	fd;
			rv = cf_queue_pop(cn->conn_q, &fd, CF_QUEUE_NOWAIT);
			if (rv == CF_QUEUE_OK)
				close(fd);
		} while (rv == CF_QUEUE_OK);
		do {
			int	fd;
			rv = cf_queue_pop(cn->conn_q_asyncfd, &fd, CF_QUEUE_NOWAIT);
			if (rv == CF_QUEUE_OK)
				close(fd);
		} while (rv == CF_QUEUE_OK);

		do {
			//When we reach this point, ideally there should not be any workitems.
			rv = cf_queue_pop(cn->asyncwork_q, &aw, CF_QUEUE_NOWAIT);
			if (rv == CF_QUEUE_OK) {
				free(aw);
			}
		} while (rv == CF_QUEUE_OK);

		//We want to delete all the workitems of this node
		if (g_cl_async_hashtab) {
			shash_reduce_delete(g_cl_async_hashtab, cl_del_node_asyncworkitems, cn);
		}

		//Now that all the workitems are released the FD can be closed
		if (cn->asyncfd != -1) {
			close(cn->asyncfd);
			cn->asyncfd = -1;
		}

		cf_queue_destroy(cn->conn_q);
		cf_queue_destroy(cn->conn_q_asyncfd);
		cf_queue_destroy(cn->asyncwork_q);
		pthread_mutex_destroy(&cn->LOCK);
		cf_client_rc_free(cn);
	}
	
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x12da0
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0xaa5c
movq 0x20(%rsp), %rdi
addq $0x20, %rdi
callq 0x16e10
movq 0x20(%rsp), %rax
movq 0x70(%rax), %rdi
leaq 0x8(%rsp), %rsi
xorl %edx, %edx
callq 0x14590
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jne 0xa94a
movl 0x8(%rsp), %edi
callq 0x2570
jmp 0xa94c
cmpl $0x0, 0xc(%rsp)
je 0xa921
jmp 0xa955
movq 0x20(%rsp), %rax
movq 0x78(%rax), %rdi
leaq 0x4(%rsp), %rsi
xorl %edx, %edx
callq 0x14590
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jne 0xa97e
movl 0x4(%rsp), %edi
callq 0x2570
jmp 0xa980
cmpl $0x0, 0xc(%rsp)
je 0xa955
jmp 0xa989
movq 0x20(%rsp), %rax
movq 0x88(%rax), %rdi
leaq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x14590
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jne 0xa9b6
movq 0x10(%rsp), %rdi
callq 0x22e0
jmp 0xa9b8
cmpl $0x0, 0xc(%rsp)
je 0xa989
leaq 0x15c0a(%rip), %rax     # 0x205d0
cmpq $0x0, (%rax)
je 0xa9e7
leaq 0x15bfd(%rip), %rax     # 0x205d0
movq (%rax), %rdi
movq 0x20(%rsp), %rdx
leaq 0x536e(%rip), %rsi      # 0xfd50
callq 0x50e0
movq 0x20(%rsp), %rax
cmpl $-0x1, 0x80(%rax)
je 0xaa14
movq 0x20(%rsp), %rax
movl 0x80(%rax), %edi
callq 0x2570
movq 0x20(%rsp), %rax
movl $0xffffffff, 0x80(%rax) # imm = 0xFFFFFFFF
movq 0x20(%rsp), %rax
movq 0x70(%rax), %rdi
callq 0x13ff0
movq 0x20(%rsp), %rax
movq 0x78(%rax), %rdi
callq 0x13ff0
movq 0x20(%rsp), %rax
movq 0x88(%rax), %rdi
callq 0x13ff0
movq 0x20(%rsp), %rdi
addq $0x90, %rdi
callq 0x22d0
movq 0x20(%rsp), %rdi
callq 0x12e70
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: citrusleaf_cluster_shutdown
void
citrusleaf_cluster_shutdown(void)
{
	// this one use has to be threadsafe, because two simultaneous shutdowns???
	cf_ll_element *e;
	// pthread_mutex_lock(&cluster_ll_LOCK);
	while ((e = cf_ll_get_head(&cluster_ll))) {
		cl_cluster *asc = (cl_cluster *)e; 
		citrusleaf_cluster_destroy(asc); // safe?
	}

	/* Cancel tender thread */	
	pthread_cancel(tender_thr);

	/* 
	 * If a process is forked, the threads in it do not get spawned in the child process.
	 * In citrusleaf_init(), we are remembering the processid(g_init_pid) of the process who spawned the 
	 * background threads. If the current process is not the process who spawned the background threads
	 * then it cannot call pthread_join() on the threads which does not exist in this process.
	 */
	if(g_init_pid == getpid()) {
		pthread_join(tender_thr,NULL);
	}

	// pthread_mutex_unlock(&cluster_ll_LOCK);
}

// Assembly:
subq $0x18, %rsp
leaq 0x1596d(%rip), %rdi     # 0x203e8
callq 0xa210
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0xaaa1
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
callq 0xa6d0
jmp 0xaa74
movq 0x15988(%rip), %rdi     # 0x20430
callq 0x2370
leaq 0x15900(%rip), %rax     # 0x203b4
movl (%rax), %eax
movl %eax, 0x4(%rsp)
callq 0x23d0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jne 0xaad9
movq 0x15960(%rip), %rdi     # 0x20430
xorl %eax, %eax
movl %eax, %esi
callq 0x2250
addq $0x18, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: citrusleaf_cluster_add_addr_map
void
citrusleaf_cluster_add_addr_map(cl_cluster *asc, char *orig, char *alt)
{
	int	i, vsz;
	cl_addrmap *oldmap=NULL, *newmap=NULL;


	//Search if the given mapping already exists
	vsz = asc->host_addr_map_v.len;
	for (i=0; i<vsz; i++)
	{
		oldmap = cf_vector_pointer_get(&asc->host_addr_map_v, i);
		if (oldmap && strcmp(oldmap->orig, orig) == 0) {
			//The original address is already in the map. update its alternative.
			free(oldmap->alt); //free the old string.
			oldmap->alt = strdup(alt);
			return;
		}
	}

	//We need to add the supplied map only if does not already exist
	if (i==vsz) {
		cl_addrmap *newmap = (cl_addrmap *) malloc(sizeof(struct cl_addrmap));
		if (newmap == NULL) {
			return;
		}

		newmap->orig = strdup(orig);
		newmap->alt = strdup(alt);
		cf_vector_pointer_append(&asc->host_addr_map_v, newmap);
		//cf_debug("Adding the mapping %x:%s->%s", newmap, orig, alt);
	} 
	else {
		//cf_debug("Mapping %s->%s already exists", oldmap->orig, oldmap->alt);
	}

}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq 0x30(%rsp), %rax
movl 0xb4(%rax), %eax
movl %eax, 0x18(%rsp)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x18(%rsp), %eax
jge 0xb144
movq 0x30(%rsp), %rdi
addq $0xa8, %rdi
movl 0x1c(%rsp), %esi
callq 0x9db0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0xb135
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq 0x28(%rsp), %rsi
callq 0x2380
cmpl $0x0, %eax
jne 0xb135
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x22e0
movq 0x20(%rsp), %rdi
callq 0x2520
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0xb1a7
jmp 0xb137
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xb0cc
movl 0x1c(%rsp), %eax
cmpl 0x18(%rsp), %eax
jne 0xb1a5
movl $0x10, %edi
callq 0x2310
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0xb165
jmp 0xb1a7
movq 0x28(%rsp), %rdi
callq 0x2520
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rdi
callq 0x2520
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x30(%rsp), %rdi
addq $0xa8, %rdi
movq (%rsp), %rsi
callq 0xaae0
jmp 0xb1a7
jmp 0xb1a7
addq $0x38, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: cl_cluster_node_create
cl_cluster_node *
cl_cluster_node_create(char *name, struct sockaddr_in *sa_in)
{
	int i;
	cl_cluster_node *cn = cf_client_rc_alloc( sizeof(cl_cluster_node ) );
	if (!cn)	return(0);
	
	strcpy(cn->name, name);

	cn->dun_score = 0;
	cn->dunned = false;
	
	cf_vector_init(&cn->sockaddr_in_v, sizeof( struct sockaddr_in ), 5, 0);
	cf_vector_append(&cn->sockaddr_in_v, sa_in);
	
	cn->conn_q = cf_queue_create( sizeof(int), true );
	cn->conn_q_asyncfd = cf_queue_create( sizeof(int), true );

	cn->asyncfd = -1;
	cn->asyncwork_q = cf_queue_create(sizeof(cl_async_work *), true);
	
	cn->partition_generation = 0xFFFFFFFF;
	
	pthread_mutex_init(&cn->LOCK, 0);
	
	return(cn);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl $0xb8, %edi
callq 0x12e00
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0xb581
movq $0x0, 0x20(%rsp)
jmp 0xb654
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x2270
movq (%rsp), %rax
movl $0x0, 0x14(%rax)
movq (%rsp), %rax
movb $0x0, 0x18(%rax)
movq (%rsp), %rdi
addq $0x20, %rdi
movl $0x10, %esi
movl $0x5, %edx
xorl %ecx, %ecx
callq 0x16b50
movq (%rsp), %rdi
addq $0x20, %rdi
movq 0x10(%rsp), %rsi
callq 0x17140
movl $0x4, %edi
movl $0x1, %esi
callq 0x13e70
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x70(%rax)
movl $0x4, %edi
movl $0x1, %esi
callq 0x13e70
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x78(%rax)
movq (%rsp), %rax
movl $0xffffffff, 0x80(%rax) # imm = 0xFFFFFFFF
movl $0x8, %edi
movl $0x1, %esi
callq 0x13e70
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x88(%rax)
movq (%rsp), %rax
movl $0xffffffff, 0x68(%rax) # imm = 0xFFFFFFFF
movq (%rsp), %rdi
addq $0x90, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2430
movq (%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: cl_cluster_node_get_random
cl_cluster_node *
cl_cluster_node_get_random(cl_cluster *asc)
{
	cl_cluster_node *cn;
	
	uint node_v_sz = cf_vector_size(&asc->node_v);
	if (node_v_sz == 0) {
#ifdef DEBUG		
		cf_debug("cluster node get: no nodes in this cluster");
#endif		
		return(0);
	}

	uint i=0;
	do {
		asc->last_node ++;
		if (asc->last_node >= node_v_sz)	asc->last_node = 0;
		int node_i = asc->last_node;

#ifdef DEBUG_VERBOSE		
		cf_debug("cluster node get: vsize %d choosing %d",
			cf_vector_size(&asc->node_v), node_i);
#endif		

		cn = cf_vector_pointer_get(&asc->node_v, node_i);
		i++;
        
	} while( (cn->dunned == true) && (i <= node_v_sz) );

#ifdef DEBUG    
    cf_debug("   random node chosen: %s",cn->name);
#endif    
    
	// grab a reservation
	cf_client_rc_reserve(cn);

	return(cn);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
addq $0xf8, %rdi
callq 0x9da0
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jne 0xb693
movq $0x0, 0x20(%rsp)
jmp 0xb74a
movl $0x0, 0x8(%rsp)
movq 0x18(%rsp), %rax
movl 0xf0(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xf0(%rax)
movq 0x18(%rsp), %rax
movl 0xf0(%rax), %eax
cmpl 0xc(%rsp), %eax
jb 0xb6cf
movq 0x18(%rsp), %rax
movl $0x0, 0xf0(%rax)
movq 0x18(%rsp), %rax
movl 0xf0(%rax), %eax
movl %eax, 0x4(%rsp)
movq 0x18(%rsp), %rdi
addq $0xf8, %rdi
movl 0x4(%rsp), %esi
callq 0x9db0
movq %rax, 0x10(%rsp)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movb 0x18(%rax), %al
andb $0x1, %al
movzbl %al, %ecx
xorl %eax, %eax
cmpl $0x1, %ecx
movb %al, 0x3(%rsp)
jne 0xb72a
movl 0x8(%rsp), %eax
cmpl 0xc(%rsp), %eax
setbe %al
movb %al, 0x3(%rsp)
movb 0x3(%rsp), %al
testb $0x1, %al
jne 0xb69b
movq 0x10(%rsp), %rdi
callq 0x12d30
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: cl_cluster_node_get
cl_cluster_node *
cl_cluster_node_get(cl_cluster *asc, const char *ns, const cf_digest *d, bool write)
{
	cl_cluster_node	*cn;	
	pthread_mutex_lock(&asc->LOCK);

	// first, try to get one that matches this digest
	cn = cl_partition_table_get(asc, (char *)ns, cl_partition_getid(asc->n_partitions, (cf_digest *) d) , write);
	if (cn && (cn->dunned == false)) {
#ifdef DEBUG_VERBOSE		
		cf_debug("cluster node get: found match key %"PRIx64" node %s (%s):",
											*(uint64_t*)d, cn->name, write?"write":"read");
#endif		
		cf_client_rc_reserve(cn);
		pthread_mutex_unlock(&asc->LOCK);
		return(cn);
	}
#ifdef DEBUG_VERBOSE	
	cf_debug("cluster node get: not found, try random key %"PRIx64, *(uint64_t *)d);
#endif	
	
	cn = cl_cluster_node_get_random(asc);
	pthread_mutex_unlock(&asc->LOCK);
	return(cn);
}

// Assembly:
subq $0x48, %rsp
movb %cl, %al
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
andb $0x1, %al
movb %al, 0x27(%rsp)
movq 0x38(%rsp), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x23e0
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x38(%rsp), %rax
movzwl 0x140(%rax), %edi
movq 0x28(%rsp), %rsi
callq 0xb850
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movw %ax, %cx
movb 0x27(%rsp), %al
andb $0x1, %al
movzwl %cx, %edx
movzbl %al, %ecx
callq 0xd360
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0xb81a
movq 0x18(%rsp), %rax
movb 0x18(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xb81a
movq 0x18(%rsp), %rdi
callq 0x12d30
movq 0x38(%rsp), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x21c0
movq 0x18(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0xb844
movq 0x38(%rsp), %rdi
callq 0xb660
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x21c0
movq 0x18(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: cl_cluster_get_node_names
void 
cl_cluster_get_node_names(cl_cluster *asc, int *n_nodes, char **node_names)
{
	pthread_mutex_lock(&asc->LOCK);
	uint size = cf_vector_size(&asc->node_v);
	*n_nodes = size;

	if (size == 0) {
		*node_names = 0;
		pthread_mutex_unlock(&asc->LOCK);
		return;
	}

	*node_names = malloc(NODE_NAME_SIZE * size);
	if (*node_names == 0) {
		pthread_mutex_unlock(&asc->LOCK);
		return;
	}

	char *nptr = *node_names;
	for (uint i = 0; i < size; i++) {
		cl_cluster_node *cn = cf_vector_pointer_get(&asc->node_v, i);
		memcpy(nptr, cn->name, NODE_NAME_SIZE);
		nptr += NODE_NAME_SIZE;
	}
	pthread_mutex_unlock(&asc->LOCK);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x30(%rsp), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x23e0
movq 0x30(%rsp), %rdi
addq $0xf8, %rdi
callq 0x9da0
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %ecx
movq 0x28(%rsp), %rax
movl %ecx, (%rax)
cmpl $0x0, 0x1c(%rsp)
jne 0xb8ed
movq 0x20(%rsp), %rax
movq $0x0, (%rax)
movq 0x30(%rsp), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x21c0
jmp 0xb9a8
imull $0x14, 0x1c(%rsp), %eax
movl %eax, %eax
movl %eax, %edi
callq 0x2310
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax)
jne 0xb927
movq 0x30(%rsp), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x21c0
jmp 0xb9a8
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jae 0xb997
movq 0x30(%rsp), %rdi
addq $0xf8, %rdi
movl 0xc(%rsp), %esi
callq 0x9db0
movq %rax, (%rsp)
movq 0x10(%rsp), %rax
movq (%rsp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movl 0x10(%rcx), %ecx
movl %ecx, 0x10(%rax)
movq 0x10(%rsp), %rax
addq $0x14, %rax
movq %rax, 0x10(%rsp)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xb93c
movq 0x30(%rsp), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x21c0
addq $0x38, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: cl_cluster_node_get_byname
cl_cluster_node *
cl_cluster_node_get_byname(cl_cluster *asc, char *name)
{
	pthread_mutex_lock(&asc->LOCK);

	for (uint i = 0; i < cf_vector_size(&asc->node_v); i++) {
		cl_cluster_node *cn = cf_vector_pointer_get(&asc->node_v, i);
		if (strcmp(name, cn->name) == 0) {
			pthread_mutex_unlock(&asc->LOCK);
			return(cn);
		}
	}
	pthread_mutex_unlock(&asc->LOCK);
	return(0);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x23e0
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x28(%rsp), %rdi
addq $0xf8, %rdi
callq 0x9da0
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jae 0xba54
movq 0x28(%rsp), %rdi
addq $0xf8, %rdi
movl 0x1c(%rsp), %esi
callq 0x9db0
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x2380
cmpl $0x0, %eax
jne 0xba45
movq 0x28(%rsp), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x21c0
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0xba6e
jmp 0xba47
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xb9d7
movq 0x28(%rsp), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x21c0
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: str_split
static void
str_split(char split_c, char *str, cf_vector *v)
{
	char *prev = str;
	while (*str) {
		if (split_c == *str) {
			*str = 0;
			cf_vector_append(v, &prev);
			prev = str+1;
		}
		str++;
	}
	if (prev != str) {
		cf_vector_append(v, &prev);
	}
}

// Assembly:
subq $0x28, %rsp
movb %dil, %al
movb %al, 0x27(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
cmpb $0x0, (%rax)
je 0xbe1f
movsbl 0x27(%rsp), %eax
movq 0x18(%rsp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xbe0f
movq 0x18(%rsp), %rax
movb $0x0, (%rax)
movq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x17140
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0xbdcf
movq 0x8(%rsp), %rax
cmpq 0x18(%rsp), %rax
je 0xbe3a
movq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x17140
addq $0x28, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: cl_cluster_node_fd_get
int
cl_cluster_node_fd_get(cl_cluster_node *cn, bool asyncfd, bool nbconnect)
{
	int fd;
#if ONEASYNCFD
	if (asyncfd == true) {
		if (cn->asyncfd == -1) {
			cn->asyncfd = cl_cluster_node_fd_create(cn, true);
		} 
		fd = cn->asyncfd;
		return fd;
	}
#endif
	cf_queue *q;
	if (asyncfd == true) {
		q = cn->conn_q_asyncfd;
	} else {
		q = cn->conn_q;
	}
	
	int rv = cf_queue_pop(q, &fd, CF_QUEUE_NOWAIT);
	if (rv == CF_QUEUE_OK)
		;
	else if (rv == CF_QUEUE_EMPTY) {
		if ((asyncfd == true) || (nbconnect == true)) {
			//Use a non-blocking socket for async client
			fd = cl_cluster_node_fd_create(cn, true);
		} else {
			fd = cl_cluster_node_fd_create(cn, false);
		}
	}
	else {
		fd = -1;
	}

	return fd;
}

// Assembly:
subq $0x28, %rsp
movb %dl, %al
movb %sil, %cl
movq %rdi, 0x20(%rsp)
andb $0x1, %cl
movb %cl, 0x1f(%rsp)
andb $0x1, %al
movb %al, 0x1e(%rsp)
movb 0x1f(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xc199
movq 0x20(%rsp), %rax
movq 0x78(%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0xc1a7
movq 0x20(%rsp), %rax
movq 0x70(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x18(%rsp), %rsi
xorl %edx, %edx
callq 0x14590
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jne 0xc1c5
jmp 0xc219
cmpl $-0x2, 0xc(%rsp)
jne 0xc20f
movb 0x1f(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
je 0xc1e8
movb 0x1e(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xc1fd
movq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0xbef0
movl %eax, 0x18(%rsp)
jmp 0xc20d
movq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0xbef0
movl %eax, 0x18(%rsp)
jmp 0xc217
movl $0xffffffff, 0x18(%rsp) # imm = 0xFFFFFFFF
jmp 0xc219
movl 0x18(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: cl_cluster_node_fd_put
void
cl_cluster_node_fd_put(cl_cluster_node *cn, int fd, bool asyncfd)
{
#if ONEASYNCFD
	return;	//FD does not get closed. It just lies around.
#endif
	cf_queue *q;
	if (asyncfd == true) {
		q = cn->conn_q_asyncfd;
		// Async queue is used by XDS. It can open lot of connections 
		// depending on batch-size. Dont worry about limiting the pool.
		cf_queue_push(q, &fd);
	} else {
		q = cn->conn_q;
		if (! cf_queue_push_limit(q, &fd, 300)) {
			close(fd);
		}
	}
}

// Assembly:
subq $0x18, %rsp
movb %dl, %al
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
andb $0x1, %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xc270
movq 0x10(%rsp), %rax
movq 0x78(%rax), %rax
movq %rax, (%rsp)
movq (%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x14300
jmp 0xc29f
movq 0x10(%rsp), %rax
movq 0x70(%rax), %rax
movq %rax, (%rsp)
movq (%rsp), %rdi
leaq 0xc(%rsp), %rsi
movl $0x12c, %edx            # imm = 0x12C
callq 0x14430
testb $0x1, %al
jne 0xc29d
movl 0xc(%rsp), %edi
callq 0x2570
jmp 0xc29f
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: cluster_get_n_partitions
void
cluster_get_n_partitions( cl_cluster *asc, cf_vector *sockaddr_in_v )
{
	// check if someone found the value
	if (asc->n_partitions != 0)
		return;

	for (uint i=0;i<cf_vector_size(sockaddr_in_v);i++) {
		struct sockaddr_in *sa_in = cf_vector_getp(sockaddr_in_v, i);
		int n_partitions = 0;

		if (cl_get_n_partitions(sa_in, &n_partitions) != 0) {
			continue;
		}
		asc->n_partitions = n_partitions;
		break;
	}
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movzwl 0x140(%rax), %eax
cmpl $0x0, %eax
je 0xc2d1
jmp 0xc346
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movl %eax, (%rsp)
movq 0x18(%rsp), %rdi
callq 0x9da0
movl %eax, %ecx
movl (%rsp), %eax
cmpl %ecx, %eax
jae 0xc346
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
callq 0x17340
movq %rax, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
movq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x12bc0
cmpl $0x0, %eax
je 0xc324
jmp 0xc339
movl 0x4(%rsp), %eax
movw %ax, %cx
movq 0x20(%rsp), %rax
movw %cx, 0x140(%rax)
jmp 0xc346
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0xc2d9
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: citrusleaf_cluster_init
int citrusleaf_cluster_init()
{
    if (g_clust_initialized) {
    	return(0);
	}
    
    // No destruction function is used.
	// NOTE: A destruction function should not be used because elements
	// in this list are used even after they are removed from the list.
	// Refer to the function citrusleaf_cluster_destroy() for more info.
	cf_ll_init(&cluster_ll, 0, false);
	
    g_clust_initialized = 1;
   	g_clust_tend_speed = 1;
	pthread_create( &tender_thr, 0, cluster_tender_fn, 0);

	return(0);	
}

// Assembly:
pushq %rax
leaq 0x13ff0(%rip), %rax     # 0x203b8
cmpl $0x0, (%rax)
je 0xc3d7
movl $0x0, 0x4(%rsp)
jmp 0xc422
leaq 0x1400a(%rip), %rdi     # 0x203e8
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x13900
leaq 0x13fc8(%rip), %rax     # 0x203b8
movl $0x1, (%rax)
movl $0x1, 0x11ed0(%rip)     # 0x1e2d0
leaq 0x14029(%rip), %rdi     # 0x20430
xorl %eax, %eax
movl %eax, %ecx
leaq 0x1e(%rip), %rdx        # 0xc430
movq %rcx, %rsi
callq 0x2500
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
popq %rcx
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: cluster_tender_fn
static void *
cluster_tender_fn(void *gcc_is_ass)
{
	uint64_t cnt = 1;
	do {
		sleep(1);
		
		// if tend period is non zero tend at that period
		// otherwise at default period
		cf_ll_element *e = cf_ll_get_head(&cluster_ll);
		while (e) {
			int period = ((cl_cluster *)e)->tend_speed;
			if (period) {
				if ((cnt % period) == 0) {
					cluster_tend( (cl_cluster *) e);
				}
			} else {
				if ((cnt % g_clust_tend_speed) == 0) {
					cluster_tend( (cl_cluster *) e);
				}
			}
			e = cf_ll_get_next(e);
		}
		cnt++;
	} while (1);
	return(0);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq $0x1, 0x18(%rsp)
movl $0x1, %edi
callq 0x21b0
leaq 0x13f95(%rip), %rdi     # 0x203e8
callq 0xa210
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0xc4d0
movq 0x10(%rsp), %rax
movl 0x154(%rax), %eax
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
je 0xc49c
movq 0x18(%rsp), %rax
movslq 0xc(%rsp), %rcx
xorl %edx, %edx
divq %rcx
cmpq $0x0, %rdx
jne 0xc49a
movq 0x10(%rsp), %rdi
callq 0xab40
jmp 0xc4bf
movq 0x18(%rsp), %rax
movslq 0x11e28(%rip), %rcx     # 0x1e2d0
xorl %edx, %edx
divq %rcx
cmpq $0x0, %rdx
jne 0xc4bd
movq 0x10(%rsp), %rdi
callq 0xab40
jmp 0xc4bf
movq 0x10(%rsp), %rdi
callq 0xa250
movq %rax, 0x10(%rsp)
jmp 0xc45d
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
movb $0x1, %al
testb $0x1, %al
jne 0xc442
jmp 0xc4ea
xorl %eax, %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: cluster_ping_address
static void
cluster_ping_address(cl_cluster *asc, struct sockaddr_in *sa_in)
{
	char node_name[NODE_NAME_SIZE];

	if (cl_get_node_name(sa_in, node_name) != 0) {
		return;
	}
		
	// if new nodename, add to cluster
	cl_cluster_node *cn = cl_cluster_node_get_byname(asc, node_name);
	if (!cn) {
		/*
		if (cf_debug_enabled()) {
			cf_debug("%s node unknown, creating new", node_name);
			dump_sockaddr_in("New node is ",sa_in);
		}
		*/
		cl_cluster_node *node = cl_cluster_node_create(node_name, sa_in);

		// Appends must be locked regardless of only being called from tend thread, because
		// other threads reads need to wait on their locks for the append to complete.
		pthread_mutex_lock(&asc->LOCK);
		cf_vector_pointer_append(&asc->node_v, node);
		pthread_mutex_unlock(&asc->LOCK);
	}
	// if not new, add address to node
	else {
		cf_vector_append_unique(&cn->sockaddr_in_v, sa_in);
	}
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x12a40
cmpl $0x0, %eax
je 0xc5a4
jmp 0xc61f
movq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xb9b0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0xc60c
leaq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xb550
movq %rax, (%rsp)
movq 0x30(%rsp), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x23e0
movq 0x30(%rsp), %rdi
addq $0xf8, %rdi
movq (%rsp), %rsi
callq 0xaae0
movq 0x30(%rsp), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x21c0
jmp 0xc61f
movq 0x8(%rsp), %rdi
addq $0x20, %rdi
movq 0x28(%rsp), %rsi
callq 0x171b0
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: cluster_services_parse
static void
cluster_services_parse(cl_cluster *asc, char *services, cf_vector *sockaddr_t_v) 
{
	cf_vector_define(host_str_v, sizeof(void *), 0);
	str_split(';',services, &host_str_v);
	// host_str_v is vector of addr:port
	for (uint i=0;i<cf_vector_size(&host_str_v);i++) {
		char *host_str = cf_vector_pointer_get(&host_str_v, i);
		cf_vector_define(host_port_v, sizeof(void *), 0);
		str_split(':', host_str, &host_port_v);
		if (cf_vector_size(&host_port_v) == 2) {
			char *host_s = cf_vector_pointer_get(&host_port_v,0);
			char *port_s = cf_vector_pointer_get(&host_port_v,1);
			int port = atoi(port_s);
			cl_lookup(asc, host_s, port, sockaddr_t_v);
		}
		cf_vector_destroy(&host_port_v);
	}
	cf_vector_destroy(&host_str_v);
}

// Assembly:
subq $0x8d8, %rsp            # imm = 0x8D8
movq %rdi, 0x8d0(%rsp)
movq %rsi, 0x8c8(%rsp)
movq %rdx, 0x8c0(%rsp)
leaq 0x4c0(%rsp), %rdx
leaq 0x478(%rsp), %rdi
movl $0x8, %esi
movl $0x400, %ecx            # imm = 0x400
xorl %r8d, %r8d
callq 0x16c50
movq 0x8c8(%rsp), %rsi
movl $0x3b, %edi
leaq 0x478(%rsp), %rdx
callq 0xbdb0
movl $0x0, 0x474(%rsp)
movl 0x474(%rsp), %eax
movl %eax, (%rsp)
leaq 0x478(%rsp), %rdi
callq 0x9da0
movl %eax, %ecx
movl (%rsp), %eax
cmpl %ecx, %eax
jae 0xca3c
movl 0x474(%rsp), %esi
leaq 0x478(%rsp), %rdi
callq 0x9db0
movq %rax, 0x468(%rsp)
leaq 0x60(%rsp), %rdx
leaq 0x18(%rsp), %rdi
movl $0x8, %esi
movl $0x400, %ecx            # imm = 0x400
xorl %r8d, %r8d
callq 0x16c50
movq 0x468(%rsp), %rsi
movl $0x3a, %edi
leaq 0x18(%rsp), %rdx
callq 0xbdb0
leaq 0x18(%rsp), %rdi
callq 0x9da0
cmpl $0x2, %eax
jne 0xca1c
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x9db0
movq %rax, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x9db0
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
callq 0x2460
movl %eax, 0x4(%rsp)
movq 0x8d0(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl 0x4(%rsp), %eax
movq 0x8c0(%rsp), %rcx
movswl %ax, %edx
callq 0xd460
leaq 0x18(%rsp), %rdi
callq 0x16e10
movl 0x474(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x474(%rsp)
jmp 0xc946
leaq 0x478(%rsp), %rdi
callq 0x16e10
addq $0x8d8, %rsp            # imm = 0x8D8
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_cluster.c
// Function: trim
static char*
trim(char *str)
{
	// Warning: This method walks on input string.
	char *begin = str;

	// Trim leading space
	while (isspace(*begin)) {
		begin++;
	}

	if(*begin == 0) {
		return begin;
	}

	// Trim trailing space.  Go to end first so whitespace is preserved
	// in the middle of the string.
	char *end = begin + strlen(begin) - 1;

	while (end > begin && isspace(*end)) {
		end--;
	}
	*(end + 1) = 0;
	return begin;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x20(%rsp)
callq 0x22b0
movq (%rax), %rax
movq 0x20(%rsp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0xcd74
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0xcd43
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xcd90
movq 0x20(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0xce1d
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
callq 0x2100
movq %rax, %rcx
movq 0x10(%rsp), %rax
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rcx
xorl %eax, %eax
cmpq 0x20(%rsp), %rcx
movb %al, 0xf(%rsp)
jbe 0xcdf0
callq 0x22b0
movq (%rax), %rax
movq 0x18(%rsp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0xcdfa
jmp 0xce0a
movq 0x18(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0xcdb8
movq 0x18(%rsp), %rax
movb $0x0, 0x1(%rax)
movq 0x20(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_partition.c
// Function: cl_partition_table_remove_node
void
cl_partition_table_remove_node( cl_cluster *asc, cl_cluster_node *node )
{
#ifdef DEBUG
	cf_debug("remove node %s",node->name);
#endif	
	
	cl_partition_table *pt = asc->partition_table_head;
	while(pt) {
		
		for (int i=0;i<asc->n_partitions;i++) {
			cl_partition *p = &pt->partitions[i];
			if (p->write == node) p->write = 0;
			for (int j=0;j<p->n_read;j++) {
				if (p->read[j] == node) {
					if (j < MAX_REPLICA_COUNT-1)
						// overlapping copies must use memmove!
						memmove(&p->read[j], &p->read[j+1], 
							((MAX_REPLICA_COUNT - 1) - j) * sizeof(cl_cluster_node *) );
					p->n_read--;
					break;
				}
			}
		}
		
		pt = pt->next;
	}
	return;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq 0x148(%rax), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
je 0xcf90
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movq 0x30(%rsp), %rcx
movzwl 0x140(%rcx), %ecx
cmpl %ecx, %eax
jge 0xcf7e
movq 0x20(%rsp), %rax
addq $0x30, %rax
movslq 0x1c(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rax
cmpq 0x28(%rsp), %rax
jne 0xced0
movq 0x10(%rsp), %rax
movq $0x0, (%rax)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jge 0xcf6c
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
movq 0x10(%rax,%rcx,8), %rax
cmpq 0x28(%rsp), %rax
jne 0xcf5a
cmpl $0x4, 0xc(%rsp)
jge 0xcf4a
movq 0x10(%rsp), %rdi
addq $0x10, %rdi
movslq 0xc(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq 0x10(%rsp), %rsi
addq $0x10, %rsi
movl 0xc(%rsp), %eax
addl $0x1, %eax
cltq
shlq $0x3, %rax
addq %rax, %rsi
movl $0x4, %eax
subl 0xc(%rsp), %eax
movslq %eax, %rdx
shlq $0x3, %rdx
callq 0x2480
movq 0x10(%rsp), %rax
movl 0x8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0xcf6c
jmp 0xcf5c
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xced8
jmp 0xcf6e
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xce83
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0xce6f
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_partition.c
// Function: cl_partition_table_create
cl_partition_table *
cl_partition_table_create(cl_cluster *asc, char *ns) 
{
#ifdef DEBUG
	cf_debug("partition table create: npartitions %d", asc->n_partitions);
#endif

	cl_partition_table *pt = malloc( sizeof(cl_partition_table) + (sizeof(cl_partition) * asc->n_partitions) );
	if (!pt)	return(0);
	memset(pt, 0, sizeof(cl_partition_table) + (sizeof(cl_partition) * asc->n_partitions) );
	strcpy( pt->ns, ns );
	
	pt->next = asc->partition_table_head;
	asc->partition_table_head = pt;

	return(pt);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movzwl 0x140(%rax), %eax
imulq $0x38, %rax, %rdi
addq $0x30, %rdi
callq 0x2310
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0xcfdf
movq $0x0, 0x20(%rsp)
jmp 0xd041
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rax
movzwl 0x140(%rax), %eax
imulq $0x38, %rax, %rdx
addq $0x30, %rdx
xorl %esi, %esi
callq 0x2170
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
movq 0x10(%rsp), %rsi
callq 0x2270
movq 0x18(%rsp), %rax
movq 0x148(%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x148(%rax)
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax,%rax)