// File: /workspace/github_c_makefile_star2_O0/martincameron[P]towntalk/worker.c
// Function: parse_worker
static struct worker* parse_worker( struct element *elem, struct string *file, char *message ) {
	int params, idx;
	struct function *func, parent;
	struct worker *work = new_worker( message );
	if( work ) {
		parent.library = NULL;
		parent.env = &work->env;
		parent.file = new_string_value( file->string );
		if( parent.file ) {
			func = parse_function( elem, work->custom.str.string, &parent, message );
			if( func ) {
				if( add_decl( &func->str, elem->line, &work->env, message ) ) {
					work->env.entry_point = func;
					params = func->num_parameters;
					work->args = calloc( params, sizeof( struct variable ) );
					if( work->args ) {
						work->strings = calloc( params, sizeof( struct array ) );
					}
					if( work->strings ) {
						work->parameters = calloc( params, sizeof( struct value_expression ) );
					}
					if( work->parameters ) {
						for( idx = 0; idx < params; idx++ ) {
							work->parameters[ idx ].next = &work->parameters[ idx + 1 ];
						}
						parse_function_body( func, NULL, message );
					} else {
						strcpy( message, OUT_OF_MEMORY );
					}
				}
				unref_string( &func->str );
			}
			unref_string( parent.file );
		} else {
			strcpy( message, OUT_OF_MEMORY );
		}
		if( message[ 0 ] ) {
			unref_string( &work->custom.str );
			work = NULL;
		}
	}
	return work;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x176d0
movq %rax, -0x98(%rbp)
cmpq $0x0, -0x98(%rbp)
je 0x16ed0
movq $0x0, -0x60(%rbp)
movq -0x98(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3a30
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0x16e9b
movq -0x8(%rbp), %rdi
movq -0x98(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rcx
leaq -0x90(%rbp), %rdx
callq 0x9280
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x16e90
movq -0x28(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x28(%rax), %esi
movq -0x98(%rbp), %rdx
addq $0x20, %rdx
movq -0x18(%rbp), %rcx
callq 0x4720
cmpq $0x0, %rax
je 0x16e87
movq -0x28(%rbp), %rcx
movq -0x98(%rbp), %rax
movq %rcx, 0x3b8(%rax)
movq -0x28(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x1c(%rbp)
movslq -0x1c(%rbp), %rdi
movl $0x10, %esi
callq 0x3120
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, 0x3c8(%rax)
movq -0x98(%rbp), %rax
cmpq $0x0, 0x3c8(%rax)
je 0x16dca
movslq -0x1c(%rbp), %rdi
movl $0x48, %esi
callq 0x3120
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, 0x400(%rax)
movq -0x98(%rbp), %rax
cmpq $0x0, 0x400(%rax)
je 0x16dfa
movslq -0x1c(%rbp), %rdi
movl $0x30, %esi
callq 0x3120
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, 0x3f0(%rax)
movq -0x98(%rbp), %rax
cmpq $0x0, 0x3f0(%rax)
je 0x16e72
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x16e5f
movq -0x98(%rbp), %rax
movq 0x3f0(%rax), %rcx
movl -0x20(%rbp), %eax
addl $0x1, %eax
cltq
shlq $0x5, %rax
addq %rax, %rcx
movq -0x98(%rbp), %rax
movq 0x3f0(%rax), %rax
movslq -0x20(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x16e12
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x9700
jmp 0x16e85
movq -0x18(%rbp), %rdi
leaq 0xa2e3(%rip), %rax      # 0x21160
movq (%rax), %rsi
callq 0x3070
jmp 0x16e87
movq -0x28(%rbp), %rdi
callq 0x3c20
movq -0x68(%rbp), %rdi
callq 0x3c20
jmp 0x16eae
movq -0x18(%rbp), %rdi
leaq 0xa2ba(%rip), %rax      # 0x21160
movq (%rax), %rsi
callq 0x3070
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0x16ece
movq -0x98(%rbp), %rdi
callq 0x3c20
movq $0x0, -0x98(%rbp)
jmp 0x16ed0
movq -0x98(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq