// File: /workspace/github_c_makefile_star2_O2/sharpyfox[P]citrusleaf-client/tests/key_c/src/main.c
// Function: test_one_key
int 
test_one_key(void)
{
	cl_cluster *asc;
	asc = citrusleaf_cluster_create();
	citrusleaf_cluster_follow(asc, false); // just this host!
	citrusleaf_cluster_add_host(asc, g_config.host, g_config.port,0);

	// Create a key for accessing
	cl_object o_key;
	citrusleaf_object_init_str(&o_key,"key");
	
	// set a value
	cl_bin values[1];
	strcpy(values[0].bin_name, g_config.bin);
	citrusleaf_object_init_str(&values[0].object, TEST_STRING);
	
	citrusleaf_put(asc, g_config.ns, g_config.table, &o_key, values, 1, 0);

	// now let's pull it out again
	memset(values, 0, sizeof(values));
	strcpy(values[0].bin_name, g_config.bin);

	citrusleaf_get(asc, g_config.ns, g_config.table, &o_key, values, 1, 0, NULL);
	
	if (values[0].object.type != CL_STR) {
		fprintf(stderr, "Test failed, type in correct, expected %d received %d\n",
			(int)CL_STR, (int)values[0].object.type);
		return(-1);
	}
	
	if (values[0].object.sz != strlen(TEST_STRING)) {
		fprintf(stderr, "Test failed, length incorrect, got %d expected %d\n",
			(int) values[0].object.sz, (int) strlen(TEST_STRING));
		return(-1);
	}
		
	if (strcmp(values[0].object.u.str, TEST_STRING) != 0) {
		fprintf(stderr, "Test failed, string incorrect, got %s expected %s\n",
			values[0].object.u.str, TEST_STRING);
		return(-1);
	}
		
	// have to hand back any possible malloced memory
	citrusleaf_object_free(&values[0].object);

	citrusleaf_cluster_destroy(asc);
	
	fprintf(stderr, "TEST SUCCESS\n");
	return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
callq 0x7a79
movq %rax, %rdi
xorl %esi, %esi
movq %rax, %rbx
callq 0x881e
movq 0x179d6(%rip), %rsi     # 0x1a330
movswl 0x179d7(%rip), %edx     # 0x1a338
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x7d03
leaq 0x40(%rsp), %r15
leaq 0xd852(%rip), %rsi      # 0x101c9
movq %r15, %rdi
callq 0x564e
movq 0x179ca(%rip), %rsi     # 0x1a350
movq %rsp, %r12
movq %r12, %rdi
callq 0x2210
leaq 0x20(%rsp), %r14
leaq 0xd830(%rip), %rsi      # 0x101cd
movq %r14, %rdi
callq 0x564e
movq 0x17994(%rip), %rsi     # 0x1a340
movq 0x17995(%rip), %rdx     # 0x1a348
subq $0x8, %rsp
pushq $0x1
popq %rbp
movq %r15, %rcx
movq %rbx, %rdi
movq %r12, %r8
movl %ebp, %r9d
pushq $0x0
callq 0x6bef
popq %rcx
popq %rdx
movq 0x1797a(%rip), %rsi     # 0x1a350
xorps %xmm0, %xmm0
movq %r12, %rdi
movaps %xmm0, -0x20(%r14)
movaps %xmm0, -0x10(%r14)
movaps %xmm0, (%r14)
movaps %xmm0, 0x10(%r14)
callq 0x2210
movq 0x17945(%rip), %rsi     # 0x1a340
movq 0x17946(%rip), %rdx     # 0x1a348
movq %r15, %rcx
movq %rbx, %rdi
movq %r12, %r8
movl %ebp, %r9d
pushq $0x0
pushq $0x0
callq 0x6574
popq %rcx
popq %rdx
movl (%r14), %ecx
cmpl $0x3, %ecx
jne 0x2a74
movq 0x28(%rsp), %rdx
cmpq $0x5, %rdx
jne 0x2a8a
movq 0x30(%rsp), %r15
leaq 0xd795(%rip), %rsi      # 0x101cd
movq %r15, %rdi
callq 0x2360
testl %eax, %eax
jne 0x2ab5
movq %r14, %rdi
callq 0x56e9
movq %rbx, %rdi
callq 0x7f37
movq 0x15585(%rip), %rax     # 0x17fe0
leaq 0xd80e(%rip), %rdi      # 0x10270
movq (%rax), %rcx
pushq $0xd
popq %rsi
pushq $0x1
popq %rdx
callq 0x2550
xorl %eax, %eax
jmp 0x2aa8
movq 0x15565(%rip), %rax     # 0x17fe0
leaq 0xd751(%rip), %rsi      # 0x101d3
movq (%rax), %rdi
pushq $0x3
popq %rdx
jmp 0x2a9e
movq 0x1554f(%rip), %rax     # 0x17fe0
leaq 0xd772(%rip), %rsi      # 0x1020a
movq (%rax), %rdi
pushq $0x5
popq %rcx
xorl %eax, %eax
callq 0x2390
pushq $-0x1
popq %rax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x15524(%rip), %rax     # 0x17fe0
leaq 0xd77a(%rip), %rsi      # 0x1023d
leaq 0xd703(%rip), %rcx      # 0x101cd
movq %r15, %rdx
movq (%rax), %rdi
xorl %eax, %eax
callq 0x2390
jmp 0x2aa5