// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x1, -0x4c(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x30f0
movq $0x0, -0x70(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x58(%rbp)
movb %al, -0x79(%rbp)
je 0x1177f
cmpl $0x0, -0x4c(%rbp)
setne %al
movb %al, -0x79(%rbp)
movb -0x79(%rbp), %al
testb $0x1, %al
jne 0x1178b
jmp 0x1195d
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x68(%rbp), %rdx
callq *%rax
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x11958
cmpq $0x0, -0x60(%rbp)
je 0x1182a
movq -0x60(%rbp), %rax
movsbl 0x14(%rax), %eax
cmpl $0x9, %eax
jne 0x11812
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0x11812
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdx
movq -0x58(%rbp), %rcx
leaq -0x68(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq *%rax
movl %eax, -0x4c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x3ce0
cmpl $0x0, -0x4c(%rbp)
je 0x1180b
movq -0x78(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x11810
jmp 0x1195d
jmp 0x11812
movq -0x60(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x11853
leaq -0x40(%rbp), %rdi
movl -0x68(%rbp), %edx
leaq 0xaa78(%rip), %rsi      # 0x1c2b0
movb $0x0, %al
callq 0x31f0
leaq -0x40(%rbp), %rdi
callq 0x30c0
movl %eax, -0x20(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0x11890
cmpq $0x0, -0x60(%rbp)
je 0x11890
movq -0x60(%rbp), %rax
movsbl 0x14(%rax), %eax
cmpl $0x0, %eax
jne 0x11890
movq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq $0x0, -0x60(%rbp)
movl $0x0, -0x68(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x1194c
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jle 0x11929
movl -0x1c(%rbp), %edi
addl -0x20(%rbp), %edi
callq 0x39b0
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0x11917
cmpq $0x0, -0x70(%rbp)
je 0x118e4
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rsi
movslq -0x1c(%rbp), %rdx
shlq $0x0, %rdx
callq 0x3170
movq -0x70(%rbp), %rdi
callq 0x3c20
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rdi
movslq -0x1c(%rbp), %rax
addq %rax, %rdi
movq -0x48(%rbp), %rsi
movslq -0x20(%rbp), %rdx
shlq $0x0, %rdx
callq 0x3170
movl -0x20(%rbp), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x70(%rbp)
jmp 0x11927
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x5f20
movl %eax, -0x4c(%rbp)
jmp 0x11943
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl -0x20(%rbp), %edx
leaq 0xab79(%rip), %rcx      # 0x1c4b4
callq 0x4330
movl %eax, -0x4c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x3be0
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0x11769
cmpl $0x0, -0x4c(%rbp)
je 0x11971
movq -0x70(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x11983
cmpq $0x0, -0x70(%rbp)
je 0x11981
movq -0x70(%rbp), %rdi
callq 0x3c20
jmp 0x11983
movl -0x4c(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nop