// File: /workspace/github_c_makefile_star2_O0/DeforaOS[P]libSystem/src/variable.c
// Function: variable_set_typev
VariableError variable_set_typev(Variable * variable, VariableType type,
		va_list ap)
{
	int32_t i32;
	uint32_t u32;
	int64_t i64;
	uint64_t u64;
	double d;
	Buffer * b;
	String * s;
	Mutator * m;

	switch(type)
	{
		case VT_NULL:
			_variable_destroy(variable);
			break;
		case VT_BOOL:
			_variable_destroy(variable);
			u32 = va_arg(ap, uint32_t);
#ifdef DEBUG
			fprintf(stderr, "DEBUG: %s(%s)\n", __func__,
					u32 ? "true" : "false");
#endif
			variable->u.b = u32 ? true : false;
			break;
		case VT_INT8:
			_variable_destroy(variable);
			i32 = va_arg(ap, int32_t);
#ifdef DEBUG
			fprintf(stderr, "DEBUG: %s(%d)\n", __func__, i32);
#endif
			variable->u.int8 = i32;
			break;
		case VT_UINT8:
			_variable_destroy(variable);
			u32 = va_arg(ap, uint32_t);
#ifdef DEBUG
			fprintf(stderr, "DEBUG: %s(%u)\n", __func__, u32);
#endif
			variable->u.uint8 = u32;
			break;
		case VT_INT16:
			_variable_destroy(variable);
			i32 = va_arg(ap, int32_t);
#ifdef DEBUG
			fprintf(stderr, "DEBUG: %s(%d)\n", __func__, i32);
#endif
			variable->u.int16 = i32;
			break;
		case VT_UINT16:
			_variable_destroy(variable);
			u32 = va_arg(ap, uint32_t);
#ifdef DEBUG
			fprintf(stderr, "DEBUG: %s(%u)\n", __func__, u32);
#endif
			variable->u.uint16 = u32;
			break;
		case VT_INT32:
			_variable_destroy(variable);
			i32 = va_arg(ap, int32_t);
#ifdef DEBUG
			fprintf(stderr, "DEBUG: %s(%d)\n", __func__, i32);
#endif
			variable->u.int32 = i32;
			break;
		case VT_UINT32:
			_variable_destroy(variable);
			u32 = va_arg(ap, uint32_t);
#ifdef DEBUG
			fprintf(stderr, "DEBUG: %s(%u)\n", __func__, u32);
#endif
			variable->u.uint32 = u32;
			break;
		case VT_INT64:
			_variable_destroy(variable);
			i64 = va_arg(ap, int64_t);
#ifdef DEBUG
			fprintf(stderr, "DEBUG: %s(%ld)\n", __func__, i64);
#endif
			variable->u.int64 = i64;
			break;
		case VT_UINT64:
			_variable_destroy(variable);
			u64 = va_arg(ap, uint64_t);
#ifdef DEBUG
			fprintf(stderr, "DEBUG: %s(%lu)\n", __func__, u64);
#endif
			variable->u.uint64 = u64;
			break;
		case VT_FLOAT:
			_variable_destroy(variable);
			d = va_arg(ap, double);
#ifdef DEBUG
			fprintf(stderr, "DEBUG: %s(%f)\n", __func__, d);
#endif
			variable->u.f = d;
			break;
		case VT_DOUBLE:
			_variable_destroy(variable);
			d = va_arg(ap, double);
#ifdef DEBUG
			fprintf(stderr, "DEBUG: %s(%lf)\n", __func__, d);
#endif
			variable->u.d = d;
			break;
		case VT_BUFFER:
			b = va_arg(ap, Buffer *);
#ifdef DEBUG
			fprintf(stderr, "DEBUG: %s(%p)\n", __func__, (void *)b);
#endif
			b = (b != NULL)
				? buffer_new_copy(b) : buffer_new(0, NULL);
			if(b  == NULL)
				return -1;
			_variable_destroy(variable);
			variable->u.buffer = b;
			break;
		case VT_STRING:
			s = va_arg(ap, String *);
#ifdef DEBUG
			fprintf(stderr, "DEBUG: %s(\"%s\")\n", __func__, s);
#endif
			if((s = string_new(s)) == NULL)
				return -1;
			_variable_destroy(variable);
			variable->u.string = s;
			break;
		case VT_COMPOUND:
			s = va_arg(ap, String *);
			if(s != NULL && (s = string_new(s)) == NULL)
				return -1;
			if((m = mutator_new()) == NULL)
			{
				string_delete(s);
				return -1;
			}
			_variable_destroy(variable);
			variable->u.compound.name = s;
			variable->u.compound.members = m;
			break;
		case VT_POINTER:
			_variable_destroy(variable);
			variable->u.pointer = va_arg(ap, void *);
			break;
		default:
			return error_set_code(-ENOSYS, "%s", strerror(ENOSYS));
	}
	variable->type = type;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl -0x14(%rbp), %eax
movq %rax, -0x60(%rbp)
subq $0x10, %rax
ja 0xc312
movq -0x60(%rbp), %rax
leaq 0x470e(%rip), %rcx      # 0x101c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
callq 0xd1a0
jmp 0xc337
movq -0x10(%rbp), %rdi
callq 0xd1a0
movq -0x20(%rbp), %rax
movq %rax, -0x70(%rbp)
movl (%rax), %eax
movl %eax, -0x64(%rbp)
cmpl $0x28, %eax
ja 0xbafd
movq -0x70(%rbp), %rcx
movl -0x64(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x78(%rbp)
jmp 0xbb14
movq -0x70(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
cmpl $0x0, %eax
setne %cl
movq -0x10(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x8(%rax)
jmp 0xc337
movq -0x10(%rbp), %rdi
callq 0xd1a0
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movl (%rax), %eax
movl %eax, -0x7c(%rbp)
cmpl $0x28, %eax
ja 0xbb7f
movq -0x88(%rbp), %rcx
movl -0x7c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x90(%rbp)
jmp 0xbb9c
movq -0x88(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x8(%rax)
jmp 0xc337
movq -0x10(%rbp), %rdi
callq 0xd1a0
movq -0x20(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl (%rax), %eax
movl %eax, -0x94(%rbp)
cmpl $0x28, %eax
ja 0xbbfc
movq -0xa0(%rbp), %rcx
movl -0x94(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0xa8(%rbp)
jmp 0xbc19
movq -0xa0(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x8(%rax)
jmp 0xc337
movq -0x10(%rbp), %rdi
callq 0xd1a0
movq -0x20(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl (%rax), %eax
movl %eax, -0xac(%rbp)
cmpl $0x28, %eax
ja 0xbc79
movq -0xb8(%rbp), %rcx
movl -0xac(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0xc0(%rbp)
jmp 0xbc96
movq -0xb8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x8(%rax)
jmp 0xc337
movq -0x10(%rbp), %rdi
callq 0xd1a0
movq -0x20(%rbp), %rax
movq %rax, -0xd0(%rbp)
movl (%rax), %eax
movl %eax, -0xc4(%rbp)
cmpl $0x28, %eax
ja 0xbcf8
movq -0xd0(%rbp), %rcx
movl -0xc4(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0xd8(%rbp)
jmp 0xbd15
movq -0xd0(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x8(%rax)
jmp 0xc337
movq -0x10(%rbp), %rdi
callq 0xd1a0
movq -0x20(%rbp), %rax
movq %rax, -0xe8(%rbp)
movl (%rax), %eax
movl %eax, -0xdc(%rbp)
cmpl $0x28, %eax
ja 0xbd77
movq -0xe8(%rbp), %rcx
movl -0xdc(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0xf0(%rbp)
jmp 0xbd94
movq -0xe8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0xc337
movq -0x10(%rbp), %rdi
callq 0xd1a0
movq -0x20(%rbp), %rax
movq %rax, -0x100(%rbp)
movl (%rax), %eax
movl %eax, -0xf4(%rbp)
cmpl $0x28, %eax
ja 0xbdf2
movq -0x100(%rbp), %rcx
movl -0xf4(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x108(%rbp)
jmp 0xbe0f
movq -0x100(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0xc337
movq -0x10(%rbp), %rdi
callq 0xd1a0
movq -0x20(%rbp), %rax
movq %rax, -0x118(%rbp)
movl (%rax), %eax
movl %eax, -0x10c(%rbp)
cmpl $0x28, %eax
ja 0xbe6d
movq -0x118(%rbp), %rcx
movl -0x10c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x120(%rbp)
jmp 0xbe8a
movq -0x118(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0xc337
movq -0x10(%rbp), %rdi
callq 0xd1a0
movq -0x20(%rbp), %rax
movq %rax, -0x130(%rbp)
movl (%rax), %eax
movl %eax, -0x124(%rbp)
cmpl $0x28, %eax
ja 0xbeec
movq -0x130(%rbp), %rcx
movl -0x124(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x138(%rbp)
jmp 0xbf09
movq -0x130(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0xc337
movq -0x10(%rbp), %rdi
callq 0xd1a0
movq -0x20(%rbp), %rax
movq %rax, -0x150(%rbp)
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x148(%rbp)
movl 0x4(%rax), %eax
movl %eax, -0x13c(%rbp)
cmpl $0xa0, %eax
ja 0xbf83
movq -0x148(%rbp), %rcx
movl -0x13c(%rbp), %edx
movq -0x150(%rbp), %rsi
movslq %edx, %rax
addq 0x10(%rsi), %rax
addl $0x10, %edx
movl %edx, (%rcx)
movq %rax, -0x158(%rbp)
jmp 0xbfa0
movq -0x150(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x8(%rax)
jmp 0xc337
movq -0x10(%rbp), %rdi
callq 0xd1a0
movq -0x20(%rbp), %rax
movq %rax, -0x170(%rbp)
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x168(%rbp)
movl 0x4(%rax), %eax
movl %eax, -0x15c(%rbp)
cmpl $0xa0, %eax
ja 0xc022
movq -0x168(%rbp), %rcx
movl -0x15c(%rbp), %edx
movq -0x170(%rbp), %rsi
movslq %edx, %rax
addq 0x10(%rsi), %rax
addl $0x10, %edx
movl %edx, (%rcx)
movq %rax, -0x178(%rbp)
jmp 0xc03f
movq -0x170(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x8(%rax)
jmp 0xc337
movq -0x20(%rbp), %rax
movq %rax, -0x188(%rbp)
movl (%rax), %eax
movl %eax, -0x17c(%rbp)
cmpl $0x28, %eax
ja 0xc09c
movq -0x188(%rbp), %rcx
movl -0x17c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x190(%rbp)
jmp 0xc0b9
movq -0x188(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x190(%rbp)
movq -0x190(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0xc0e0
movq -0x48(%rbp), %rdi
callq 0x47b0
movq %rax, -0x198(%rbp)
jmp 0xc0f3
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0x4100
movq %rax, -0x198(%rbp)
movq -0x198(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0xc111
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xc347
movq -0x10(%rbp), %rdi
callq 0xd1a0
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0xc337
movq -0x20(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movl (%rax), %eax
movl %eax, -0x19c(%rbp)
cmpl $0x28, %eax
ja 0xc165
movq -0x1a8(%rbp), %rcx
movl -0x19c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x1b0(%rbp)
jmp 0xc182
movq -0x1a8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x1b0(%rbp)
movq -0x1b0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x41f0
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
jne 0xc1af
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xc347
movq -0x10(%rbp), %rdi
callq 0xd1a0
movq -0x50(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0xc337
movq -0x20(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movl (%rax), %eax
movl %eax, -0x1b4(%rbp)
cmpl $0x28, %eax
ja 0xc203
movq -0x1c0(%rbp), %rcx
movl -0x1b4(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x1c8(%rbp)
jmp 0xc220
movq -0x1c0(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0xc254
movq -0x50(%rbp), %rdi
callq 0x41f0
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
jne 0xc254
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xc347
callq 0x4390
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
jne 0xc278
movq -0x50(%rbp), %rdi
callq 0x4260
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xc347
movq -0x10(%rbp), %rdi
callq 0xd1a0
movq -0x50(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0xc337
movq -0x10(%rbp), %rdi
callq 0xd1a0
movq -0x20(%rbp), %rax
movq %rax, -0x1d8(%rbp)
movl (%rax), %eax
movl %eax, -0x1cc(%rbp)
cmpl $0x28, %eax
ja 0xc2e1
movq -0x1d8(%rbp), %rcx
movl -0x1cc(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x1e0(%rbp)
jmp 0xc2fe
movq -0x1d8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0xc337
movl $0x26, %edi
callq 0x4840
movq %rax, %rdx
movl $0xffffffda, %edi       # imm = 0xFFFFFFDA
leaq 0x3d33(%rip), %rsi      # 0x1005e
movb $0x0, %al
callq 0x4630
movl %eax, -0x4(%rbp)
jmp 0xc347
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
nopw %cs:(%rax,%rax)