LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: error_defer_e
static void error_defer_e(expr_t* exp, const char* fmt, ...)
{
	fprintf(stderr, "\nError (%s:%i):\n", exp->ctx.file, exp->ctx.line);
	
	va_list args;
	va_start(args, fmt);
	vfprintf(stderr, fmt, args);
	va_end(args);
	
	g_has_error = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
testb %al, %al
je 0xa918
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %r9, -0xb8(%rbp)
movq %r8, -0xc0(%rbp)
movq %rcx, -0xc8(%rbp)
movq %rdx, -0xd0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0xf6b5(%rip), %rax      # 0x19ff8
movq %rax, -0xe8(%rbp)
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
movl 0x8(%rax), %ecx
leaq 0x9a01(%rip), %rsi      # 0x14360
xorl %eax, %eax
callq 0x2150
movq -0xe8(%rbp), %rax
leaq -0xe0(%rbp), %rcx
movq %rcx, -0x20(%rbp)
leaq 0x10(%rbp), %rcx
movq %rcx, -0x28(%rbp)
movl $0x30, -0x2c(%rbp)
movl $0x10, -0x30(%rbp)
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x21e0
movb $0x1, 0xfaf7(%rip)      # 0x1a49c
addq $0xf0, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: get_user_type_tag_from_name
static type_tag_t* get_user_type_tag_from_name(script_t* script, const char* name)
{
	for (int i = 0; i < script->modules.length; ++i)
	{
		script_module_t* module = vec_get(&script->modules, i);
		type_tag_t* tag = map_get(&module->user_type_tags, name);
		if (tag)
			return tag;
	}

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x2c8(%rcx), %rax
jae 0xaa26
movq -0x10(%rbp), %rdi
addq $0x2b8, %rdi            # imm = 0x2B8
movslq -0x1c(%rbp), %rsi
callq 0x11890
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
addq $0xb0, %rdi
movq -0x18(%rbp), %rsi
callq 0x11fa0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xaa19
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xaa2e
jmp 0xaa1b
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xa9c7
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: get_struct_member_function
static func_decl_t* get_struct_member_function(script_t* script, const char* struct_name, const char* func_name)
{
	size_t la = strlen(struct_name);
	size_t length = la + strlen(func_name) + 2;
	type_tag_t* struct_tag = get_user_type_tag_from_name(script, struct_name);
	if (!struct_tag) return NULL;

	// NOTE: Stores (struct_name)_(func_name)
	// which is ultimately the name of the member function
	// in the global scope
	char* buf = emalloc(length);

	strcpy(buf, struct_name);
	buf[la] = '_';
	strcpy(buf + la + 1, func_name);

	func_decl_t* result = reference_function(script, buf);
	free(buf);

	if (result && (result->args.length < 1 || !compare_type_tags(vec_get_value(&result->args, 0, var_decl_t*)->tag, struct_tag)))
		return NULL;

	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20a0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rdi
callq 0x20a0
movq %rax, %rcx
movq -0x50(%rbp), %rax
addq %rcx, %rax
addq $0x2, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xa9b0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0xb949
movq $0x0, -0x8(%rbp)
jmp 0xb9e7
movq -0x30(%rbp), %rdi
callq 0x3580
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2050
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
movb $0x5f, (%rax,%rcx)
movq -0x40(%rbp), %rdi
addq -0x28(%rbp), %rdi
addq $0x1, %rdi
movq -0x20(%rbp), %rsi
callq 0x2050
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x9cb0
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0x2030
cmpq $0x0, -0x48(%rbp)
je 0xb9df
movq -0x48(%rbp), %rax
cmpq $0x1, 0x50(%rax)
jb 0xb9d5
movq -0x48(%rbp), %rdi
addq $0x40, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x11890
movq (%rax), %rax
movq 0x8(%rax), %rdi
movq -0x38(%rbp), %rsi
callq 0x99a0
cmpb $0x0, %al
jne 0xb9df
movq $0x0, -0x8(%rbp)
jmp 0xb9e7
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: error_exit_e
static void error_exit_e(expr_t* exp, const char* fmt, ...)
{
	fprintf(stderr, "\nError (%s:%i):\n", exp->ctx.file, exp->ctx.line);
	
	va_list args;
	va_start(args, fmt);
	vfprintf(stderr, fmt, args);
	va_end(args);
	
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
testb %al, %al
je 0xba38
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %r9, -0xb8(%rbp)
movq %r8, -0xc0(%rbp)
movq %rcx, -0xc8(%rbp)
movq %rdx, -0xd0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0xe595(%rip), %rax      # 0x19ff8
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
leaq 0x88e4(%rip), %rsi      # 0x14360
movb $0x0, %al
callq 0x2150
leaq -0x30(%rbp), %rax
leaq -0xe0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq 0xe54a(%rip), %rax      # 0x19ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x21e0
leaq -0x30(%rbp), %rax
movl $0x1, %edi
callq 0x2210
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: get_struct_type_member_index
static int get_struct_type_member_index(type_tag_t* tag, const char* name)
{
	// NOTE: In unions, all members are located at the same index (0)
	if(tag->ds.is_union)
		return 0;

	for(int i = 0; i < tag->ds.members.length; ++i)
	{
		type_tag_member_t* mem = vec_get(&tag->ds.members, i);
		if(strcmp(mem->name, name) == 0)
			return mem->index;
	}
	
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x28(%rax)
je 0xbaf3
movl $0x0, -0x4(%rbp)
jmp 0xbb56
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jae 0xbb4f
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
addq $0x38, %rdi
movslq -0x1c(%rbp), %rsi
callq 0x11890
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x2130
cmpl $0x0, %eax
jne 0xbb42
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0xbb56
jmp 0xbb44
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xbafa
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: get_root_var_decl
static var_decl_t* get_root_var_decl(expr_t* exp)
{
	switch (exp->type)
	{
		case EXP_VAR:
		{
			return exp->varx.decl;
		} break;

		case EXP_CALL:
		{
			return get_root_var_decl(exp->callx.func);
		} break;

		case EXP_ARRAY_INDEX:
		{
			return get_root_var_decl(exp->array_index.array);
		} break;

		default:
			return NULL;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0x14(%rbp)
subl $0x5, %eax
je 0xbbe1
jmp 0xbbcd
movl -0x14(%rbp), %eax
subl $0x6, %eax
je 0xbc02
jmp 0xbbd7
movl -0x14(%rbp), %eax
subl $0xf, %eax
je 0xbbef
jmp 0xbc15
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0xbc1d
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xbbb0
movq %rax, -0x8(%rbp)
jmp 0xbc1d
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xbbb0
movq %rax, -0x8(%rbp)
jmp 0xbc1d
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: warn_e
static void warn_e(expr_t* exp, script_warning_t warning, ...)
{
	if(!g_warning_disabled[(int)warning])
	{
		fprintf(stderr, "\nWarning %s (%s:%i):\n", g_warning_name[(int)warning], exp->ctx.file, exp->ctx.line);
	
		va_list args;
		va_start(args, warning);
		vfprintf(stderr, g_warning_format[(int)warning], args);
		va_end(args);
		
		fprintf(stderr, "\n");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
testb %al, %al
je 0xbc98
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %r9, -0xb8(%rbp)
movq %r8, -0xc0(%rbp)
movq %rcx, -0xc8(%rbp)
movq %rdx, -0xd0(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movslq -0xc(%rbp), %rcx
leaq 0xe7d7(%rip), %rax      # 0x1a49d
cmpb $0x0, (%rax,%rcx)
jne 0xbd69
movq 0xe321(%rip), %rax      # 0x19ff8
movq (%rax), %rdi
movslq -0xc(%rbp), %rcx
leaq 0xe4ab(%rip), %rax      # 0x1a190
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movl 0x8(%rax), %r8d
leaq 0x83ac(%rip), %rsi      # 0x140ac
movb $0x0, %al
callq 0x2150
leaq -0x30(%rbp), %rax
leaq -0xe0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq 0xe2c6(%rip), %rax      # 0x19ff8
movq (%rax), %rdi
movslq -0xc(%rbp), %rcx
leaq 0xe470(%rip), %rax      # 0x1a1b0
movq (%rax,%rcx,8), %rsi
leaq -0x30(%rbp), %rdx
callq 0x21e0
leaq -0x30(%rbp), %rax
movq 0xe2a0(%rip), %rax      # 0x19ff8
movq (%rax), %rdi
leaq 0x90da(%rip), %rsi      # 0x14e3c
movb $0x0, %al
callq 0x2150
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: destroy_type_tag
static void destroy_type_tag(void* vtag)
{
	type_tag_t* tag = vtag;
	switch(tag->type)
	{
		case TAG_FUNC:
		{	
			vec_destroy(&tag->func.arg_types);
		} break;
	
		case TAG_STRUCT:
		{
			free(tag->ds.name);
			
			for(int i = 0; i < tag->ds.members.length; ++i)
			{
				type_tag_member_t* mem = vec_get(&tag->ds.members, i);
				free(mem->name);
				if(mem->default_value)
					delete_expr(mem->default_value);
			}
				
			vec_destroy(&tag->ds.using);
			vec_destroy(&tag->ds.members);
		} break;
		
		default: break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x24(%rbp)
subl $0x6, %eax
je 0xc162
jmp 0xc155
movl -0x24(%rbp), %eax
subl $0xa, %eax
je 0xc174
jmp 0xc204
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
callq 0x11dc0
jmp 0xc206
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x2030
movl $0x0, -0x14(%rbp)
movslq -0x14(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jae 0xc1e0
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
addq $0x38, %rdi
movslq -0x14(%rbp), %rsi
callq 0x11890
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x2030
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xc1d3
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xbdb0
jmp 0xc1d5
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xc188
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
addq $0x18, %rdi
callq 0x11dc0
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
addq $0x38, %rdi
callq 0x11dc0
jmp 0xc206
jmp 0xc206
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: get_heap_value
static script_value_t* get_heap_value(script_t* script)
{
	script_heap_block_t* block = script->heap_head;
	while(block)
	{
		if (block->num_free > 0)
		{
			int index = block->free_indices[--block->num_free];
			return &block->values[index];
		}

		block = block->next;
	}

	add_heap_block(script);
	return get_heap_value(script);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x150(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xc72f
movq -0x18(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jle 0xc722
movq -0x18(%rbp), %rax
movq -0x18(%rbp), %rdx
movl 0x8(%rdx), %ecx
addl $-0x1, %ecx
movl %ecx, 0x8(%rdx)
movslq %ecx, %rcx
movl 0xc(%rax,%rcx,4), %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
addq $0x110, %rax            # imm = 0x110
movslq -0x1c(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0xc745
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0xc6db
movq -0x10(%rbp), %rdi
callq 0x2780
movq -0x10(%rbp), %rdi
callq 0xc6c0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: mark_all
static void mark_all(script_t* script)
{
	if(script->ret_val)
		mark(script->ret_val);
	for(int i = 0; i < script->stack.length; ++i)
	{
		script_value_t* val = vec_get_value(&script->stack, i, script_value_t*);
		mark(val);
	}
	
	for(int i = 0; i < script->globals.length; ++i)
	{
		script_value_t* val = vec_get_value(&script->globals, i, script_value_t*);
		mark(val);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x160(%rax)
je 0xc77a
movq -0x8(%rbp), %rax
movq 0x160(%rax), %rdi
callq 0xc8a0
movl $0x0, -0xc(%rbp)
movslq -0xc(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x1a8(%rcx), %rax
jae 0xc7c1
movq -0x8(%rbp), %rdi
addq $0x198, %rdi            # imm = 0x198
movslq -0xc(%rbp), %rsi
callq 0x11890
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0xc8a0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xc781
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x180(%rcx), %rax
jae 0xc808
movq -0x8(%rbp), %rdi
addq $0x170, %rdi            # imm = 0x170
movslq -0x1c(%rbp), %rsi
callq 0x11890
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xc8a0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xc7c8
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: sweep
static void sweep(script_t* script)
{
	script_value_t** val = &script->gc_head;
	
	while(*val)
	{
		if(!(*val)->marked)
		{
			script_value_t* unreached = *val;
			*val = unreached->next;
			--script->num_objects;
			delete_value(script, unreached);
		}
		else
		{
			(*val)->marked = 0;
			val = &(*val)->next;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x158, %rax            # imm = 0x158
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0xc899
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpb $0x0, 0x18(%rax)
jne 0xc87d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movl 0x168(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x168(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xc9a0
jmp 0xc897
movq -0x10(%rbp), %rax
movq (%rax), %rax
movb $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
addq $0x10, %rax
movq %rax, -0x10(%rbp)
jmp 0xc82a
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: mark
static void mark(script_value_t* value)
{
	if(!value) return;
	if(value->marked) return;
	
	value->marked = 1;
	
	if(value->type == VAL_ARRAY)
	{
		for(int i = 0; i < value->array.length; ++i)
		{	
			script_value_t* v = vec_get_value(&value->array, i, script_value_t*); 
			mark(v);
		}
	}
	else if(value->type == VAL_STRUCT_INSTANCE)
	{
		for(int i = 0; i < value->ds.members.length; ++i)
		{
			script_value_t* v = vec_get_value(&value->ds.members, i, script_value_t*); 
			mark(v);
		}
	}
	else if(value->type == VAL_NATIVE)
	{
		if(value->nat.on_mark)
			value->nat.on_mark(value->nat.value);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xc8b8
jmp 0xc996
movq -0x8(%rbp), %rax
cmpb $0x0, 0x18(%rax)
je 0xc8c7
jmp 0xc996
movq -0x8(%rbp), %rax
movb $0x1, 0x18(%rax)
movq -0x8(%rbp), %rax
cmpl $0x6, 0xc(%rax)
jne 0xc91c
movl $0x0, -0xc(%rbp)
movslq -0xc(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jae 0xc91a
movq -0x8(%rbp), %rdi
addq $0x20, %rdi
movslq -0xc(%rbp), %rsi
callq 0x11890
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0xc8a0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xc8e0
jmp 0xc996
movq -0x8(%rbp), %rax
cmpl $0x7, 0xc(%rax)
jne 0xc969
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jae 0xc967
movq -0x8(%rbp), %rdi
addq $0x20, %rdi
movslq -0x1c(%rbp), %rsi
callq 0x11890
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xc8a0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xc92d
jmp 0xc994
movq -0x8(%rbp), %rax
cmpl $0x8, 0xc(%rax)
jne 0xc992
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0xc990
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x20(%rcx), %rdi
callq *%rax
jmp 0xc992
jmp 0xc994
jmp 0xc996
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: delete_value
static void delete_value(script_t* script, script_value_t* val)
{	
	switch(val->type)
	{
		case VAL_NULL:
		case VAL_BOOL:
		case VAL_CHAR:
		case VAL_NUMBER:
		case VAL_FUNC: break;
		
		case VAL_STRING: free(val->string.data); val->string.data = NULL; break;
		case VAL_ARRAY: vec_destroy(&val->array); break;
		case VAL_STRUCT_INSTANCE: vec_destroy(&val->ds.members); break;
		case VAL_NATIVE: if(val->nat.on_delete) val->nat.on_delete(val->nat.value); break;
	}
	
	val->block->free_indices[val->block->num_free++] = val->block_index;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movq %rax, -0x18(%rbp)
subq $0x8, %rax
ja 0xca2f
movq -0x18(%rbp), %rax
leaq 0x6b18(%rip), %rcx      # 0x134e4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0xca2f
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2030
movq -0x10(%rbp), %rax
movq $0x0, 0x28(%rax)
jmp 0xca2f
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
callq 0x11dc0
jmp 0xca2f
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
callq 0x11dc0
jmp 0xca2f
movq -0x10(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0xca2d
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rdi
callq *%rax
jmp 0xca2f
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rsi
movl 0x8(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x8(%rsi)
movslq %ecx, %rcx
movl %edx, 0xc(%rax,%rcx,4)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: get_char
static int get_char()
{
	if(!g_code) return EOF;
	
	int c = *g_code;
	if(c == '\0') return EOF;
	else 
	{
		++g_code;
		return c;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpq $0x0, 0xce94(%rip)      # 0x1a490
jne 0xd607
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd63b
movq 0xce82(%rip), %rax      # 0x1a490
movsbl (%rax), %eax
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jne 0xd623
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd63b
movq 0xce66(%rip), %rax      # 0x1a490
addq $0x1, %rax
movq %rax, 0xce5b(%rip)      # 0x1a490
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_bin_rhs
static expr_t* parse_bin_rhs(script_t* script, expr_t* lhs, int eprec)
{
	while(1)
	{
		int prec = get_prec(g_cur_tok);
	
		if(prec < eprec)
			return lhs;
	
		int op = g_cur_tok;
		
		get_next_token();
		
		expr_t* rhs = parse_unary(script);
		if(get_prec(g_cur_tok) > prec)
			rhs = parse_bin_rhs(script, rhs, prec + 1);
		
		expr_t* newLhs = create_expr(EXP_BINARY);
		
		newLhs->binx.lhs = lhs;
		newLhs->binx.rhs = rhs;
		newLhs->binx.op = op;
		
		lhs = newLhs;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl 0xcd27(%rip), %edi      # 0x1a5b0
callq 0xf7a0
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xd8a3
movq -0x10(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
movl 0xcd07(%rip), %eax      # 0x1a5b0
movl %eax, -0x1c(%rbp)
callq 0xd640
movq -0x8(%rbp), %rdi
callq 0xd660
movq %rax, -0x28(%rbp)
movl 0xccec(%rip), %edi      # 0x1a5b0
callq 0xf7a0
cmpl -0x18(%rbp), %eax
jle 0xd8e5
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x18(%rbp), %edx
addl $0x1, %edx
callq 0xd870
movq %rax, -0x28(%rbp)
movl $0xe, %edi
callq 0xa1b0
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x40(%rax)
movl -0x1c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x48(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0xd883
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_atomic
static expr_t* parse_atomic(script_t* script)
{
	expr_t* exp = create_expr(EXP_ATOMIC);
	get_next_token();

	exp->atomx = parse_expr(script);
	return exp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x1a, %edi
callq 0xa1b0
movq %rax, -0x10(%rbp)
callq 0xd640
movq -0x8(%rbp), %rdi
callq 0xd5a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_directive
static expr_t* parse_directive(script_t* script)
{
	if(strcmp(g_lexeme, "#import") == 0)
	{
		get_next_token();
		
		if(g_cur_tok != TOK_STRING) error_exit_p("Expected string after '#import' but received '%s'\n", g_token_names[g_cur_tok]);
		
		apply_import_directive(script, g_lexeme);
		get_next_token();
	
		return parse_expr(script);
	}
	else if(strcmp(g_lexeme, "#on_compile") == 0)
	{
		get_next_token();
		
		expr_t* exp = parse_expr(script);
		
		script_module_t* cur_module = vec_get(&script->modules, g_cur_module_index);
		vec_push_back(&cur_module->compile_time_blocks, &exp);

		// NOTE: The compile time block is not a part of the runtime
		// program.
		return parse_expr(script);
	}
	else
		error_exit_p("Invalid directive '%s'\n", g_lexeme);
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
leaq 0xc7ad(%rip), %rdi      # 0x1a5c0
leaq 0x721a(%rip), %rsi      # 0x15034
callq 0x2130
cmpl $0x0, %eax
jne 0xde79
callq 0xd640
cmpl $0x22, 0xc780(%rip)     # 0x1a5b0
je 0xde52
movslq 0xc777(%rip), %rcx      # 0x1a5b0
leaq 0xc3e0(%rip), %rax      # 0x1a220
movq (%rax,%rcx,8), %rsi
leaq 0x71f1(%rip), %rdi      # 0x1503c
movb $0x0, %al
callq 0xa0e0
movq -0x10(%rbp), %rdi
leaq 0xc763(%rip), %rsi      # 0x1a5c0
callq 0xed80
callq 0xd640
movq -0x10(%rbp), %rdi
callq 0xd5a0
movq %rax, -0x8(%rbp)
jmp 0xdefd
leaq 0xc740(%rip), %rdi      # 0x1a5c0
leaq 0x71e8(%rip), %rsi      # 0x1506f
callq 0x2130
cmpl $0x0, %eax
jne 0xdede
callq 0xd640
movq -0x10(%rbp), %rdi
callq 0xd5a0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
addq $0x2b8, %rdi            # imm = 0x2B8
movslq 0xc5e3(%rip), %rsi      # 0x1a498
callq 0x11890
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0x70, %rdi
leaq -0x18(%rbp), %rsi
callq 0x11960
movq -0x10(%rbp), %rdi
callq 0xd5a0
movq %rax, -0x8(%rbp)
jmp 0xdefd
leaq 0x7196(%rip), %rdi      # 0x1507b
leaq 0xc6d4(%rip), %rsi      # 0x1a5c0
movb $0x0, %al
callq 0xa0e0
jmp 0xdef5
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_bool
static expr_t* parse_bool(script_t* script)
{
	expr_t* exp = create_expr(EXP_BOOL);
	if(g_cur_tok == TOK_TRUE) exp->boolean_value = 1;
	else exp->boolean_value = 0;
	get_next_token();
	
	return exp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x7, %edi
callq 0xa1b0
movq %rax, -0x10(%rbp)
cmpl $0xa, 0xc64f(%rip)      # 0x1a5b0
jne 0xdf6d
movq -0x10(%rbp), %rax
movb $0x1, 0x38(%rax)
jmp 0xdf75
movq -0x10(%rbp), %rax
movb $0x0, 0x38(%rax)
callq 0xd640
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_char
static expr_t* parse_char(script_t* script)
{
	expr_t* exp = create_expr(EXP_CHAR);
	exp->code = g_lexeme[0];
	get_next_token();
	
	return exp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x8, %edi
callq 0xa1b0
movq %rax, -0x10(%rbp)
movb 0xc610(%rip), %cl       # 0x1a5c0
movq -0x10(%rbp), %rax
movb %cl, 0x38(%rax)
callq 0xd640
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_var
static expr_t* parse_var(script_t* script)
{
	get_next_token();
	if(g_cur_tok != TOK_IDENT) error_exit_p("Expected identifier after 'var'\n");
	
	expr_t* exp = create_expr(EXP_VAR);
	exp->varx.name = estrdup(g_lexeme);
	
	get_next_token();
			
	if (g_cur_tok != TOK_COLON)
	{
		// NOTE: Type not given so it remains null until resolved
		exp->varx.decl = declare_variable(script, exp->varx.name, create_type_tag(script, TAG_UNKNOWN));
		return exp;
	}

	get_next_token();
	
	type_tag_t* tag = parse_type_tag(script);
	exp->varx.decl = declare_variable(script, exp->varx.name, tag);

	return exp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
callq 0xd640
cmpl $0x16, 0xc5c8(%rip)     # 0x1a5b0
je 0xdff8
leaq 0x70ca(%rip), %rdi      # 0x150bb
movb $0x0, %al
callq 0xa0e0
movl $0x5, %edi
callq 0xa1b0
movq %rax, -0x18(%rbp)
leaq 0xc5b3(%rip), %rdi      # 0x1a5c0
callq 0x2500
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x38(%rax)
callq 0xd640
cmpl $0x1d, 0xc587(%rip)     # 0x1a5b0
je 0xe072
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movl $0xb, %esi
callq 0x9860
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq %rax, %rdx
callq 0x9d80
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xe0ac
callq 0xd640
movq -0x10(%rbp), %rdi
callq 0xef40
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x9d80
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_ident
static expr_t* parse_ident(script_t* script)
{
	expr_t* exp = create_expr(EXP_VAR);
	
	exp->varx.name = estrdup(g_lexeme);
	exp->varx.decl = reference_variable(script, g_lexeme);
	
	get_next_token();
	
	return exp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x5, %edi
callq 0xa1b0
movq %rax, -0x10(%rbp)
leaq 0xc4df(%rip), %rdi      # 0x1a5c0
callq 0x2500
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rdi
leaq 0xc4c4(%rip), %rsi      # 0x1a5c0
callq 0x9f10
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
callq 0xd640
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_paren
static expr_t* parse_paren(script_t* script)
{
	expr_t* exp = create_expr(EXP_PAREN);
	
	get_next_token();
	exp->paren = parse_expr(script);
	
	if(g_cur_tok != TOK_CLOSEPAREN) error_exit_p("Expected ')' after '('\n");
	get_next_token();
	
	return exp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x10, %edi
callq 0xa1b0
movq %rax, -0x10(%rbp)
callq 0xd640
movq -0x8(%rbp), %rdi
callq 0xd5a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
cmpl $0x1a, 0xc456(%rip)     # 0x1a5b0
je 0xe16a
leaq 0x7060(%rip), %rdi      # 0x151c3
movb $0x0, %al
callq 0xa0e0
callq 0xd640
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_block
static expr_t* parse_block(script_t* script)
{
	expr_t* exp = create_expr(EXP_BLOCK);
	get_next_token();
	
	vector_t block;
	vec_init(&block, sizeof(expr_t*));
	
	enter_scope();
	while(g_cur_tok != TOK_CLOSECURLY)
	{
		expr_t* e = parse_expr(script);
		vec_push_back(&block, &e);
	}
	exit_scope();
	
	get_next_token();
	
	exp->block = block;
	return exp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl $0x12, %edi
callq 0xa1b0
movq %rax, -0x10(%rbp)
callq 0xd640
leaq -0x30(%rbp), %rdi
movl $0x8, %esi
callq 0x114e0
callq 0xf0d0
cmpl $0x1c, 0xc3f7(%rip)     # 0x1a5b0
je 0xe1d7
movq -0x8(%rbp), %rdi
callq 0xd5a0
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x11960
jmp 0xe1b2
callq 0xf0f0
callq 0xd640
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, 0x38(%rax)
movq -0x28(%rbp), %rcx
movq %rcx, 0x40(%rax)
movq -0x20(%rbp), %rcx
movq %rcx, 0x48(%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x50(%rax)
movq -0x10(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_if
static expr_t* parse_if(script_t* script)
{
	expr_t* exp = create_expr(EXP_IF);
	get_next_token();
	
	exp->ifx.cond = parse_expr(script);
	exp->ifx.body = parse_expr(script);
	
	if(g_cur_tok == TOK_ELSE)
	{
		get_next_token();
		exp->ifx.alt = parse_expr(script);
	}
	else
		exp->ifx.alt = NULL;
		
	return exp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x13, %edi
callq 0xa1b0
movq %rax, -0x10(%rbp)
callq 0xd640
movq -0x8(%rbp), %rdi
callq 0xd5a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rdi
callq 0xd5a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
cmpl $0xe, 0xc352(%rip)      # 0x1a5b0
jne 0xe27b
callq 0xd640
movq -0x8(%rbp), %rdi
callq 0xd5a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
jmp 0xe287
movq -0x10(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_while
static expr_t* parse_while(script_t* script)
{
	expr_t* exp = create_expr(EXP_WHILE);
	get_next_token();

	exp->whilex.cond = parse_expr(script);
	exp->whilex.body = parse_expr(script);
	
	return exp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x14, %edi
callq 0xa1b0
movq %rax, -0x10(%rbp)
callq 0xd640
movq -0x8(%rbp), %rdi
callq 0xd5a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rdi
callq 0xd5a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_for
static expr_t* parse_for(script_t* script)
{
	expr_t* exp = create_expr(EXP_FOR);
	get_next_token();

	++g_scope;

	exp->forx.init = parse_expr(script);

	if (g_cur_tok != TOK_COMMA) error_exit_p("Expected ',' after for initializer\n");
	get_next_token();

	exp->forx.cond = parse_expr(script);
	
	if (g_cur_tok != TOK_COMMA) error_exit_p("Expected ',' after for condition\n");
	get_next_token();

	exp->forx.step = parse_expr(script);
	exp->forx.body = parse_expr(script);
	--g_scope;

	return exp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x15, %edi
callq 0xa1b0
movq %rax, -0x10(%rbp)
callq 0xd640
movl 0xc17b(%rip), %eax      # 0x1a4a0
addl $0x1, %eax
movl %eax, 0xc172(%rip)      # 0x1a4a0
movq -0x8(%rbp), %rdi
callq 0xd5a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
cmpl $0x1f, 0xc267(%rip)     # 0x1a5b0
je 0xe359
leaq 0x6e89(%rip), %rdi      # 0x151db
movb $0x0, %al
callq 0xa0e0
callq 0xd640
movq -0x8(%rbp), %rdi
callq 0xd5a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
cmpl $0x1f, 0xc237(%rip)     # 0x1a5b0
je 0xe389
leaq 0x6e7d(%rip), %rdi      # 0x151ff
movb $0x0, %al
callq 0xa0e0
callq 0xd640
movq -0x8(%rbp), %rdi
callq 0xd5a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rdi
callq 0xd5a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x50(%rax)
movl 0xc0e4(%rip), %eax      # 0x1a4a0
addl $-0x1, %eax
movl %eax, 0xc0db(%rip)      # 0x1a4a0
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_number
static expr_t* parse_number(script_t* script)
{
	expr_t* exp = create_expr(EXP_NUMBER);
	
	double number = strtod(g_lexeme, NULL);
	get_next_token();
	
	exp->number_index = register_number(script, number);
	
	return exp; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x9, %edi
callq 0xa1b0
movq %rax, -0x10(%rbp)
leaq 0xbfdf(%rip), %rdi      # 0x1a5c0
xorl %eax, %eax
movl %eax, %esi
callq 0x2080
movsd %xmm0, -0x18(%rbp)
callq 0xd640
movq -0x8(%rbp), %rdi
movsd -0x18(%rbp), %xmm0
callq 0xa230
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_string
static expr_t* parse_string(script_t* script)
{
	expr_t* exp = create_expr(EXP_STRING);
	
	exp->string_index = register_string(script, g_lexeme);
	
	get_next_token();
	
	return exp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0xa, %edi
callq 0xa1b0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xbf7b(%rip), %rsi      # 0x1a5c0
callq 0xa2c0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x38(%rax)
callq 0xd640
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_return
static expr_t* parse_return(script_t* script)
{
	if(!g_cur_func) error_exit_p("'return' can only be used inside a function body\n");
	expr_t* exp = create_expr(EXP_RETURN);
	exp->retx.parent = g_cur_func;
	
	g_cur_func->has_return = 1;
	
	if(get_next_token() != TOK_SEMICOLON)
		exp->retx.value = parse_expr(script);
	else
	{
		get_next_token();
		exp->retx.value = NULL;
	}
		
	return exp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, 0xbe24(%rip)      # 0x1a4a8
jne 0xe694
leaq 0x6d08(%rip), %rdi      # 0x15395
movb $0x0, %al
callq 0xa0e0
movl $0x16, %edi
callq 0xa1b0
movq %rax, -0x10(%rbp)
movq 0xbdff(%rip), %rcx      # 0x1a4a8
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq 0xbdf0(%rip), %rax      # 0x1a4a8
movb $0x1, 0x64(%rax)
callq 0xd640
cmpl $0x1e, %eax
je 0xe6dc
movq -0x8(%rbp), %rdi
callq 0xd5a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
jmp 0xe6ed
callq 0xd640
movq -0x10(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_write
static expr_t* parse_write(script_t* script)
{
	expr_t* exp = create_expr(EXP_WRITE);
	get_next_token();
	
	exp->write = parse_expr(script);
	
	return exp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0xc, %edi
callq 0xa1b0
movq %rax, -0x10(%rbp)
callq 0xd640
movq -0x8(%rbp), %rdi
callq 0xd5a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_array_literal
static expr_t* parse_array_literal(script_t* script)
{
	expr_t* exp = create_expr(EXP_ARRAY_LITERAL);
	get_next_token();

	exp->array_literal.contained = NULL;
	
	vector_t array_values;
	vec_init(&array_values, sizeof(expr_t*));
	
	while(g_cur_tok != TOK_CLOSESQUARE)
	{
		expr_t* e = parse_expr(script);
		vec_push_back(&array_values, &e);
		if(g_cur_tok == TOK_COMMA) get_next_token();
		else if(g_cur_tok != TOK_CLOSESQUARE) error_exit_p("Unexpected '%s'\n", g_token_names[g_cur_tok]);
	}
	get_next_token();
	
	exp->array_literal.values = array_values;
	
	if(array_values.length == 0) 
	{
		if(g_cur_tok != TOK_COLON) error_exit_p("Expected ':' after empty array literal\n");
		get_next_token();
		
		exp->array_literal.contained = parse_type_tag(script);
	}
	
	return exp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl $0x11, %edi
callq 0xa1b0
movq %rax, -0x10(%rbp)
callq 0xd640
movq -0x10(%rbp), %rax
movq $0x0, 0x38(%rax)
leaq -0x30(%rbp), %rdi
movl $0x8, %esi
callq 0x114e0
cmpl $0x18, 0xbe30(%rip)     # 0x1a5b0
je 0xe7d9
movq -0x8(%rbp), %rdi
callq 0xd5a0
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x11960
cmpl $0x1f, 0xbe0d(%rip)     # 0x1a5b0
jne 0xe7ac
callq 0xd640
jmp 0xe7d7
cmpl $0x18, 0xbdfd(%rip)     # 0x1a5b0
je 0xe7d5
movslq 0xbdf4(%rip), %rcx      # 0x1a5b0
leaq 0xba5d(%rip), %rax      # 0x1a220
movq (%rax,%rcx,8), %rsi
leaq 0x6bf9(%rip), %rdi      # 0x153c7
movb $0x0, %al
callq 0xa0e0
jmp 0xe7d7
jmp 0xe779
callq 0xd640
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, 0x40(%rax)
movq -0x28(%rbp), %rcx
movq %rcx, 0x48(%rax)
movq -0x20(%rbp), %rcx
movq %rcx, 0x50(%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x58(%rax)
cmpq $0x0, -0x20(%rbp)
jne 0xe839
cmpl $0x1d, 0xbda0(%rip)     # 0x1a5b0
je 0xe820
leaq 0x6bbf(%rip), %rdi      # 0x153d8
movb $0x0, %al
callq 0xa0e0
callq 0xd640
movq -0x8(%rbp), %rdi
callq 0xef40
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_extern
static expr_t* parse_extern(script_t* script)
{
	get_next_token();
	
	if (g_cur_tok == TOK_OPENCURLY)
	{
		// NOTE: Extern list
		expr_t* exp = create_expr(EXP_EXTERN_LIST);
		
		exp->type = EXP_EXTERN_LIST;
		vec_init(&exp->extern_array, sizeof(expr_t*));

		get_next_token();

		while (g_cur_tok != TOK_CLOSECURLY)
		{
			expr_t* declExp = parse_extern_decl(script);
			vec_push_back(&exp->extern_array, &declExp);
		}

		get_next_token();

		return exp;
	}

	return parse_extern_decl(script);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
callq 0xd640
cmpl $0x1b, 0xbd48(%rip)     # 0x1a5b0
jne 0xe8d2
movl $0x18, %edi
callq 0xa1b0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl $0x18, 0x28(%rax)
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
movl $0x8, %esi
callq 0x114e0
callq 0xd640
cmpl $0x1c, 0xbd0f(%rip)     # 0x1a5b0
je 0xe8c3
movq -0x10(%rbp), %rdi
callq 0xf430
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
leaq -0x20(%rbp), %rsi
callq 0x11960
jmp 0xe89a
callq 0xd640
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xe8df
movq -0x10(%rbp), %rdi
callq 0xf430
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: exit_scope
static void exit_scope()
{
	if(g_cur_func)
	{		
		for(int i = 0; i < g_cur_func->locals.length; ++i)
		{
			var_decl_t* decl = vec_get_value(&g_cur_func->locals, i, var_decl_t*);
			if(decl->scope == g_scope) decl->scope = -1;	// NOTE: can no longer access this variable because we exited this scope
		}
	}
	--g_scope;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpq $0x0, 0xb3a8(%rip)      # 0x1a4a8
je 0xf15e
movl $0x0, -0x4(%rbp)
movslq -0x4(%rbp), %rax
movq 0xb394(%rip), %rcx      # 0x1a4a8
cmpq 0x30(%rcx), %rax
jae 0xf15c
movq 0xb387(%rip), %rdi      # 0x1a4a8
addq $0x20, %rdi
movslq -0x4(%rbp), %rsi
callq 0x11890
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
cmpl 0xb35e(%rip), %eax      # 0x1a4a0
jne 0xf14f
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x18(%rax) # imm = 0xFFFFFFFF
jmp 0xf151
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xf109
jmp 0xf15e
movl 0xb33c(%rip), %eax      # 0x1a4a0
addl $-0x1, %eax
movl %eax, 0xb333(%rip)      # 0x1a4a0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: declare_function
static func_decl_t* declare_function(script_t* script, const char* name)
{
	script_module_t* module = vec_get(&script->modules, g_cur_module_index);
	func_decl_t* decl = emalloc(sizeof(func_decl_t));
	
	decl->parent = g_cur_func;
	decl->type = DECL_FUNCTION;
	decl->tag = create_type_tag(script, TAG_FUNC);
	decl->name = estrdup(name);
	
	vec_init(&decl->locals, sizeof(var_decl_t*));
	vec_init(&decl->args, sizeof(var_decl_t*));

	decl->index = script->function_names.length;
	
	char* dup_name = estrdup(name);
	vec_push_back(&script->function_names, &dup_name);
	
	int undef_pc = -1;
	vec_push_back(&script->function_pcs, &undef_pc);
	
	decl->has_return = 0;

	vec_push_back(&module->functions, &decl);
	return decl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
addq $0x2b8, %rdi            # imm = 0x2B8
movslq 0xb2f6(%rip), %rsi      # 0x1a498
callq 0x11890
movq %rax, -0x18(%rbp)
movl $0x68, %edi
callq 0x3580
movq %rax, -0x20(%rbp)
movq 0xb2e8(%rip), %rcx      # 0x1a4a8
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x8(%rbp), %rdi
movl $0x6, %esi
callq 0x9860
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdi
callq 0x2500
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rdi
addq $0x20, %rdi
movl $0x8, %esi
callq 0x114e0
movq -0x20(%rbp), %rdi
addq $0x40, %rdi
movl $0x8, %esi
callq 0x114e0
movq -0x8(%rbp), %rax
movq 0x288(%rax), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x60(%rax)
movq -0x10(%rbp), %rdi
callq 0x2500
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
addq $0x278, %rdi            # imm = 0x278
leaq -0x28(%rbp), %rsi
callq 0x11960
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rdi
addq $0x298, %rdi            # imm = 0x298
leaq -0x2c(%rbp), %rsi
callq 0x11960
movq -0x20(%rbp), %rax
movb $0x0, 0x64(%rax)
movq -0x18(%rbp), %rdi
addq $0x20d0, %rdi           # imm = 0x20D0
leaq -0x20(%rbp), %rsi
callq 0x11960
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: declare_argument
static var_decl_t* declare_argument(const char* name, type_tag_t* tag)
{
	if(!g_cur_func) error_exit("Attempting to declare argument outside of function\n");
	
	var_decl_t* decl = emalloc(sizeof(var_decl_t));
	
	vec_push_back(&g_cur_func->tag->func.arg_types, &tag);
	
	decl->parent = g_cur_func;
	decl->tag = tag;
	decl->name = estrdup(name);
	decl->scope = g_scope;
	decl->index = INVALID_VAR_DECL_INDEX;
	
	vec_push_back(&g_cur_func->args, &decl);
	return decl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, 0xb1d0(%rip)      # 0x1a4a8
jne 0xf2e8
leaq 0x5ff7(%rip), %rdi      # 0x152d8
movb $0x0, %al
callq 0x3990
movl $0x20, %edi
callq 0x3580
movq %rax, -0x18(%rbp)
movq 0xb1ab(%rip), %rax      # 0x1a4a8
movq 0x10(%rax), %rdi
addq $0x28, %rdi
leaq -0x10(%rbp), %rsi
callq 0x11960
movq 0xb193(%rip), %rcx      # 0x1a4a8
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
callq 0x2500
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movl 0xb15e(%rip), %ecx      # 0x1a4a0
movq -0x18(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x18(%rbp), %rax
movl $0xffffd8f1, 0x1c(%rax) # imm = 0xFFFFD8F1
movq 0xb14d(%rip), %rdi      # 0x1a4a8
addq $0x40, %rdi
leaq -0x18(%rbp), %rsi
callq 0x11960
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: finalize_args
static void finalize_args()
{
	if (!g_cur_func) error_exit("Attempting to finalize arguments outside of function\n");

	for (int i = 0; i < g_cur_func->args.length; ++i)
	{
		var_decl_t* arg = vec_get_value(&g_cur_func->args, i, var_decl_t*);
		arg->index = -(int)g_cur_func->args.length + i;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpq $0x0, 0xb118(%rip)      # 0x1a4a8
jne 0xf3a0
leaq 0x5f73(%rip), %rdi      # 0x1530c
movb $0x0, %al
callq 0x3990
movl $0x0, -0x4(%rbp)
movslq -0x4(%rbp), %rax
movq 0xb0f6(%rip), %rcx      # 0x1a4a8
cmpq 0x50(%rcx), %rax
jae 0xf3f7
movq 0xb0e9(%rip), %rdi      # 0x1a4a8
addq $0x40, %rdi
movslq -0x4(%rbp), %rsi
callq 0x11890
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq 0xb0ce(%rip), %rax      # 0x1a4a8
movq 0x50(%rax), %rax
xorl %ecx, %ecx
subl %eax, %ecx
addl -0x4(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xf3a7
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)