// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x60, %rsp
callq 0x841c
movq %rax, %rbx
xorl %r13d, %r13d
movq %rax, %rdi
xorl %esi, %esi
callq 0x9423
movq 0x19066(%rip), %rsi     # 0x1c330
movswl 0x19067(%rip), %edx     # 0x1c338
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x86fd
leaq 0xeeeb(%rip), %rsi      # 0x121cd
leaq 0x40(%rsp), %r15
movq %r15, %rdi
callq 0x5ee9
movq 0x1905a(%rip), %rsi     # 0x1c350
movq %rsp, %r12
movq %r12, %rdi
callq 0x2210
leaq 0x20(%rsp), %r14
leaq 0xeec4(%rip), %rsi      # 0x121d1
movq %r14, %rdi
callq 0x5ee9
movq 0x19024(%rip), %rsi     # 0x1c340
movq 0x19025(%rip), %rdx     # 0x1c348
subq $0x8, %rsp
movq %rbx, %rdi
movq %r15, %rcx
movq %r12, %r8
movl $0x1, %r9d
pushq %r13
callq 0x76cb
addq $0x10, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, -0x20(%r14)
movaps %xmm0, -0x10(%r14)
movaps %xmm0, (%r14)
movaps %xmm0, 0x10(%r14)
movq 0x18ff2(%rip), %rsi     # 0x1c350
movq %r12, %rdi
callq 0x2210
movq 0x18fd3(%rip), %rsi     # 0x1c340
movq 0x18fd4(%rip), %rdx     # 0x1c348
movq %rbx, %rdi
movq %r15, %rcx
movq %r12, %r8
movl $0x1, %r9d
pushq %r13
pushq $0x0
callq 0x6f6c
addq $0x10, %rsp
movl (%r14), %ecx
cmpl $0x3, %ecx
jne 0x33ca
movq 0x28(%rsp), %rdx
cmpq $0x5, %rdx
jne 0x33e2
movq 0x30(%rsp), %r15
leaq 0xee22(%rip), %rsi      # 0x121d1
movq %r15, %rdi
callq 0x2360
testl %eax, %eax
jne 0x3412
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2916
xorl %eax, %eax
jmp 0x3404
movq 0x16c0f(%rip), %rax     # 0x19fe0
movq (%rax), %rdi
leaq 0xedfc(%rip), %rsi      # 0x121d7
movl $0x3, %edx
jmp 0x33f8
movq 0x16bf7(%rip), %rax     # 0x19fe0
movq (%rax), %rdi
leaq 0xee1b(%rip), %rsi      # 0x1220e
movl $0x5, %ecx
xorl %eax, %eax
callq 0x2390
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x16bc7(%rip), %rax     # 0x19fe0
movq (%rax), %rdi
leaq 0xee1e(%rip), %rsi      # 0x12241
leaq 0xeda7(%rip), %rcx      # 0x121d1
movq %r15, %rdx
xorl %eax, %eax
callq 0x2390
jmp 0x33ff