// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/citrusleaf.c
// Function: set_object
static int
set_object(cl_msg_op *op, cl_object *obj)
{
	int rv = 0;
	
	obj->type = op->particle_type;
	
	switch(op->particle_type) {
		case CL_NULL:
			obj->sz = 0;
			obj->free = 0;
			break;
		case CL_INT:
			obj->sz = 0; // unused in integer case
			obj->free = 0;
			rv = op_to_value_int(cl_msg_op_get_value_p(op), cl_msg_op_get_value_sz(op),&(obj->u.i64));
			break;
		case CL_STR:
			obj->sz = cl_msg_op_get_value_sz(op);
			obj->free = obj->u.str = malloc(obj->sz+1);
			if (obj->free == NULL)	return(-1);
			memcpy(obj->u.str, cl_msg_op_get_value_p(op), obj->sz);
			obj->u.str[obj->sz] = 0;
			break;
		case CL_BLOB:
		case CL_JAVA_BLOB:
		case CL_CSHARP_BLOB:
		case CL_PYTHON_BLOB:
		case CL_RUBY_BLOB:
		case CL_PHP_BLOB:
			obj->sz = cl_msg_op_get_value_sz(op);
			obj->free = obj->u.blob = malloc(obj->sz);
			if (obj->free == 0)	return(-1);
			memcpy(obj->u.blob, cl_msg_op_get_value_p(op), obj->sz);
			break;
		default:
			cf_error("parse: received unknown object type %d", op->particle_type);
			return(-1);
	}
	return(rv);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movl $0x0, 0x2c(%rsp)
movq 0x38(%rsp), %rax
movzbl 0x5(%rax), %ecx
movq 0x30(%rsp), %rax
movl %ecx, (%rax)
movq 0x38(%rsp), %rax
movzbl 0x5(%rax), %eax
movq %rax, 0x20(%rsp)
subq $0xb, %rax
ja 0x6d73
movq 0x20(%rsp), %rax
leaq 0x11be2(%rip), %rcx     # 0x187bc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x30(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x30(%rsp), %rax
movq $0x0, 0x18(%rax)
jmp 0x6dac
movq 0x30(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x30(%rsp), %rax
movq $0x0, 0x18(%rax)
movq 0x38(%rsp), %rdi
callq 0x5ed0
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rdi
callq 0x9be0
movq 0x18(%rsp), %rdi
movl %eax, %esi
movq 0x30(%rsp), %rdx
addq $0x10, %rdx
callq 0x9a30
movl %eax, 0x2c(%rsp)
jmp 0x6dac
movq 0x38(%rsp), %rdi
callq 0x9be0
movl %eax, %eax
movl %eax, %ecx
movq 0x30(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdi
addq $0x1, %rdi
callq 0x2310
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x30(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x30(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x6caa
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x6db4
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x38(%rsp), %rdi
callq 0x5ed0
movq 0x10(%rsp), %rdi
movq %rax, %rsi
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdx
callq 0x21e0
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x30(%rsp), %rcx
movq 0x8(%rcx), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x6dac
movq 0x38(%rsp), %rdi
callq 0x9be0
movl %eax, %eax
movl %eax, %ecx
movq 0x30(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x2310
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x30(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x30(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x6d43
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x6db4
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
callq 0x5ed0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdx
callq 0x21e0
jmp 0x6dac
leaq 0x1755e(%rip), %rax     # 0x1e2d8
movl (%rax), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jg 0x6da2
leaq 0x17557(%rip), %rax     # 0x1e2e0
movq (%rax), %rcx
movq 0x38(%rsp), %rax
movzbl 0x5(%rax), %edx
xorl %edi, %edi
leaq 0x11bad(%rip), %rsi     # 0x1894b
movb $0x0, %al
callq *%rcx
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x6db4
movl 0x2c(%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax)