// File: /workspace/github_c_makefile_star2_O0/martincameron[P]towntalk/worker.c
// Function: evaluate_execute_expression
enum result evaluate_execute_expression( struct expression *this,
	struct variables *vars, struct variable *result ) {
	struct expression *parameter = this->parameters;
	struct environment *env = vars->func->env;
	struct variable var = { 0, NULL };
	struct worker *work;
	struct string *str;
	int count, idx;
	enum result ret = evaluate_custom( parameter, &worker_type, vars, &var );
	if( ret ) {
		work = ( struct worker * ) var.string_value;
		parameter = parameter->next;
		count = 0;
		while( parameter ) {
			count++;
			parameter = parameter->next;
		}
		if( work->env.entry_point->num_parameters == count ) {
			if( ( size_t ) &ret < env->stack_limit ) {
				ret = throw_stack_overflow( vars, this );
			} else if( work->locked == 0 ) {
				await_worker( work, 1 );
				idx = 0;
				parameter = this->parameters->next;
				while( parameter && ret ) {
					dispose_variable( &work->args[ idx ] );
					ret = parameter->evaluate( parameter, vars, &work->args[ idx ] );
					if( ret ) {
						work->parameters[ idx ].index = ( long_int ) work->args[ idx ].number_value;
						( ( struct value_expression * ) work->parameters )[ idx ].num = work->args[ idx ].number_value;
						str = work->args[ idx ].string_value;
						if( str ) {
							if( str->type == STRING || ( str->type == ARRAY && !( ( struct array * ) str )->string_values ) ) {
								work->strings[ idx ].str.reference_count = 1;
								work->strings[ idx ].str.type = str->type;
								work->strings[ idx ].str.string = str->string;
								work->strings[ idx ].str.length = str->length;
								if( str->type == ARRAY ) {
									work->strings[ idx ].number_values = ( ( struct array * ) str )->number_values;
									work->strings[ idx ].length = ( ( struct array * ) str )->length;
								}
								( ( struct value_expression * ) work->parameters )[ idx ].str = &work->strings[ idx ].str;
								work->parameters[ idx ].evaluate = evaluate_string_literal_expression;
							} else {
								ret = throw( vars, this, 0, "Values of this type cannot be passed to workers." );
							}
						} else {
							( ( struct value_expression * ) work->parameters )[ idx ].str = NULL;
							work->parameters[ idx ].evaluate = evaluate_number_literal_expression;
						}
					}
					parameter = parameter->next;
					idx++;
				}
				if( ret ) {
					work->ret = OKAY;
					dispose_variable( &work->result );
					dispose_variable( &work->exception );
					env->worker = &work->custom;
					work->env.interrupted = env->interrupted;
					if( start_worker( work ) ) {
						result->string_value = var.string_value;
						result->string_value->reference_count++;
					} else {
						ret = throw( vars, this, 0, "Unable to start worker." );
					}
					env->worker = NULL;
				}
			} else {
				ret = throw( vars, this, 0, "Worker locked." );
			}
		} else {
			ret = throw( vars, this, count, "Incorrect number of parameters to function." );
		}
		dispose_temporary( &var );
	}
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x40(%rax), %rax
movq %rax, -0x28(%rbp)
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x30f0
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0xb051(%rip), %rsi      # 0x21f80
leaq -0x38(%rbp), %rcx
callq 0x55d0
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x54(%rbp)
je 0x1739e
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x4c(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x16f7e
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x16f60
movq -0x40(%rbp), %rax
movq 0x3b8(%rax), %rax
movl 0x1c(%rax), %eax
cmpl -0x4c(%rbp), %eax
jne 0x1737b
leaq -0x54(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x16fb7
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x5f50
movl %eax, -0x54(%rbp)
jmp 0x17379
movq -0x40(%rbp), %rax
movsbl 0x3f8(%rax), %eax
cmpl $0x0, %eax
jne 0x1735e
movq -0x40(%rbp), %rdi
movl $0x1, %esi
callq 0x16760
movl $0x0, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x20(%rbp)
movb %al, -0x55(%rbp)
je 0x17006
cmpl $0x0, -0x54(%rbp)
setne %al
movb %al, -0x55(%rbp)
movb -0x55(%rbp), %al
testb $0x1, %al
jne 0x17012
jmp 0x172b1
movq -0x40(%rbp), %rax
movq 0x3c8(%rax), %rdi
movslq -0x50(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x3be0
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rcx
movq 0x3c8(%rcx), %rdx
movslq -0x50(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rdx
callq *%rax
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x54(%rbp)
je 0x17297
movq -0x40(%rbp), %rax
movq 0x3c8(%rax), %rax
movslq -0x50(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x40(%rbp), %rax
movq 0x3f0(%rax), %rax
movslq -0x50(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x40(%rbp), %rax
movq 0x3c8(%rax), %rax
movslq -0x50(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x40(%rbp), %rax
movq 0x3f0(%rax), %rax
movslq -0x50(%rbp), %rdx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x28(%rax)
movq -0x40(%rbp), %rax
movq 0x3c8(%rax), %rax
movslq -0x50(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x17256
movq -0x48(%rbp), %rax
movsbl 0x14(%rax), %eax
cmpl $0x0, %eax
je 0x1711a
movq -0x48(%rbp), %rax
movsbl 0x14(%rax), %eax
cmpl $0x2, %eax
jne 0x1723b
movq -0x48(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x1723b
movq -0x40(%rbp), %rax
movq 0x400(%rax), %rax
movslq -0x50(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq $0x1, (%rax)
movq -0x48(%rbp), %rax
movb 0x14(%rax), %cl
movq -0x40(%rbp), %rax
movq 0x400(%rax), %rax
movslq -0x50(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x14(%rax)
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x40(%rbp), %rax
movq 0x400(%rax), %rax
movslq -0x50(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x48(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x40(%rbp), %rax
movq 0x400(%rax), %rax
movslq -0x50(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movq -0x48(%rbp), %rax
movsbl 0x14(%rax), %eax
cmpl $0x2, %eax
jne 0x171e8
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x40(%rbp), %rax
movq 0x400(%rax), %rax
movslq -0x50(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
movq -0x48(%rbp), %rax
movl 0x40(%rax), %ecx
movq -0x40(%rbp), %rax
movq 0x400(%rax), %rax
movslq -0x50(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x40(%rax)
movq -0x40(%rbp), %rax
movq 0x400(%rax), %rcx
movslq -0x50(%rbp), %rax
imulq $0x48, %rax, %rax
addq %rax, %rcx
movq -0x40(%rbp), %rax
movq 0x3f0(%rax), %rax
movslq -0x50(%rbp), %rdx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x20(%rax)
movq -0x40(%rbp), %rax
movq 0x3f0(%rax), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
leaq -0x13485(%rip), %rcx    # 0x3db0
movq %rcx, 0x18(%rax)
jmp 0x17254
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
xorl %edx, %edx
leaq 0x54f5(%rip), %rcx      # 0x1c741
callq 0x4330
movl %eax, -0x54(%rbp)
jmp 0x17295
movq -0x40(%rbp), %rax
movq 0x3f0(%rax), %rax
movslq -0x50(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x20(%rax)
movq -0x40(%rbp), %rax
movq 0x3f0(%rax), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
leaq -0x13511(%rip), %rcx    # 0x3d80
movq %rcx, 0x18(%rax)
jmp 0x17297
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x16ff0
cmpl $0x0, -0x54(%rbp)
je 0x1735c
movq -0x40(%rbp), %rax
movl $0x1, 0x418(%rax)
movq -0x40(%rbp), %rdi
addq $0x3d0, %rdi            # imm = 0x3D0
callq 0x3be0
movq -0x40(%rbp), %rdi
addq $0x3e0, %rdi            # imm = 0x3E0
callq 0x3be0
movq -0x40(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x3a0(%rax)
movq -0x28(%rbp), %rax
movb 0x18(%rax), %cl
movq -0x40(%rbp), %rax
movb %cl, 0x38(%rax)
movq -0x40(%rbp), %rdi
callq 0x166b0
cmpl $0x0, %eax
je 0x17334
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x1734d
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
xorl %edx, %edx
leaq 0x542d(%rip), %rcx      # 0x1c772
callq 0x4330
movl %eax, -0x54(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, 0x3a0(%rax)
jmp 0x17377
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
xorl %edx, %edx
leaq 0x541b(%rip), %rcx      # 0x1c78a
callq 0x4330
movl %eax, -0x54(%rbp)
jmp 0x17379
jmp 0x17395
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl -0x4c(%rbp), %edx
leaq 0x47f5(%rip), %rcx      # 0x1bb82
callq 0x4330
movl %eax, -0x54(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3ce0
movl -0x54(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)