// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_int32_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 ptr;
	size_t sizee;
	subtilis_ir_operand_t gt_zero;
	subtilis_ir_operand_t eq_zero;
	subtilis_ir_operand_t op0;

	eq_zero.label = SIZE_MAX;

	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_builtin_memset_i32(p, ptr, sizee, e->exp.ir_op.reg, err);
	if (err->type != SUBTILIS_ERROR_OK)
		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 $0x1b0, %rsp            # imm = 0x1B0
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, -0x1a0(%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 0x54830
jmp 0x549a6
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 0x5485a
jmp 0x5499a
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq 0x18(%rbp), %rcx
callq 0x6dc00
movq %rax, -0x190(%rbp)
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x54884
jmp 0x5499a
testb $0x1, -0x31(%rbp)
je 0x54922
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x198(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x1a0(%rbp)
movq -0x190(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq 0x18(%rbp), %r9
movq -0x1a8(%rbp), %rdx
movq -0x198(%rbp), %rcx
movq -0x1a0(%rbp), %r8
movl $0x43, %esi
callq 0x38360
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x548fd
jmp 0x5499a
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x198(%rbp), %rsi
movq 0x18(%rbp), %rdx
callq 0x39960
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x54920
jmp 0x5499a
jmp 0x54922
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq 0x18(%rbp), %rcx
callq 0x6d1e0
movq %rax, -0x188(%rbp)
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x54949
jmp 0x5499a
movq -0x8(%rbp), %rdi
movq -0x188(%rbp), %rsi
movq -0x190(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0x148(%rax), %rcx
movq 0x18(%rbp), %r8
callq 0x3fb30
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5497a
jmp 0x5499a
testb $0x1, -0x31(%rbp)
je 0x54998
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x1a0(%rbp), %rsi
movq 0x18(%rbp), %rdx
callq 0x39960
jmp 0x5499a
leaq -0x180(%rbp), %rdi
callq 0x3e100
movq -0x30(%rbp), %rdi
callq 0x36ee0
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
nopl (%rax,%rax)