LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/common/utils.c
// Function: subtilis_make_cmdline
char *subtilis_make_cmdline(int argc, char **argv, subtilis_error_t *err)
{
	size_t size = 0;
	size_t i;
	char *ret_val;

	for (i = 1; i < argc; i++)
		size += strlen(argv[i]) + 1;

	if (size < 2) {
		subtilis_error_set_assertion_failed(err);
		return NULL;
	}

	ret_val = malloc(size);
	if (!ret_val) {
		subtilis_error_set_oom(err);
		return NULL;
	}
	ret_val[0] = 0;

	for (i = 1; i < argc - 1; i++) {
		strcat(ret_val, argv[i]);
		strcat(ret_val, " ");
	}
	strcat(ret_val, argv[i]);

	return ret_val;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
cmpl $0x2, %edi
jb 0x14949
movq %rsi, %rbx
movl %edi, %ebp
movslq %edi, %r12
movl $0x1, %r13d
xorl %r15d, %r15d
movq (%rbx,%r13,8), %rdi
callq 0x120f0
addq %rax, %r15
incq %r15
incq %r13
cmpq %r13, %r12
jne 0x1492c
cmpq $0x1, %r15
ja 0x14973
leaq 0x5e5d9(%rip), %rdx     # 0x72f29
movq %r14, %rdi
movl $0xf, %esi
movl $0x59, %ecx
callq 0x145a4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x121d0
testq %rax, %rax
je 0x149d9
movq %rax, %r15
movb $0x0, (%rax)
decl %ebp
movl $0x1, %r14d
cmpl $0x2, %ebp
jb 0x149bf
movslq %ebp, %r14
movl $0x1, %r12d
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
callq 0x12270
movq %r15, %rdi
callq 0x120f0
movw $0x20, (%r15,%rax)
incq %r12
cmpq %r12, %r14
jne 0x1499c
movq (%rbx,%r14,8), %rsi
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x12270
leaq 0x5e549(%rip), %rdx     # 0x72f29
movq %r14, %rdi
movl $0x1, %esi
movl $0x5f, %ecx
jmp 0x1495d
nop
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/common/buffer.c
// Function: subtilis_buffer_reserve
void subtilis_buffer_reserve(subtilis_buffer_t *buffer, size_t length,
			     subtilis_error_t *err)
{
	size_t rem = 0;
	size_t new_max_size = 0;
	size_t extra_space = sizeof(subtilis_fixed_buffer_t);
	subtilis_fixed_buffer_t *b = buffer->buffer;

	if (b) {
		length += b->start;
		if (length <= b->max_size)
			return;
	}
	rem = length % buffer->granularity;
	new_max_size =
	    (rem == 0) ? length : (length - rem) + buffer->granularity;

	b = (subtilis_fixed_buffer_t *)realloc(buffer->buffer,
					       new_max_size + extra_space);
	if (!b) {
		subtilis_error_set_oom(err);
		return;
	}

	if (!buffer->buffer) {
		b->start = 0;
		b->end = 0;
	}
	b->max_size = new_max_size;
	buffer->buffer = b;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x14a1d
addq 0x8(%rdi), %rsi
cmpq (%rdi), %rsi
jbe 0x14a58
movq (%rbx), %r15
movq %rsi, %rax
xorl %edx, %edx
divq %r15
addq %rsi, %r15
subq %rdx, %r15
testq %rdx, %rdx
cmoveq %rsi, %r15
leaq 0x20(%r15), %rsi
callq 0x12210
testq %rax, %rax
je 0x14a5e
cmpq $0x0, 0x8(%rbx)
jne 0x14a51
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %r15, (%rax)
movq %rax, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x5ea14(%rip), %rdx     # 0x73479
movq %r14, %rdi
movl $0x1, %esi
movl $0x30, %ecx
popq %rbx
popq %r14
popq %r15
jmp 0x145a4
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/common/buffer.c
// Function: subtilis_buffer_expand_if_full
void subtilis_buffer_expand_if_full(subtilis_buffer_t *buffer,
				    subtilis_error_t *err)
{
	subtilis_fixed_buffer_t *b = buffer->buffer;

	if (!b)
		subtilis_buffer_reserve(buffer, buffer->granularity, err);
	else if ((b->max_size - b->end) == 0)
		subtilis_buffer_reserve(buffer,
					buffer->granularity + b->max_size, err);
}

// Assembly:
movq %rsi, %rdx
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x14a99
movq (%rax), %rsi
cmpq 0x10(%rax), %rsi
jne 0x14aa1
addq (%rdi), %rsi
jmp 0x14a00
movq (%rdi), %rsi
jmp 0x14a00
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/common/buffer.c
// Function: subtilis_buffer_append_reserve
void subtilis_buffer_append_reserve(subtilis_buffer_t *buffer, size_t length,
				    subtilis_error_t *err)
{
	size_t new_end = length;
	size_t new_length;
	subtilis_fixed_buffer_t *b = buffer->buffer;

	if (b) {
		new_end += b->end;
		new_length = new_end - b->start;
	} else {
		new_length = length;
	}

	subtilis_buffer_reserve(buffer, new_length, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	b = buffer->buffer;
	b->end = new_end;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x14ac6
addq 0x10(%rax), %rbx
movq %rbx, %rsi
subq 0x8(%rax), %rsi
jmp 0x14ac9
movq %rbx, %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x14a00
cmpl $0x0, (%r15)
jne 0x14ae2
movq 0x8(%r14), %rax
movq %rbx, 0x10(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/common/buffer.c
// Function: subtilis_buffer_append
void subtilis_buffer_append(subtilis_buffer_t *buffer, const void *data,
			    size_t length, subtilis_error_t *err)
{
	size_t old_size;

	if (length == 0)
		return;

	old_size = subtilis_buffer_get_size(buffer);

	subtilis_buffer_append_reserve(buffer, length, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	(void)memcpy(buffer->buffer->data + old_size, data, length);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdx, %rdx
je 0x14b2d
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x14b15
movq 0x10(%rax), %r13
subq 0x8(%rax), %r13
jmp 0x14b18
xorl %r13d, %r13d
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x14aa2
cmpl $0x0, (%r12)
je 0x14b37
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x8(%r15), %rax
leaq (%rax,%r13), %rdi
addq $0x18, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x121b0
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/common/buffer.c
// Function: subtilis_buffer_insert
void subtilis_buffer_insert(subtilis_buffer_t *buffer, size_t pos,
			    const void *data, size_t length,
			    subtilis_error_t *err)
{
	size_t new_length;
	void *move_from;
	subtilis_fixed_buffer_t *b;
	size_t size = subtilis_buffer_get_size(buffer);

	if (pos > size) {
		subtilis_error_set_assertion_failed(err);
		return;
	}

	new_length = size + length;

	subtilis_buffer_reserve(buffer, new_length, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	b = buffer->buffer;
	move_from = b->data + pos + b->start;
	if (pos < size)
		memmove(((char *)move_from) + length, move_from, size - pos);

	memcpy(move_from, data, length);
	b->end += length;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r13
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbp
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x14be3
movq 0x10(%rax), %r15
subq 0x8(%rax), %r15
jmp 0x14be6
xorl %r15d, %r15d
cmpq %r12, %r15
jae 0x14c12
leaq 0x5e887(%rip), %rdx     # 0x73479
movq %r13, %rdi
movl $0xf, %esi
movl $0x8c, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x145a4
leaq (%r15,%rbx), %rsi
movq %rbp, %rdi
movq %r13, %rdx
callq 0x14a00
cmpl $0x0, (%r13)
jne 0x14c62
movq 0x8(%rbp), %rbp
leaq (%r12,%rbp), %rax
movq 0x8(%rbp), %rcx
leaq (%rcx,%rax), %r13
addq $0x18, %r13
subq %r12, %r15
jbe 0x14c50
leaq (%rbx,%r13), %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x12230
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x121b0
addq %rbx, 0x10(%rbp)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/common/buffer.c
// Function: subtilis_buffer_delete
void subtilis_buffer_delete(subtilis_buffer_t *buffer, size_t pos,
			    size_t length, subtilis_error_t *err)
{
	size_t last_pos = pos + length;
	void *move_to;
	void *move_from;
	size_t bytes_to_move;
	subtilis_fixed_buffer_t *b = buffer->buffer;
	size_t size;

	if (!b) {
		subtilis_error_set_assertion_failed(err);
		return;
	}

	size = b->end - b->start;

	if (last_pos > size) {
		subtilis_error_set_assertion_failed(err);
		return;
	}

	if (last_pos == size) {
		b->end = pos + b->start;
	} else {
		move_to = ((char *)b->data) + pos + b->start;
		move_from = ((char *)move_to) + length;
		bytes_to_move = size - last_pos;
		memmove(move_to, move_from, bytes_to_move);
		b->end -= length;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rdi), %r14
testq %r14, %r14
je 0x14cab
movq %rdx, %rbx
leaq (%rdx,%rsi), %rdi
movq 0x8(%r14), %rax
movq 0x10(%r14), %rdx
subq %rax, %rdx
subq %rdi, %rdx
jae 0x14ccb
leaq 0x5e7dd(%rip), %rdx     # 0x73479
movq %rcx, %rdi
movl $0xf, %esi
movl $0xb1, %ecx
jmp 0x14cbf
leaq 0x5e7c7(%rip), %rdx     # 0x73479
movq %rcx, %rdi
movl $0xf, %esi
movl $0xaa, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x145a4
jne 0x14cd2
addq %rsi, %rax
jmp 0x14cf5
addq %r14, %rsi
leaq (%rsi,%rax), %rcx
leaq (%rax,%rsi), %rdi
addq $0x18, %rdi
leaq (%rbx,%rcx), %rsi
addq $0x18, %rsi
callq 0x12230
movq 0x10(%r14), %rax
subq %rbx, %rax
movq %rax, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/common/buffer.c
// Function: subtilis_buffer_zero_terminate
void subtilis_buffer_zero_terminate(subtilis_buffer_t *buffer,
				    subtilis_error_t *err)
{
	uint8_t zero = 0;
	subtilis_fixed_buffer_t *b = buffer->buffer;

	if (!b || (b->start == b->end) || (((char *)b->data)[b->end - 1] != 0))
		subtilis_buffer_append(buffer, &zero, 1, err);
}

// Assembly:
pushq %rax
movq %rsi, %rcx
movb $0x0, 0x7(%rsp)
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x14d24
movq 0x10(%rax), %rdx
cmpq %rdx, 0x8(%rax)
je 0x14d24
cmpb $0x0, 0x17(%rax,%rdx)
je 0x14d33
leaq 0x7(%rsp), %rsi
movl $0x1, %edx
callq 0x14ae8
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/common/buffer.c
// Function: subtilis_buffer_remove_terminator
void subtilis_buffer_remove_terminator(subtilis_buffer_t *buffer)
{
	subtilis_fixed_buffer_t *b = buffer->buffer;

	if (!b)
		return;

	while ((b->end > b->start) && (((char *)b->data)[b->end - 1] == 0))
		b->end--;
}

// Assembly:
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x14d5b
movq 0x8(%rax), %rcx
movq 0x10(%rax), %rdx
cmpq %rcx, %rdx
jbe 0x14d5b
cmpb $0x0, 0x17(%rax,%rdx)
jne 0x14d5b
decq %rdx
movq %rdx, 0x10(%rax)
jmp 0x14d46
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser.c
// Function: subtilis_parser_delete
void subtilis_parser_delete(subtilis_parser_t *p)
{
	size_t i;

	if (!p)
		return;

	for (i = 0; i < p->num_calls; i++)
		subtilis_parser_call_delete(p->calls[i]);
	free(p->calls);

	for (i = 0; i < p->num_call_addrs; i++)
		subtilis_parser_call_addr_delete(p->call_addrs[i]);
	free(p->call_addrs);

	subtilis_ir_prog_delete(p->prog);
	subtilis_symbol_table_delete(p->main_st);
	subtilis_symbol_table_delete(p->st);
	free(p);
}

// Assembly:
testq %rdi, %rdi
je 0x15088
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x80(%rdi)
je 0x1501d
xorl %r14d, %r14d
movq 0x90(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x35a74
incq %r14
cmpq 0x80(%rbx), %r14
jb 0x15001
movq 0x90(%rbx), %rdi
callq 0x122c0
cmpq $0x0, 0x98(%rbx)
je 0x15052
xorl %r14d, %r14d
movq 0xa8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x35b52
incq %r14
cmpq 0x98(%rbx), %r14
jb 0x15036
movq 0xa8(%rbx), %rdi
callq 0x122c0
movq 0x58(%rbx), %rdi
callq 0x2c14d
movq 0x70(%rbx), %rdi
callq 0x2e2c2
movq 0x60(%rbx), %rdi
callq 0x2e2c2
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x122c0
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser.c
// Function: subtilis_parser_statement
void subtilis_parser_statement(subtilis_parser_t *p, subtilis_token_t *t,
			       subtilis_error_t *err)
{
	subtilis_keyword_fn fn;
	const char *tbuf;
	int key_type;

	if ((p->current->endproc) &&
	    !((t->type == SUBTILIS_TOKEN_KEYWORD) &&
	      (t->tok.keyword.type == SUBTILIS_KEYWORD_DEF))) {
		subtilis_error_set_useless_statement(err, p->l->stream->name,
						     p->l->line);
		return;
	}

	tbuf = subtilis_token_get_text(t);
	if (t->type == SUBTILIS_TOKEN_IDENTIFIER) {
		subtilis_parser_assignment(p, t, err);
		return;
	} else if ((t->type == SUBTILIS_TOKEN_OPERATOR) &&
		   !strcmp(tbuf, "<-")) {
		subtilis_parser_return(p, t, err);
		return;
	} else if (t->type != SUBTILIS_TOKEN_KEYWORD) {
		subtilis_error_set_keyword_expected(
		    err, tbuf, p->l->stream->name, p->l->line);
		return;
	}

	key_type = t->tok.keyword.type;
	fn = keyword_fns[key_type];
	if (!fn) {
		tbuf = subtilis_token_get_text(t);
		subtilis_error_set_not_supported(err, tbuf, p->l->stream->name,
						 p->l->line);
		return;
	}
	fn(p, t, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x48(%rdi), %rax
cmpb $0x1, 0x88(%rax)
jne 0x150b1
cmpl $0x1, (%r15)
jne 0x150e2
cmpl $0x1d, 0x8(%r15)
jne 0x150e2
movq %r15, %rdi
callq 0x12ad0
movl (%r15), %ecx
cmpl $0x1, %ecx
je 0x1515a
cmpl $0x2, %ecx
je 0x1510b
cmpl $0x6, %ecx
jne 0x15120
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x183e9
movq (%r14), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0x5e396(%rip), %r8      # 0x73489
movq %rbx, %rdi
movl $0x2e, %esi
movl $0xbd, %r9d
popq %rbx
popq %r14
popq %r15
jmp 0x145c8
cmpb $0x3c, (%rax)
jne 0x15120
cmpb $0x2d, 0x1(%rax)
jne 0x15120
cmpb $0x0, 0x2(%rax)
je 0x151b1
movq (%r14), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x5e357(%rip), %r10     # 0x73489
leaq 0x5ecdc(%rip), %rcx     # 0x73e15
movq %rbx, %rdi
movl $0x10, %esi
movq %rax, %rdx
pushq $0xcb
pushq %r10
callq 0x143da
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movslq 0x8(%r15), %rax
leaq 0x875fb(%rip), %rcx     # 0x9c760
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x1517e
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq %r15, %rdi
callq 0x12ad0
movq (%r14), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x5e2f1(%rip), %r10     # 0x73489
leaq 0x5ec76(%rip), %rcx     # 0x73e15
movq %rbx, %rdi
movl $0x13, %esi
movq %rax, %rdx
pushq $0xd4
jmp 0x15149
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x1cb13
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser.c
// Function: subtilis_parse
void subtilis_parse(subtilis_parser_t *p, subtilis_error_t *err)
{
	subtilis_token_t *t = NULL;

	t = subtilis_token_new(err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	prv_root(p, t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_parser_check_calls(p, err);

cleanup:

	subtilis_token_delete(t);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %rdi
callq 0x12b56
cmpl $0x0, (%rbx)
je 0x15434
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movl $0x3fffffff, %edi       # imm = 0x3FFFFFFF
movq %rbx, %rsi
callq 0x2b7af
cmpl $0x0, (%rbx)
jne 0x154fe
leaq 0x90d1c(%rip), %rcx     # 0xa6170
movq (%rcx), %rsi
leaq 0x5f4ba(%rip), %rdx     # 0x74918
movq %r15, %rdi
movq %rax, %rcx
movq %rbx, %r8
callq 0x35b78
cmpl $0x0, (%rbx)
jne 0x154fe
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2b7af
cmpl $0x0, (%rbx)
jne 0x154fe
leaq 0x90ced(%rip), %rcx     # 0xa6178
movq (%rcx), %rsi
leaq 0x5f483(%rip), %rdx     # 0x74918
movq %r15, %rdi
movq %rax, %rcx
movq %rbx, %r8
callq 0x35b78
cmpl $0x0, (%rbx)
jne 0x154fe
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2b7af
cmpl $0x0, (%rbx)
jne 0x154fe
leaq 0x90cc2(%rip), %rcx     # 0xa6180
movq (%rcx), %rsi
leaq 0x5f450(%rip), %rdx     # 0x74918
movq %r15, %rdi
movq %rax, %rcx
movq %rbx, %r8
callq 0x35b78
cmpl $0x0, (%rbx)
jne 0x154fe
movq %r15, %rdi
movq %rbx, %rsi
callq 0x155fb
cmpl $0x0, (%rbx)
jne 0x154fe
movq (%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12edc
cmpl $0x0, (%rbx)
je 0x1550b
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x12a38
movq 0x48(%r15), %rdi
movq %rbx, %rsi
callq 0x2bf78
movq 0x48(%r15), %rcx
movq %rax, 0xc0(%rcx)
cmpl $0x0, (%rbx)
jne 0x154fe
cmpl $0x0, (%r14)
je 0x1553d
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x15089
jmp 0x15522
movq 0x50(%r15), %rax
movq 0x70(%r15), %rcx
movq 0x310(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq 0x48(%r15), %rdi
movq 0x98(%rdi), %rsi
movq %rbx, %rdx
callq 0x2cca6
cmpl $0x0, (%rbx)
jne 0x154fe
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1ca2d
cmpl $0x0, (%rbx)
jne 0x154fe
movq 0x48(%r15), %rdi
movq 0xa0(%rdi), %rsi
movq %rbx, %rdx
callq 0x2cca6
cmpl $0x0, (%rbx)
jne 0x154fe
movq %r15, %rdi
movq %rbx, %rsi
callq 0x15661
cmpl $0x0, (%rbx)
jne 0x154fe
movq 0x48(%r15), %rdi
movl $0x74, %esi
movq %rbx, %rdx
callq 0x2be37
cmpl $0x0, (%rbx)
jne 0x154fe
movq 0x48(%r15), %rdi
movq %rbx, %rsi
callq 0x2bbae
cmpl $0x0, (%rbx)
jne 0x154fe
movq %r15, %rdi
movq %rbx, %rsi
callq 0x436af
cmpl $0x0, (%rbx)
jne 0x154fe
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1ccfe
jmp 0x154fe
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser.c
// Function: prv_initialise_free_mem
static void prv_initialise_free_mem(subtilis_parser_t *p, subtilis_token_t *t,
				    subtilis_error_t *err)
{
	size_t reg;
	subtilis_exp_t *e;

	if (!p->settings.check_mem_leaks)
		return;

	reg = subtilis_ir_section_add_instr1(p->current,
					     SUBTILIS_OP_INSTR_HEAP_FREE, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	e = subtilis_exp_new_int32_var(reg, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_var_assign_hidden(p, subtilis_heap_free_on_startup_var,
				   &subtilis_type_integer, e, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x1, 0xba(%rdi)
jne 0x15633
movq %rsi, %rbx
movq %rdi, %r14
movq 0x48(%rdi), %rdi
movl $0x87, %esi
movq %rbx, %rdx
callq 0x2be13
cmpl $0x0, (%rbx)
jne 0x15633
movl %eax, %edi
movq %rbx, %rsi
callq 0x2b71f
cmpl $0x0, (%rbx)
je 0x1563b
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x90b46(%rip), %rcx     # 0xa6188
movq (%rcx), %rsi
leaq 0x5f2cc(%rip), %rdx     # 0x74918
movq %r14, %rdi
movq %rax, %rcx
movq %rbx, %r8
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x35b78
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser.c
// Function: prv_end
static void prv_end(subtilis_parser_t *p, subtilis_token_t *t,
		    subtilis_error_t *err)
{
	subtilis_ir_operand_t end_label;

	if (p->current != p->main) {
		subtilis_ir_section_add_instr_no_arg(
		    p->current, SUBTILIS_OP_INSTR_END, err);
	} else {
		end_label.label = p->current->nofree_label;
		subtilis_ir_section_add_instr_no_reg(
		    p->current, SUBTILIS_OP_INSTR_JMP, end_label, err);
	}
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_lexer_get(p->l, t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	p->current->endproc = true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x48(%rdi), %rdi
cmpq 0x50(%rbx), %rdi
je 0x1585d
movl $0x74, %esi
movq %r14, %rdx
callq 0x2be37
jmp 0x15871
movq 0xa0(%rdi), %rdx
movl $0x45, %esi
movq %r14, %rcx
callq 0x2be1f
cmpl $0x0, (%r14)
jne 0x15896
movq (%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x12edc
cmpl $0x0, (%r14)
jne 0x15896
movq 0x48(%rbx), %rax
movb $0x1, 0x88(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser.c
// Function: prv_parser_type
static void prv_parser_type(subtilis_parser_t *p, subtilis_token_t *t,
			    subtilis_error_t *err)
{
	const char *tbuf;
	char *name;
	subtilis_type_t type;

	type.type = SUBTILIS_TYPE_VOID;

	subtilis_lexer_get(p->l, t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	tbuf = subtilis_token_get_text(t);
	if ((t->type != SUBTILIS_TOKEN_KEYWORD) ||
	    ((t->tok.keyword.type != SUBTILIS_KEYWORD_PROC) &&
	     (t->tok.keyword.type != SUBTILIS_KEYWORD_FN) &&
	     (t->tok.keyword.type != SUBTILIS_KEYWORD_REC))) {
		subtilis_error_set_expected(err, "REC, PROC or FN", tbuf,
					    p->l->stream->name, p->l->line);
		return;
	}

	if (t->tok.keyword.type == SUBTILIS_KEYWORD_REC)
		name = subtilis_parser_parse_rec_type(p, t, &type, err);
	else
		name = subtilis_parser_parse_call_type(p, t, &type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	if ((p->current != p->main) || (p->level > 0)) {
		subtilis_error_set_type_not_at_top_level(
		    err, name, p->l->stream->name, p->l->line);
		goto on_error;
	}

	subtilis_symbol_table_insert_type(p->st, name, &type, err);
	if (err->type == SUBTILIS_ERROR_TYPE_ALREADY_DEFINED) {
		subtilis_error_set_already_defined(
		    err, name, p->l->stream->name, p->l->line);
	}

on_error:
	subtilis_type_free(&type);
	free(name);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x150, %rsp            # imm = 0x150
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl $0x8, 0x8(%rsp)
movq (%rdi), %rdi
callq 0x12edc
cmpl $0x0, (%rbx)
je 0x158cf
addq $0x150, %rsp            # imm = 0x150
jmp 0x15937
movq %r15, %rdi
callq 0x12ad0
cmpl $0x1, (%r15)
jne 0x15900
movl 0x8(%r15), %ecx
cmpl $0x3, %ecx
jae 0x15900
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
cmpl $0x2, %ecx
jne 0x1593d
movq %rbx, %rcx
callq 0x29090
jmp 0x15945
movq (%r14), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x5db77(%rip), %r10     # 0x73489
leaq 0x5db9f(%rip), %rdx     # 0x734b8
movq %rbx, %rdi
movl $0x1d, %esi
movq %rax, %rcx
pushq $0x1b6                  # imm = 0x1B6
pushq %r10
callq 0x143da
addq $0x160, %rsp            # imm = 0x160
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rcx
callq 0x1c483
movq %rax, %r15
cmpl $0x0, (%rbx)
jne 0x15991
movq 0x48(%r14), %rax
cmpq 0x50(%r14), %rax
jne 0x1595e
cmpq $0x0, 0x78(%r14)
je 0x159a8
movq (%r14), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x5db19(%rip), %rax     # 0x73489
leaq 0x5e49e(%rip), %rcx     # 0x73e15
movq %rbx, %rdi
movl $0x57, %esi
movq %r15, %rdx
pushq $0x1c3                  # imm = 0x1C3
pushq %rax
callq 0x143da
addq $0x10, %rsp
leaq 0x8(%rsp), %rdi
callq 0x2f56e
movq %r15, %rdi
callq 0x122c0
jmp 0x158c6
movq 0x60(%r14), %rdi
leaq 0x8(%rsp), %rdx
movq %r15, %rsi
movq %rbx, %rcx
callq 0x2e7c2
cmpl $0x68, (%rbx)
jne 0x15991
movq (%r14), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x5dab6(%rip), %rax     # 0x73489
leaq 0x5e43b(%rip), %rcx     # 0x73e15
movq %rbx, %rdi
movl $0x20, %esi
movq %r15, %rdx
pushq $0x1ca                  # imm = 0x1CA
jmp 0x15987
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_array.c
// Function: subtils_parser_read_array
subtilis_exp_t *subtils_parser_read_array(subtilis_parser_t *p,
					  subtilis_token_t *t,
					  const char *var_name,
					  subtilis_error_t *err)
{
	size_t mem_reg;
	const subtilis_symbol_t *s;

	s = subtilis_parser_get_symbol(p, var_name, &mem_reg, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	if (!subtilis_type_if_is_array(&s->t)) {
		subtilis_error_not_array(err, var_name, p->l->stream->name,
					 p->l->line);
		return NULL;
	}

	return subtils_parser_read_array_with_type(p, t, &s->t, mem_reg, s->loc,
						   var_name, err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movq %rsp, %rdx
movq %rbx, %rsi
callq 0x1e8b1
cmpl $0x0, (%r14)
jne 0x15a7d
movq %rax, %rbp
leaq 0x8(%rax), %r13
movq %r13, %rdi
callq 0x376b5
testb %al, %al
je 0x15a4c
movq (%rsp), %rcx
movq (%rbp), %r8
subq $0x8, %rsp
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbx, %r9
pushq %r14
callq 0x15a8e
addq $0x10, %rsp
jmp 0x15a7f
movq (%r12), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x5da89(%rip), %rax     # 0x734e8
leaq 0x5e3af(%rip), %rcx     # 0x73e15
movq %r14, %rdi
movl $0x3b, %esi
movq %rbx, %rdx
pushq $0x2b
pushq %rax
callq 0x143da
addq $0x10, %rsp
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_array.c
// Function: prv_read_rec_el
static subtilis_exp_t *
prv_read_rec_el(subtilis_parser_t *p, subtilis_token_t *t,
		const subtilis_type_t *type, subtilis_exp_t **indices,
		size_t dims, size_t mem_reg, size_t loc, const char *var_name,
		subtilis_error_t *err)
{
	subtilis_type_t el_type;
	subtilis_exp_t *offset;
	subtilis_exp_t *e;

	offset = subtilis_array_index_calc(p, var_name, type, mem_reg, loc,
					   indices, dims, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	el_type.type = SUBTILIS_TYPE_VOID;
	subtilis_type_if_element_type(p, type, &el_type, err);
	if (err->type != SUBTILIS_ERROR_OK) {
		subtilis_exp_delete(offset);
		return NULL;
	}

	e = subtilis_parser_rec_exp(p, t, &el_type, offset->exp.ir_op.reg, 0,
				    err);
	subtilis_exp_delete(offset);
	subtilis_type_free(&el_type);

	return e;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x150, %rsp            # imm = 0x150
movq %r8, %rax
movq %rcx, %r10
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r15
movq 0x190(%rsp), %rbx
movq 0x188(%rsp), %rsi
movq 0x180(%rsp), %r8
movq %r9, %rcx
movq %r10, %r9
pushq %rbx
pushq %rax
callq 0x43706
addq $0x10, %rsp
cmpl $0x0, (%rbx)
jne 0x15d84
movq %rax, %r12
leaq 0x8(%rsp), %rdx
movl $0x8, (%rdx)
movq %r15, %rdi
movq %r13, %rsi
movq %rbx, %rcx
callq 0x360be
cmpl $0x0, (%rbx)
je 0x15d9a
movq %r12, %rdi
callq 0x2b166
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x148(%r12), %rcx
leaq 0x8(%rsp), %r13
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x298f7
movq %rax, %rbx
movq %r12, %rdi
callq 0x2b166
movq %r13, %rdi
callq 0x2f56e
jmp 0x15d86
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_array.c
// Function: subtils_parser_read_vector
subtilis_exp_t *subtils_parser_read_vector(subtilis_parser_t *p,
					   subtilis_token_t *t,
					   const char *var_name,
					   subtilis_error_t *err)
{
	size_t mem_reg;
	const subtilis_symbol_t *s;

	s = subtilis_parser_get_symbol(p, var_name, &mem_reg, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	if (!subtilis_type_if_is_vector(&s->t)) {
		subtilis_error_not_vector(err, var_name, p->l->stream->name,
					  p->l->line);
		return NULL;
	}

	return subtils_parser_read_vector_with_type(p, t, &s->t, mem_reg,
						    s->loc, var_name, err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movq %rsp, %rdx
movq %rbx, %rsi
callq 0x1e8b1
cmpl $0x0, (%r14)
jne 0x16083
movq %rax, %rbp
leaq 0x8(%rax), %r13
movq %r13, %rdi
callq 0x376d3
testb %al, %al
je 0x1604f
movq (%rsp), %rcx
movq (%rbp), %r8
subq $0x8, %rsp
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbx, %r9
pushq %r14
callq 0x16094
addq $0x10, %rsp
jmp 0x16085
movq (%r12), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x5d486(%rip), %rax     # 0x734e8
leaq 0x5ddac(%rip), %rcx     # 0x73e15
movq %r14, %rdi
movl $0x3c, %esi
movq %rbx, %rdx
pushq $0xf3
pushq %rax
callq 0x143da
addq $0x10, %rsp
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_array.c
// Function: subtils_parser_element_address
subtilis_exp_t *
subtils_parser_element_address(subtilis_parser_t *p, subtilis_token_t *t,
			       const subtilis_symbol_t *s, size_t mem_reg,
			       const char *var_name, subtilis_error_t *err)
{
	subtilis_exp_t *indices[SUBTILIS_MAX_DIMENSIONS];
	size_t i;
	subtilis_exp_t *e = NULL;
	size_t dims = 0;

	dims = subtilis_var_bracketed_int_args_have_b(
	    p, t, indices, SUBTILIS_MAX_DIMENSIONS, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	subtilis_lexer_get(p->l, t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	if (dims == 0) {
		subtilis_error_bad_index_count(err, var_name,
					       p->l->stream->name, p->l->line);
		goto cleanup;
	}

	e = subtilis_type_if_indexed_address(p, var_name, &s->t, mem_reg,
					     s->loc, indices, dims, err);

cleanup:

	for (i = 0; i < dims; i++)
		subtilis_exp_delete(indices[i]);

	return e;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r9, %r14
movq %r8, (%rsp)
movq %rcx, %r13
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbp
leaq 0x10(%rsp), %rdx
movl $0xa, %ecx
movq %r9, %r8
callq 0x1f0d1
cmpl $0x0, (%r14)
je 0x164dc
xorl %r14d, %r14d
jmp 0x16548
movq %rax, %rbx
movq %r13, 0x8(%rsp)
movq (%rbp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x12edc
cmpl $0x0, (%r14)
je 0x16503
xorl %r14d, %r14d
testq %rbx, %rbx
jne 0x16533
jmp 0x16548
testq %rbx, %rbx
je 0x1655a
movq (%r12), %r8
addq $0x8, %r12
leaq 0x10(%rsp), %r9
movq %rbp, %rdi
movq (%rsp), %rsi
movq %r12, %rdx
movq 0x8(%rsp), %rcx
pushq %r14
pushq %rbx
callq 0x366a0
addq $0x10, %rsp
movq %rax, %r14
xorl %r15d, %r15d
movq 0x10(%rsp,%r15,8), %rdi
callq 0x2b166
incq %r15
cmpq %r15, %rbx
jne 0x16536
movq %r14, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rbp), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x5cf7b(%rip), %rax     # 0x734e8
leaq 0x5d8a1(%rip), %rcx     # 0x73e15
movq %r14, %rdi
movl $0x3a, %esi
movq (%rsp), %rdx
pushq $0x1a0                  # imm = 0x1A0
pushq %rax
callq 0x143da
addq $0x10, %rsp
jmp 0x164d7
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_array.c
// Function: parser_array_var_bracketed_int_args
size_t parser_array_var_bracketed_int_args(subtilis_parser_t *p,
					   subtilis_token_t *t,
					   subtilis_exp_t **e, size_t max,
					   bool *vec, subtilis_error_t *err)
{
	const char *tbuf;

	subtilis_lexer_get(p->l, t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return 0;

	tbuf = subtilis_token_get_text(t);
	if (t->type == SUBTILIS_TOKEN_OPERATOR) {
		if (!strcmp(tbuf, "(")) {
			*vec = false;
			return subtilis_var_bracketed_int_args_have_b(p, t, e,
								      max, err);
		} else if (!strcmp(tbuf, "{")) {
			e[0] = subtilis_curly_bracketed_arg_have_b(p, t, err);
			if (err->type != SUBTILIS_ERROR_OK)
				return 0;

			*vec = true;
			return e[0] ? 1 : 0;
		}
	}

	subtilis_error_set_expected(err, "( or {", tbuf, p->l->stream->name,
				    p->l->line);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %rbp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movq (%rdi), %rdi
movq %r9, %rdx
callq 0x12edc
cmpl $0x0, (%rbx)
jne 0x16648
movq %r12, %rdi
callq 0x12ad0
cmpl $0x2, (%r12)
jne 0x16613
movzbl (%rax), %ecx
cmpl $0x7b, %ecx
je 0x1660d
cmpl $0x28, %ecx
jne 0x16613
cmpb $0x0, 0x1(%rax)
jne 0x16613
movb $0x0, (%r14)
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbp, %rcx
movq %rbx, %r8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1f0d1
cmpb $0x0, 0x1(%rax)
je 0x16659
movq (%r13), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x5cec2(%rip), %r10     # 0x734e8
leaq 0x5cf43(%rip), %rdx     # 0x73570
movq %rbx, %rdi
movl $0x1d, %esi
movq %rax, %rcx
pushq $0x1d0                  # imm = 0x1D0
pushq %r10
callq 0x143da
addq $0x10, %rsp
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x1f564
movq %rax, (%r15)
cmpl $0x0, (%rbx)
jne 0x16648
movq %rax, %rcx
movb $0x1, (%r14)
xorl %eax, %eax
testq %rcx, %rcx
setne %al
jmp 0x1664a
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_array.c
// Function: prv_fn_check_type
static void prv_fn_check_type(subtilis_parser_t *p, subtilis_exp_t *e1,
			      const subtilis_type_t *type,
			      subtilis_error_t *err)
{
	if (e1->partial_name)
		subtilis_parser_call_add_addr(p, type, e1, err);
	else if (!subtilis_type_eq(&e1->type, type))
		subtilis_error_set_fn_type_mismatch(err, p->l->stream->name,
						    p->l->line);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rsi, %rax
movq %rdi, %r14
cmpq $0x0, 0x160(%rsi)
je 0x16e44
movq %r14, %rdi
movq %rdx, %rsi
movq %rax, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1d3d0
movq %rax, %rdi
movq %rdx, %rsi
callq 0x2f0ec
testb %al, %al
je 0x16e5b
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq (%r14), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0x5c67c(%rip), %r8      # 0x734e8
movq %rbx, %rdi
movl $0x42, %esi
movl $0x3fe, %r9d            # imm = 0x3FE
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x145c8
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_array.c
// Function: prv_parse_fn_initialiser
static void prv_parse_fn_initialiser(subtilis_parser_t *p, subtilis_token_t *t,
				     const subtilis_type_t *el_type,
				     subtilis_exp_t *e,
				     const subtilis_array_desc_t *d,
				     subtilis_error_t *err)
{
	subtilis_exp_t **ee;
	size_t element_size;
	size_t data_reg;
	size_t entries = 0;
	size_t i = 0;

	ee = prv_parse_expression_list(p, e, el_type, t, &entries,
				       prv_fn_check_type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	element_size = subtilis_type_if_size(&e->type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	prv_check_expression_list_size(p, d, ee, entries, element_size, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	data_reg = subtilis_reference_get_data(p, d->reg, d->loc, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	prv_parse_fn_list(p, data_reg, ee, entries, element_size, err);

cleanup:

	for (i = 0; i < entries; i++)
		subtilis_exp_delete(ee[i]);
	free(ee);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r14
movq %r8, %r13
movq %rcx, %r15
movq %rsi, %rcx
movq %rdi, %r12
leaq 0x10(%rsp), %r8
movq $0x0, (%r8)
movq %r9, (%rsp)
leaq -0xa5(%rip), %r9        # 0x16e15
movq %r15, %rsi
callq 0x17874
cmpl $0x0, (%r14)
je 0x16ed7
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r15, %rdi
movq %r14, %rsi
callq 0x35d88
cmpl $0x0, (%r14)
movq 0x10(%rsp), %r15
jne 0x16f3d
movq %rax, %rbp
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %rax, %rcx
movq %r14, %r8
callq 0x17a40
cmpl $0x0, (%r14)
jne 0x16f3d
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
movq %r12, %rdi
movq %r14, %rcx
callq 0x4d258
cmpl $0x0, (%r14)
jne 0x16f3d
movq %r12, %rdi
movq %rax, %rsi
movq %rbx, %rdx
movq %r15, %rcx
movq %rbp, %r8
movq %r14, %r9
callq 0x17d8e
testq %r15, %r15
je 0x16f56
xorl %r14d, %r14d
movq (%rbx,%r14,8), %rdi
callq 0x2b166
incq %r14
cmpq %r14, %r15
jne 0x16f45
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x122c0
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_array.c
// Function: prv_append_const_el
static uint8_t *prv_append_const_el(subtilis_parser_t *p, subtilis_exp_t *e,
				    const subtilis_type_t *el_type,
				    size_t element_size, uint8_t *buffer,
				    size_t el, size_t *max_els,
				    subtilis_error_t *err)
{
	uint8_t *new_buf;
	size_t new_max;

	if (el == *max_els) {
		new_max = *max_els + SUBTILIS_CONFIG_CONSTANT_ARRAY_GRAN;
		new_buf = realloc(buffer, new_max * element_size);
		if (!new_buf) {
			subtilis_error_set_oom(err);
			goto cleanup;
		}
		buffer = new_buf;
		*max_els = new_max;
	}

	if (!subtilis_type_if_is_const(&e->type)) {
		subtilis_error_set_const_expression_expected(
		    err, p->l->stream->name, p->l->line);
		goto cleanup;
	}

	e = subtilis_type_if_coerce_type(p, e, el_type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	memcpy(&buffer[el * element_size], &e->exp.ir_op, element_size);

cleanup:

	subtilis_exp_delete(e);

	return buffer;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r12
movq %r8, %rbx
movq %rdx, 0x10(%rsp)
movq %rsi, %r14
movq %rdi, %r13
movq 0x58(%rsp), %rbp
movq 0x50(%rsp), %r15
cmpq %r9, (%r15)
movq %rcx, 0x8(%rsp)
jne 0x1772b
leaq 0x100(%r12), %rbp
movq %rbp, %rsi
imulq %rcx, %rsi
movq %rbx, %rdi
callq 0x12210
testq %rax, %rax
je 0x1779a
movq %rbp, (%r15)
movq %rax, %rbx
movq 0x58(%rsp), %rbp
movq %r14, %rdi
callq 0x368fd
testb %al, %al
je 0x17773
movq %r13, %rdi
movq %r14, %rsi
movq 0x10(%rsp), %rdx
movq %rbp, %rcx
callq 0x37860
movq %rax, %r14
cmpl $0x0, (%rbp)
jne 0x177b5
movq 0x8(%rsp), %rdx
imulq %rdx, %r12
addq %rbx, %r12
movq %r14, %rsi
addq $0x148, %rsi            # imm = 0x148
movq %r12, %rdi
callq 0x121b0
jmp 0x177b5
movq (%r13), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0x5bd63(%rip), %r8      # 0x734e8
movq %rbp, %rdi
movl $0x48, %esi
movl $0x1eb, %r9d            # imm = 0x1EB
callq 0x145c8
jmp 0x177b5
leaq 0x5bd47(%rip), %rdx     # 0x734e8
movq 0x58(%rsp), %rdi
movl $0x1, %esi
movl $0x1e2, %ecx            # imm = 0x1E2
callq 0x145a4
movq %r14, %rdi
callq 0x2b166
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_array.c
// Function: prv_check_initialiser_count
static void prv_check_initialiser_count(subtilis_parser_t *p, size_t entries,
					size_t mem_reg, subtilis_exp_t *maxe,
					subtilis_error_t *err)
{
	subtilis_exp_t *sizee = NULL;
	subtilis_ir_operand_t error_label;
	subtilis_ir_operand_t ok_label;

	error_label = subtilis_array_type_error_label(p);
	ok_label.label = subtilis_ir_section_new_label(p->current);

	sizee = subtilis_exp_new_int32(entries, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	sizee = subtilis_type_if_lte(p, sizee, maxe, err);
	maxe = NULL;
	subtilis_ir_section_add_instr_reg(p->current, SUBTILIS_OP_INSTR_JMPC,
					  sizee->exp.ir_op, ok_label,
					  error_label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_ir_section_add_label(p->current, ok_label.label, err);

cleanup:
	subtilis_exp_delete(maxe);
	subtilis_exp_delete(sizee);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
callq 0x4248b
movq %rax, %rbp
movq 0x48(%r15), %rdi
callq 0x2cc99
movq %rax, %r13
movl %r14d, %edi
movq %rbx, %rsi
callq 0x2b7af
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x17856
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x370d0
movq %rax, %r14
movq 0x48(%r15), %rdi
movq 0x148(%rax), %rdx
movl $0x43, %esi
movq %r13, %rcx
movq %rbp, %r8
movq %rbx, %r9
callq 0x2bd42
cmpl $0x0, (%rbx)
jne 0x17853
movq 0x48(%r15), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x2cca6
xorl %r12d, %r12d
movq %r12, %rdi
callq 0x2b166
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2b166
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_array.c
// Function: prv_check_expression_list_size
static void prv_check_expression_list_size(subtilis_parser_t *p,
					   const subtilis_array_desc_t *d,
					   subtilis_exp_t **ee, size_t entries,
					   size_t element_size,
					   subtilis_error_t *err)
{
	int32_t dim;
	bool dynamic = false;
	size_t max_elements = 1;
	subtilis_exp_t *maxe = NULL;
	subtilis_exp_t *maxe_dup = NULL;
	size_t i = 0;
	const subtilis_type_t *type = d->t;

	do {
		dim = type->params.array.dims[i];
		if (dim == SUBTILIS_DYNAMIC_DIMENSION) {
			max_elements = SIZE_MAX;
			dynamic = true;
			break;
		}
		max_elements *= (dim + 1);
		i++;
	} while (i < type->params.array.num_dims);

	if (!dynamic) {
		if (entries > max_elements)
			subtilis_error_bad_element_count(
			    err, p->l->stream->name, p->l->line);
	} else {
		maxe = subtilis_array_type_dynamic_size(p, d->reg, d->loc, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
		maxe_dup = subtilis_type_if_dup(maxe, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
		prv_check_initialiser_count(p, entries * element_size, d->reg,
					    maxe_dup, err);
	}

cleanup:

	subtilis_exp_delete(maxe);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rdi, %r14
movq 0x8(%rsi), %rcx
movl $0x1, %eax
xorl %edx, %edx
movslq 0xc(%rcx,%rdx,4), %rdi
cmpq $-0x1, %rdi
je 0x17aac
incq %rdi
imulq %rdi, %rax
incq %rdx
movslq 0x8(%rcx), %rdi
cmpq %rdi, %rdx
jb 0x17a60
cmpq %r12, %rax
jae 0x17aa7
movq (%r14), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0x5ba54(%rip), %r8      # 0x734e8
movq %rbx, %rdi
movl $0x47, %esi
movl $0x3b1, %r9d            # imm = 0x3B1
callq 0x145c8
xorl %r13d, %r13d
jmp 0x17aef
movq 0x10(%rsi), %rax
movq 0x18(%rsi), %rdx
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rcx
callq 0x44280
movq %rax, %r13
cmpl $0x0, (%rbx)
jne 0x17aef
movq %r13, %rdi
movq %rbx, %rsi
callq 0x36182
cmpl $0x0, (%rbx)
jne 0x17aef
imulq %r12, %r15
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %rbx, %rcx
callq 0x177cf
movq %r13, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2b166
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_array.c
// Function: prv_parse_fn_list
static void prv_parse_fn_list(subtilis_parser_t *p, size_t array_base,
			      subtilis_exp_t **ee, size_t entries,
			      size_t element_size, subtilis_error_t *err)
{
	size_t i;
	subtilis_ir_operand_t op1;
	subtilis_ir_operand_t op2;

	op1.reg = array_base;
	op2.integer = (int32_t)element_size;

	for (i = 0; i < entries - 1; i++) {
		subtilis_type_if_assign_to_mem(p, op1.reg, 0, ee[i], err);
		ee[i] = NULL;
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		op1.reg = subtilis_ir_section_add_instr(
		    p->current, SUBTILIS_OP_INSTR_ADDI_I32, op1, op2, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
	}
	subtilis_type_if_assign_to_mem(p, op1.reg, 0, ee[i], err);
	ee[i] = NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r15
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
movq %rcx, 0x8(%rsp)
decq %rbx
je 0x17e0c
movl %r8d, %eax
movq %rax, 0x10(%rsp)
xorl %ebp, %ebp
movq (%r14,%rbp,8), %rcx
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
movq %r15, %r8
callq 0x362c6
movq $0x0, (%r14,%rbp,8)
cmpl $0x0, (%r15)
jne 0x17e2f
movq 0x48(%r12), %rdi
movl $0x9, %esi
movq %r13, %rdx
movq 0x10(%rsp), %rcx
movq %r15, %r8
callq 0x2bc8f
cmpl $0x0, (%r15)
jne 0x17e2f
movq %rax, %r13
incq %rbp
cmpq %rbp, %rbx
jne 0x17dbf
movq 0x8(%rsp), %rbx
movq -0x8(%r14,%rbx,8), %rcx
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
movq %r15, %r8
callq 0x362c6
movq $0x0, -0x8(%r14,%rbx,8)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_assignment.c
// Function: subtilis_parser_create_array_ref
void subtilis_parser_create_array_ref(subtilis_parser_t *p,
				      const char *var_name,
				      const subtilis_type_t *array_type,
				      subtilis_exp_t *e, bool local,
				      subtilis_error_t *err)
{
	subtilis_type_t type;
	const subtilis_symbol_t *s;

	if (array_type->type != e->type.type) {
		subtilis_error_set_array_type_mismatch(err, p->l->stream->name,
						       p->l->line);
		goto cleanup;
	}
	subtilis_type_init_copy(&type, &e->type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	/*
	 * If the expression is a temporary variable and we're assigning to
	 * a local variable, we can simply just promote the temporary to a
	 * full local variable and avoid copying the data.
	 */

	if (local && e->temporary) {
		(void)subtilis_symbol_table_promote_tmp(
		    p->local_st, &e->type, e->temporary, var_name, err);
		subtilis_type_free(&type);
		subtilis_exp_delete(e);
		return;
	}

	s = subtilis_symbol_table_insert(local ? p->local_st : p->st, var_name,
					 &type, err);
	subtilis_type_free(&type);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_array_type_create_ref(
	    p, var_name, s,
	    local ? SUBTILIS_IR_REG_LOCAL : SUBTILIS_IR_REG_GLOBAL, e, err);
	return;

cleanup:

	subtilis_exp_delete(e);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %r9, %r14
movq %rcx, %rbx
movq %rdi, %r12
movl (%rdx), %eax
cmpl (%rcx), %eax
jne 0x17eaf
movl %r8d, %ebp
movq %rsi, %r15
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2f457
cmpl $0x0, (%r14)
jne 0x17ed4
testb %bpl, %bpl
je 0x17eee
movq 0x158(%rbx), %rdx
leaq 0x68(%r12), %rax
testq %rdx, %rdx
je 0x17ef3
movq (%rax), %rdi
movq %rbx, %rsi
movq %r15, %rcx
movq %r14, %r8
callq 0x2e83a
leaq 0x10(%rsp), %rdi
callq 0x2f56e
jmp 0x17ed4
movq (%r12), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0x5b6e3(%rip), %r8      # 0x735a4
movq %r14, %rdi
movl $0x41, %esi
movl $0x58, %r9d
callq 0x145c8
movq %rbx, %rdi
callq 0x2b166
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x60(%r12), %rax
movq (%rax), %rdi
leaq 0x10(%rsp), %r13
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x2e3cd
movq %rax, 0x8(%rsp)
movq %r13, %rdi
callq 0x2f56e
cmpl $0x0, (%r14)
jne 0x17ed4
movzbl %bpl, %ecx
incq %rcx
movq %r12, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %r8
movq %r14, %r9
callq 0x42e1e
jmp 0x17edc
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_assignment.c
// Function: subtilis_parser_assign_local_num
subtilis_exp_t *subtilis_parser_assign_local_num(subtilis_parser_t *p,
						 subtilis_token_t *t,
						 const char *var_name,
						 const subtilis_type_t *type,
						 subtilis_error_t *err)
{
	subtilis_exp_t *e;

	e = subtilis_parser_expression(p, t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;
	if (!subtilis_type_if_is_numeric(&e->type)) {
		subtilis_error_set_expected(err, "Numeric expression",
					    subtilis_type_name(&e->type),
					    p->l->stream->name, p->l->line);
		subtilis_exp_delete(e);
		return NULL;
	}
	e = subtilis_type_if_copy_var(p, e, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;
	e = subtilis_type_if_exp_to_var(p, e, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;
	e = subtilis_type_if_coerce_type(p, e, type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	return e;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r15
movq %rdi, %r14
movq %r8, %rdx
callq 0x1ec4c
cmpl $0x0, (%rbx)
jne 0x17ff5
movq %rax, %r12
movq %rax, %rdi
callq 0x37534
testb %al, %al
je 0x17fb1
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x36169
cmpl $0x0, (%rbx)
jne 0x17ff5
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x36119
cmpl $0x0, (%rbx)
jne 0x17ff5
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x37860
movq %rax, %rcx
xorl %eax, %eax
cmpl $0x0, (%rbx)
cmoveq %rcx, %rax
jmp 0x17ff7
movq %r12, %rdi
callq 0x2f5ad
movq (%r14), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x5b5d9(%rip), %r10     # 0x735a4
leaq 0x5b5ef(%rip), %rdx     # 0x735c1
movq %rbx, %rdi
movl $0x1d, %esi
movq %rax, %rcx
pushq $0x1e3                  # imm = 0x1E3
pushq %r10
callq 0x143da
addq $0x10, %rsp
movq %r12, %rdi
callq 0x2b166
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq