// File: /workspace/github_c_makefile_star2_O2/DeforaOS[P]libSystem/src/variable.c
// Function: variable_new_copy
Variable * variable_new_copy(Variable const * from)
{
	switch(from->type)
	{
		case VT_NULL:
			return variable_new(from->type);
		case VT_BOOL:
			return variable_new(from->type, from->u.b);
		case VT_INT8:
			return variable_new(from->type, from->u.int8);
		case VT_UINT8:
			return variable_new(from->type, from->u.uint8);
		case VT_INT16:
			return variable_new(from->type, from->u.int16);
		case VT_UINT16:
			return variable_new(from->type, from->u.uint16);
		case VT_INT32:
			return variable_new(from->type, from->u.int32);
		case VT_UINT32:
			return variable_new(from->type, from->u.uint32);
		case VT_INT64:
			return variable_new(from->type, from->u.int64);
		case VT_UINT64:
			return variable_new(from->type, from->u.uint64);
		case VT_FLOAT:
			return variable_new(from->type, from->u.f);
		case VT_DOUBLE:
			return variable_new(from->type, from->u.d);
		case VT_STRING:
			return variable_new(from->type, from->u.string);
		case VT_BUFFER:
			return variable_new(from->type, from->u.buffer);
		case VT_ARRAY:
			return _new_copy_array(from);
		case VT_COMPOUND:
			return _new_copy_compound(from);
		case VT_POINTER:
			return variable_new(from->type, from->u.pointer);
	}
	error_set_code(1, "%s%u%s", "Unable to copy this type of variable (",
			from->type, ")");
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl (%rdi), %ecx
cmpq $0x10, %rcx
ja 0x8f00
movq %rdi, %r14
leaq 0x240e(%rip), %rax      # 0xb214
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
xorl %edi, %edi
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x46c0
movq 0x8(%r14), %rsi
pushq $0x10
jmp 0x8f75
movq 0x10(%r14), %rdi
callq 0x4340
movl 0x8(%r14), %edi
movq %rax, %rsi
xorl %eax, %eax
callq 0x46a0
testq %rax, %rax
je 0x8ee2
movq %rax, %rbx
movq 0x10(%rax), %rdi
movq 0x10(%r14), %rsi
callq 0x4360
testl %eax, %eax
jne 0x8eda
jmp 0x8f21
movsd 0x8(%r14), %xmm0
pushq $0xb
jmp 0x8f5e
movswl 0x8(%r14), %esi
pushq $0x4
jmp 0x8f45
movq 0x8(%r14), %rsi
pushq $0xc
jmp 0x8f75
movq 0x8(%r14), %rsi
pushq $0x9
jmp 0x8f75
movsbl 0x8(%r14), %esi
pushq $0x2
jmp 0x8f45
movq 0x10(%r14), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x4650
testq %rax, %rax
je 0x8ee2
movq %rax, %rbx
movq 0x18(%rax), %rax
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
movq 0x18(%r14), %rdi
leaq 0x1068(%rip), %rsi      # 0x9f34
movq %r15, %rdx
callq 0x43a0
cmpq $0x0, (%r15)
jne 0x8f21
movq %rbx, %rdi
callq 0x4330
xorl %ebx, %ebx
jmp 0x8f21
movzbl 0x8(%r14), %esi
pushq $0x3
jmp 0x8f45
movl 0x8(%r14), %esi
pushq $0x7
jmp 0x8f45
movzbl 0x8(%r14), %esi
pushq $0x1
jmp 0x8f45
leaq 0x2661(%rip), %rsi      # 0xb568
leaq 0x2661(%rip), %rdx      # 0xb56f
leaq 0x220b(%rip), %r8       # 0xb120
xorl %ebx, %ebx
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x4610
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movzwl 0x8(%r14), %esi
pushq $0x5
jmp 0x8f45
movq 0x8(%r14), %rsi
pushq $0xd
jmp 0x8f75
movl 0x8(%r14), %esi
pushq $0x6
popq %rdi
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x46c0
cvtss2sd 0x8(%r14), %xmm0
pushq $0xa
popq %rdi
movb $0x1, %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x46c0
movq 0x8(%r14), %rsi
pushq $0x8
popq %rdi
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x46c0