LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/fn_type.c
// Function: prv_zero
static subtilis_exp_t *prv_zero(subtilis_parser_t *p,
				const subtilis_type_t *type,
				subtilis_error_t *err)
{
	subtilis_ir_operand_t op1;
	size_t reg_num;
	subtilis_exp_t *e = NULL;
	size_t call_index;

	call_index = prv_generate_zero_fn(p, type->params.fn.ret_val, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;
	op1.label = (int32_t)call_index;
	reg_num = subtilis_ir_section_add_instr2(
	    p->current, SUBTILIS_OP_INSTR_GET_PROC_ADDR, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;
	e = subtilis_exp_new_int32_var(reg_num, err);

	return e;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x5b6e0
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5a958
movq $0x0, -0x8(%rbp)
jmp 0x5a9ae
movq -0x40(%rbp), %rax
cltq
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rdx
movl $0x9b, %esi
callq 0x38490
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5a993
movq $0x0, -0x8(%rbp)
jmp 0x5a9ae
movq -0x30(%rbp), %rax
movl %eax, %edi
movq -0x20(%rbp), %rsi
callq 0x37770
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/fn_type.c
// Function: prv_zero_reg
static void prv_zero_reg(subtilis_parser_t *p, const subtilis_type_t *type,
			 size_t reg, subtilis_error_t *err)
{
	subtilis_ir_operand_t op0;
	subtilis_ir_operand_t op1;
	size_t call_index;

	call_index = prv_generate_zero_fn(p, type->params.fn.ret_val, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;
	op0.reg = reg;
	op1.label = (int32_t)call_index;
	subtilis_ir_section_add_instr_no_reg2(
	    p->current, SUBTILIS_OP_INSTR_GET_PROC_ADDR, op0, op1, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x5b6e0
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5a9fc
jmp 0x5aa2c
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rax
cltq
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x20(%rbp), %r8
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movl $0x9b, %esi
callq 0x385a0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/fn_type.c
// Function: prv_array_of
static void prv_array_of(const subtilis_type_t *el_type, subtilis_type_t *type,
			 subtilis_error_t *err)
{
	subtilis_type_free(type);
	type->type = SUBTILIS_TYPE_ARRAY_FN;
	subtilis_type_init_to_from_fn(&type->params.array.params.fn, el_type,
				      err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3e100
movq -0x10(%rbp), %rax
movl $0xe, (%rax)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
addq $0x30, %rdi
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x3eaf0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/fn_type.c
// Function: prv_vector_of
static void prv_vector_of(const subtilis_type_t *el_type, subtilis_type_t *type,
			  subtilis_error_t *err)
{
	subtilis_type_free(type);
	type->type = SUBTILIS_TYPE_VECTOR_FN;
	subtilis_type_init_to_from_fn(&type->params.array.params.fn, el_type,
				      err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3e100
movq -0x10(%rbp), %rax
movl $0x14, (%rax)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
addq $0x30, %rdi
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x3eaf0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/fn_type.c
// Function: prv_load_from_mem
static subtilis_exp_t *prv_load_from_mem(subtilis_parser_t *p,
					 const subtilis_type_t *type,
					 size_t mem_reg, size_t loc,
					 subtilis_error_t *err)
{
	subtilis_ir_operand_t op1;
	subtilis_ir_operand_t op2;
	size_t reg;

	op1.reg = mem_reg;
	op2.integer = (int32_t)loc;
	reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_LOADO_I32, op1, op2, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	return subtilis_exp_new_var(type, reg, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movl %eax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %rdx
movq -0x40(%rbp), %rcx
movl $0x12, %esi
callq 0x38230
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5ac60
movq $0x0, -0x8(%rbp)
jmp 0x5ac77
movq -0x18(%rbp), %rdi
movq -0x48(%rbp), %rax
movl %eax, %esi
movq -0x30(%rbp), %rdx
callq 0x37590
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/fn_type.c
// Function: prv_coerce_type
static subtilis_exp_t *prv_coerce_type(subtilis_parser_t *p, subtilis_exp_t *e,
				       const subtilis_type_t *type,
				       subtilis_error_t *err)
{
	subtilis_type_compare_diag(p, &e->type, type, err);
	if (err->type != SUBTILIS_ERROR_OK) {
		subtilis_exp_delete(e);
		return NULL;
	}

	return e;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x4a960
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5acd9
movq -0x18(%rbp), %rdi
callq 0x36ee0
movq $0x0, -0x8(%rbp)
jmp 0x5ace1
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/fn_type.c
// Function: prv_logical
static subtilis_exp_t *prv_logical(subtilis_parser_t *p,
				   subtilis_op_instr_type_t type,
				   subtilis_exp_t *a1, subtilis_exp_t *a2,
				   subtilis_error_t *err)
{
	size_t reg;

	if (!subtilis_type_eq(&a1->type, &a2->type)) {
		subtilis_error_set_fn_type_mismatch(err, p->l->stream->name,
						    p->l->line);
		goto cleanup;
	}

	reg = subtilis_ir_section_add_instr(p->current, type, a1->exp.ir_op,
					    a2->exp.ir_op, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;
	a1->exp.ir_op.reg = reg;
	subtilis_exp_delete(a2);
	return a1;

cleanup:

	subtilis_exp_delete(a1);
	subtilis_exp_delete(a2);

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x3d880
testb $0x1, %al
jne 0x5bb2e
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %ecx
movl $0x42, %esi
leaq 0x50d7e(%rip), %r8      # 0xac89f
movl $0x149, %r9d            # imm = 0x149
callq 0x15930
jmp 0x5bb89
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %r8
movq 0x148(%rcx), %rdx
movq 0x148(%rax), %rcx
callq 0x38230
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5bb67
jmp 0x5bb89
movq -0x38(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x148(%rax)
movq -0x28(%rbp), %rdi
callq 0x36ee0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5bba3
movq -0x20(%rbp), %rdi
callq 0x36ee0
movq -0x28(%rbp), %rdi
callq 0x36ee0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: subtilis_array_create_1el
void subtilis_array_create_1el(subtilis_parser_t *p,
			       const subtilis_type_t *type, size_t mem_reg,
			       size_t loc, bool push, subtilis_error_t *err)
{
	subtilis_type_t const_type;
	size_t i;
	subtilis_exp_t **ee;
	subtilis_ir_operand_t store_reg;

	store_reg.reg = mem_reg;
	subtilis_type_init_copy(&const_type, type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	ee = malloc(sizeof(*ee) * const_type.params.array.num_dims);
	if (!ee) {
		subtilis_error_set_oom(err);
		goto cleanup;
	}

	for (i = 0; i < const_type.params.array.num_dims; i++) {
		const_type.params.array.dims[i] = 1;
		ee[i] = subtilis_exp_new_int32(1, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
	}

	subtilis_array_type_allocate(p, "temporary array", &const_type, loc, ee,
				     store_reg, push, err);
cleanup:
	for (i = 0; i < const_type.params.array.num_dims; i++)
		free(ee[i]);
	free(ee);

	subtilis_type_free(&const_type);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
andb $0x1, %al
movb %al, -0x21(%rbp)
movq %r9, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq -0x178(%rbp), %rdi
callq 0x3dec0
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5bc94
jmp 0x5bdeb
movslq -0x170(%rbp), %rdi
shlq $0x3, %rdi
callq 0x121b0
movq %rax, -0x188(%rbp)
cmpq $0x0, -0x188(%rbp)
jne 0x5bcd4
movq -0x30(%rbp), %rdi
movl $0x1, %esi
leaq 0x50cb8(%rip), %rdx     # 0xac97d
movl $0x75, %ecx
callq 0x158e0
jmp 0x5bd8a
movq $0x0, -0x180(%rbp)
movq -0x180(%rbp), %rax
movslq -0x170(%rbp), %rcx
cmpq %rcx, %rax
jae 0x5bd48
movq -0x180(%rbp), %rax
movl $0x1, -0x16c(%rbp,%rax,4)
movq -0x30(%rbp), %rsi
movl $0x1, %edi
callq 0x37800
movq %rax, %rdx
movq -0x188(%rbp), %rax
movq -0x180(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5bd32
jmp 0x5bd8a
jmp 0x5bd34
movq -0x180(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x180(%rbp)
jmp 0x5bcdf
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rcx
movq -0x188(%rbp), %r8
movb -0x21(%rbp), %r10b
movq -0x30(%rbp), %rax
movq -0x190(%rbp), %r9
leaq 0x50c26(%rip), %rsi     # 0xac993
leaq -0x178(%rbp), %rdx
andb $0x1, %r10b
movzbl %r10b, %r10d
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x5be00
movq $0x0, -0x180(%rbp)
movq -0x180(%rbp), %rax
movslq -0x170(%rbp), %rcx
cmpq %rcx, %rax
jae 0x5bdd3
movq -0x188(%rbp), %rax
movq -0x180(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x12290
movq -0x180(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x180(%rbp)
jmp 0x5bd95
movq -0x188(%rbp), %rdi
callq 0x12290
leaq -0x178(%rbp), %rdi
callq 0x3e100
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: subtilis_array_type_init
void subtilis_array_type_init(subtilis_parser_t *p, const char *var_name,
			      const subtilis_type_t *element_type,
			      subtilis_type_t *type, subtilis_exp_t **e,
			      size_t dims, subtilis_error_t *err)
{
	size_t i;

	if (dims > SUBTILIS_MAX_DIMENSIONS) {
		subtilis_error_set_assertion_failed(err);
		return;
	}

	type->type = SUBTILIS_TYPE_VOID;
	subtilis_type_if_array_of(element_type, type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	type->params.array.num_dims = dims;
	for (i = 0; i < dims; i++) {
		if (e[i]->type.type == SUBTILIS_TYPE_CONST_INTEGER) {
			if (e[i]->exp.ir_op.integer < 0) {
				subtilis_error_bad_dim(err, var_name,
						       p->l->stream->name,
						       p->l->line);
				return;
			}
			type->params.array.dims[i] = e[i]->exp.ir_op.integer;
		} else {
			type->params.array.dims[i] = SUBTILIS_DYNAMIC_DIMENSION;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0xa, -0x30(%rbp)
jbe 0x5c0ca
movq 0x10(%rbp), %rdi
movl $0xf, %esi
leaq 0x508c2(%rip), %rdx     # 0xac97d
movl $0x94, %ecx
callq 0x158e0
jmp 0x5c1c3
movq -0x20(%rbp), %rax
movl $0x8, (%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq 0x10(%rbp), %rdx
callq 0x479c0
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5c0f3
jmp 0x5c1c3
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x5c1c3
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x1, (%rax)
jne 0x5c1a0
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x148(%rax)
jge 0x5c180
movq 0x10(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %r9d
movl $0x38, %esi
leaq 0x4f110(%rip), %rcx     # 0xab276
leaq 0x50810(%rip), %rax     # 0xac97d
movq %rax, (%rsp)
movl $0xa3, 0x8(%rsp)
callq 0x156d0
jmp 0x5c1c3
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x148(%rax), %edx
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rcx
movl %edx, 0xc(%rax,%rcx,4)
jmp 0x5c1b0
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rcx
movl $0xffffffff, 0xc(%rax,%rcx,4) # imm = 0xFFFFFFFF
jmp 0x5c1b2
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x5c108
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: subtilis_array_type_vector_init
void subtilis_array_type_vector_init(const subtilis_type_t *element_type,
				     subtilis_type_t *type,
				     subtilis_error_t *err)
{
	type->type = SUBTILIS_TYPE_VOID;
	subtilis_type_if_vector_of(element_type, type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	type->params.array.num_dims = 1;
	type->params.array.dims[0] = SUBTILIS_DYNAMIC_DIMENSION;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl $0x8, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x47a50
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5c20a
jmp 0x5c220
movq -0x10(%rbp), %rax
movl $0x1, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0xffffffff, 0xc(%rax)  # imm = 0xFFFFFFFF
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: subtilis_array_zero_buf_i32
void subtilis_array_zero_buf_i32(subtilis_parser_t *p,
				 const subtilis_type_t *type, size_t data_reg,
				 size_t size_reg, subtilis_error_t *err)
{
	subtilis_ir_operand_t zero;
	size_t zero_reg;

	zero.integer = 0;
	zero_reg = subtilis_ir_section_add_instr2(
	    p->current, SUBTILIS_OP_INSTR_MOVI_I32, zero, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_builtin_memset_i32(p, data_reg, size_reg, zero_reg, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rdx
movl $0x1b, %esi
callq 0x38490
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5c40c
jmp 0x5c425
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x3fb30
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: subtilis_array_zero_buf_i8
void subtilis_array_zero_buf_i8(subtilis_parser_t *p,
				const subtilis_type_t *type, size_t data_reg,
				size_t size_reg, subtilis_error_t *err)
{
	subtilis_ir_operand_t zero;
	size_t zero_reg;

	zero.integer = 0;
	zero_reg = subtilis_ir_section_add_instr2(
	    p->current, SUBTILIS_OP_INSTR_MOVI_I32, zero, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_builtin_memset_i8(p, data_reg, size_reg, zero_reg, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rdx
movl $0x1b, %esi
callq 0x38490
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5c47c
jmp 0x5c495
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x3fc60
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: subtilis_array_type_vector_alloc
void subtilis_array_type_vector_alloc(subtilis_parser_t *p, size_t loc,
				      const subtilis_type_t *type,
				      subtilis_exp_t *e,
				      subtilis_ir_operand_t store_reg,
				      bool push, subtilis_error_t *err)
{
	if (e->type.type == SUBTILIS_TYPE_CONST_INTEGER) {
		if (e->exp.ir_op.integer < 0) {
			subtilis_array_type_vector_zero_ref(
			    p, type, loc, store_reg.reg, true, err);
			return;
		}

		e = subtilis_type_if_dup(e, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		e = subtilis_type_if_exp_to_var(p, e, err);
		if (err->type == SUBTILIS_ERROR_OK)
			prv_1d_static_alloc(p, loc, type, e, store_reg, push,
					    err);
		subtilis_exp_delete(e);
	} else {
		prv_dynamic_vector_alloc(p, loc, type, e, store_reg, push, err);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %r9b, %al
movq 0x10(%rbp), %r9
movq %r8, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
andb $0x1, %al
movb %al, -0x29(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x5c57b
movq -0x28(%rbp), %rax
cmpl $0x0, 0x148(%rax)
jge 0x5c506
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rcx
movq 0x10(%rbp), %r9
movl $0x1, %r8d
callq 0x5c230
jmp 0x5c5a8
movq -0x28(%rbp), %rdi
movq 0x10(%rbp), %rsi
callq 0x47d20
movq %rax, -0x28(%rbp)
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5c525
jmp 0x5c5a8
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq 0x10(%rbp), %rdx
callq 0x47c10
movq %rax, -0x28(%rbp)
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x5c570
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movb -0x29(%rbp), %r9b
movq 0x10(%rbp), %rax
movq -0x8(%rbp), %r8
andb $0x1, %r9b
movzbl %r9b, %r9d
movq %rax, (%rsp)
callq 0x5c5b0
movq -0x28(%rbp), %rdi
callq 0x36ee0
jmp 0x5c5a8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movb -0x29(%rbp), %r9b
movq 0x10(%rbp), %rax
movq -0x8(%rbp), %r8
andb $0x1, %r9b
movzbl %r9b, %r9d
movq %rax, (%rsp)
callq 0x5c750
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: prv_1d_dynamic_alloc
static void prv_1d_dynamic_alloc(subtilis_parser_t *p, size_t loc,
				 const subtilis_type_t *type, subtilis_exp_t *e,
				 subtilis_ir_operand_t store_reg, bool push,
				 subtilis_error_t *err)
{
	subtilis_ir_operand_t ok_label;
	subtilis_ir_operand_t error_label;
	subtilis_ir_operand_t zero;
	subtilis_ir_operand_t condee;

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

	zero.integer = 0;
	condee.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_GTEI_I32, e->exp.ir_op, zero, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_ir_section_add_instr_reg(p->current, SUBTILIS_OP_INSTR_JMPC,
					  condee, ok_label, error_label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_ir_section_add_label(p->current, ok_label.label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	prv_1d_static_alloc(p, loc, type, e, store_reg, push, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %r9b, %al
movq 0x10(%rbp), %r9
movq %r8, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
andb $0x1, %al
movb %al, -0x29(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5d190
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x38(%rbp)
movl $0x0, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rbp), %r8
movq 0x148(%rax), %rdx
movq -0x48(%rbp), %rcx
movl $0x41, %esi
callq 0x38230
movq %rax, -0x50(%rbp)
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5cad9
jmp 0x5cb53
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq 0x10(%rbp), %r9
movq -0x50(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
movl $0x43, %esi
callq 0x38360
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5cb06
jmp 0x5cb53
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x38(%rbp), %rsi
movq 0x10(%rbp), %rdx
callq 0x39960
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5cb26
jmp 0x5cb53
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movb -0x29(%rbp), %r9b
movq 0x10(%rbp), %rax
movq -0x8(%rbp), %r8
andb $0x1, %r9b
movzbl %r9b, %r9d
movq %rax, (%rsp)
callq 0x5c5b0
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: subtilis_array_type_error_label
subtilis_ir_operand_t subtilis_array_type_error_label(subtilis_parser_t *p)
{
	subtilis_ir_operand_t error_label;

	if (p->current->array_access == SIZE_MAX) {
		error_label.label = subtilis_ir_section_new_label(p->current);
		p->current->array_access = error_label.label;
	} else {
		error_label.label = p->current->array_access;
	}

	return error_label;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
cmpq $-0x1, 0xb0(%rax)
jne 0x5d1d4
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq %rcx, 0xb0(%rax)
jmp 0x5d1e7
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0xb0(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: prv_calc_max_dim
static subtilis_exp_t *prv_calc_max_dim(subtilis_parser_t *p,
					const subtilis_type_t *type, size_t ptr,
					subtilis_error_t *err)
{
	subtilis_exp_t *max_dim = NULL;
	subtilis_exp_t *one;

	if (type->params.array.dims[0] != SUBTILIS_DYNAMIC_DIMENSION)
		max_dim =
		    subtilis_exp_new_int32(type->params.array.dims[0], err);
	else
		max_dim = subtilis_type_if_load_from_mem(
		    p, &subtilis_type_integer, ptr, SUBTIILIS_ARRAY_DIMS_OFF,
		    err);

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

	one = subtilis_exp_new_int32(1, err);
	if (err->type != SUBTILIS_ERROR_OK) {
		subtilis_exp_delete(max_dim);
		return NULL;
	}

	return subtilis_type_if_add(p, max_dim, one, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpl $-0x1, 0xc(%rax)
je 0x5d6f0
movq -0x18(%rbp), %rax
movl 0xc(%rax), %edi
movq -0x28(%rbp), %rsi
callq 0x37800
movq %rax, -0x30(%rbp)
jmp 0x5d711
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %r8
leaq 0x4e1cd(%rip), %rsi     # 0xab8d0
movl $0x10, %ecx
callq 0x48080
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5d724
movq $0x0, -0x8(%rbp)
jmp 0x5d76b
movq -0x28(%rbp), %rsi
movl $0x1, %edi
callq 0x37800
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5d752
movq -0x30(%rbp), %rdi
callq 0x36ee0
movq $0x0, -0x8(%rbp)
jmp 0x5d76b
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x48e20
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: prv_copy_ref_base
static void prv_copy_ref_base(subtilis_parser_t *p, const subtilis_type_t *t,
			      subtilis_ir_operand_t dest_reg,
			      size_t dest_offset,
			      subtilis_ir_operand_t source_reg,
			      size_t source_offset, bool ref,
			      subtilis_error_t *err)
{
	size_t ref_start;

	ref_start = prv_new_ref_base(p, t, dest_reg, dest_offset, source_reg,
				     source_offset, ref, err);
	/*
	 * It's important that this comes last as the reference we're
	 * copying might be left on the stack of a previous function.
	 * We don't want to overwrite the data before we've copied it.
	 */

	subtilis_reference_push_ref(p, t, ref_start, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x18(%rbp), %rax
movb 0x10(%rbp), %al
movq %rdx, -0x8(%rbp)
movq %r8, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r9, -0x30(%rbp)
andb $0x1, %al
movb %al, -0x31(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r9
movb -0x31(%rbp), %r10b
movq 0x18(%rbp), %rax
movq -0x8(%rbp), %rdx
movq -0x10(%rbp), %r8
andb $0x1, %r10b
movzbl %r10b, %r10d
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x5e3c0
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x18(%rbp), %rcx
callq 0x6ce80
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: subtilis_array_type_create_ref
void subtilis_array_type_create_ref(subtilis_parser_t *p, const char *var_name,
				    const subtilis_symbol_t *s, size_t mem_reg,
				    subtilis_exp_t *e, subtilis_error_t *err)
{
	subtilis_ir_operand_t dest_op;
	subtilis_ir_operand_t source_op;

	subtilis_array_type_match(p, &s->t, &e->type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	dest_op.reg = mem_reg;
	source_op.reg = e->exp.ir_op.reg;
	prv_copy_ref_base(p, &s->t, dest_op, s->loc, source_op, 0, true, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_reference_inc_cleanup_stack(p, &s->t, err);

cleanup:

	subtilis_exp_delete(e);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x5e240
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5e1c4
jmp 0x5e22e
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq 0x148(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq -0x40(%rbp), %r8
xorl %r9d, %r9d
movl $0x1, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x5e0f0
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5e219
jmp 0x5e22e
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
movq -0x30(%rbp), %rdx
callq 0x6d280
movq -0x28(%rbp), %rdi
callq 0x36ee0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: subtilis_array_type_match
void subtilis_array_type_match(subtilis_parser_t *p, const subtilis_type_t *t1,
			       const subtilis_type_t *t2, subtilis_error_t *err)
{
	if (!subtilis_type_eq(t1, t2)) {
		if (subtilis_type_if_is_array(t2) ||
		    subtilis_type_if_is_vector(t2))
			subtilis_error_set_array_type_mismatch(
			    err, p->l->stream->name, p->l->line);
		else
			subtilis_error_not_array_or_vector(
			    err, subtilis_type_name(t2), p->l->stream->name,
			    p->l->line);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x3d880
testb $0x1, %al
jne 0x5e30f
movq -0x18(%rbp), %rdi
callq 0x49ff0
testb $0x1, %al
jne 0x5e289
movq -0x18(%rbp), %rdi
callq 0x4a040
testb $0x1, %al
jne 0x5e289
jmp 0x5e2bb
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rdx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %ecx
movl $0x41, %esi
leaq 0x4e6cf(%rip), %r8      # 0xac97d
movl $0x572, %r9d            # imm = 0x572
callq 0x15930
jmp 0x5e30d
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3e190
movq -0x28(%rbp), %rdi
movq %rax, %rdx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %r9d
movl $0x3d, %esi
leaq 0x4cf81(%rip), %rcx     # 0xab276
leaq 0x4e681(%rip), %rax     # 0xac97d
movq %rax, (%rsp)
movl $0x576, 0x8(%rsp)       # imm = 0x576
callq 0x156d0
jmp 0x5e30f
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: subtilis_array_type_init_field
void subtilis_array_type_init_field(subtilis_parser_t *p,
				    const subtilis_type_t *type, size_t mem_reg,
				    size_t loc, subtilis_exp_t *e,
				    subtilis_error_t *err)
{
	subtilis_ir_operand_t dest_reg;
	subtilis_ir_operand_t source_reg;

	dest_reg.reg = mem_reg;
	source_reg.reg = e->exp.ir_op.reg;

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

	(void)prv_new_ref_base(p, type, dest_reg, loc, source_reg, 0, true,
			       err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

cleanup:

	subtilis_exp_delete(e);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq 0x148(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x5e240
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5e377
jmp 0x5e3b0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq -0x40(%rbp), %r8
xorl %r9d, %r9d
movl $0x1, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x5e3c0
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5e3ae
jmp 0x5e3b0
jmp 0x5e3b0
movq -0x28(%rbp), %rdi
callq 0x36ee0
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: subtilis_array_type_reset_field
void subtilis_array_type_reset_field(subtilis_parser_t *p,
				     const subtilis_type_t *type,
				     size_t mem_reg, size_t loc,
				     subtilis_exp_t *e, subtilis_error_t *err)
{
	subtilis_array_type_match(p, type, &e->type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	/*
	 * TODO: I suspect this is incorrect for arrays of RECS which need
	 * dereffing.  Check when we have initialiser for arrays of RECS.
	 */

	subtilis_array_type_assign_ref(p, type, mem_reg, loc, e->exp.ir_op.reg,
				       err);
cleanup:

	subtilis_exp_delete(e);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x5e240
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5e820
jmp 0x5e844
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq 0x148(%rax), %r8
movq -0x30(%rbp), %r9
callq 0x5e860
movq -0x28(%rbp), %rdi
callq 0x36ee0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: subtilis_array_type_assign_ref
void subtilis_array_type_assign_ref(subtilis_parser_t *p,
				    const subtilis_type_t *type,
				    size_t dest_mem_reg, size_t dest_loc,
				    size_t source_reg, subtilis_error_t *err)
{
	bool check_size = subtilis_type_if_is_vector(type);

	subtilis_reference_type_assign_ref(p, dest_mem_reg, dest_loc,
					   source_reg, check_size, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_array_type_copy_dims(p, type, dest_mem_reg, dest_loc,
				      source_reg, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4a040
andb $0x1, %al
movb %al, -0x31(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movb -0x31(%rbp), %al
movq -0x30(%rbp), %r9
andb $0x1, %al
movzbl %al, %r8d
callq 0x6d6f0
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5e8bb
jmp 0x5e8d8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x5e9e0
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: subtlis_array_type_copy_ret
void subtlis_array_type_copy_ret(subtilis_parser_t *p, const subtilis_type_t *t,
				 size_t dest_reg, size_t source_reg,
				 subtilis_error_t *err)
{
	subtilis_ir_operand_t d;
	subtilis_ir_operand_t s;

	d.reg = dest_reg;
	s.reg = source_reg;

	prv_copy_ref_base(p, t, d, 0, s, 0, false, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_reference_inc_cleanup_stack(p, t, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %r8
xorl %ecx, %ecx
movl %ecx, %r9d
xorl %ecx, %ecx
movq %r9, %rcx
movl $0x0, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x5e0f0
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5e946
jmp 0x5e957
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x6d280
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: subtilis_array_type_copy_dims
void subtilis_array_type_copy_dims(subtilis_parser_t *p,
				   const subtilis_type_t *type,
				   size_t dest_mem_reg, size_t dest_loc,
				   size_t source_reg, subtilis_error_t *err)
{
	size_t i;
	subtilis_ir_operand_t op0;
	subtilis_ir_operand_t op1;
	subtilis_ir_operand_t op2;
	size_t copy_reg;
	const subtilis_type_array_t *dest_type = &type->params.array;

	for (i = 0; i < dest_type->num_dims; i++) {
		if (dest_type->dims[i] != SUBTILIS_DYNAMIC_DIMENSION)
			continue;

		op0.reg = source_reg;
		op1.integer = SUBTIILIS_ARRAY_DIMS_OFF + (i * sizeof(int32_t));
		copy_reg = subtilis_ir_section_add_instr(
		    p->current, SUBTILIS_OP_INSTR_LOADO_I32, op0, op1, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;

		op0.reg = copy_reg;
		op1.reg = dest_mem_reg;
		op2.integer =
		    dest_loc + SUBTIILIS_ARRAY_DIMS_OFF + (i * sizeof(int32_t));
		subtilis_ir_section_add_instr_reg(p->current,
						  SUBTILIS_OP_INSTR_STOREO_I32,
						  op0, op1, op2, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x60(%rbp), %rcx
movslq (%rcx), %rcx
cmpq %rcx, %rax
jae 0x5eae6
movq -0x60(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpl $-0x1, 0x4(%rax,%rcx,4)
je 0x5ea3c
jmp 0x5ead5
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
shlq $0x2, %rax
addq $0x10, %rax
movl %eax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x30(%rbp), %r8
movq -0x40(%rbp), %rdx
movq -0x48(%rbp), %rcx
movl $0x12, %esi
callq 0x38230
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5ea80
jmp 0x5eae6
movq -0x58(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq -0x38(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl %eax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x30(%rbp), %r9
movq -0x40(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %r8
movl $0x17, %esi
callq 0x38360
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5ead3
jmp 0x5eae6
jmp 0x5ead5
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x5ea14
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: subtilis_array_gen_index_error_code
void subtilis_array_gen_index_error_code(subtilis_parser_t *p,
					 subtilis_error_t *err)
{
	subtilis_ir_operand_t error_label;
	subtilis_exp_t *ecode = NULL;

	if (p->current->array_access == SIZE_MAX)
		return;

	error_label.label = p->current->array_access;

	subtilis_ir_section_add_label(p->current, error_label.label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	ecode = subtilis_exp_new_int32(SUBTILIS_ERROR_CODE_BAD_DIM, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_exp_generate_error(p, ecode, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
cmpq $-0x1, 0xb0(%rax)
jne 0x5ed3c
jmp 0x5ed9d
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq 0xb0(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x39960
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5ed6f
jmp 0x5ed9d
movq -0x10(%rbp), %rsi
movl $0xa, %edi
callq 0x37800
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5ed8c
jmp 0x5ed9d
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x37d10
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: prv_1d_index_calc
static subtilis_exp_t *
prv_1d_index_calc(subtilis_parser_t *p, const char *var_name,
		  const subtilis_type_t *type, size_t mem_reg, size_t loc,
		  subtilis_exp_t **e, size_t index_count, subtilis_error_t *err)
{
	subtilis_exp_t *sizee = NULL;
	int32_t offset = loc + SUBTIILIS_ARRAY_DIMS_OFF;

	prv_check_last_index(p, var_name, e, type, offset, mem_reg, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	sizee = subtilis_type_if_dup(e[0], err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	sizee = subtilis_type_if_exp_to_var(p, sizee, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	return prv_compute_element_address(p, type, mem_reg, loc, sizee, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x30(%rbp), %rax
addq $0x10, %rax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl -0x44(%rbp), %r8d
movq -0x28(%rbp), %r9
movq 0x18(%rbp), %rax
movq %rax, (%rsp)
callq 0x5f720
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5f333
movq $0x0, -0x8(%rbp)
jmp 0x5f3a3
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movq 0x18(%rbp), %rsi
callq 0x47d20
movq %rax, -0x40(%rbp)
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5f35a
movq $0x0, -0x8(%rbp)
jmp 0x5f3a3
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq 0x18(%rbp), %rdx
callq 0x47c10
movq %rax, -0x40(%rbp)
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5f382
movq $0x0, -0x8(%rbp)
jmp 0x5f3a3
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x40(%rbp), %r8
movq 0x18(%rbp), %r9
callq 0x5f840
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: prv_get_dynamic_dim_size
static subtilis_exp_t *prv_get_dynamic_dim_size(subtilis_parser_t *p,
						int32_t dim_size,
						int32_t offset, size_t mem_reg,
						subtilis_error_t *err)
{
	subtilis_ir_operand_t op0;
	subtilis_ir_operand_t op1;
	size_t reg;
	subtilis_exp_t *maxe = NULL;

	if (dim_size == SUBTILIS_DYNAMIC_DIMENSION) {
		op0.reg = mem_reg;
		op1.integer = offset;
		reg = subtilis_ir_section_add_instr(
		    p->current, SUBTILIS_OP_INSTR_LOADO_I32, op0, op1, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return NULL;
		maxe = subtilis_exp_new_int32_var(reg, err);
	} else {
		maxe = subtilis_exp_new_int32(dim_size, err);
	}

	return maxe;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x48(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0x5f630
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movl $0x12, %esi
callq 0x38230
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5f61b
movq $0x0, -0x8(%rbp)
jmp 0x5f648
movq -0x40(%rbp), %rax
movl %eax, %edi
movq -0x28(%rbp), %rsi
callq 0x37770
movq %rax, -0x48(%rbp)
jmp 0x5f640
movl -0x14(%rbp), %edi
movq -0x28(%rbp), %rsi
callq 0x37800
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: prv_check_dynamic_index
static subtilis_exp_t *prv_check_dynamic_index(subtilis_parser_t *p,
					       subtilis_exp_t *e,
					       int32_t dim_size, int32_t offset,
					       size_t mem_reg,
					       subtilis_error_t *err)
{
	subtilis_exp_t *maxe;
	subtilis_exp_t *maxe_dup = NULL;

	maxe = prv_get_dynamic_dim_size(p, dim_size, offset, mem_reg, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	maxe_dup = subtilis_type_if_dup(maxe, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;
	prv_check_dynamic_dim(p, e, 0, maxe_dup, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	return maxe;

cleanup:

	subtilis_exp_delete(maxe);

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x5f5b0
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5f6b4
movq $0x0, -0x8(%rbp)
jmp 0x5f70d
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x47d20
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5f6d0
jmp 0x5f6fc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %r8
xorl %edx, %edx
callq 0x5eb40
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5f6f2
jmp 0x5f6fc
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5f70d
movq -0x38(%rbp), %rdi
callq 0x36ee0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: prv_check_last_index
static void prv_check_last_index(subtilis_parser_t *p, const char *var_name,
				 subtilis_exp_t **e,
				 const subtilis_type_t *type, int32_t offset,
				 size_t mem_reg, subtilis_error_t *err)
{
	int32_t dim_size;
	size_t i = type->params.array.num_dims - 1;
	subtilis_exp_t *maxe = NULL;

	dim_size = type->params.array.dims[i];
	if ((dim_size != SUBTILIS_DYNAMIC_DIMENSION) &&
	    (e[i]->type.type == SUBTILIS_TYPE_CONST_INTEGER)) {
		if ((e[i]->exp.ir_op.integer < 0) ||
		    (e[i]->exp.ir_op.integer > dim_size)) {
			subtilis_error_bad_index(
			    err, var_name, p->l->stream->name, p->l->line);
			return;
		}
	} else {
		maxe = prv_check_dynamic_index(p, e[i], dim_size, offset,
					       mem_reg, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		subtilis_exp_delete(maxe);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
subl $0x1, %eax
cltq
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq -0x40(%rbp), %rcx
movl 0xc(%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
cmpl $-0x1, -0x34(%rbp)
je 0x5f7f8
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x1, (%rax)
jne 0x5f7f8
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x148(%rax)
jl 0x5f7b2
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x148(%rax), %eax
cmpl -0x34(%rbp), %eax
jle 0x5f7f6
movq 0x10(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %r9d
movl $0x39, %esi
leaq 0x4ba9a(%rip), %rcx     # 0xab276
leaq 0x4d19a(%rip), %rax     # 0xac97d
movq %rax, (%rsp)
movl $0x6cd, 0x8(%rsp)       # imm = 0x6CD
callq 0x156d0
jmp 0x5f833
jmp 0x5f833
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movl -0x34(%rbp), %edx
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
movq 0x10(%rbp), %r9
callq 0x5f660
movq %rax, -0x48(%rbp)
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5f82a
jmp 0x5f833
movq -0x48(%rbp), %rdi
callq 0x36ee0
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)