LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: print_stack_trace
static void print_stack_trace(script_t* script)
{
	fprintf(stderr, "Trace:\n");
	for(int i = script->call_records.length - 1; i >= 0; --i)
	{
		script_call_record_t* record = vec_get(&script->call_records, i);

		fprintf(stderr, "(%s, %d): ", record->file, record->line);
		
		if (record->function.is_extern)
			fprintf(stderr, "extern %s(", vec_get_value(&script->extern_names, record->function.index, char*));
		else
			fprintf(stderr, "%s(", vec_get_value(&script->function_names, record->function.index, char*));
		
		if (record->nargs > 0)
		{
			// NOTE: arguments started at exactly record->stackSize - record->nargs
			int args_start = record->stack_size - record->nargs;

			// NOTE: Print all arguments to this function
			// TODO: Have write_value take in a FILE* so we can route this
			// to stderr
			for (int i = args_start; i < args_start + record->nargs; ++i)
			{
				write_value(vec_get_value(&script->stack, i, script_value_t*), 1);
				if (i + 1 < args_start + record->nargs)
					fprintf(stderr, ", ");
			}
		}

		fprintf(stderr, ")\n");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq 0x13c7c(%rip), %r12     # 0x15ff0
movq (%r12), %rcx
leaq 0xe9f5(%rip), %rdi      # 0x10d74
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
callq 0x2240
movl 0x140(%r14), %eax
decl %eax
js 0x24c4
leaq 0x130(%r14), %rcx
movq %rcx, -0x30(%rbp)
leaq 0x198(%r14), %r15
movl %eax, %eax
pushq $0x1
popq %r13
movq %r14, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movq %rax, -0x40(%rbp)
movq %rax, %rsi
callq 0xdf24
movq %rax, %rbx
movq (%r12), %rdi
movq 0x20(%rax), %rdx
movl 0x28(%rax), %ecx
leaq 0xe9a2(%rip), %rsi      # 0x10d7c
xorl %eax, %eax
callq 0x2170
xorl %eax, %eax
cmpb $0x0, 0x14(%rbx)
sete %al
movq %r14, %rcx
movq (%r12), %r14
movslq 0x18(%rbx), %rsi
leaq 0xe98b(%rip), %r12      # 0x10d87
leaq 0xe98b(%rip), %rdx      # 0x10d8e
cmoveq %rdx, %r12
shll $0x6, %eax
leaq (%rcx,%rax), %rdi
addq $0x238, %rdi            # imm = 0x238
callq 0xdf24
movq (%rax), %rdx
movq %r14, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x2170
movl 0x10(%rbx), %eax
testl %eax, %eax
jle 0x2492
cmpl $0x0, 0x10(%rbx)
jle 0x2492
movl (%rbx), %ecx
subl %eax, %ecx
movslq %ecx, %r14
movslq %r14d, %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0xdf24
movq (%rax), %rdi
movl %r13d, %esi
callq 0x9dc1
incq %r14
movslq 0x10(%rbx), %rax
addq %r12, %rax
cmpq %rax, %r14
jl 0x2474
movslq 0x10(%rbx), %rax
addq %r12, %rax
cmpq %rax, %r14
jl 0x2441
jmp 0x2492
movq 0x13b75(%rip), %rax     # 0x15ff0
movq (%rax), %rcx
leaq 0xe90d(%rip), %rdi      # 0x10d92
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
callq 0x2240
jmp 0x2466
movq 0x13b57(%rip), %r12     # 0x15ff0
movq (%r12), %rcx
leaq 0xf286(%rip), %rdi      # 0x1172a
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
callq 0x2240
movq -0x40(%rbp), %rcx
leaq -0x1(%rcx), %rax
testq %rcx, %rcx
movq -0x38(%rbp), %r14
jg 0x23b5
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: error_defer_c
static void error_defer_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);
	
	g_has_error = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xd0, %rsp
testb %al, %al
je 0x250e
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 0x13ac0(%rip), %r14     # 0x15ff0
movq (%r14), %rdi
movq 0x18(%rbp), %rdx
movl 0x10(%rbp), %ecx
leaq 0xdd55(%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 0xef67(%rip), %rsi      # 0x114d6
callq 0x2200
movb $0x1, 0x13cc1(%rip)     # 0x1623c
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/test.c
// Function: main
int main(int argc, char* argv[])
{
	if(argc < 2)
	{
		fprintf(stderr, "%s [execution amount]\n", argv[0]);
		return 1;
	}
	
	script_t script;
	
	script_init(&script);
	
	script_disable_warning(WARN_DYNAMIC_ARRAY_LITERAL, 1);
	script_disable_warning(WARN_ARRAY_DYNAMIC_TO_SPECIFIC, 1);
	
	script_load_parse_file(&script, "test.txt", "test");
	script_compile(&script);
	
	for(int i = 2; i < argc; ++i)
	{
		if(strcmp(argv[i], "-dis") == 0)
			script_dissassemble(&script, stdout);
	}
	for(int i = 0; i < strtol(argv[1], NULL, 10); ++i)
		script_run(&script);
	script_destroy(&script);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2d8, %rsp            # imm = 0x2D8
movq %rsi, %rbx
cmpl $0x1, %edi
jle 0x27aa
movl %edi, %r14d
leaq -0x300(%rbp), %r15
movq %r15, %rdi
callq 0x2842
xorl %edi, %edi
movl $0x1, %esi
callq 0x3cc1
movl $0x1, %edi
movl $0x1, %esi
callq 0x3cc1
leaq 0xc92b(%rip), %rsi      # 0xf01b
leaq 0xc92d(%rip), %rdx      # 0xf024
movq %r15, %rdi
callq 0x37f1
movq %r15, %rdi
callq 0x3cd5
cmpl $0x2, %r14d
je 0x2747
movl %r14d, %r12d
movl $0x2, %r13d
leaq 0xc90c(%rip), %r14      # 0xf029
movq (%rbx,%r13,8), %rdi
movq %r14, %rsi
callq 0x2150
testl %eax, %eax
jne 0x273f
movq 0x13894(%rip), %rax     # 0x15fc8
movq (%rax), %rsi
movq %r15, %rdi
callq 0x4051
incq %r13
cmpq %r13, %r12
jne 0x271d
movq 0x8(%rbx), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
movl $0xa, %edx
callq 0x2190
testq %rax, %rax
jle 0x2789
xorl %r12d, %r12d
leaq -0x300(%rbp), %r15
movq %r15, %rdi
callq 0x452b
incq %r12
movq 0x8(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2190
cmpq %r12, %rax
jg 0x2769
leaq -0x300(%rbp), %rdi
callq 0x599f
movl %r14d, %eax
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x2280
movl $0x1, %r14d
jmp 0x2795
nop
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: estrdup
static char* estrdup(const char* str)
{
	size_t length = strlen(str);
	char* cpy = emalloc(length + 1);
	strcpy(cpy, str);
	
	return cpy;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x20b0
leaq 0x1(%rax), %rdi
callq 0x21b0
testq %rax, %rax
je 0x2834
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2050
leaq 0xf45c(%rip), %rdi      # 0x11c97
xorl %eax, %eax
callq 0x384e
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: add_heap_block
static void add_heap_block(script_t* script)
{
	script_heap_block_t* block = emalloc(sizeof(script_heap_block_t));
	
	block->next = script->heap_head;
	block->num_free = SCRIPT_HEAP_BLOCK_SIZE;
	for (int i = 0; i < block->num_free; ++i)
	{
		block->free_indices[i] = block->num_free - i - 1;

		block->values[i].block = block;
		block->values[i].block_index = i;
	}

	script->heap_head = block;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1110, %edi           # imm = 0x1110
callq 0x21b0
testq %rax, %rax
je 0x2f14
movq 0x150(%rbx), %rcx
movq %rcx, (%rax)
movl $0x40, 0x8(%rax)
movq %rax, %rcx
addq $0x118, %rcx            # imm = 0x118
movl $0x40, %edi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %esi, %esi
addl %edx, %edi
movl %edi, 0xc(%rax,%rsi,4)
movq %rax, -0x8(%rcx)
movl %esi, (%rcx)
incq %rsi
movslq 0x8(%rax), %rdi
decl %edx
addq $0x40, %rcx
cmpq %rdi, %rsi
jl 0x2ee8
movq %rax, 0x150(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0xed7c(%rip), %rdi      # 0x11c97
xorl %eax, %eax
callq 0x384e
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: script_reset
void script_reset(script_t* script)
{	
	vec_traverse(&script->modules, destroy_module);
	vec_clear(&script->modules);
	
	destroy_all_values(script);
	
	script->heap_head = NULL;
	add_heap_block(script);

	script->in_extern = 0;
	
	script->num_objects = 0;
	script->max_objects_until_gc = INIT_GC_THRESH;
	
	script->pc = -1;
	script->fp = 0;

	script->gc_head = NULL;
	script->ret_val = NULL;

	script->indir_depth = 0;

	vec_clear(&script->globals);
	
	vec_clear(&script->stack);
	vec_clear(&script->indir);
	
	vec_clear(&script->code);
	
	vec_clear(&script->function_names);
	vec_clear(&script->function_pcs);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x2b8(%rdi), %r14
leaq 0xcf(%rip), %rsi        # 0x300c
movq %r14, %rdi
callq 0xe189
movq %r14, %rdi
callq 0xe1c4
leaq 0x150(%rbx), %r14
movq 0x150(%rbx), %rdi
testq %rdi, %rdi
je 0x2f70
movq (%rdi), %r15
callq 0x2030
movq %r15, %rdi
testq %r15, %r15
jne 0x2f60
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq %rbx, %rdi
callq 0x2ea9
movb $0x0, 0x119(%rbx)
movabsq $0x4000000000, %rax     # imm = 0x4000000000
movq %rax, 0x168(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x11c(%rbx)
movl $0x0, 0x190(%rbx)
leaq 0x170(%rbx), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x158(%rbx)
callq 0xe1c4
leaq 0x198(%rbx), %rdi
callq 0xe1c4
leaq 0x1b8(%rbx), %rdi
callq 0xe1c4
leaq 0x1d8(%rbx), %rdi
callq 0xe1c4
leaq 0x278(%rbx), %rdi
callq 0xe1c4
addq $0x298, %rbx            # imm = 0x298
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xe1c4
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: destroy_module
static void destroy_module(void* p_module)
{
	script_module_t* module = p_module;

	vec_destroy(&module->referenced_modules);

	free(module->local_path);
	free(module->name);
	free(module->source_code);

	for(int i = 0; i < module->expr_list.length; ++i)
		delete_expr(vec_get_value(&module->expr_list, i, expr_t*));
	vec_destroy(&module->expr_list);

	vec_destroy(&module->compile_time_blocks);

	vec_destroy(&module->globals);
	vec_destroy(&module->functions);

	vec_traverse(&module->all_type_tags, destroy_type_tag);

	vec_destroy(&module->all_type_tags);
	map_destroy(&module->user_type_tags);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xe1d2
movq 0x40(%rbx), %rdi
callq 0x2030
movq 0x38(%rbx), %rdi
callq 0x2030
movq 0x30(%rbx), %rdi
callq 0x2030
leaq 0x50(%rbx), %r14
cmpq $0x0, 0x60(%rbx)
je 0x3063
xorl %r15d, %r15d
movq %r14, %rdi
movq %r15, %rsi
callq 0xdf24
movq (%rax), %rdi
callq 0x9b68
incq %r15
cmpq %r15, 0x60(%rbx)
ja 0x3047
movq %r14, %rdi
callq 0xe1d2
leaq 0x70(%rbx), %rdi
callq 0xe1d2
leaq 0x20f0(%rbx), %rdi
callq 0xe1d2
leaq 0x20d0(%rbx), %rdi
callq 0xe1d2
leaq 0x90(%rbx), %r14
leaq 0x6c99(%rip), %rsi      # 0x9d33
movq %r14, %rdi
callq 0xe189
movq %r14, %rdi
callq 0xe1d2
addq $0xb0, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xe5c4
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: pop_value
static script_value_t* pop_value(script_t* script)
{
	if(script->stack.length == 0) error_exit_script(script, "Stack underflow\n");
	
	script_value_t* val;
	vec_pop_back(&script->stack, &val);
	
	return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cmpq $0x0, 0x1a8(%rdi)
je 0x314e
addq $0x198, %rdi            # imm = 0x198
leaq -0x10(%rbp), %rbx
movq %rbx, %rsi
callq 0xdfda
movq (%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0xdbfd(%rip), %rsi      # 0x10d52
xorl %eax, %eax
callq 0x321a
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: script_push_bool
void script_push_bool(script_t* script, char bv)
{
	// NOTE: Singleton values
	// which never get gc'd
	static script_value_t true_val = { 0 };
	static script_value_t false_val = { 0 };

	true_val.type = VAL_BOOL;
	true_val.boolean = 1;
	
	false_val.type = VAL_BOOL;
	false_val.boolean = 0;

	push_value(script, bv ? &true_val : &false_val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x1, %eax
movl %eax, 0x13011(%rip)     # 0x1617c
leaq 0x12ffe(%rip), %rcx     # 0x16170
movb $0x1, 0x13017(%rip)     # 0x16190
movl %eax, 0x1303d(%rip)     # 0x161bc
leaq 0x1302a(%rip), %rax     # 0x161b0
movb $0x0, 0x13043(%rip)     # 0x161d0
testb %sil, %sil
cmovneq %rcx, %rax
movq %rax, %rsi
popq %rbp
jmp 0x319a
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: script_pop_bool
char script_pop_bool(script_t* script)
{	
	script_value_t* val = pop_value(script);
	if(val->type != VAL_BOOL)
		error_exit_script(script, "Expected bool but received %s\n", g_value_types[val->type]);

	return val->boolean;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3121
movl 0xc(%rax), %ecx
cmpq $0x1, %rcx
jne 0x31fe
movb 0x20(%rax), %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x129eb(%rip), %rax     # 0x15bf0
movq (%rax,%rcx,8), %rdx
leaq 0xc4ad(%rip), %rsi      # 0xf6bd
movq %rbx, %rdi
xorl %eax, %eax
callq 0x321a
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: error_exit_script
static void error_exit_script(script_t* script, const char* fmt, ...)
{
	fprintf(stderr, "\nError (%s:%i):\n", script->cur_file, script->cur_line);
	
	va_list args;
	va_start(args, fmt);
	vfprintf(stderr, fmt, args);
	va_end(args);
	
	fprintf(stderr, "\n");
	print_stack_trace(script);
	
	debug_script(script);

	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
testb %al, %al
je 0x3262
movaps %xmm0, -0xc0(%rbp)
movaps %xmm1, -0xb0(%rbp)
movaps %xmm2, -0xa0(%rbp)
movaps %xmm3, -0x90(%rbp)
movaps %xmm4, -0x80(%rbp)
movaps %xmm5, -0x70(%rbp)
movaps %xmm6, -0x60(%rbp)
movaps %xmm7, -0x50(%rbp)
leaq -0xf0(%rbp), %r15
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
movq 0x12d70(%rip), %r12     # 0x15ff0
movq (%r12), %rdi
movq 0x128(%rbx), %rdx
movl 0x124(%rbx), %ecx
leaq 0xcffe(%rip), %rsi      # 0x10296
xorl %eax, %eax
callq 0x2170
leaq -0x40(%rbp), %rdx
movq %r15, 0x10(%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq (%r12), %rdi
movq %r14, %rsi
callq 0x2200
movq (%r12), %rsi
movl $0xa, %edi
callq 0x2120
movq %rbx, %rdi
callq 0x2359
movq %rbx, %rdi
callq 0x503a
movl $0x1, %edi
callq 0x2230
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: new_value
static script_value_t* new_value(script_t* script, script_value_type_t type)
{
	if(!script->in_extern && script->num_objects >= script->max_objects_until_gc) collect_garbage(script); 
	
	script_value_t* val = get_heap_value(script);
	
	val->marked = 0;
	val->type = type;
	
	val->next = script->gc_head;
	script->gc_head = val;
	
	++script->num_objects;
	
	return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
cmpb $0x0, 0x119(%rdi)
jne 0x3476
movl 0x168(%rbx), %eax
cmpl 0x16c(%rbx), %eax
jl 0x3476
movq 0x160(%rbx), %rdi
testq %rdi, %rdi
je 0x335c
callq 0xa01d
cmpq $0x0, 0x1a8(%rbx)
je 0x338f
leaq 0x198(%rbx), %r15
xorl %r12d, %r12d
movq %r15, %rdi
movq %r12, %rsi
callq 0xdf24
movq (%rax), %rdi
callq 0xa01d
incq %r12
cmpq %r12, 0x1a8(%rbx)
ja 0x3370
cmpq $0x0, 0x180(%rbx)
je 0x33c2
leaq 0x170(%rbx), %r15
xorl %r12d, %r12d
movq %r15, %rdi
movq %r12, %rsi
callq 0xdf24
movq (%rax), %rdi
callq 0xa01d
incq %r12
cmpq %r12, 0x180(%rbx)
ja 0x33a3
movq 0x158(%rbx), %r13
testq %r13, %r13
je 0x3468
leaq 0x158(%rbx), %r12
leaq 0xbc90(%rip), %r15      # 0xf070
cmpb $0x0, 0x18(%r13)
je 0x33f5
movb $0x0, 0x18(%r13)
addq $0x10, %r13
movq %r13, %r12
jmp 0x345b
movq 0x10(%r13), %rax
movq %rax, (%r12)
decl 0x168(%rbx)
movl 0xc(%r13), %eax
addl $-0x4, %eax
cmpl $0x4, %eax
ja 0x3445
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
leaq 0x20(%r13), %rdi
callq 0xe1d2
jmp 0x3445
movq 0x28(%r13), %rdi
callq 0x2030
movq $0x0, 0x28(%r13)
jmp 0x3445
movq 0x30(%r13), %rax
testq %rax, %rax
je 0x3445
movq 0x20(%r13), %rdi
callq *%rax
movl 0x8(%r13), %eax
movq (%r13), %rcx
movslq 0x8(%rcx), %rdx
leal 0x1(%rdx), %esi
movl %esi, 0x8(%rcx)
movl %eax, 0xc(%rcx,%rdx,4)
movq (%r12), %r13
testq %r13, %r13
jne 0x33e0
movl 0x168(%rbx), %eax
addl %eax, %eax
movl %eax, 0x16c(%rbx)
movq %rbx, %rdi
callq 0x9fd2
movb $0x0, 0x18(%rax)
movl %r14d, 0xc(%rax)
movq 0x158(%rbx), %rcx
movq %rcx, 0x10(%rax)
movq %rax, 0x158(%rbx)
incl 0x168(%rbx)
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: script_pop_char
char script_pop_char(script_t* script)
{
	script_value_t* val = pop_value(script);
	if(val->type != VAL_CHAR)
		error_exit_script(script, "Expected char but received %s\n", g_value_types[val->type]);

	return val->code;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3121
movl 0xc(%rax), %ecx
cmpq $0x2, %rcx
jne 0x34ce
movb 0x20(%rax), %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x1271b(%rip), %rax     # 0x15bf0
movq (%rax,%rcx,8), %rdx
leaq 0xc1fc(%rip), %rsi      # 0xf6dc
movq %rbx, %rdi
xorl %eax, %eax
callq 0x321a
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: script_pop_number
double script_pop_number(script_t* script)
{
	script_value_t* val = pop_value(script);
	if(val->type != VAL_NUMBER)
		error_exit_script(script, "Expected number but received %s\n", g_value_types[val->type]);
	
	return val->number;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3121
movl 0xc(%rax), %ecx
cmpq $0x3, %rcx
jne 0x3540
movsd 0x20(%rax), %xmm0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x126a9(%rip), %rax     # 0x15bf0
movq (%rax,%rcx,8), %rdx
leaq 0xc1a9(%rip), %rsi      # 0xf6fb
movq %rbx, %rdi
xorl %eax, %eax
callq 0x321a
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: script_push_cstr
void script_push_cstr(script_t* script, const char* string)
{
	script_value_t* val = new_value(script, VAL_STRING);
	val->string.length = strlen(string);
	val->string.data = emalloc(val->string.length + 1);
	strcpy(val->string.data, string);
	
	push_value(script, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x4, %esi
callq 0x3318
movq %rax, %r15
movq %r14, %rdi
callq 0x20b0
movl %eax, 0x20(%r15)
leal 0x1(%rax), %edi
callq 0x21b0
testq %rax, %rax
je 0x35b6
movq %rax, 0x28(%r15)
movq %rax, %rdi
movq %r14, %rsi
callq 0x2050
movq %rbx, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x319a
leaq 0xe6da(%rip), %rdi      # 0x11c97
xorl %eax, %eax
callq 0x384e
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: script_push_string
void script_push_string(script_t* script, script_string_t string)
{
	script_value_t* val = new_value(script, VAL_STRING);
	val->string.length = string.length;
	val->string.data = emalloc(string.length + 1);
	strcpy(val->string.data, string.data);
	
	push_value(script, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %r12d
movq %rdi, %rbx
movl $0x4, %esi
callq 0x3318
movq %rax, %r15
movl %r12d, 0x20(%rax)
incl %r12d
movq %r12, %rdi
callq 0x21b0
testq %rax, %rax
je 0x361b
movq %rax, 0x28(%r15)
movq %rax, %rdi
movq %r14, %rsi
callq 0x2050
movq %rbx, %rdi
movq %r15, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x319a
leaq 0xe675(%rip), %rdi      # 0x11c97
xorl %eax, %eax
callq 0x384e
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: script_pop_string
script_string_t script_pop_string(script_t* script)
{
	script_value_t* val = pop_value(script);
	if (val->type != VAL_STRING)
		error_exit_script(script, "Expected string but received %s\n", g_value_types[val->type]);
	return val->string;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3121
movl 0xc(%rax), %ecx
cmpq $0x4, %rcx
jne 0x3650
movl 0x20(%rax), %ecx
movq 0x28(%rax), %rdx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x12599(%rip), %rax     # 0x15bf0
movq (%rax,%rcx,8), %rdx
leaq 0xc0ba(%rip), %rsi      # 0xf71c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x321a
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: script_push_array
void script_push_array(script_t* script, size_t length)
{
	script_value_t* val = new_value(script, VAL_ARRAY);
	vec_init(&val->array, sizeof(script_value_t*));
	vec_reserve(&val->array, length);
	push_value(script, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x6, %esi
callq 0x3318
movq %rax, %r15
leaq 0x20(%rax), %r12
movl $0x8, %esi
movq %r12, %rdi
callq 0xdcb4
movq %r12, %rdi
movq %rbx, %rsi
callq 0xdeac
movq %r14, %rdi
movq %r15, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x319a
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: script_push_native
void script_push_native(script_t* script, void* value, script_native_callback_t on_mark, script_native_callback_t on_delete)
{
	script_value_t* val = new_value(script, VAL_NATIVE);
	val->nat.value = value;
	val->nat.on_mark = on_mark;
	val->nat.on_delete = on_delete;
	push_value(script, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl $0x8, %esi
callq 0x3318
movq %r15, 0x20(%rax)
movq %r14, 0x28(%rax)
movq %rbx, 0x30(%rax)
movq %r12, %rdi
movq %rax, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x319a
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: script_load_parse_file
void script_load_parse_file(script_t* script, const char* filename, const char* module_name)
{
	FILE* in = fopen(filename, "rb");
	
	if (!in)
		error_exit("Failed to open file '%s'\n", filename);
	
	script_parse_file(script, in, filename, module_name);

	fclose(in);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq 0xbf72(%rip), %rsi      # 0xf77e
movq %rbx, %rdi
callq 0x21f0
testq %rax, %rax
je 0x383d
movq %rax, %r12
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x38fb
movq %r12, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x20a0
leaq 0xbf3d(%rip), %rdi      # 0xf781
movq %rbx, %rsi
xorl %eax, %eax
callq 0x384e
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: error_exit
static void error_exit(const char* fmt, ...)
{
	fprintf(stderr, "\nError:\n");
	
	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 0x388e
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 0x12740(%rip), %r15     # 0x15ff0
movq (%r15), %rcx
leaq 0xd529(%rip), %rdi      # 0x10de3
movl $0x8, %esi
movl $0x1, %edx
callq 0x2240
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: script_parse_file
void script_parse_file(script_t* script, FILE* in, const char* local_path, const char* module_name)
{
	fseek(in, 0, SEEK_END);
	size_t length = ftell(in);
	fseek(in, 0, SEEK_SET);
	
	char* str = emalloc(length + 1);
	fread(str, sizeof(char), length, in);
	str[length] = '\0';
	
	rewind(in);
	
	script_parse_code(script, str, local_path, module_name);
	
	free(str);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, -0x30(%rbp)
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq %rsi, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x21c0
movq %r12, %rdi
callq 0x2180
movq %rax, %r13
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21c0
leaq 0x1(%r13), %rdi
callq 0x21b0
testq %rax, %rax
je 0x3995
movq %rax, %rbx
movl $0x1, %esi
movq %rax, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0x2080
movb $0x0, (%rbx,%r13)
movq %r12, %rdi
callq 0x20e0
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq -0x30(%rbp), %rcx
callq 0x39a3
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2030
leaq 0xe2fb(%rip), %rdi      # 0x11c97
xorl %eax, %eax
callq 0x384e
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: script_parse_code
void script_parse_code(script_t* script, const char* code, const char* local_path, const char* module_name)
{
	g_file = local_path;
	g_code = code;
	g_line = 1;
	
	// NOTE: adding the current module in and parsing it
	int current_module_index = add_module(script, local_path, module_name, code);

	script_module_t* module = vec_get(&script->modules, current_module_index);
	
	if (!module->parsed)
	{
		g_cur_module_index = current_module_index;
			
		parse_program(script, &module->expr_list);
		module->parsed = 1;
	}

	// NOTE: parse any unparsed modules
	for(int i = 0; i < script->modules.length; ++i)
	{
		script_module_t* module = vec_get(&script->modules, i);
		
		if(!module->parsed)
		{
			g_file = module->local_path;
			g_line = 1;
			g_code = module->source_code;
			g_cur_module_index = i;
			
			// NOTE: new modules *might* result
			// in a relocation of the module values (i.e a vec_realloc call could result in the 
			// vec.data being moved somewhere else leaving this "module" pointer invalid)
			
			// NOTE: this should not be 'destroyed' because
			// it is being copied into module->expr_list 
			vector_t expr_list;
			vec_init(&expr_list, sizeof(expr_t*));
			
			parse_program(script, &expr_list);
			
			// NOTE: the module pointer must be reset for above reason
			module = vec_get(&script->modules, i);
			module->expr_list = expr_list;
			module->parsed = 1;
		}
	}
	
	if(g_has_error) error_exit("Found errors in script code. Stopping compilation\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rax
movq %rdi, %rbx
movq %rdx, 0x12791(%rip)     # 0x16150
movq %rsi, 0x1286a(%rip)     # 0x16230
movl $0x1, 0x12778(%rip)     # 0x16148
movq %rdx, %rsi
movq %rcx, %rdx
movq %rax, %rcx
callq 0x3acc
movl %eax, %r15d
leaq 0x2b8(%rbx), %r14
movslq %eax, %rsi
movq %r14, %rdi
callq 0xdf24
cmpb $0x0, 0x48(%rax)
jne 0x3a18
movq %rax, %r12
movl %r15d, 0x12835(%rip)    # 0x16238
movq %rax, %rsi
addq $0x50, %rsi
movq %rbx, %rdi
callq 0x3c52
movb $0x1, 0x48(%r12)
cmpq $0x0, 0x2c8(%rbx)
je 0x3aa8
xorl %r15d, %r15d
leaq -0x40(%rbp), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0xdf24
cmpb $0x0, 0x48(%rax)
jne 0x3a9c
movq 0x40(%rax), %rcx
movq %rcx, 0x12707(%rip)     # 0x16150
movl $0x1, 0x126f5(%rip)     # 0x16148
movq 0x30(%rax), %rax
movq %rax, 0x127d2(%rip)     # 0x16230
movl %r15d, 0x127d3(%rip)    # 0x16238
movl $0x8, %esi
movq %r12, %rdi
callq 0xdcb4
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3c52
movq %r14, %rdi
movq %r15, %rsi
callq 0xdf24
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups %xmm0, 0x50(%rax)
movups %xmm1, 0x60(%rax)
movb $0x1, 0x48(%rax)
incq %r15
cmpq %r15, 0x2c8(%rbx)
ja 0x3a2d
cmpb $0x0, 0x1278d(%rip)     # 0x1623c
jne 0x3abe
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbcd6(%rip), %rdi      # 0xf79b
xorl %eax, %eax
callq 0x384e
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: add_module
static int add_module(script_t* script, const char* local_path, const char* module_name, const char* code)
{
	// NOTE: This'll slow down add module a bit (but who cares, how many modules could you possibly have :)
	if (local_path)
	{
		for (int i = 0; i < script->modules.length; ++i)
		{
			script_module_t* module = vec_get(&script->modules, i);
			if (module->local_path)
			{
				if (strcmp(module->local_path, local_path) == 0)
					return i;
			}
		}
	}
	
	script_module_t module;
	
	module.start_pc = -1;
	module.end_pc = -1;
	module.name = module_name ? estrdup(module_name) : NULL;
	module.local_path = local_path ? estrdup(local_path) : NULL;
	module.source_code = estrdup(code);
	module.parsed = 0;
	module.compiled = 0;
	
	vec_init(&module.referenced_modules, sizeof(int));

	vec_init(&module.expr_list, sizeof(expr_t*));
	vec_init(&module.compile_time_blocks, sizeof(expr_t*));
	
	vec_init(&module.globals, sizeof(var_decl_t*));
	vec_init(&module.functions, sizeof(func_decl_t*));
	vec_init(&module.all_type_tags, sizeof(type_tag_t*));
	map_init(&module.user_type_tags);

	vec_push_back(&script->modules, &module);
	return script->modules.length - 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2138, %rsp           # imm = 0x2138
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %rsi, %rsi
je 0x3b6a
movq %rdx, -0x40(%rbp)
movq %r14, -0x38(%rbp)
movq %rbx, -0x48(%rbp)
cmpq $0x0, 0x2c8(%r15)
setne %bl
je 0x3b52
leaq 0x2b8(%r15), %r14
xorl %r12d, %r12d
movq %r14, %rdi
movq %r12, %rsi
callq 0xdf24
movq 0x40(%rax), %rdi
movb $0x1, %r13b
testq %rdi, %rdi
je 0x3b3c
movq -0x38(%rbp), %rsi
callq 0x2150
testl %eax, %eax
jne 0x3b3c
xorl %r13d, %r13d
movl %r12d, -0x2c(%rbp)
testb %r13b, %r13b
je 0x3b52
incq %r12
cmpq %r12, 0x2c8(%r15)
seta %bl
ja 0x3b11
jmp 0x3b52
testb $0x1, %bl
movq -0x48(%rbp), %rbx
movq -0x38(%rbp), %r14
movq -0x40(%rbp), %rdx
movl -0x2c(%rbp), %eax
jne 0x3c40
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, -0x2138(%rbp)
testq %rdx, %rdx
je 0x3b85
movq %rdx, %rdi
callq 0x2807
jmp 0x3b87
xorl %eax, %eax
movq %rax, -0x2120(%rbp)
testq %r14, %r14
je 0x3b9d
movq %r14, %rdi
callq 0x2807
jmp 0x3b9f
xorl %eax, %eax
leaq -0x2158(%rbp), %r14
movq %rax, 0x40(%r14)
movq %rbx, %rdi
callq 0x2807
movq %rax, 0x30(%r14)
movw $0x0, 0x48(%r14)
movl $0x4, %esi
movq %r14, %rdi
callq 0xdcb4
leaq -0x2108(%rbp), %rdi
movl $0x8, %esi
callq 0xdcb4
leaq -0x20e8(%rbp), %rdi
movl $0x8, %esi
callq 0xdcb4
leaq -0x68(%rbp), %rdi
movl $0x8, %esi
callq 0xdcb4
leaq -0x88(%rbp), %rdi
movl $0x8, %esi
callq 0xdcb4
leaq -0x20c8(%rbp), %rdi
movl $0x8, %esi
callq 0xdcb4
leaq -0x20a8(%rbp), %rdi
callq 0xe200
leaq 0x2b8(%r15), %rdi
movq %r14, %rsi
callq 0xdf81
movl 0x2c8(%r15), %eax
decl %eax
addq $0x2138, %rsp           # imm = 0x2138
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: parse_program
static void parse_program(script_t* script, vector_t* program)
{
	get_token(1);
	get_next_token();
	
	while(g_cur_tok != TOK_EOF)
	{
		expr_t* e = parse_expr(script);
		if (!e) break;
		vec_push_back(program, &e);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl $0x20, 0x124e7(%rip)    # 0x16158
xorl %edi, %edi
callq 0xa0ca
movl %eax, 0x126d2(%rip)     # 0x16350
cmpl $0x32, %eax
je 0x3cb4
leaq -0x28(%rbp), %r15
movq %r14, %rdi
callq 0xac14
movq %rax, %r12
movq %rax, -0x28(%rbp)
testq %rax, %rax
je 0x3ca6
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdf81
testq %r12, %r12
je 0x3cb4
cmpl $0x32, 0x1269e(%rip)    # 0x16350
jne 0x3c87
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: script_run
void script_run(script_t* script)
{
	allocate_globals(script);
	vec_clear(&script->stack);
	
	// NOTE: making sure that compile-time externs
	// cannot be called at this point
	g_cur_module_index = -1;
	
	script->pc = 0;
	while(script->pc >= 0)
		script_execute_cycle(script);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4571
leaq 0x198(%rbx), %rdi
callq 0xe1c4
movl $0xffffffff, 0x11ce9(%rip) # imm = 0xFFFFFFFF
movl $0x0, 0x11c(%rbx)
movq %rbx, %rdi
callq 0x45f3
cmpl $0x0, 0x11c(%rbx)
jns 0x4559
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: allocate_globals
static void allocate_globals(script_t* script)
{
	static script_value_t null_val;
	null_val.type = VAL_NULL;

	script_value_t* pv = &null_val;

	int num_globals = 0;
	for (int i = 0; i < script->modules.length; ++i)
	{
		script_module_t* module = vec_get(&script->modules, i);
		num_globals += module->globals.length;
	}

	vec_resize(&script->globals, num_globals, &pv);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x0, 0x11eef(%rip)     # 0x1647c
leaq 0x11edc(%rip), %rax     # 0x16470
movq %rax, -0x28(%rbp)
xorl %r14d, %r14d
cmpq $0x0, 0x2c8(%rdi)
je 0x45d0
leaq 0x2b8(%rbx), %r15
xorl %r12d, %r12d
movq %r15, %rdi
movq %r12, %rsi
callq 0xdf24
addl 0x2100(%rax), %r14d
incq %r12
cmpq %r12, 0x2c8(%rbx)
ja 0x45af
movslq %r14d, %r14
addq $0x170, %rbx            # imm = 0x170
leaq -0x28(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xdec2
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: script_start
void script_start(script_t* script)
{
	allocate_globals(script);
	vec_clear(&script->stack);
	
	g_cur_module_index = -1;

	script->pc = 0;

	// NOTE: All global code needs to be run at startup
	// because otherwise globals remain uninitialized
	// etc
	while (script->pc >= 0)
		script_execute_cycle(script);
	
	script->pc = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4571
leaq 0x198(%rbx), %rdi
callq 0xe1c4
movl $0xffffffff, 0x1122a(%rip) # imm = 0xFFFFFFFF
movl $0x0, 0x11c(%rbx)
movq %rbx, %rdi
callq 0x45f3
cmpl $0x0, 0x11c(%rbx)
jns 0x5018
movl $0x0, 0x11c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: script_get_function_by_name
char script_get_function_by_name(script_t* script, const char* name, script_function_t* function)
{
	for(int i = 0; i < script->function_names.length; ++i)
	{
		char* func_name = vec_get_value(&script->function_names, i, char*);
		if(strcmp(name, func_name) == 0)
		{
			function->index = i;
			function->is_extern = 0;
			return 1;
		}
	}
	
	for(int i = 0; i < script->extern_names.length; ++i)
	{
		char* extern_name = vec_get_value(&script->extern_names, i, char*);
		if(strcmp(name, extern_name) == 0)
		{
			function->index = i;
			function->is_extern = 1;
			return 1;
		}
	}
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, -0x30(%rbp)
movq %rsi, %r14
movq %rdi, %r15
cmpq $0x0, 0x288(%rdi)
setne %bl
je 0x582e
leaq 0x278(%r15), %r13
xorl %r12d, %r12d
movq %r13, %rdi
xorl %esi, %esi
callq 0xdf24
movq (%rax), %rsi
movq %r14, %rdi
callq 0x2150
testl %eax, %eax
je 0x581c
xorl %r12d, %r12d
incq %r12
cmpq %r12, 0x288(%r15)
seta %bl
jbe 0x582e
movq %r13, %rdi
movq %r12, %rsi
callq 0xdf24
movq (%rax), %rsi
movq %r14, %rdi
callq 0x2150
testl %eax, %eax
jne 0x57f3
movq -0x30(%rbp), %rax
movl %r12d, 0x4(%rax)
movb $0x0, (%rax)
movb $0x1, %r12b
testb %bl, %bl
jne 0x5897
cmpq $0x0, 0x248(%r15)
setne %r12b
je 0x5897
leaq 0x238(%r15), %rbx
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %esi, %esi
callq 0xdf24
movq (%rax), %rsi
movq %r14, %rdi
callq 0x2150
testl %eax, %eax
je 0x588c
xorl %r13d, %r13d
incq %r13
cmpq %r13, 0x248(%r15)
seta %r12b
jbe 0x5897
movq %rbx, %rdi
movq %r13, %rsi
callq 0xdf24
movq (%rax), %rsi
movq %r14, %rdi
callq 0x2150
testl %eax, %eax
jne 0x5862
movq -0x30(%rbp), %rax
movl %r13d, 0x4(%rax)
movb $0x1, (%rax)
movl %r12d, %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: script_call_function
void script_call_function(script_t* script, script_function_t function, int nargs)
{
	int depth = script->indir_depth;
	push_stack_frame(script, (word)nargs);
	script->pc = vec_get_value(&script->function_pcs, function.index, int);
	
	while (script->indir_depth > depth && script->pc >= 0)
		script_execute_cycle(script);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x190(%rdi), %r15d
movzbl %dl, %esi
callq 0x590a
leaq 0x298(%rbx), %rdi
sarq $0x20, %r14
movq %r14, %rsi
callq 0xdf24
movl (%rax), %eax
movl %eax, 0x11c(%rbx)
cmpl %r15d, 0x190(%rbx)
jle 0x58ff
cmpl $0x0, 0x11c(%rbx)
js 0x58ff
movq %rbx, %rdi
callq 0x45f3
jmp 0x58e3
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_stack_frame
static void push_stack_frame(script_t* script, word nargs)
{
	int i_nargs = (int)nargs;

	vec_push_back(&script->indir, &i_nargs);
	vec_push_back(&script->indir, &script->fp);
	vec_push_back(&script->indir, &script->pc);
	
	script->fp = script->stack.length;
	++script->indir_depth;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq -0x14(%rbp), %rax
movl %esi, (%rax)
leaq 0x1b8(%rdi), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0xdf81
leaq 0x120(%rbx), %rsi
movq %r14, %rdi
callq 0xdf81
leaq 0x11c(%rbx), %rsi
movq %r14, %rdi
callq 0xdf81
movl 0x1a8(%rbx), %eax
movl %eax, 0x120(%rbx)
incl 0x190(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: script_destroy
void script_destroy(script_t* script)
{
	vec_traverse(&script->modules, destroy_module);
	vec_destroy(&script->modules);
	
	destroy_all_values(script);
	
	vec_destroy(&script->globals);
	
	vec_destroy(&script->code);
	
	vec_destroy(&script->stack);
	vec_destroy(&script->indir);
	
	vec_destroy(&script->numbers);
	
	vec_traverse(&script->strings, destroy_string);
	vec_destroy(&script->strings);
	
	vec_traverse(&script->extern_names, destroy_cstring);
	vec_destroy(&script->extern_names);
	
	vec_destroy(&script->externs);
	
	vec_traverse(&script->function_names, destroy_cstring);
	vec_destroy(&script->function_names);
	
	vec_destroy(&script->function_pcs);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x2b8(%rdi), %r14
leaq -0x29ae(%rip), %rsi     # 0x300c
movq %r14, %rdi
callq 0xe189
movq %r14, %rdi
callq 0xe1d2
movq 0x150(%rbx), %rdi
testq %rdi, %rdi
je 0x59e6
movq (%rdi), %r14
callq 0x2030
movq %r14, %rdi
testq %r14, %r14
jne 0x59d6
movq $0x0, 0x158(%rbx)
leaq 0x170(%rbx), %rdi
callq 0xe1d2
leaq 0x1d8(%rbx), %rdi
callq 0xe1d2
leaq 0x198(%rbx), %rdi
callq 0xe1d2
leaq 0x1b8(%rbx), %rdi
callq 0xe1d2
leaq 0x1f8(%rbx), %rdi
callq 0xe1d2
leaq 0x218(%rbx), %r14
leaq 0x70(%rip), %rsi        # 0x5aab
movq %r14, %rdi
callq 0xe189
movq %r14, %rdi
callq 0xe1d2
leaq 0x238(%rbx), %r14
leaq 0x71(%rip), %r15        # 0x5aca
movq %r14, %rdi
movq %r15, %rsi
callq 0xe189
movq %r14, %rdi
callq 0xe1d2
leaq 0x258(%rbx), %rdi
callq 0xe1d2
leaq 0x278(%rbx), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0xe189
movq %r14, %rdi
callq 0xe1d2
addq $0x298, %rbx            # imm = 0x298
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xe1d2
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: ext_unmarshal
static void ext_unmarshal(script_t* script, vector_t* args)
{
	script_value_t* desc_val = script_get_arg(args, 0);
	script_value_t* mem_val = script_get_arg(args, 1);

	const char* desc = desc_val->string.data;
	char* mem = (char*)mem_val->nat.value;
	
	script_value_t* val = unmarshal(script, &desc, &mem);
	if (!val)
	{
		script_push_null(script);
		script_return_top(script);
	}
	else
	{
		push_value(script, val);
		script_return_top(script);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
xorl %esi, %esi
callq 0xdf24
movq (%rax), %r15
movl $0x1, %esi
movq %r14, %rdi
callq 0xdf24
movq (%rax), %rax
movq 0x28(%r15), %rcx
leaq -0x28(%rbp), %rsi
movq %rcx, (%rsi)
movq 0x20(%rax), %rax
leaq -0x20(%rbp), %rdx
movq %rax, (%rdx)
movq %rbx, %rdi
callq 0x7a69
testq %rax, %rax
jne 0x5b3b
movl $0x0, 0x106c8(%rip)     # 0x161fc
leaq 0x106b5(%rip), %rax     # 0x161f0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x319a
movq %rbx, %rdi
callq 0x3121
movq %rax, 0x160(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: ext_debug_break
static void ext_debug_break(script_t* script, vector_t* args)
{
	// NOTE: HACK: pop call record off because we want to be
	// in the scope of the enclosing function
	script_call_record_t record = vec_get_value(&script->call_records, script->call_records.length - 1, script_call_record_t);
	pop_call_record(script);

	debug_script(script);
	
	vec_push_back(&script->call_records, &record);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdi, %r14
leaq 0x130(%rdi), %rbx
movq 0x140(%rdi), %rsi
decq %rsi
movq %rbx, %rdi
callq 0xdf24
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movaps %xmm0, -0x40(%rbp)
movaps %xmm1, -0x30(%rbp)
movaps %xmm2, -0x20(%rbp)
cmpq $0x0, 0x140(%r14)
je 0x5bb4
leaq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0xdfda
movq %r14, %rdi
callq 0x503a
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0xdf81
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: ext_add_module
static void ext_add_module(script_t* script, vector_t* args)
{
	script_value_t* name_val = script_get_arg(args, 0);
	script_value_t* code_val = script_get_arg(args, 1);
	
	const char* name = name_val->string.data;
	const char* code = code_val->string.data;
	
	script_parse_code(script, code, NULL, name);
	script_push_number(script, script->modules.length - 1);
	script_return_top(script);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
xorl %esi, %esi
callq 0xdf24
movq (%rax), %r15
movl $0x1, %esi
movq %r14, %rdi
callq 0xdf24
movq (%rax), %rax
movq 0x28(%r15), %rcx
movq 0x28(%rax), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x39a3
movq 0x2c8(%rbx), %rax
decq %rax
movq %rax, %xmm0
punpckldq 0x9426(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x942e(%rip), %xmm0     # 0xf060
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, -0x30(%rbp)
movq %rbx, %rdi
movl $0x3, %esi
callq 0x3318
movaps -0x30(%rbp), %xmm0
movsd %xmm0, 0x20(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x319a
movq %rbx, %rdi
callq 0x3121
movq %rax, 0x160(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: ext_load_module
static void ext_load_module(script_t* script, vector_t* args)
{
	script_value_t* name_val = script_get_arg(args, 0);
	script_value_t* path_val = script_get_arg(args, 1);

	const char* name = name_val->string.data;
	const char* path = path_val->string.data;

	script_load_parse_file(script, path, name);
	script_push_number(script, script->modules.length - 1);
	script_return_top(script);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
xorl %esi, %esi
callq 0xdf24
movq (%rax), %r15
movl $0x1, %esi
movq %r14, %rdi
callq 0xdf24
movq (%rax), %rax
movq 0x28(%r15), %rdx
movq 0x28(%rax), %rsi
movq %rbx, %rdi
callq 0x37f1
movq 0x2c8(%rbx), %rax
decq %rax
movq %rax, %xmm0
punpckldq 0x937b(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x9383(%rip), %xmm0     # 0xf060
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, -0x30(%rbp)
movq %rbx, %rdi
movl $0x3, %esi
callq 0x3318
movaps -0x30(%rbp), %xmm0
movsd %xmm0, 0x20(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x319a
movq %rbx, %rdi
callq 0x3121
movq %rax, 0x160(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: ext_compile_module
static void ext_compile_module(script_t* script, vector_t* args)
{
	append_code(script, OP_HALT);
	
	script_value_t* idx_val = script_get_arg(args, 0);
	int module_index = (int)idx_val->number;
	
	script_module_t* module = vec_get(&script->modules, module_index);
	compile_module(script, module);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x11(%rbp), %rsi
movb $0x30, (%rsi)
addq $0x1d8, %rdi            # imm = 0x1D8
callq 0xdf81
movq %rbx, %rdi
xorl %esi, %esi
callq 0xdf24
movq (%rax), %rax
cvttsd2si 0x20(%rax), %eax
leaq 0x2b8(%r14), %rdi
movslq %eax, %rsi
callq 0xdf24
movq %r14, %rdi
movq %rax, %rsi
callq 0x3d15
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: ext_run_module
static void ext_run_module(script_t* script, vector_t* args)
{
	script_value_t* idx_val = script_get_arg(args, 0);
	int module_index = (int)idx_val->number;
	
	script_module_t* module = vec_get(&script->modules, module_index);

	if(!module->compiled)
		error_exit_script(script, "Attempting to run an uncompiled module '%s'\n", module->name);

	int pc = script->pc;
	script->pc = module->start_pc;
	
	while (script->pc >= 0 && script->pc < module->end_pc)
		script_execute_cycle(script);

	script->pc = pc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, %rdi
xorl %esi, %esi
callq 0xdf24
movq (%rax), %rax
cvttsd2si 0x20(%rax), %eax
leaq 0x2b8(%rbx), %rdi
movslq %eax, %rsi
callq 0xdf24
movq %rax, %r14
cmpb $0x0, 0x49(%rax)
je 0x5df8
movl 0x11c(%rbx), %r15d
movl 0x20(%r14), %eax
movl %eax, 0x11c(%rbx)
testl %eax, %eax
js 0x5de6
movl %eax, %eax
cmpq %rax, 0x28(%r14)
jbe 0x5de6
movq %rbx, %rdi
callq 0x45f3
movl 0x11c(%rbx), %eax
jmp 0x5dca
movl %r15d, 0x11c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x38(%r14), %rdx
leaq 0x9dd2(%rip), %rsi      # 0xfbd5
movq %rbx, %rdi
xorl %eax, %eax
callq 0x321a