// File: /workspace/github_c_makefile_star2_O1/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, 0x40(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdi, 0x28(%rsp)
movq 0x8(%rdi), %r12
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
testq %r12, %r12
je 0xcc76
movq %rsp, %r13
xorl %ebx, %ebx
movq $0x0, 0x38(%rsp)
movq %r12, %rdi
movq 0x20(%rsp), %rsi
movq %r13, %rdx
callq *0x18(%r12)
testl %eax, %eax
je 0xcad8
movl %eax, %ebp
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0xcadf
cmpb $0x9, 0x14(%rax)
jne 0xcac9
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
je 0xcac9
movq %r13, %rdi
leaq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %r12, %rcx
callq *%rax
movl %eax, %ebp
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xcab7
callq 0x3979
testl %ebp, %ebp
je 0xccaa
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movl 0x10(%rax), %r15d
movq 0x8(%rax), %rsi
jmp 0xcb0c
xorl %ebp, %ebp
jmp 0xcc67
movl (%rsp), %edx
movq %rbx, %r14
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
leaq 0x62f0(%rip), %rsi      # 0x12de4
xorl %eax, %eax
callq 0x3200
movq %rbx, %rdi
callq 0x30c0
movq %rax, %r15
movq %rbx, %rsi
movq %r14, %rbx
testq %rbx, %rbx
sete %cl
movq 0x8(%rsp), %rax
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xcb2e
cmpb $0x0, 0x14(%rax)
je 0xcbf9
movl %r15d, %eax
xorl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq 0x38(%rsp), %r14
cmpl %r14d, %eax
jle 0xcbd9
movq %rsi, 0x48(%rsp)
movq %rbx, 0x30(%rsp)
leal (%r15,%r14), %r13d
movslq %r13d, %rbx
leaq 0x19(%rbx), %rdi
callq 0x31b0
testq %rax, %rax
je 0xcc0b
movq %rax, %rcx
addq $0x18, %rcx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq %rcx, 0x8(%rax)
movb $0x0, 0x18(%rax,%rbx)
movq $0x1, (%rax)
movl %ebx, 0x10(%rax)
movq %rax, 0x18(%rsp)
movslq %r14d, %r14
movq 0x30(%rsp), %rbx
testq %rbx, %rbx
je 0xcbb9
movq 0x8(%rax), %rdi
movq 0x8(%rbx), %rsi
movq %r14, %rdx
callq 0x3180
movq %rbx, %rdi
callq 0x3979
movq 0x18(%rsp), %rax
addq 0x8(%rax), %r14
movslq %r15d, %rdx
movq %r14, %rdi
movq 0x48(%rsp), %rsi
callq 0x3180
movq 0x18(%rsp), %rbx
jmp 0xcc32
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movl %r15d, %edx
leaq 0x63fb(%rip), %rcx      # 0x12fe8
callq 0x3cc3
xorl %ebp, %ebp
movl %r14d, %r13d
jmp 0xcc32
movq $0x0, 0x8(%rsp)
movl $0x0, (%rsp)
jmp 0xcc5a
movq %rax, 0x18(%rsp)
movq 0xc559(%rip), %rcx      # 0x19170
xorl %ebp, %ebp
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
xorl %edx, %edx
callq 0x3cc3
movl %r14d, %r13d
movq 0x30(%rsp), %rbx
movl $0x0, (%rsp)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xcc51
callq 0x3979
movq $0x0, 0x8(%rsp)
movl %r13d, %r15d
movq %rbx, %rax
movq %rsp, %r13
movq 0x10(%r12), %r12
movq %r15, 0x38(%rsp)
movq %rax, %rbx
testq %r12, %r12
je 0xcc7d
testl %ebp, %ebp
jne 0xca61
jmp 0xcc7d
movl $0x1, %ebp
xorl %ebx, %ebx
testl %ebp, %ebp
je 0xcc8c
movq 0x40(%rsp), %rax
movq %rbx, 0x8(%rax)
jmp 0xcc99
testq %rbx, %rbx
je 0xcc99
movq %rbx, %rdi
callq 0x3979
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
jmp 0xcc7d