// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_float64_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;
	subtilis_ir_operand_t op1;

	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;

	op0.reg = p->current->reg_counter++;
	op1.reg = p->current->reg_counter++;
	subtilis_ir_section_add_instr_reg(p->current,
					  SUBTILIS_OP_INSTR_MOV_FP_I32_I32, op0,
					  op1, e->exp.ir_op, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_builtin_memset_i64(p, ptr, sizee, op0.reg, op1.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 0x56a60
jmp 0x56c55
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 0x56a8a
jmp 0x56c49
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 0x56ab4
jmp 0x56c49
testb $0x1, -0x31(%rbp)
je 0x56b55
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 0x56b2d
jmp 0x56c49
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 0x56b53
jmp 0x56c49
jmp 0x56b55
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 0x56b7f
jmp 0x56c49
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rcx
movq 0x18(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x18(%rcx)
movq %rax, -0x1a8(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rcx
movq 0x18(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x18(%rcx)
movq %rax, -0x1b0(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x18(%rbp), %r9
movq -0x1a8(%rbp), %rdx
movq -0x1b0(%rbp), %rcx
movq 0x148(%rax), %r8
movl $0x99, %esi
callq 0x38360
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x56bf5
jmp 0x56c49
movq -0x8(%rbp), %rdi
movq -0x188(%rbp), %rsi
movq -0x190(%rbp), %rdx
movq -0x1a8(%rbp), %rcx
movq -0x1b0(%rbp), %r8
movq 0x18(%rbp), %r9
callq 0x3fd90
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x56c29
jmp 0x56c49
testb $0x1, -0x31(%rbp)
je 0x56c47
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x1a0(%rbp), %rsi
movq 0x18(%rbp), %rdx
callq 0x39960
jmp 0x56c49
leaq -0x180(%rbp), %rdi
callq 0x3e100
movq -0x30(%rbp), %rdi
callq 0x36ee0
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
nopw (%rax,%rax)