// File: /workspace/github_c_makefile_star2_O2/martincameron[P]towntalk/towntalk.c
// Function: evaluate_str_expression
static enum result evaluate_str_expression( struct expression *this,
	struct variables *vars, struct variable *result ) {
	int str_len = 0, len;
	char num[ 32 ], *val;
	enum result ret = OKAY;
	struct expression *parameter = this->parameters;
	struct variable var = { 0, NULL };
	struct string *str = NULL, *new;
	while( parameter && ret ) {
		ret = parameter->evaluate( parameter, vars, &var );
		if( ret ) {
			if( var.string_value ) {
				if( var.string_value->type == CUSTOM && ( ( struct custom * ) var.string_value )->type->to_str ) {
					ret = ( ( struct custom * ) var.string_value )->type->to_str( &var, &new, vars, parameter );
					dispose_temporary( &var );
					if( ret ) {
						var.string_value = new;
					} else {
						break;
					}
				}
				len = var.string_value->length;
				val = var.string_value->string;
			} else {
#if defined( FLOATING_POINT )
				sprintf( num, "%.16g", var.number_value );
#else
				sprintf( num, "%d", var.number_value );
#endif
				len = strlen( num );
				val = num;
			}
			if( str == NULL && var.string_value && var.string_value->type == STRING ) {
				str = var.string_value;
				var.string_value = NULL;
				var.number_value = 0;
				str_len = len;
			} else {
				if( MAX_INTEGER - len > str_len ) {
					new = new_string( str_len + len );
					if( new ) {
						if( str ) {
							memcpy( new->string, str->string, sizeof( char ) * str_len );
							unref_string( str );
						}
						memcpy( &new->string[ str_len ], val, sizeof( char ) * len );
						str_len += len;
						str = new;
					} else {
						ret = throw_out_of_memory( vars, this );
					}
				} else {
					ret = throw( vars, this, len, "String too large." );
				}
				dispose_variable( &var );
			}
			parameter = parameter->next;
		}
	}
	if( ret ) {
		result->string_value = str;
	} else if( str ) {
		unref_string( str );
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, 0x48(%rsp)
movq %rsi, %r14
movq %rdi, 0x38(%rsp)
movq 0x8(%rdi), %r12
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r13
movaps %xmm0, (%r13)
pushq $0x1
popq %rbp
movq $0x0, (%rsp)
xorl %r15d, %r15d
testq %r12, %r12
je 0xc006
testl %ebp, %ebp
je 0xc006
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq *0x18(%r12)
xorl %ebp, %ebp
testl %eax, %eax
je 0xbe4f
movl %eax, %ebx
movq 0x28(%rsp), %rax
testq %rax, %rax
movq %r15, 0x8(%rsp)
je 0xbecb
cmpb $0x9, 0x14(%rax)
jne 0xbefe
movq 0x18(%rax), %rcx
movq 0x10(%rcx), %r8
testq %r8, %r8
movq (%rsp), %rbp
je 0xbf02
movq %r13, %rdi
leaq 0x18(%rsp), %rsi
movq %r14, %rdx
movq %r12, %rcx
callq *%r8
movl %eax, %ebx
movq %r13, %rdi
callq 0x3988
testl %ebx, %ebx
je 0xc015
movq 0x18(%rsp), %rax
movq %rax, 0x28(%rsp)
jmp 0xbf02
movl 0x20(%rsp), %edx
leaq 0x50(%rsp), %rbp
movq %rbp, %rdi
leaq 0x5f42(%rip), %rsi      # 0x11e20
xorl %eax, %eax
callq 0x3200
movq %rbp, %rdi
callq 0x30c0
movq %rax, %r15
movq 0x28(%rsp), %rax
movq %rbp, %rsi
movq (%rsp), %rbp
jmp 0xbf0a
movq (%rsp), %rbp
movl 0x10(%rax), %r15d
movq 0x8(%rax), %rsi
cmpq $0x0, 0x8(%rsp)
sete %cl
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xbf2a
cmpb $0x0, 0x14(%rax)
je 0xbfc5
movl %r15d, %eax
xorl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl %ebp, %eax
jle 0xbfac
movq %rsi, (%rsp)
leal (%r15,%rbp), %edi
movl %edi, 0x14(%rsp)
callq 0x3723
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0xbfd7
movslq %ebp, %rcx
movq 0x8(%rsp), %rbp
testq %rbp, %rbp
je 0xbf89
movq 0x8(%rax), %rdi
movq 0x8(%rbp), %rsi
movq %rcx, %rdx
movq %rcx, 0x40(%rsp)
callq 0x3180
movq %rbp, %rdi
callq 0x38b2
movq 0x40(%rsp), %rcx
movq 0x18(%rsp), %rax
movl 0x14(%rsp), %ebp
addq 0x8(%rax), %rcx
movslq %r15d, %rdx
movq %rcx, %rdi
movq (%rsp), %rsi
callq 0x3180
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0xbfe6
movq %r14, %rdi
movq 0x38(%rsp), %rsi
movl %r15d, %edx
leaq 0x6068(%rip), %rcx      # 0x12026
callq 0x3bb2
jmp 0xbfe4
andq $0x0, 0x28(%rsp)
andl $0x0, 0x20(%rsp)
movq %rax, 0x8(%rsp)
jmp 0xbff1
movq %r14, %rdi
movq 0x38(%rsp), %rsi
callq 0x4c90
xorl %ebx, %ebx
movq %r13, %rdi
callq 0x3896
movl %ebp, %r15d
movq 0x10(%r12), %r12
movq %r15, (%rsp)
movl %ebx, %ebp
movq 0x8(%rsp), %r15
jmp 0xbe4f
testl %ebp, %ebp
je 0xc015
movq 0x48(%rsp), %rax
movq %r15, 0x8(%rax)
jmp 0xc024
xorl %ebp, %ebp
testq %r15, %r15
je 0xc024
movq %r15, %rdi
callq 0x38b2
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq