// File: /workspace/github_c_makefile_star2_O3/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 0x20c73
movq %rax, (%rbx)
cmpl $0x0, (%r13)
jne 0x21383
movq %r13, %rbx
movq 0x8(%rsp), %r13
movq %rbp, (%rsp)
movq %r15, %rdi
callq 0x12ad0
cmpl $0x2, (%r15)
jne 0x2134f
cmpb $0x2c, (%rax)
jne 0x2134f
cmpb $0x0, 0x1(%rax)
je 0x21399
movq (%r14), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x525dc(%rip), %r10     # 0x7393d
leaq 0x5222a(%rip), %rdx     # 0x73592
movq %rbx, %rdi
movl $0x1d, %esi
movq %rax, %rcx
pushq $0x133                  # imm = 0x133
pushq %r10
callq 0x143da
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 %r14, %rdi
movq %r15, %rsi
movq %rbx, %rbp
movq %rbx, %rdx
callq 0x1ec4c
cmpl $0x0, (%rbx)
jne 0x21383
movq %rax, %r15
movq %rax, %rdi
movq %rbp, %rsi
callq 0x377bc
cmpl $0x0, (%rbp)
jne 0x21383
testb %al, %al
je 0x2146e
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
movq %rbp, %rcx
callq 0x360be
cmpl $0x0, (%rbp)
jne 0x2148e
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x35d88
movq 0x198(%rsp), %rcx
movq %rax, (%rcx)
movq %rbp, %rdi
callq 0x2f56e
cmpl $0x0, (%rbx)
jne 0x2148e
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 0x4d8c4
movq (%rsp), %rcx
movq %rax, (%rcx)
cmpl $0x0, (%rbx)
jne 0x21490
movb $0x1, %bpl
cmpl $0x7, (%r15)
je 0x21461
movq %r15, %rdi
callq 0x376d3
movl %eax, %ebp
movq 0x148(%r15), %rax
movq %rax, (%r12)
jmp 0x21490
movq (%r14), %rax
movq 0x30(%rax), %rcx
movl 0x38(%rax), %r8d
leaq 0x524ec(%rip), %rsi     # 0x7396c
movq %r14, %rdi
movq %r15, %rdx
movq %rbp, %r9
callq 0x379db
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x2b166
jmp 0x21385