// File: /workspace/github_c_makefile_star2_O1/martincameron[P]towntalk/towntalk.c
// Function: value_to_element
static struct element* value_to_element( number number_value, struct string *string_value,
	struct environment *env, int max_depth, char *message ) {
	struct element *elem = NULL;
	if( max_depth < 1 ) {
		strcpy( message, "Maximum element depth exceeded." );
	} else if( string_value ) {
		if( number_value ) {
			elem = new_tuple_element( string_value, number_value, env, max_depth, message );
		} else {
			switch( string_value->type ) {
				case STRING:
					elem = new_string_element( string_value );
					break;
				case ELEMENT:
					elem = new_literal_element( ( struct element * ) string_value );
					break;
				case ARRAY:
					elem = new_array_element( ( struct array * ) string_value, env, max_depth, message );
					break;
				case STRUCT:
					elem = new_element( string_value->length );
					if( elem ) {
						strcpy( elem->str.string, string_value->string );
					}
					break;
				case FUNCTION:
					if( get_decl( env->decls_index[ hash_code( string_value->string, 0 ) ],
					string_value->string, string_value->length, FUNCTION ) ) {
						elem = new_element( string_value->length + 1 );
						if( elem ) {
							elem->str.string[ 0 ] = '@';
							strcpy( &elem->str.string[ 1 ], string_value->string );
						}
					} else {
						elem = new_string_element( string_value );
					}
					break;
				default:
					strcpy( message, "Unsupported reference type." );
					break;
			}
		}
	} else {
		elem = new_number_element( number_value );
	}
	if( elem == NULL && message[ 0 ] == 0 ) {
		strcpy( message, OUT_OF_MEMORY );
	}
	return elem;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
testl %ecx, %ecx
jle 0xea5d
movq %rsi, %r15
movl %edi, %r13d
testq %rsi, %rsi
je 0xea77
movl %ecx, %ebp
movq %rdx, %r12
testl %r13d, %r13d
je 0xea87
movl $0x35, %edi
callq 0x31b0
testq %rax, %rax
je 0xeb53
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
addq $0x30, %rax
movq %rax, 0x8(%r14)
movb $0x0, 0x34(%r14)
movq $0x1, (%r14)
movl $0x4, 0x10(%r14)
movb $0x1, 0x14(%r14)
movl $0x70757424, 0x30(%r14) # imm = 0x70757424
movl $0x33, %edi
callq 0x31b0
testq %rax, %rax
je 0xe9f8
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
leaq 0x30(%rax), %rcx
movq %rcx, 0x8(%rax)
movb $0x0, 0x32(%rax)
movq $0x1, (%rax)
movl $0x2, 0x10(%rax)
movb $0x1, 0x14(%rax)
movq %rax, 0x20(%r14)
testq %rax, %rax
je 0xeb4b
movq 0x8(%rax), %rax
movb $0x0, 0x2(%rax)
movw $0x2928, (%rax)         # imm = 0x2928
decl %ebp
xorl %edi, %edi
movq %r15, %rsi
movq %r12, %rdx
movl %ebp, %ecx
movq %rbx, %r8
callq 0xe93a
testq %rax, %rax
je 0xeb4b
movq 0x20(%r14), %rcx
movq %rax, 0x18(%rcx)
movq %rax, %r15
movq 0x20(%rax), %rax
testq %rax, %rax
jne 0xea37
movl %r13d, %edi
callq 0xee86
movq %rax, 0x20(%r15)
testq %rax, %rax
jne 0xeb56
jmp 0xeb4b
movups 0x3a99(%rip), %xmm0     # 0x124fd
movups %xmm0, 0x10(%rbx)
movups 0x3a7e(%rip), %xmm0     # 0x124ed
movups %xmm0, (%rbx)
jmp 0xeb53
movl %r13d, %edi
callq 0xee86
movq %rax, %r14
jmp 0xeb56
movzbl 0x14(%r15), %eax
cmpq $0x6, %rax
ja 0xeb81
leaq 0x3693(%rip), %rcx      # 0x12130
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x32, %edi
callq 0x31b0
testq %rax, %rax
je 0xeb53
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
addq $0x30, %rax
movq %rax, 0x8(%r14)
movq $0x1, (%r14)
movl $0x1, 0x10(%r14)
movb $0x1, 0x14(%r14)
movw $0x24, 0x30(%r14)
movl $0x33, %edi
callq 0x31b0
testq %rax, %rax
je 0xeb28
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
leaq 0x30(%rax), %rcx
movq %rcx, 0x8(%rax)
movb $0x0, 0x32(%rax)
movq $0x1, (%rax)
movl $0x2, 0x10(%rax)
movb $0x1, 0x14(%rax)
movq %rax, 0x20(%r14)
testq %rax, %rax
je 0xeb4b
movq 0x8(%rax), %rax
movb $0x0, 0x2(%rax)
movw $0x7d7b, (%rax)         # imm = 0x7D7B
incq (%r15)
movq 0x20(%r14), %rax
movq %r15, 0x18(%rax)
jmp 0xeb56
movq %r14, %rdi
callq 0x3979
xorl %r14d, %r14d
testq %r14, %r14
jne 0xeb6f
cmpb $0x0, (%rbx)
jne 0xeb6f
movq 0xa609(%rip), %rsi      # 0x19170
movq %rbx, %rdi
callq 0x3070
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movups 0x4590(%rip), %xmm0     # 0x13118
movups %xmm0, 0xc(%rbx)
movups 0x4579(%rip), %xmm0     # 0x1310c
jmp 0xea6f
movl $0x38, %edi
callq 0x31b0
testq %rax, %rax
je 0xeb53
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
addq $0x30, %rax
movq %rax, 0x8(%r14)
movb $0x0, 0x37(%r14)
movq $0x1, (%r14)
movl $0x7, 0x10(%r14)
movb $0x1, 0x14(%r14)
cmpq $0x0, 0x28(%r15)
je 0xec96
movq 0x8(%r14), %rax
movb $0x0, 0x4(%rax)
movl $0x77656e24, (%rax)     # imm = 0x77656E24
movl $0x4, 0x10(%r14)
jmp 0xecc5
movl 0x10(%r15), %edi
callq 0x36a0
testq %rax, %rax
je 0xeb53
movq %rax, %r14
movq 0x8(%rax), %rdi
jmp 0xec7b
movq 0x8(%r15), %rsi
movb (%rsi), %cl
xorl %eax, %eax
testb %cl, %cl
je 0xec3b
leaq 0x1(%rsi), %rdx
movzbl %cl, %ecx
xorl %ecx, %eax
movb (%rdx), %cl
incq %rdx
testb %cl, %cl
jne 0xec2a
andl $0x1f, %eax
movq 0x280(%r12,%rax,8), %rdi
movl 0x10(%r15), %ebp
movl %ebp, %edx
movl $0x6, %ecx
callq 0x8a37
testq %rax, %rax
je 0xec89
incl %ebp
movl %ebp, %edi
callq 0x36a0
testq %rax, %rax
je 0xeb53
movq %rax, %r14
movq 0x8(%rax), %rax
movb $0x40, (%rax)
movq 0x8(%r14), %rdi
incq %rdi
movq 0x8(%r15), %rsi
callq 0x3070
jmp 0xeb56
movq %r15, %rdi
callq 0xee3b
jmp 0xea7f
cmpq $0x0, 0x20(%r15)
movq 0x8(%r14), %rax
je 0xecb8
movl $0x796172, 0x3(%rax)    # imm = 0x796172
movl $0x72726124, (%rax)     # imm = 0x72726124
movl $0x6, 0x10(%r14)
jmp 0xecc5
movabsq $0x72656666756224, %rcx # imm = 0x72656666756224
movq %rcx, (%rax)
movl $0x33, %edi
callq 0x31b0
testq %rax, %rax
je 0xed00
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
leaq 0x30(%rax), %rcx
movq %rcx, 0x8(%rax)
movb $0x0, 0x32(%rax)
movq $0x1, (%rax)
movl $0x2, 0x10(%rax)
movb $0x1, 0x14(%rax)
movq %rax, 0x20(%r14)
testq %rax, %rax
je 0xed47
movq 0x8(%rax), %rax
movb $0x0, 0x2(%rax)
movw $0x2928, (%rax)         # imm = 0x2928
movq 0x28(%r15), %rax
testq %rax, %rax
je 0xed4e
movl 0x10(%rax), %edi
callq 0x36a0
movq 0x20(%r14), %rcx
movq %rax, 0x18(%rcx)
testq %rax, %rax
je 0xed5f
movq 0x8(%rax), %rdi
movq 0x28(%r15), %rax
movq 0x8(%rax), %rsi
callq 0x3070
jmp 0xed5f
xorl %eax, %eax
jmp 0xee0d
movl 0x40(%r15), %edi
callq 0xee86
movq 0x20(%r14), %rcx
movq %rax, 0x18(%rcx)
movslq 0x40(%r15), %rax
testq %rax, %rax
jle 0xed95
movq 0x18(%r15), %rdx
xorl %esi, %esi
xorl %ecx, %ecx
cmpl $0x0, (%rdx,%rsi,4)
je 0xed83
leal 0x1(%rsi), %ecx
incq %rsi
cmpq %rsi, %rax
jne 0xed70
jmp 0xed97
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0xed79
cmpq $0x0, (%rdi,%rsi,8)
jne 0xed76
jmp 0xed79
xorl %ecx, %ecx
movq 0x20(%r14), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0xee0d
testl %ecx, %ecx
jle 0xee0d
movq %r12, 0x10(%rsp)
decl %ebp
movl %ecx, %ecx
movq %rcx, 0x8(%rsp)
xorl %r13d, %r13d
movq $0x0, (%rsp)
movq %rax, %r12
movq 0x20(%rax), %rax
testq %rax, %rax
jne 0xedc1
movq 0x20(%r15), %rax
testq %rax, %rax
je 0xedde
movq (%rax,%r13,8), %rax
movq %rax, (%rsp)
movq 0x18(%r15), %rax
movl (%rax,%r13,4), %edi
movq (%rsp), %rsi
movq 0x10(%rsp), %rdx
movl %ebp, %ecx
movq %rbx, %r8
callq 0xe93a
movq %rax, 0x20(%r12)
testq %rax, %rax
je 0xee0d
incq %r13
cmpq 0x8(%rsp), %r13
jb 0xedc1
testq %rax, %rax
jne 0xeb56
movq %r14, %rdi
callq 0x3979
cmpb $0x0, (%rbx)
jne 0xeb53
movq 0xa342(%rip), %rsi      # 0x19170
movq %rbx, %rdi
callq 0x3070
jmp 0xeb53