// File: /workspace/github_c_makefile_star2_O2/markdryan[P]subtilis/frontend/parser_file.c
// Function: prv_block_operation_prep
static bool prv_block_operation_prep(subtilis_parser_t *p, subtilis_token_t *t,
				     subtilis_ir_operand_t *handle,
				     subtilis_ir_operand_t *array_size,
				     size_t *val_reg, bool *cow, bool *arg1_tmp,
				     size_t *el_size, subtilis_error_t *err)

{
	const char *tbuf;
	bool scalar_ref;
	bool check_dims = false;
	subtilis_exp_t *val = NULL;
	subtilis_type_t el_type;

	*handle = prv_parse_handle(p, t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return false;

	tbuf = subtilis_token_get_text(t);
	if ((t->type != SUBTILIS_TOKEN_OPERATOR) || strcmp(tbuf, ",")) {
		subtilis_error_set_expected(err, ",", tbuf, p->l->stream->name,
					    p->l->line);
		return false;
	}

	val = subtilis_parser_expression(p, t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return false;

	scalar_ref = subtilis_type_if_is_serializable_ref(&val->type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return false;
	if (!scalar_ref) {
		subtilis_type_diag_expected_error(
		    p, "string or array of scalar types", &val->type,
		    p->l->stream->name, p->l->line, err);
		goto cleanup;
	}

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

	*el_size = subtilis_type_if_size(&el_type, err);
	subtilis_type_free(&el_type);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;
	*arg1_tmp = val->temporary;
	*cow = val->type.type == SUBTILIS_TYPE_STRING;

	array_size->reg =
	    subtilis_reference_type_get_size(p, val->exp.ir_op.reg, 0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	check_dims = (val->type.type == SUBTILIS_TYPE_STRING) ||
		     subtilis_type_if_is_vector(&val->type);

	*val_reg = val->exp.ir_op.reg;

cleanup:

	subtilis_exp_delete(val);

	return check_dims;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %r9, 0x8(%rsp)
movq %r8, %r12
movq %rcx, %rbp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x1a0(%rsp), %r13
movq %r13, %rdx
callq 0x1fee7
movq %rax, (%rbx)
cmpl $0x0, (%r13)
jne 0x205d5
movq %r13, %rbx
movq 0x8(%rsp), %r13
movq %rbp, (%rsp)
movq %r15, %rdi
callq 0x12a25
cmpl $0x2, (%r15)
jne 0x205a5
cmpb $0x2c, (%rax)
jne 0x205a5
cmpb $0x0, 0x1(%rax)
je 0x205eb
movq (%r14), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x4d342(%rip), %r10     # 0x6d8f9
leaq 0x4cfd4(%rip), %rdx     # 0x6d592
pushq $0x1d
popq %rsi
movq %rbx, %rdi
movq %rax, %rcx
pushq $0x133                  # imm = 0x133
pushq %r10
callq 0x140cd
popq %rax
popq %rcx
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rbp
movq %rbx, %rdx
callq 0x1dfd5
cmpl $0x0, (%rbx)
jne 0x205d5
movq %rax, %r15
movq %rax, %rdi
movq %rbp, %rsi
callq 0x358d3
cmpl $0x0, (%rbp)
jne 0x205d5
testb %al, %al
je 0x206c0
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
movq %rbp, %rcx
callq 0x34108
cmpl $0x0, (%rbp)
jne 0x206e0
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x33df0
movq 0x198(%rsp), %rcx
movq %rax, (%rcx)
movq %rbp, %rdi
callq 0x2dc7c
cmpl $0x0, (%rbx)
jne 0x206e0
cmpq $0x0, 0x158(%r15)
movq 0x190(%rsp), %rax
setne (%rax)
cmpl $0x7, (%r15)
sete (%r13)
movq 0x148(%r15), %rsi
xorl %ebp, %ebp
movq %r14, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x4acab
movq (%rsp), %rcx
movq %rax, (%rcx)
cmpl $0x0, (%rbx)
jne 0x206e2
movb $0x1, %bpl
cmpl $0x7, (%r15)
je 0x206b3
movq %r15, %rdi
callq 0x357ea
movl %eax, %ebp
movq 0x148(%r15), %rax
movq %rax, (%r12)
jmp 0x206e2
movq (%r14), %rax
movq 0x30(%rax), %rcx
movl 0x38(%rax), %r8d
leaq 0x4d256(%rip), %rsi     # 0x6d928
movq %r14, %rdi
movq %r15, %rdx
movq %rbp, %r9
callq 0x35ae4
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x29d88
jmp 0x205d7