// File: /workspace/github_c_makefile_star2_O3/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 0xe6e9
movq %rsi, %r15
movl %edi, %r13d
testq %rsi, %rsi
je 0xe703
movl %ecx, %ebp
movq %rdx, %r12
testl %r13d, %r13d
je 0xe71c
movl $0x35, %edi
callq 0x31b0
testq %rax, %rax
je 0xe7dd
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
addq $0x30, %rax
movq %rax, 0x8(%r14)
movq $0x1, (%r14)
movl $0x4, 0x10(%r14)
movb $0x1, 0x14(%r14)
movl $0x70757424, 0x30(%r14) # imm = 0x70757424
movb $0x0, 0x34(%r14)
movl $0x33, %edi
callq 0x31b0
testq %rax, %rax
je 0xe7cd
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movq %rax, %rcx
addq $0x30, %rcx
movq %rcx, 0x8(%rax)
movq $0x1, (%rax)
movl $0x2, 0x10(%rax)
movb $0x1, 0x14(%rax)
movq %rax, 0x20(%r14)
movb $0x0, 0x32(%rax)
movw $0x2928, 0x30(%rax)     # imm = 0x2928
decl %ebp
xorl %edi, %edi
movq %r15, %rsi
movq %r12, %rdx
movl %ebp, %ecx
movq %rbx, %r8
callq 0xe5d9
testq %rax, %rax
je 0xe7d5
movq 0x20(%r14), %rcx
movq %rax, 0x18(%rcx)
movq %rax, %r15
movq 0x20(%rax), %rax
testq %rax, %rax
jne 0xe6c7
movl %r13d, %edi
callq 0xeb0a
movq %rax, 0x20(%r15)
testq %rax, %rax
jne 0xe70e
jmp 0xe7d5
movups 0x3e12(%rip), %xmm0     # 0x12502
movups %xmm0, 0x10(%rbx)
movups 0x3df7(%rip), %xmm0     # 0x124f2
movups %xmm0, (%rbx)
jmp 0xe7dd
movl %r13d, %edi
callq 0xeb0a
movq %rax, %r14
testq %r14, %r14
jne 0xe7f4
jmp 0xe7dd
movzbl 0x14(%r15), %eax
cmpq $0x6, %rax
ja 0xe806
leaq 0x3a16(%rip), %rcx      # 0x12148
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x32, %edi
callq 0x31b0
testq %rax, %rax
je 0xe7dd
movq %rax, %r14
xorps %xmm0, %xmm0
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 0xe7cd
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movq %rax, %rcx
addq $0x30, %rcx
movq %rcx, 0x8(%rax)
movq $0x1, (%rax)
movl $0x2, 0x10(%rax)
movb $0x1, 0x14(%rax)
movq %rax, 0x20(%r14)
movb $0x0, 0x32(%rax)
movw $0x7d7b, 0x30(%rax)     # imm = 0x7D7B
incq (%r15)
movq %r15, 0x18(%rax)
jmp 0xe7f4
movq $0x0, 0x20(%r14)
movq %r14, %rdi
callq 0x394d
cmpb $0x0, (%rbx)
jne 0xe7f1
movq 0xa987(%rip), %rsi      # 0x19170
movq %rbx, %rdi
callq 0x3070
xorl %r14d, %r14d
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movups 0x4909(%rip), %xmm0     # 0x13116
movups %xmm0, 0xc(%rbx)
movups 0x48f2(%rip), %xmm0     # 0x1310a
jmp 0xe6fb
movl $0x38, %edi
callq 0x31b0
testq %rax, %rax
je 0xe7dd
movq %rax, %r14
addq $0x10, %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movups %xmm0, 0x20(%r14)
movq %r14, %rcx
addq $0x30, %rcx
movq %rcx, 0x8(%r14)
movb $0x0, 0x37(%r14)
movq $0x1, (%r14)
movl $0x7, 0x10(%r14)
movb $0x1, 0x14(%r14)
movq 0x28(%r15), %r13
testq %r13, %r13
je 0xe91d
movb $0x0, 0x4(%rcx)
movl $0x77656e24, (%rcx)     # imm = 0x77656E24
movl $0x4, (%rax)
jmp 0xe946
movl 0x10(%r15), %edi
callq 0x3690
testq %rax, %rax
je 0xe7dd
movq %rax, %r14
movq 0x8(%rax), %rdi
jmp 0xe902
movq 0x8(%r15), %rsi
movb (%rsi), %cl
xorl %eax, %eax
testb %cl, %cl
je 0xe8c2
leaq 0x1(%rsi), %rdx
movzbl %cl, %ecx
xorl %ecx, %eax
movb (%rdx), %cl
incq %rdx
testb %cl, %cl
jne 0xe8b1
andl $0x1f, %eax
movq 0x280(%r12,%rax,8), %rdi
movl 0x10(%r15), %ebp
movl %ebp, %edx
movl $0x6, %ecx
callq 0x887e
testq %rax, %rax
je 0xe910
incl %ebp
movl %ebp, %edi
callq 0x3690
testq %rax, %rax
je 0xe7dd
movq %rax, %r14
movq 0x8(%rax), %rax
movb $0x40, (%rax)
movq 0x8(%r14), %rdi
incq %rdi
movq 0x8(%r15), %rsi
callq 0x3070
jmp 0xe7f4
movq %r15, %rdi
callq 0xeabf
jmp 0xe70b
cmpq $0x0, 0x20(%r15)
je 0xe939
movl $0x796172, 0x3(%rcx)    # imm = 0x796172
movl $0x72726124, (%rcx)     # imm = 0x72726124
movl $0x6, (%rax)
jmp 0xe946
movabsq $0x72656666756224, %rax # imm = 0x72656666756224
movq %rax, (%rcx)
movl $0x33, %edi
callq 0x31b0
testq %rax, %rax
je 0xe9b9
movq %rax, %rcx
addq $0x30, %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movq %rcx, 0x8(%rax)
movq $0x1, (%rax)
movl $0x2, 0x10(%rax)
movb $0x1, 0x14(%rax)
movq %rax, 0x20(%r14)
movb $0x0, 0x32(%rax)
movw $0x2928, 0x30(%rax)     # imm = 0x2928
testq %r13, %r13
je 0xe9c6
movl 0x10(%r13), %edi
callq 0x3690
movq 0x20(%r14), %rcx
movq %rax, 0x18(%rcx)
testq %rax, %rax
je 0xe9d7
movq 0x8(%rax), %rdi
movq 0x28(%r15), %rax
movq 0x8(%rax), %rsi
callq 0x3070
jmp 0xe9d7
movq $0x0, 0x20(%r14)
jmp 0xea9a
movl 0x40(%r15), %edi
callq 0xeb0a
movq 0x20(%r14), %rcx
movq %rax, 0x18(%rcx)
movslq 0x40(%r15), %rax
testq %rax, %rax
jle 0xea89
movq 0x18(%r15), %rdx
xorl %esi, %esi
xorl %ecx, %ecx
cmpl $0x0, (%rdx,%rsi,4)
je 0xe9ff
leal 0x1(%rsi), %ecx
incq %rsi
cmpq %rsi, %rax
jne 0xe9ec
jmp 0xea11
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0xe9f5
cmpq $0x0, (%rdi,%rsi,8)
jne 0xe9f2
jmp 0xe9f5
movq 0x20(%r14), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0xea91
testl %ecx, %ecx
jle 0xea91
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 0xea3b
movq 0x20(%r15), %rax
testq %rax, %rax
je 0xea58
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 0xe5d9
movq %rax, 0x20(%r12)
testq %rax, %rax
je 0xea91
incq %r13
cmpq 0x8(%rsp), %r13
jb 0xea3b
jmp 0xea91
movq 0x20(%r14), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
jne 0xe70e
movq %r14, %rdi
callq 0x394d
cmpb $0x0, (%rbx)
jne 0xe7f1
movq 0xa6be(%rip), %rsi      # 0x19170
movq %rbx, %rdi
callq 0x3070
jmp 0xe7dd