// File: /workspace/github_c_makefile_star2_O1/martincameron[P]towntalk/towntalk.c
// Function: evaluate_load_expression
static enum result evaluate_load_expression( struct expression *this,
	struct variables *vars, struct variable *result ) {
	long len;
	char message[ 64 ];
	struct string *str;
	struct variable file = { 0 };
	int offset = 0, count = -1;
	struct expression *parameter = this->parameters;
	enum result ret = evaluate_string( parameter, vars, &file );
	if( ret ) {
		parameter = parameter->next;
		if( parameter ) {
			ret = evaluate_integer( parameter, vars, &offset );
			parameter = parameter->next;
		}
		if( ret && parameter ) {
			ret = evaluate_integer( parameter, vars, &count );
			if( ret && parameter->next ) {
				ret = throw( vars, this, 0, "Too many parameters." );
			}
		}
		if( ret ) {
			len = load_file( file.string_value->string, NULL, offset, 0, message );
			if( len >= 0 ) {
				if( count >= 0 && count < len ) {
					len = count;
				}
				if( len < MAX_INTEGER ) {
					str = new_string( len );
					if( str ) {
						len = load_file( file.string_value->string, str->string, offset, len, message );
						if( len >= 0 ) {
							str->length = len;
							str->string[ len ] = 0;
							result->string_value = str;
						} else {
							unref_string( str );
							ret = throw( vars, this, 0, message );
						}
					} else {
						ret = throw_out_of_memory( vars, this );
					}
				} else {
					ret = throw( vars, this, 0, "File too large." );
				}
			} else {
				ret = throw( vars, this, 0, message );
			}
		}
		dispose_temporary( &file );
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movl $0x0, 0xc(%rsp)
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
movq 0x8(%rdi), %r12
movq %r12, %rdi
callq 0x445f
testl %eax, %eax
je 0xd356
movq 0x10(%r12), %r12
testq %r12, %r12
je 0xd35d
leaq 0xc(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x4714
movl %eax, %ebx
movq 0x10(%r12), %r12
jmp 0xd362
xorl %ebx, %ebx
jmp 0xd4cb
movl %eax, %ebx
xorl %r12d, %r12d
testl %ebx, %ebx
setne %al
testq %r12, %r12
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xd3ae
leaq 0x8(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x4714
testl %eax, %eax
je 0xd3a8
cmpq $0x0, 0x10(%r12)
je 0xd3ac
leaq 0x5ced(%rip), %rcx      # 0x13084
xorl %ebx, %ebx
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3cc3
jmp 0xd3ae
xorl %ebx, %ebx
jmp 0xd3ae
movl %eax, %ebx
testl %ebx, %ebx
je 0xd499
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
movslq 0xc(%rsp), %r13
leaq 0x30(%rsp), %r8
xorl %esi, %esi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x383d
testq %rax, %rax
js 0xd487
movslq 0x8(%rsp), %rcx
cmpq %rcx, %rax
movq %rcx, %r12
cmovlq %rax, %r12
testq %rcx, %rcx
cmovsq %rax, %r12
cmpq $0x7ffffffe, %r12       # imm = 0x7FFFFFFE
jg 0xd49d
movq %rbp, 0x20(%rsp)
movslq %r12d, %rcx
movq %rcx, 0x28(%rsp)
leaq 0x19(%rcx), %rdi
callq 0x31b0
testq %rax, %rax
je 0xd4a6
movq %rax, %rbp
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
addq $0x18, %rax
movq %rax, 0x8(%rbp)
movq 0x28(%rsp), %rax
movb $0x0, 0x18(%rbp,%rax)
movq $0x1, (%rbp)
movl %r12d, 0x10(%rbp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x8(%rbp), %rsi
leaq 0x30(%rsp), %r8
movq %r13, %rdx
movq %r12, %rcx
callq 0x383d
testq %rax, %rax
js 0xd4dc
movl %eax, 0x10(%rbp)
movq 0x8(%rbp), %rcx
movb $0x0, (%rcx,%rax)
movq 0x20(%rsp), %rax
movq %rbp, 0x8(%rax)
jmp 0xd4bc
leaq 0x30(%rsp), %rcx
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3cc3
xorl %ebx, %ebx
jmp 0xd4bc
leaq 0x5780(%rip), %rcx      # 0x12c24
jmp 0xd4ad
movq 0xbcc3(%rip), %rcx      # 0x19170
xorl %ebx, %ebx
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3cc3
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xd4cb
callq 0x3979
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbp, %rdi
callq 0x3979
xorl %ebx, %ebx
leaq 0x30(%rsp), %rcx
jmp 0xd4af