// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_rec_type.c
// Function: prv_set
static void prv_set(subtilis_parser_t *p, const char *var_name,
		    const subtilis_type_t *type, size_t mem_reg, size_t loc,
		    subtilis_exp_t *e, bool check_size, subtilis_error_t *err)
{
	subtilis_type_t el_type;
	size_t sizee;
	//	size_t ptr;
	subtilis_ir_operand_t gt_zero;
	subtilis_ir_operand_t eq_zero;
	subtilis_ir_operand_t op0;

	eq_zero.label = SIZE_MAX;

	el_type.type = SUBTILIS_TYPE_VOID;
	subtilis_type_if_element_type(p, type, &el_type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto free_e;

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

	sizee = subtilis_reference_type_get_size(p, mem_reg, loc, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	if (check_size) {
		gt_zero.label = subtilis_ir_section_new_label(p->current);
		eq_zero.label = subtilis_ir_section_new_label(p->current);
		op0.reg = sizee;
		subtilis_ir_section_add_instr_reg(p->current,
						  SUBTILIS_OP_INSTR_JMPC, op0,
						  gt_zero, eq_zero, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
		subtilis_ir_section_add_label(p->current, gt_zero.label, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
	}

	//	ptr = subtilis_reference_get_data(p, mem_reg, loc, err);
	//	if (err->type != SUBTILIS_ERROR_OK)
	//		goto cleanup;

	subtilis_error_set_assertion_failed(err);
	goto cleanup;

	if (check_size)
		subtilis_ir_section_add_label(p->current, eq_zero.label, err);

cleanup:
	subtilis_type_free(&el_type);

free_e:
	subtilis_exp_delete(e);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq 0x18(%rbp), %rax
movb 0x10(%rbp), %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
andb $0x1, %al
movb %al, -0x31(%rbp)
movq $-0x1, -0x198(%rbp)
movl $0x8, -0x180(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq 0x18(%rbp), %rcx
leaq -0x180(%rbp), %rdx
callq 0x47b70
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5a61a
jmp 0x5a72f
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq 0x18(%rbp), %rcx
leaq -0x180(%rbp), %rdx
callq 0x4a2e0
movq %rax, -0x30(%rbp)
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5a644
jmp 0x5a723
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq 0x18(%rbp), %rcx
callq 0x6dc00
movq %rax, -0x188(%rbp)
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5a66e
jmp 0x5a723
testb $0x1, -0x31(%rbp)
je 0x5a709
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x190(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x198(%rbp)
movq -0x188(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq 0x18(%rbp), %r9
movq -0x1a0(%rbp), %rdx
movq -0x190(%rbp), %rcx
movq -0x198(%rbp), %r8
movl $0x43, %esi
callq 0x38360
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5a6e4
jmp 0x5a723
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x190(%rbp), %rsi
movq 0x18(%rbp), %rdx
callq 0x39960
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5a707
jmp 0x5a723
jmp 0x5a709
movq 0x18(%rbp), %rdi
movl $0xf, %esi
leaq 0x51fe6(%rip), %rdx     # 0xac6ff
movl $0xf0, %ecx
callq 0x158e0
leaq -0x180(%rbp), %rdi
callq 0x3e100
movq -0x30(%rbp), %rdi
callq 0x36ee0
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
nopw %cs:(%rax,%rax)