LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: ext_u8_buffer_to_string
static void ext_u8_buffer_to_string(script_t* script, vector_t* args)
{
	script_native_t* nat = &script_get_arg(args, 0)->nat;
	vector_t* buf = nat->value;
	unsigned char null_terminator = '\0';
	vec_push_back(buf, &null_terminator);
	script_string_t str = { buf->length - 1, (char*)buf->data };
	
	script_push_string(script, str);
	script_return_top(script);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsi, %rdi
xorl %esi, %esi
callq 0xdf24
movq (%rax), %rax
movq 0x20(%rax), %r14
leaq -0x11(%rbp), %rsi
movb $0x0, (%rsi)
movq %r14, %rdi
callq 0xdf81
movl 0x10(%r14), %esi
decl %esi
movq (%r14), %rdx
movq %rbx, %rdi
callq 0x35c4
movq %rbx, %rdi
callq 0x3121
movq %rax, 0x160(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: create_type_tag
static type_tag_t* create_type_tag(script_t* script, tag_t type)
{
	type_tag_t* tag = emalloc(sizeof(type_tag_t)); 
	
	tag->defined = 1;
	tag->finalized = 0;
	
	tag->ctx.file = g_file;
	tag->ctx.line = g_line;
	tag->ctx.scope = g_scope;
	
	tag->type = type;
	
	switch(type)
	{
		case TAG_FUNC:
		{
			vec_init(&tag->func.arg_types, sizeof(type_tag_t*));
			tag->func.return_type = NULL;
		} break;
		
		case TAG_ARRAY:
		{
			tag->contained = NULL;
		} break;
		
		case TAG_STRUCT:
		{
			tag->ds.name = NULL;
			tag->ds.is_union = 0;
			tag->ds.size = 0;
			vec_init(&tag->ds.using, sizeof(type_tag_t*));
			vec_init(&tag->ds.members, sizeof(type_tag_member_t));
		} break;
		
		default: break;
	}
	
	script_module_t* module = vec_get(&script->modules, g_cur_module_index);
	vec_push_back(&module->all_type_tags, &tag);

	return tag;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movl $0x80, %edi
callq 0x21b0
testq %rax, %rax
je 0x825b
movq %rax, -0x18(%rbp)
movw $0x1, 0x24(%rax)
movq 0xdfac(%rip), %rcx      # 0x16150
movq %rcx, 0x8(%rax)
movl 0xdf9a(%rip), %ecx      # 0x16148
movl %ecx, (%rax)
movl 0xe08a(%rip), %ecx      # 0x16240
movl %ecx, 0x10(%rax)
movl %r14d, 0x20(%rax)
cmpl $0xa, %r14d
je 0x81f8
cmpl $0x7, %r14d
je 0x81ee
cmpl $0x6, %r14d
jne 0x8226
addq $0x28, %rax
movl $0x8, %esi
movq %rax, %rdi
callq 0xdcb4
movq -0x18(%rbp), %rax
movq $0x0, 0x48(%rax)
jmp 0x8226
movq $0x0, 0x28(%rax)
jmp 0x8226
movb $0x0, 0x28(%rax)
movq %rax, %rdi
addq $0x40, %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movl $0x8, %esi
callq 0xdcb4
movq -0x18(%rbp), %rdi
addq $0x60, %rdi
movl $0x20, %esi
callq 0xdcb4
addq $0x2b8, %rbx            # imm = 0x2B8
movslq 0xe004(%rip), %rsi      # 0x16238
movq %rbx, %rdi
callq 0xdf24
leaq 0x90(%rax), %rdi
leaq -0x18(%rbp), %rbx
movq %rbx, %rsi
callq 0xdf81
movq (%rbx), %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x9a35(%rip), %rdi      # 0x11c97
xorl %eax, %eax
callq 0x384e
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: compare_type_tags
static char compare_type_tags(type_tag_t* a, type_tag_t* b)
{
	if(a->type != TAG_VOID && b->type != TAG_VOID)
	{
		if(a->type == TAG_DYNAMIC || b->type == TAG_DYNAMIC)
			return 1;
	}
	
	if(a->type != b->type) return 0;
	
	switch(a->type)
	{
		case TAG_FUNC:
		{
			if(!compare_type_tags(a->func.return_type, b->func.return_type)) return 0;
			if(a->func.arg_types.length != b->func.arg_types.length) return 0;
			
			for(int i = 0; i < a->func.arg_types.length; ++i)
			{
				if(!compare_type_tags(vec_get_value(&a->func.arg_types, i, type_tag_t*), vec_get_value(&b->func.arg_types, i, type_tag_t*)))
					return 0;
			}
		} break;
		
		case TAG_ARRAY:
		{
			if(a->contained->type == TAG_DYNAMIC || b->contained->type == TAG_DYNAMIC)
			{
				context_t ctx;
				ctx.file = g_file;
				ctx.line = g_line;
				
				warn_c(ctx, WARN_ARRAY_DYNAMIC_TO_SPECIFIC);
			}
			
			if(!compare_type_tags(a->contained, b->contained)) return 0;
		} break;
		
		case TAG_STRUCT:
		{
			return strcmp(a->ds.name, b->ds.name) == 0;
		} break;
		
		default: break;
	}
	
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl 0x20(%rdi), %ecx
testl %ecx, %ecx
je 0x82a4
movl 0x20(%rbx), %eax
testl %eax, %eax
je 0x82a4
cmpl $0x1, %ecx
sete %dl
cmpl $0x1, %eax
sete %al
orb %dl, %al
movb $0x1, %al
jne 0x83d9
cmpl 0x20(%rbx), %ecx
jne 0x836e
cmpl $0xa, %ecx
je 0x83c7
cmpl $0x7, %ecx
je 0x8372
cmpl $0x6, %ecx
jne 0x83c3
movq 0x48(%r14), %rdi
movq 0x48(%rbx), %rsi
callq 0x8269
testb %al, %al
je 0x836e
movq 0x38(%r14), %rax
cmpq 0x38(%rbx), %rax
jne 0x836e
cmpq $0x0, 0x38(%r14)
setne %r15b
je 0x83c3
leaq 0x28(%r14), %rdi
addq $0x28, %rbx
movq %rdi, -0x30(%rbp)
xorl %esi, %esi
callq 0xdf24
movq (%rax), %r12
movq %rbx, %rdi
xorl %esi, %esi
callq 0xdf24
movq (%rax), %rsi
movq %r12, %rdi
callq 0x8269
testb %al, %al
je 0x8369
movl $0x1, %r12d
cmpq %r12, 0x38(%r14)
seta %r15b
jbe 0x83c3
movq -0x30(%rbp), %rdi
movq %r12, %rsi
callq 0xdf24
movq (%rax), %r13
movq %rbx, %rdi
movq %r12, %rsi
callq 0xdf24
movq (%rax), %rsi
movq %r13, %rdi
callq 0x8269
incq %r12
testb %al, %al
jne 0x832f
testb %r15b, %r15b
je 0x83c3
xorl %eax, %eax
jmp 0x83d9
movq 0x28(%r14), %rax
cmpl $0x1, 0x20(%rax)
je 0x8386
movq 0x28(%rbx), %rax
cmpl $0x1, 0x20(%rax)
jne 0x83b2
movq 0xddc3(%rip), %rax      # 0x16150
movq %rax, -0x48(%rbp)
movl 0xddb1(%rip), %eax      # 0x16148
movl %eax, -0x50(%rbp)
movups -0x50(%rbp), %xmm0
movups -0x40(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
xorl %eax, %eax
callq 0x83e8
movq 0x28(%r14), %rdi
movq 0x28(%rbx), %rsi
callq 0x8269
testb %al, %al
je 0x836e
movb $0x1, %al
jmp 0x83d9
movq 0x30(%r14), %rdi
movq 0x30(%rbx), %rsi
callq 0x2150
testl %eax, %eax
sete %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: warn_c
static void warn_c(context_t ctx, script_warning_t warning, ...)
{
	if(!g_warning_disabled[(int)warning])
	{
		fprintf(stderr, "\nWarning %s (%s:%i):\n", g_warning_name[(int)warning], ctx.file, 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
pushq %rbx
subq $0xc8, %rsp
testb %al, %al
je 0x841e
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq %rsi, -0xc8(%rbp)
movq %rdx, -0xc0(%rbp)
movq %rcx, -0xb8(%rbp)
movq %r8, -0xb0(%rbp)
movq %r9, -0xa8(%rbp)
cmpb $0x0, 0xddf6(%rip)      # 0x1623e
je 0x8454
addq $0xc8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x10(%rbp), %rax
movq 0xdb91(%rip), %rbx      # 0x15ff0
movq (%rbx), %rdi
movq 0x8(%rax), %rcx
movl (%rax), %r8d
leaq 0x7b72(%rip), %rsi      # 0xffe2
leaq 0x7b97(%rip), %rdx      # 0x1000e
xorl %eax, %eax
callq 0x2170
leaq -0xd0(%rbp), %rax
leaq -0x20(%rbp), %rdx
movq %rax, 0x10(%rdx)
leaq 0x30(%rbp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq (%rbx), %rdi
leaq 0x7be3(%rip), %rsi      # 0x1008f
callq 0x2200
movq (%rbx), %rsi
movl $0xa, %edi
callq 0x2120
jmp 0x844a
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: reference_function
static func_decl_t* reference_function(script_t* script, const char* name)
{
	for (int module_index = 0; module_index < script->modules.length; ++module_index)
	{
		script_module_t* module = vec_get(&script->modules, module_index);
		for (int i = 0; i < module->functions.length; ++i)
		{
			func_decl_t* decl = vec_get_value(&module->functions, i, func_decl_t*);
			if (strcmp(decl->name, name) == 0)
				return decl;
		}
	}
	
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, -0x30(%rbp)
cmpq $0x0, 0x2c8(%rdi)
je 0x8598
leaq 0x2b8(%rdi), %rax
movq %rax, -0x40(%rbp)
xorl %r14d, %r14d
movq %rdi, -0x38(%rbp)
movq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0xdf24
cmpq $0x0, 0x20e0(%rax)
setne %r13b
movq %r14, -0x48(%rbp)
je 0x857b
movq %rax, %r12
leaq 0x20d0(%rax), %rdi
movq %rdi, -0x50(%rbp)
xorl %esi, %esi
callq 0xdf24
movq (%rax), %r14
movq 0x18(%r14), %rdi
movq -0x30(%rbp), %rsi
callq 0x2150
testl %eax, %eax
cmoveq %r14, %rbx
je 0x857b
movl $0x1, %r14d
cmpq %r14, 0x20e0(%r12)
seta %r13b
jbe 0x857b
movq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0xdf24
movq (%rax), %r15
movq 0x18(%r15), %rdi
movq -0x30(%rbp), %rsi
callq 0x2150
incq %r14
testl %eax, %eax
cmoveq %r15, %rbx
jne 0x8546
testb %r13b, %r13b
jne 0x859a
movq -0x48(%rbp), %r14
incq %r14
movq -0x38(%rbp), %rax
cmpq %r14, 0x2c8(%rax)
ja 0x84f5
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: declare_variable
static var_decl_t* declare_variable(script_t* script, const char* name, type_tag_t* tag)
{
	var_decl_t* decl = reference_variable(script, name);
	
	if(!decl)
	{
		decl = emalloc(sizeof(type_tag_t));
		
		decl->parent = g_cur_func;
		decl->tag = tag;
		decl->name = estrdup(name);
		decl->scope = g_scope;
		
		if(g_cur_func)
		{
			decl->index = g_cur_func->locals.length;
			vec_push_back(&g_cur_func->locals, &decl);
			return decl;
		}
	
		// NOTE: g_cur_module_index MUST have the right value rn
		script_module_t* module = vec_get(&script->modules, g_cur_module_index);

		// NOTE: The global index must be unique across modules
		int index = module->globals.length;
		for (int i = 0; i < g_cur_module_index; ++i)
		{
			script_module_t* prev_module = vec_get(&script->modules, i);
			index += prev_module->globals.length;
		}

		decl->index = index;
		vec_push_back(&module->globals, &decl);

		return decl;
	}
	else if (!g_cur_func)
		error_exit_p("Attempted to redeclare global variable '%s'\n", name);

	return decl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
callq 0x86d2
movq %rax, -0x28(%rbp)
testq %rax, %rax
je 0x85f1
cmpq $0x0, 0xdc6e(%rip)      # 0x16248
jne 0x86b3
leaq 0x7c82(%rip), %rdi      # 0x10269
movq %r14, %rsi
xorl %eax, %eax
callq 0x88df
movl $0x80, %edi
callq 0x21b0
testq %rax, %rax
je 0x86c4
movq %rax, -0x28(%rbp)
movq 0xdc39(%rip), %rcx      # 0x16248
movq %rcx, (%rax)
movq %r15, 0x8(%rax)
movq %r14, %rdi
callq 0x2807
movq -0x28(%rbp), %rcx
movq %rax, 0x10(%rcx)
movl 0xdc14(%rip), %eax      # 0x16240
movl %eax, 0x18(%rcx)
movq 0xdc12(%rip), %r14      # 0x16248
testq %r14, %r14
je 0x8648
movl 0x30(%r14), %eax
movl %eax, 0x1c(%rcx)
addq $0x20, %r14
jmp 0x86a7
addq $0x2b8, %rbx            # imm = 0x2B8
movslq 0xdbe2(%rip), %rsi      # 0x16238
movq %rbx, %rdi
callq 0xdf24
movq %rax, %r14
movq 0x2100(%rax), %r12
cmpl $0x0, 0xdbc9(%rip)      # 0x16238
jle 0x8698
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdf24
movslq %r12d, %r12
addq 0x2100(%rax), %r12
incq %r15
movslq 0xdba5(%rip), %rax      # 0x16238
cmpq %rax, %r15
jl 0x8674
addq $0x20f0, %r14           # imm = 0x20F0
movq -0x28(%rbp), %rax
movl %r12d, 0x1c(%rax)
leaq -0x28(%rbp), %rsi
movq %r14, %rdi
callq 0xdf81
movq -0x28(%rbp), %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x95cc(%rip), %rdi      # 0x11c97
xorl %eax, %eax
callq 0x384e
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: error_exit_p
static void error_exit_p(const char* fmt, ...)
{
	fprintf(stderr, "\nError (%s:%i):\n", g_file, g_line);
	
	va_list args;
	va_start(args, fmt);
	vfprintf(stderr, fmt, args);
	va_end(args);
	
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
testb %al, %al
je 0x891f
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)
leaq -0xe0(%rbp), %r14
movq %rsi, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
movq 0xd6af(%rip), %r15      # 0x15ff0
movq (%r15), %rdi
movq 0xd805(%rip), %rdx      # 0x16150
movl 0xd7f7(%rip), %ecx      # 0x16148
leaq 0x793e(%rip), %rsi      # 0x10296
xorl %eax, %eax
callq 0x2170
leaq -0x30(%rbp), %rdx
movq %r14, 0x10(%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x2200
movl $0x1, %edi
callq 0x2230
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: create_expr
static expr_t* create_expr(expr_type_t type)
{
	expr_t* exp = emalloc(sizeof(expr_t));

	exp->is_shallow_copy = 0;
	exp->tag = NULL;
	exp->ctx.file = g_file;
	exp->ctx.line = g_line;
	exp->ctx.scope = g_scope;
	exp->ctx.func = g_cur_func;
	exp->type = type;
	
	return exp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
movl $0x60, %edi
callq 0x21b0
testq %rax, %rax
je 0x89e5
movb $0x0, (%rax)
movq $0x0, 0x30(%rax)
movq 0xd796(%rip), %rcx      # 0x16150
movq %rcx, 0x10(%rax)
movl 0xd784(%rip), %ecx      # 0x16148
movl %ecx, 0x8(%rax)
movl 0xd873(%rip), %ecx      # 0x16240
movl %ecx, 0x18(%rax)
movq 0xd871(%rip), %rcx      # 0x16248
movq %rcx, 0x20(%rax)
movl %ebx, 0x28(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x92ab(%rip), %rdi      # 0x11c97
xorl %eax, %eax
callq 0x384e
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: register_number
static int register_number(script_t* script, double number)
{
	for(int i = 0; i < script->numbers.length; ++i)
	{
		if(vec_get_value(&script->numbers, i, double) == number)
			return i;
	}
	
	vec_push_back(&script->numbers, &number);
	return script->numbers.length - 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movsd %xmm0, -0x28(%rbp)
leaq 0x1f8(%rdi), %r14
cmpq $0x0, 0x208(%rdi)
setne %r12b
je 0x8a69
xorl %r15d, %r15d
movq %r14, %rdi
xorl %esi, %esi
callq 0xdf24
movsd (%rax), %xmm0
ucomisd -0x28(%rbp), %xmm0
jne 0x8a39
jnp 0x8a64
xorl %r15d, %r15d
incq %r15
cmpq %r15, 0x208(%rbx)
seta %r12b
jbe 0x8a69
movq %r14, %rdi
movq %r15, %rsi
callq 0xdf24
movsd (%rax), %xmm0
ucomisd -0x28(%rbp), %xmm0
jne 0x8a3c
jp 0x8a3c
testb %r12b, %r12b
jne 0x8a7f
leaq -0x28(%rbp), %rsi
movq %r14, %rdi
callq 0xdf81
movl 0x208(%rbx), %r15d
decl %r15d
movl %r15d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: register_string
static int register_string(script_t* script, const char* string)
{
	for(int i = 0; i < script->strings.length; ++i)
	{
		if(strcmp(vec_get_value(&script->strings, i, script_string_t).data, string) == 0)
			return i;
	}
	
	script_string_t str;
	str.length = strlen(string);
	str.data = emalloc(str.length + 1);
	strcpy(str.data, string);
	
	vec_push_back(&script->strings, &str);
	return script->strings.length - 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x218(%rdi), %r14
cmpq $0x0, 0x228(%rdi)
setne %r13b
je 0x8b0b
xorl %r12d, %r12d
movq %r14, %rdi
xorl %esi, %esi
callq 0xdf24
movq 0x8(%rax), %rdi
movq %r15, %rsi
callq 0x2150
testl %eax, %eax
je 0x8b06
xorl %r12d, %r12d
incq %r12
cmpq %r12, 0x228(%rbx)
seta %r13b
jbe 0x8b0b
movq %r14, %rdi
movq %r12, %rsi
callq 0xdf24
movq 0x8(%rax), %rdi
movq %r15, %rsi
callq 0x2150
testl %eax, %eax
jne 0x8adb
testb %r13b, %r13b
jne 0x8b4c
movq %r15, %rdi
callq 0x20b0
movl %eax, -0x38(%rbp)
leal 0x1(%rax), %edi
callq 0x21b0
testq %rax, %rax
je 0x8b5e
leaq -0x38(%rbp), %r12
movq %rax, 0x8(%r12)
movq %rax, %rdi
movq %r15, %rsi
callq 0x2050
movq %r14, %rdi
movq %r12, %rsi
callq 0xdf81
movl 0x228(%rbx), %r12d
decl %r12d
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9132(%rip), %rdi      # 0x11c97
xorl %eax, %eax
callq 0x384e
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: get_type_tag_from_name
static type_tag_t* get_type_tag_from_name(script_t* script, const char* name)
{
	type_tag_t* user_tag = get_user_type_tag_from_name(script, name);
	if(user_tag) return user_tag;
	
	for(int i = 0; i < NUM_BUILTIN_TAGS; ++i)
	{
		if(strcmp(g_builtin_type_tags[i], name) == 0)
			return create_type_tag(script, (tag_t)i);
	}
	
	type_tag_t* potential_tag = create_type_tag(script, TAG_STRUCT);
	
	potential_tag->ds.name = estrdup(name);
	vec_init(&potential_tag->ds.members, sizeof(type_tag_member_t));
	potential_tag->defined = 0;
	
	script_module_t* module = vec_get(&script->modules, g_cur_module_index);
	map_set(&module->user_type_tags, name, potential_tag);
	
	return potential_tag;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x8e95
movq %rax, %r15
testq %rax, %rax
jne 0x8e89
leaq 0x7961(%rip), %rdi      # 0x10736
movq %rbx, %rsi
callq 0x2150
xorl %r15d, %r15d
testl %eax, %eax
je 0x8e16
leaq 0x685d(%rip), %r12      # 0xf648
cmpq $0x8, %r15
je 0x8e29
movslq 0x4(%r12,%r15,4), %rdi
addq %r12, %rdi
movq %rbx, %rsi
callq 0x2150
incq %r15
testl %eax, %eax
jne 0x8deb
leaq -0x1(%r15), %rax
cmpq $0x8, %rax
setae %r12b
jmp 0x8e19
xorl %r12d, %r12d
movq %r14, %rdi
movl %r15d, %esi
callq 0x816f
movq %rax, %r15
jmp 0x8e2d
setae %r12b
testb %r12b, %r12b
je 0x8e89
movq %r14, %rdi
movl $0xa, %esi
callq 0x816f
movq %rax, %r15
movq %rbx, %rdi
callq 0x2807
movq %rax, 0x30(%r15)
leaq 0x60(%r15), %rdi
movl $0x20, %esi
callq 0xdcb4
movb $0x0, 0x24(%r15)
addq $0x2b8, %r14            # imm = 0x2B8
movslq 0xd3c9(%rip), %rsi      # 0x16238
movq %r14, %rdi
callq 0xdf24
leaq 0xb0(%rax), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xe22f
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x0, 0x2c8(%rdi)
je 0x8eec
movq %rsi, %r14
movq %rdi, %r15
leaq 0x2b8(%rdi), %r12
xorl %r13d, %r13d
movq %r12, %rdi
movq %r13, %rsi
callq 0xdf24
leaq 0xb0(%rax), %rdi
movq %r14, %rsi
callq 0xe328
testq %rax, %rax
cmovneq %rax, %rbx
jne 0x8eee
incq %r13
cmpq %r13, 0x2c8(%r15)
ja 0x8ebd
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movq %rsi, %rdi
callq 0x20b0
movq %rax, %r13
movq %r15, %rdi
callq 0x20b0
movq %rax, %rbx
movq %r14, %rdi
movq %r12, %rsi
callq 0x8e95
testq %rax, %rax
je 0x98ee
movq %rax, -0x30(%rbp)
leaq (%rbx,%r13), %rdi
addq $0x2, %rdi
callq 0x21b0
testq %rax, %rax
je 0x9903
movq %rax, %rbx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2050
movb $0x5f, (%rbx,%r13)
leaq (%rbx,%r13), %rdi
incq %rdi
movq %r15, %rsi
callq 0x2050
movq %r14, %rdi
movq %rbx, %rsi
callq 0x84c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x2030
testq %r14, %r14
je 0x98e9
cmpq $0x0, 0x50(%r14)
je 0x98ee
movq %r14, %rdi
addq $0x40, %rdi
xorl %r15d, %r15d
xorl %esi, %esi
callq 0xdf24
movq (%rax), %rax
movq 0x8(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x8269
testb %al, %al
je 0x98f1
movq %r14, %r15
jmp 0x98f1
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x838d(%rip), %rdi      # 0x11c97
xorl %eax, %eax
callq 0x384e
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %rbx
testb %al, %al
je 0x9951
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)
leaq -0xe0(%rbp), %r14
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
movq 0xc681(%rip), %r15      # 0x15ff0
movq (%r15), %rax
movq 0x10(%rdi), %rdx
movl 0x8(%rdi), %ecx
leaq 0x6916(%rip), %rsi      # 0x10296
movq %rax, %rdi
xorl %eax, %eax
callq 0x2170
leaq -0x30(%rbp), %rdx
movq %r14, 0x10(%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x2200
movl $0x1, %edi
callq 0x2230
// File: /workspace/github_c_makefile_star2_O1/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:
xorl %eax, %eax
cmpb $0x0, 0x28(%rdi)
je 0x99c5
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x0, 0x70(%rdi)
je 0x9a26
movq %rsi, %r14
leaq 0x60(%r15), %r12
xorl %r13d, %r13d
movq %r12, %rdi
movq %r13, %rsi
callq 0xdf24
movq %rax, %rbx
movq (%rax), %rdi
movq %r14, %rsi
callq 0x2150
testl %eax, %eax
jne 0x9a0f
movl 0x8(%rbx), %ecx
movl %ecx, -0x2c(%rbp)
testl %eax, %eax
je 0x9a23
incq %r13
cmpq %r13, 0x70(%r15)
ja 0x99ec
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x9a26
movl -0x2c(%rbp), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
subq $0xd0, %rsp
testb %al, %al
je 0x9a96
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 %rdx, -0xd0(%rbp)
movq %rcx, -0xc8(%rbp)
movq %r8, -0xc0(%rbp)
movq %r9, -0xb8(%rbp)
movl %esi, %r14d
leaq 0xc781(%rip), %rax      # 0x1623d
cmpb $0x0, (%r14,%rax)
je 0x9acf
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0xc51a(%rip), %rbx      # 0x15ff0
movq (%rbx), %rax
leaq 0x5b50(%rip), %rcx      # 0xf630
movslq (%rcx,%r14,4), %rdx
addq %rcx, %rdx
movq 0x10(%rdi), %rcx
movl 0x8(%rdi), %r8d
leaq 0x64ec(%rip), %rsi      # 0xffe2
movq %rax, %rdi
xorl %eax, %eax
callq 0x2170
leaq -0xe0(%rbp), %rax
leaq -0x30(%rbp), %rdx
movq %rax, 0x10(%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq (%rbx), %rdi
leaq 0x5b0e(%rip), %rax      # 0xf63c
movslq (%rax,%r14,4), %rsi
addq %rax, %rsi
callq 0x2200
movq (%rbx), %rsi
movl $0xa, %edi
callq 0x2120
jmp 0x9ac3
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x20(%rdi), %eax
cmpl $0xa, %eax
je 0x9d57
cmpl $0x6, %eax
jne 0x9db8
addq $0x28, %rbx
movq %rbx, %r14
jmp 0x9da8
movq 0x30(%rbx), %rdi
callq 0x2030
leaq 0x60(%rbx), %r14
cmpq $0x0, 0x70(%rbx)
je 0x9d9c
xorl %r15d, %r15d
movq %r14, %rdi
movq %r15, %rsi
callq 0xdf24
movq %rax, %r12
movq (%rax), %rdi
callq 0x2030
movq 0x18(%r12), %rdi
testq %rdi, %rdi
je 0x9d93
callq 0x9b68
incq %r15
cmpq %r15, 0x70(%rbx)
ja 0x9d6e
addq $0x40, %rbx
movq %rbx, %rdi
callq 0xe1d2
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xe1d2
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x150(%rdi), %r14
movq %r14, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x9ff7
movl 0x8(%rax), %ecx
testl %ecx, %ecx
jle 0x9fe6
jmp 0xa001
movq %rbx, %rdi
callq 0x2ea9
jmp 0x9fe3
decl %ecx
movl %ecx, 0x8(%rax)
movslq 0xc(%rax,%rcx,4), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
addq $0x110, %rax            # imm = 0x110
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xa035
movq %rdi, %rbx
cmpb $0x0, 0x18(%rdi)
je 0xa040
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, 0x18(%rbx)
movl 0xc(%rbx), %eax
cmpl $0x6, %eax
je 0xa09b
cmpl $0x8, %eax
je 0xa082
cmpl $0x7, %eax
jne 0xa035
cmpq $0x0, 0x30(%rbx)
je 0xa035
leaq 0x20(%rbx), %r14
xorl %r15d, %r15d
movq %r14, %rdi
movq %r15, %rsi
callq 0xdf24
movq (%rax), %rdi
callq 0xa01d
incq %r15
cmpq %r15, 0x30(%rbx)
ja 0xa064
jmp 0xa035
movq 0x28(%rbx), %rax
testq %rax, %rax
je 0xa035
movq 0x20(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *%rax
cmpq $0x0, 0x30(%rbx)
je 0xa035
leaq 0x20(%rbx), %r14
xorl %r15d, %r15d
movq %r14, %rdi
movq %r15, %rsi
callq 0xdf24
movq (%rax), %rdi
callq 0xa01d
incq %r15
cmpq %r15, 0x30(%rbx)
ja 0xa0a9
jmp 0xa035
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movq %rdi, -0x38(%rbp)
movl 0xa668(%rip), %r12d     # 0x16350
movl %r12d, %edi
callq 0xc55b
movl %eax, %r13d
cmpl %ebx, %eax
jge 0xbcfd
movq %r15, -0x30(%rbp)
jmp 0xbd5f
movq %r15, -0x40(%rbp)
xorl %edi, %edi
callq 0xa0ca
movl %eax, 0xa642(%rip)      # 0x16350
movq %r14, %rdi
callq 0xac41
movq %r14, %r15
movq %rax, %r14
movl 0xa62e(%rip), %edi      # 0x16350
callq 0xc55b
cmpl %r13d, %eax
jle 0xbd3e
leal 0x1(%r13), %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0xbcc4
movq %rax, %r14
movl $0xe, %edi
callq 0x8991
movq %rax, %r15
movq -0x40(%rbp), %rcx
movq %rcx, 0x38(%rax)
movq %r14, 0x40(%rax)
movl %r12d, 0x48(%rax)
movq -0x38(%rbp), %r14
cmpl %ebx, %r13d
jge 0xbce1
movq -0x30(%rbp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r12
movq %rdi, %r14
addq $0x2b8, %rdi            # imm = 0x2B8
movslq 0xa132(%rip), %rsi      # 0x16238
callq 0xdf24
movq %rax, %rbx
movl $0x68, %edi
callq 0x21b0
testq %rax, %rax
je 0xc1ea
leaq -0x40(%rbp), %r15
movq %rax, (%r15)
movq 0xa119(%rip), %rcx      # 0x16248
movq %rcx, (%rax)
movl $0x0, 0x8(%rax)
movq %r14, %rdi
movl $0x6, %esi
callq 0x816f
movq (%r15), %rcx
movq %rax, 0x10(%rcx)
movq %r12, %rdi
callq 0x2807
movq (%r15), %rdi
movq %rax, 0x18(%rdi)
addq $0x20, %rdi
movl $0x8, %esi
callq 0xdcb4
movq (%r15), %rdi
addq $0x40, %rdi
movl $0x8, %esi
callq 0xdcb4
leaq 0x278(%r14), %r13
movl 0x288(%r14), %eax
movq (%r15), %rcx
movl %eax, 0x60(%rcx)
movq %r12, %rdi
callq 0x2807
leaq -0x38(%rbp), %rsi
movq %rax, (%rsi)
movq %r13, %rdi
callq 0xdf81
leaq -0x2c(%rbp), %rsi
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
addq $0x298, %r14            # imm = 0x298
movq %r14, %rdi
callq 0xdf81
movq (%r15), %rax
movb $0x0, 0x64(%rax)
addq $0x20d0, %rbx           # imm = 0x20D0
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdf81
movq (%r15), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5aa6(%rip), %rdi      # 0x11c97
xorl %eax, %eax
callq 0x384e
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, -0x20(%rbp)
cmpq $0x0, 0xa037(%rip)      # 0x16248
je 0xc29f
movq %rdi, %rbx
movl $0x20, %edi
callq 0x21b0
testq %rax, %rax
je 0xc2a8
leaq -0x28(%rbp), %r14
movq %rax, (%r14)
movq 0xa011(%rip), %rax      # 0x16248
movq 0x10(%rax), %rdi
addq $0x28, %rdi
leaq -0x20(%rbp), %r15
movq %r15, %rsi
callq 0xdf81
movq 0x9ff6(%rip), %rax      # 0x16248
movq (%r14), %rcx
movq %rax, (%rcx)
movq (%r15), %rax
movq (%r14), %rcx
movq %rax, 0x8(%rcx)
movq %rbx, %rdi
callq 0x2807
movq (%r14), %rcx
movq %rax, 0x10(%rcx)
movl 0x9fc9(%rip), %eax      # 0x16240
movl %eax, 0x18(%rcx)
movl $0xffffd8f1, 0x1c(%rcx) # imm = 0xFFFFD8F1
movq 0x9fc0(%rip), %rdi      # 0x16248
addq $0x40, %rdi
movq %r14, %rsi
callq 0xdf81
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4f5d(%rip), %rdi      # 0x11203
jmp 0xc2af
leaq 0x59e8(%rip), %rdi      # 0x11c97
xorl %eax, %eax
callq 0x384e
// File: /workspace/github_c_makefile_star2_O1/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
pushq %rbx
pushq %rax
cmpq $0x0, 0x9f84(%rip)      # 0x16248
je 0xc30d
movq 0x9f7b(%rip), %rdi      # 0x16248
cmpq $0x0, 0x50(%rdi)
je 0xc306
xorl %ebx, %ebx
addq $0x40, %rdi
movq %rbx, %rsi
callq 0xdf24
movq (%rax), %rax
movq 0x9f5c(%rip), %rcx      # 0x16248
movl 0x50(%rcx), %ecx
movl %ebx, %edx
subl %ecx, %edx
movl %edx, 0x1c(%rax)
incq %rbx
movq 0x9f48(%rip), %rdi      # 0x16248
cmpq %rbx, 0x50(%rdi)
ja 0xc2d6
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x4f23(%rip), %rdi      # 0x11237
xorl %eax, %eax
callq 0x384e
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: finalize_type
static void finalize_type(const char* key, void* v_tag, void* data)
{
	type_tag_t* tag = v_tag;
	if(tag->defined && !tag->finalized)
	{
		if(tag->type != TAG_STRUCT) error_exit_c(tag->ctx, "Attempted to use non-struct type in struct '%s'\n", tag->ds.name);
		
		for(int using_index = 0; using_index < tag->ds.using.length; ++using_index)
		{
			type_tag_t* using = vec_get_value(&tag->ds.using, using_index, type_tag_t*);
			
			for(int mem_id = 0; mem_id < using->ds.members.length; ++mem_id)
			{
				type_tag_member_t* mem = vec_get(&using->ds.members, mem_id);
				
				type_tag_member_t mem_copy;
				mem_copy.name = estrdup(mem->name);
				mem_copy.index = mem->index + tag->ds.size;
				mem_copy.type = mem->type;
			
				if(mem->default_value)
				{
					// NOTE: Making a shallow copy of the default_value expression
					mem_copy.default_value = emalloc(sizeof(expr_t));
					memcpy(mem_copy.default_value, mem->default_value, sizeof(expr_t));
					mem_copy.default_value->is_shallow_copy = 1;
				}
				else
					mem_copy.default_value = NULL;
				
				vec_push_back(&tag->ds.members, &mem_copy);
			}
			
			tag->ds.size += using->ds.size;
		}
		
		tag->finalized = 1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
cmpb $0x0, 0x24(%rsi)
je 0xcd16
movq %rsi, %r15
cmpb $0x0, 0x25(%rsi)
jne 0xcd16
cmpl $0xa, 0x20(%r15)
jne 0xcd33
cmpq $0x0, 0x50(%r15)
je 0xcd11
leaq 0x40(%r15), %rcx
movq %rcx, -0x30(%rbp)
leaq 0x60(%r15), %rcx
movq %rcx, -0x40(%rbp)
xorl %esi, %esi
movq -0x30(%rbp), %rdi
movq %rsi, -0x38(%rbp)
callq 0xdf24
movq (%rax), %rbx
cmpq $0x0, 0x70(%rbx)
je 0xccf8
leaq 0x60(%rbx), %r14
xorl %r12d, %r12d
movq %r14, %rdi
movq %r12, %rsi
callq 0xdf24
movq %rax, %r13
movq (%rax), %rdi
callq 0x2807
movq %rax, -0x60(%rbp)
movl 0x8(%r13), %eax
addl 0x38(%r15), %eax
movl %eax, -0x58(%rbp)
movq 0x10(%r13), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, 0x18(%r13)
je 0xccda
movl $0x60, %edi
callq 0x21b0
testq %rax, %rax
je 0xcd25
movq %rax, -0x48(%rbp)
movq 0x18(%r13), %rsi
movl $0xc, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movb $0x1, (%rax)
jmp 0xcce2
movq $0x0, -0x48(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xdf81
incq %r12
cmpq %r12, 0x70(%rbx)
ja 0xcc7f
movq 0x38(%rbx), %rax
addq %rax, 0x38(%r15)
movq -0x38(%rbp), %rsi
incq %rsi
cmpq %rsi, 0x50(%r15)
ja 0xcc5d
movb $0x1, 0x25(%r15)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4f6b(%rip), %rdi      # 0x11c97
xorl %eax, %eax
callq 0x384e
movq 0x30(%r15), %rsi
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
xorl %eax, %eax
callq 0xcd50
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: error_exit_c
static void error_exit_c(context_t ctx, const char* fmt, ...)
{
	fprintf(stderr, "\nError (%s:%i):\n", ctx.file, ctx.line);
	
	va_list args;
	va_start(args, fmt);
	vfprintf(stderr, fmt, args);
	va_end(args);
	
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xd0, %rsp
testb %al, %al
je 0xcd8b
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)
leaq -0xe0(%rbp), %rbx
movq %rsi, 0x8(%rbx)
movq %rdx, 0x10(%rbx)
movq %rcx, 0x18(%rbx)
movq %r8, 0x20(%rbx)
movq %r9, 0x28(%rbx)
movq 0x9243(%rip), %r14      # 0x15ff0
movq (%r14), %rdi
movq 0x18(%rbp), %rdx
movl 0x10(%rbp), %ecx
leaq 0x34d8(%rip), %rsi      # 0x10296
xorl %eax, %eax
callq 0x2170
leaq -0x30(%rbp), %rdx
movq %rbx, 0x10(%rdx)
leaq 0x30(%rbp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq (%r14), %rdi
leaq 0x4706(%rip), %rsi      # 0x114f2
callq 0x2200
movl $0x1, %edi
callq 0x2230
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: compile_file_line_info
static void compile_file_line_info(script_t* script, expr_t* exp, char ignore_last)
{
	if (exp->ctx.file)
	{
		if (ignore_last || !g_last_compiled_file || strcmp(g_last_compiled_file, exp->ctx.file) != 0)
		{
			append_code(script, OP_FILE);
			append_int(script, register_string(script, exp->ctx.file));
		}
		g_last_compiled_file = exp->ctx.file;
	}

	if(ignore_last || g_last_compiled_line != exp->ctx.line)
	{
		append_code(script, OP_LINE);
		append_int(script, exp->ctx.line);
	}
	g_last_compiled_line = exp->ctx.line;	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %rsi
testq %rsi, %rsi
je 0xce9c
testb %r15b, %r15b
sete %al
movq 0x9635(%rip), %rdi      # 0x16460
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xce41
callq 0x2150
testl %eax, %eax
je 0xce91
movl %r15d, -0x30(%rbp)
leaq -0x2b(%rbp), %rsi
movb $0x2c, (%rsi)
leaq 0x1d8(%r14), %r12
movq %r12, %rdi
callq 0xdf81
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x8a8f
movl %eax, -0x34(%rbp)
xorl %r15d, %r15d
leaq -0x29(%rbp), %r13
movb -0x34(%rbp,%r15), %al
incq %r15
movb %al, -0x29(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0xdf81
cmpq $0x4, %r15
jne 0xce71
movl -0x30(%rbp), %r15d
movq 0x10(%rbx), %rax
movq %rax, 0x95c4(%rip)      # 0x16460
testb %r15b, %r15b
jne 0xceac
movl 0x95c1(%rip), %eax      # 0x16468
cmpl 0x8(%rbx), %eax
je 0xceeb
leaq -0x2c(%rbp), %rsi
movb $0x2d, (%rsi)
addq $0x1d8, %r14            # imm = 0x1D8
movq %r14, %rdi
callq 0xdf81
movl 0x8(%rbx), %eax
movl %eax, -0x38(%rbp)
xorl %r12d, %r12d
leaq -0x2a(%rbp), %r15
movb -0x38(%rbp,%r12), %al
incq %r12
movb %al, -0x2a(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0xdf81
cmpq $0x4, %r12
jne 0xcecf
movl 0x8(%rbx), %eax
movl %eax, 0x9574(%rip)      # 0x16468
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: compile_call
static void compile_call(script_t* script, expr_t* exp)
{
	int nargs = exp->callx.args.length;

	if (exp->callx.func->type == EXP_COLON)
	{
		compile_value_expr(script, exp->callx.func->dotx.value);
		nargs += 1;
	}

	for(int i = 0; i < exp->callx.args.length; ++i)
	{
		expr_t* e = vec_get_value(&exp->callx.args, i, expr_t*);
		compile_value_expr(script, e);
	}

	compile_value_expr(script, exp->callx.func);
	
	append_code(script, OP_CALL);
	append_code(script, nargs);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x50(%rsi), %r13d
movq 0x38(%rsi), %rax
cmpl $0x3, 0x28(%rax)
jne 0xd799
movq 0x38(%rax), %rsi
movq %rbx, %rdi
callq 0xcf03
incl %r13d
cmpq $0x0, 0x50(%r14)
je 0xd7c6
leaq 0x40(%r14), %r15
xorl %r12d, %r12d
movq %r15, %rdi
movq %r12, %rsi
callq 0xdf24
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xcf03
incq %r12
cmpq %r12, 0x50(%r14)
ja 0xd7a7
movq 0x38(%r14), %rsi
movq %rbx, %rdi
callq 0xcf03
leaq -0x29(%rbp), %rsi
movb $0x29, (%rsi)
addq $0x1d8, %rbx            # imm = 0x1D8
movq %rbx, %rdi
callq 0xdf81
leaq -0x2a(%rbp), %rsi
movb %r13b, (%rsi)
movq %rbx, %rdi
callq 0xdf81
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: read_int_at
static int read_int_at(script_t* script, int pc)
{
	int value = 0;
	word* vp = (word*)(&value);
	
	for(int i = 0; i < sizeof(int) / sizeof(word); ++i)
		*vp++ = vec_get_value(&script->code, pc + i, word);
		
	return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x0, -0x1c(%rbp)
addq $0x1d8, %rbx            # imm = 0x1D8
movslq %esi, %r14
xorl %r15d, %r15d
leaq (%r14,%r15), %rsi
movq %rbx, %rdi
callq 0xdf24
movb (%rax), %al
movb %al, -0x1c(%rbp,%r15)
incq %r15
cmpq $0x4, %r15
jne 0xd827
movl -0x1c(%rbp), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: get_executing_module
static script_module_t* get_executing_module(script_t* script)
{
	for (int i = 0; i < script->modules.length; ++i)
	{
		script_module_t* m = vec_get(&script->modules, i);
		if (m->start_pc <= script->pc && m->end_pc >= script->pc)
			return m;
	}

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpq $0x0, 0x2c8(%rdi)
je 0xd8aa
movq %rdi, %rbx
leaq 0x2b8(%rdi), %r15
xorl %r12d, %r12d
movq %r15, %rdi
movq %r12, %rsi
callq 0xdf24
movslq 0x11c(%rbx), %rcx
cmpq %rcx, 0x20(%rax)
ja 0xd891
cmpq %rcx, 0x28(%rax)
jae 0xd895
movb $0x1, %cl
jmp 0xd89a
xorl %ecx, %ecx
movq %rax, %r14
testb %cl, %cl
je 0xd8ad
incq %r12
cmpq %r12, 0x2c8(%rbx)
ja 0xd873
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: read_int
static int read_int(script_t* script)
{
	int value = 0;
	word* vp = (word*)(&value);
	
	for(int i = 0; i < sizeof(int) / sizeof(word); ++i)
		*vp++ = vec_get_value(&script->code, script->pc++, word);
	
	return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x0, -0x1c(%rbp)
leaq 0x1d8(%rdi), %r14
xorl %r15d, %r15d
movslq 0x11c(%rbx), %rsi
leal 0x1(%rsi), %eax
movl %eax, 0x11c(%rbx)
movq %r14, %rdi
callq 0xdf24
movb (%rax), %al
movb %al, -0x1c(%rbp,%r15)
incq %r15
cmpq $0x4, %r15
jne 0xd8d7
movl -0x1c(%rbp), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: push_func
static void push_func(script_t* script, char is_extern, int index)
{
	script_value_t* val = new_value(script, VAL_FUNC);
	val->function.is_extern = is_extern;
	val->function.index = index;
	push_value(script, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
movl $0x5, %esi
callq 0x3318
movb %r14b, 0x20(%rax)
movl %ebx, 0x24(%rax)
movq %r15, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x319a
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: push_call_record
static void push_call_record(script_t* script, script_function_t function, word nargs)
{
	script_call_record_t record;

	record.stack_size = script->stack.length;
	record.pc = script->pc - 1;
	record.fp = script->fp;
	record.nargs = nargs;
	record.function = function;
	record.file = script->cur_file;
	record.line = script->cur_line;

	vec_push_back(&script->call_records, &record);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq 0x1a8(%rdi), %rcx
leaq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl 0x11c(%rdi), %ecx
decl %ecx
movl %ecx, 0x8(%rax)
movl 0x120(%rdi), %ecx
movl %ecx, 0xc(%rax)
movl %edx, 0x10(%rax)
movq %rsi, 0x14(%rax)
movq 0x128(%rdi), %rcx
movq %rcx, 0x20(%rax)
movl 0x124(%rdi), %ecx
movl %ecx, 0x28(%rax)
addq $0x130, %rdi            # imm = 0x130
movq %rax, %rsi
callq 0xdf81
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: pop_stack_frame
static void pop_stack_frame(script_t* script)
{
	if (script->indir_depth <= 0)
	{
		script->pc = -1;
		vec_clear(&script->stack);
		return;
	}
	
	// NOTE: Remove local values
	vec_resize(&script->stack, script->fp, NULL);

	// NOTE: Reset pc and fp
	vec_pop_back(&script->indir, &script->pc);
	vec_pop_back(&script->indir, &script->fp);
	
	int nargs;
	vec_pop_back(&script->indir, &nargs);

	// NOTE: Remove arguments
	vec_resize(&script->stack, script->stack.length - nargs, NULL);

	--script->indir_depth;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x190(%rdi)
jle 0xdc8f
leaq 0x198(%rbx), %r14
leaq 0x120(%rbx), %r15
movslq 0x120(%rbx), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0xdec2
leaq 0x1b8(%rbx), %r12
leaq 0x11c(%rbx), %rsi
movq %r12, %rdi
callq 0xdfda
movq %r12, %rdi
movq %r15, %rsi
callq 0xdfda
leaq -0x24(%rbp), %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0xdfda
movq 0x1a8(%rbx), %rsi
movslq (%r15), %rax
subq %rax, %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0xdec2
decl 0x190(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, 0x11c(%rbx) # imm = 0xFFFFFFFF
addq $0x198, %rbx            # imm = 0x198
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xe1c4