// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
cmpl $0x1, -0x1c(%rbp)
jge 0x13dbd
movq -0x28(%rbp), %rdi
leaq 0x7c06(%rip), %rsi      # 0x1b9b9
callq 0x3070
jmp 0x13f43
cmpq $0x0, -0x10(%rbp)
je 0x13f35
cmpl $0x0, -0x4(%rbp)
je 0x13dee
movq -0x10(%rbp), %rdi
movl -0x4(%rbp), %esi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
movq -0x28(%rbp), %r8
callq 0x13f70
movq %rax, -0x30(%rbp)
jmp 0x13f33
movq -0x10(%rbp), %rax
movsbl 0x14(%rax), %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x6, %eax
ja 0x13f21
movq -0x38(%rbp), %rax
leaq 0x77fc(%rip), %rcx      # 0x1b60c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
callq 0x14090
movq %rax, -0x30(%rbp)
jmp 0x13f31
movq -0x10(%rbp), %rdi
callq 0x14100
movq %rax, -0x30(%rbp)
jmp 0x13f31
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movq -0x28(%rbp), %rcx
callq 0x141b0
movq %rax, -0x30(%rbp)
jmp 0x13f31
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x3780
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x13e86
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x3070
jmp 0x13f31
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
xorl %esi, %esi
callq 0x7960
movl %eax, %ecx
movq -0x40(%rbp), %rax
movslq %ecx, %rcx
movq 0x280(%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edx
movl $0x6, %ecx
callq 0xb7d0
cmpq $0x0, %rax
je 0x13f12
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edi
addl $0x1, %edi
callq 0x3780
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x13f10
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movb $0x40, (%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x1, %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x3070
jmp 0x13f1f
movq -0x10(%rbp), %rdi
callq 0x14090
movq %rax, -0x30(%rbp)
jmp 0x13f31
movq -0x28(%rbp), %rdi
leaq 0x86ac(%rip), %rsi      # 0x1c5d8
callq 0x3070
jmp 0x13f33
jmp 0x13f41
movl -0x4(%rbp), %edi
callq 0x14480
movq %rax, -0x30(%rbp)
jmp 0x13f43
cmpq $0x0, -0x30(%rbp)
jne 0x13f66
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x13f66
movq -0x28(%rbp), %rdi
movq 0xd1ff(%rip), %rsi      # 0x21160
callq 0x3070
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq