// File: /workspace/github_c_makefile_star2_O2/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 0xd9b6
movq %rsi, %r15
movl %edi, %r13d
testq %rsi, %rsi
je 0xd9cd
movl %ecx, %ebp
movq %rdx, %r12
testl %r13d, %r13d
je 0xd9e3
pushq $0x4
popq %rdi
callq 0x3638
testq %rax, %rax
je 0xda4c
movq %rax, %r14
movq 0x8(%rax), %rax
movb $0x0, 0x4(%rax)
movl $0x70757424, (%rax)     # imm = 0x70757424
pushq $0x2
popq %rdi
callq 0x3638
movq %rax, 0x20(%r14)
testq %rax, %rax
je 0xda44
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 0xd8f5
testq %rax, %rax
je 0xda44
movq 0x20(%r14), %rcx
movq %rax, 0x18(%rcx)
movq %rax, %r15
movq 0x20(%rax), %rax
testq %rax, %rax
jne 0xd994
movl %r13d, %edi
callq 0xdcfa
movq %rax, 0x20(%r15)
testq %rax, %rax
jne 0xd9d8
jmp 0xda44
movups 0x3b85(%rip), %xmm0     # 0x11542
movups %xmm0, 0x10(%rbx)
movups 0x3b6a(%rip), %xmm0     # 0x11532
movups %xmm0, (%rbx)
jmp 0xda4c
movl %r13d, %edi
callq 0xdcfa
movq %rax, %r14
testq %r14, %r14
jne 0xda63
jmp 0xda4c
movzbl 0x14(%r15), %eax
cmpq $0x6, %rax
ja 0xda75
leaq 0x378f(%rip), %rcx      # 0x11188
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x1
popq %rdi
callq 0x3638
testq %rax, %rax
je 0xda4c
movq %rax, %r14
movq 0x8(%rax), %rax
movb $0x24, (%rax)
pushq $0x2
popq %rdi
callq 0x3638
movq %rax, 0x20(%r14)
testq %rax, %rax
je 0xda44
movq 0x8(%rax), %rax
movb $0x0, 0x2(%rax)
movw $0x7d7b, (%rax)         # imm = 0x7D7B
incq (%r15)
movq 0x20(%r14), %rax
movq %r15, 0x18(%rax)
jmp 0xda63
movq %r14, %rdi
callq 0x38b2
cmpb $0x0, (%rbx)
jne 0xda60
movq 0xa718(%rip), %rsi      # 0x18170
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 0x46da(%rip), %xmm0     # 0x12156
movups %xmm0, 0xc(%rbx)
movups 0x46c3(%rip), %xmm0     # 0x1214a
jmp 0xd9c8
pushq $0x7
popq %rdi
callq 0x3638
testq %rax, %rax
je 0xda4c
movq %rax, %r14
cmpq $0x0, 0x28(%r15)
je 0xdb49
movq 0x8(%r14), %rax
movb $0x0, 0x4(%rax)
movl $0x77656e24, (%rax)     # imm = 0x77656E24
movl $0x4, 0x10(%r14)
jmp 0xdb78
movl 0x10(%r15), %edi
callq 0x3638
testq %rax, %rax
je 0xda4c
movq %rax, %r14
movq 0x8(%rax), %rdi
jmp 0xdb2e
movq 0x8(%r15), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x5f40
movl %eax, %eax
movq 0x280(%r12,%rax,8), %rdi
movl 0x10(%r15), %ebp
pushq $0x6
popq %rcx
movq %r14, %rsi
movl %ebp, %edx
callq 0x81fe
testq %rax, %rax
je 0xdb3c
incl %ebp
movl %ebp, %edi
callq 0x3638
testq %rax, %rax
je 0xda4c
movq %rax, %r14
movq 0x8(%rax), %rax
movb $0x40, (%rax)
movq 0x8(%r14), %rdi
incq %rdi
movq 0x8(%r15), %rsi
callq 0x3070
jmp 0xda63
movq %r15, %rdi
callq 0xdcaf
jmp 0xd9d5
cmpq $0x0, 0x20(%r15)
movq 0x8(%r14), %rax
je 0xdb6b
movl $0x796172, 0x3(%rax)    # imm = 0x796172
movl $0x72726124, (%rax)     # imm = 0x72726124
movl $0x6, 0x10(%r14)
jmp 0xdb78
movabsq $0x72656666756224, %rcx # imm = 0x72656666756224
movq %rcx, (%rax)
pushq $0x2
popq %rdi
callq 0x3638
movq %rax, 0x20(%r14)
testq %rax, %rax
je 0xdc8a
movq 0x8(%rax), %rax
movb $0x0, 0x2(%rax)
movw $0x2928, (%rax)         # imm = 0x2928
movq 0x28(%r15), %rax
testq %rax, %rax
je 0xdbcb
movl 0x10(%rax), %edi
callq 0x3638
movq 0x20(%r14), %rcx
movq %rax, 0x18(%rcx)
testq %rax, %rax
je 0xdbdc
movq 0x8(%rax), %rdi
movq 0x28(%r15), %rax
movq 0x8(%rax), %rsi
callq 0x3070
jmp 0xdbdc
movl 0x40(%r15), %edi
callq 0xdcfa
movq 0x20(%r14), %rcx
movq %rax, 0x18(%rcx)
movl 0x40(%r15), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
xorl %edx, %edx
cmpq %rcx, %rax
je 0xdc12
movq 0x18(%r15), %rsi
cmpl $0x0, (%rsi,%rcx,4)
je 0xdc00
leal 0x1(%rcx), %edx
incq %rcx
jmp 0xdbe9
movq 0x20(%r15), %rsi
testq %rsi, %rsi
je 0xdbfb
cmpq $0x0, (%rsi,%rcx,8)
jne 0xdbf8
jmp 0xdbfb
movq %r12, 0x8(%rsp)
movq 0x20(%r14), %rax
movq 0x18(%rax), %rax
decl %ebp
movslq %edx, %rcx
movq %rcx, 0x10(%rsp)
xorl %r12d, %r12d
movq $0x0, (%rsp)
testq %rax, %rax
je 0xdc81
cmpq 0x10(%rsp), %r12
jge 0xdc81
movq %rax, %r13
movq 0x20(%rax), %rax
testq %rax, %rax
jne 0xdc40
movq 0x20(%r15), %rax
testq %rax, %rax
je 0xdc5d
movq (%rax,%r12,8), %rax
movq %rax, (%rsp)
movq 0x18(%r15), %rax
movl (%rax,%r12,4), %edi
incq %r12
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movl %ebp, %ecx
movq %rbx, %r8
callq 0xd8f5
movq %rax, 0x20(%r13)
jmp 0xdc34
testq %rax, %rax
jne 0xd9d8
movq %r14, %rdi
callq 0x38b2
cmpb $0x0, (%rbx)
jne 0xda60
movq 0xa4ce(%rip), %rsi      # 0x18170
movq %rbx, %rdi
callq 0x3070
jmp 0xda4c