// File: /workspace/github_c_makefile_star2_O1/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 0x20cc7
movq %rax, (%rbx)
cmpl $0x0, (%r13)
jne 0x21419
movq %r14, %r13
movq 0x8(%rsp), %r14
movq %rbp, (%rsp)
movq %r15, %rdi
callq 0x12ad0
movq %rax, %rbx
cmpl $0x2, (%r15)
jne 0x213e0
leaq 0x521c4(%rip), %rsi     # 0x73598
movq %rbx, %rdi
callq 0x12160
testl %eax, %eax
je 0x2142f
movq (%r13), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x52528(%rip), %rax     # 0x7391b
leaq 0x5219e(%rip), %rdx     # 0x73598
movq 0x1a0(%rsp), %rdi
movl $0x1d, %esi
movq %rbx, %rcx
pushq $0x133                  # imm = 0x133
pushq %rax
callq 0x1442a
addq $0x10, %rsp
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 %r13, %rdi
movq %r15, %rsi
movq 0x1a0(%rsp), %rbp
movq %rbp, %rdx
callq 0x1eb88
cmpl $0x0, (%rbp)
jne 0x21419
movq %rax, %r15
movq %rax, %rdi
movq %rbp, %rsi
callq 0x37910
cmpl $0x0, (%rbp)
jne 0x21419
testb %al, %al
je 0x21511
leaq 0x10(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rcx
callq 0x3620e
cmpl $0x0, (%rbp)
jne 0x21532
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x35ed8
movq 0x198(%rsp), %rcx
movq %rax, (%rcx)
movq %rbx, %rdi
callq 0x2f843
cmpl $0x0, (%rbp)
jne 0x21532
cmpq $0x0, 0x158(%r15)
movq 0x190(%rsp), %rax
setne (%rax)
cmpl $0x7, (%r15)
sete (%r14)
movq 0x148(%r15), %rsi
movq %rbp, %rbx
xorl %ebp, %ebp
movq %r13, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x4d908
movq (%rsp), %rcx
movq %rax, (%rcx)
cmpl $0x0, (%rbx)
jne 0x21534
movb $0x1, %bpl
cmpl $0x7, (%r15)
je 0x21504
movq %r15, %rdi
callq 0x37815
movl %eax, %ebp
movq 0x148(%r15), %rax
movq %rax, (%r12)
jmp 0x21534
movq (%r13), %rax
movq 0x30(%rax), %rcx
movl 0x38(%rax), %r8d
leaq 0x52426(%rip), %rsi     # 0x7394a
movq %r13, %rdi
movq %r15, %rdx
movq %rbp, %r9
callq 0x37b3e
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x2b4c3
jmp 0x2141b