// File: /workspace/github_c_makefile_star2_O2/markdryan[P]subtilis/frontend/parser_file.c
// Function: subtilis_parser_get_hash
subtilis_exp_t *subtilis_parser_get_hash(subtilis_parser_t *p,
					 subtilis_token_t *t,
					 subtilis_error_t *err)
{
	subtilis_ir_operand_t handle;
	subtilis_ir_operand_t ret;
	subtilis_ir_operand_t zero;
	subtilis_ir_operand_t data;
	subtilis_ir_operand_t skip_label;
	subtilis_ir_operand_t array_size;
	subtilis_ir_operand_t get_label;
	bool check_dims;
	bool arg1_tmp;
	size_t val_reg;
	const char *tbuf;
	size_t el_size;
	subtilis_exp_t *a1;
	subtilis_exp_t *a2;
	bool cow = false;

	skip_label.label = subtilis_ir_section_new_label(p->current);
	get_label.label = subtilis_ir_section_new_label(p->current);

	subtilis_lexer_get(p->l, t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	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 NULL;
	}

	check_dims =
	    prv_block_operation_prep(p, t, &handle, &array_size, &val_reg, &cow,
				     &arg1_tmp, &el_size, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	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 NULL;
	}

	subtilis_lexer_get(p->l, t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	if (arg1_tmp) {
		subtilis_error_set_temporary_not_allowed(
		    err, "second argument to get#", p->l->stream->name,
		    p->l->line);
		return NULL;
	}

	ret.reg = p->current->reg_counter++;
	if (check_dims) {
		zero.integer = 0;
		subtilis_ir_section_add_instr_no_reg2(
		    p->current, SUBTILIS_OP_INSTR_MOVI_I32, ret, zero, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return NULL;

		subtilis_ir_section_add_instr_reg(
		    p->current, SUBTILIS_OP_INSTR_JMPC, array_size, get_label,
		    skip_label, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return NULL;

		subtilis_ir_section_add_label(p->current, get_label.label, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return NULL;
	}

	if (cow)
		data.reg = subtilis_reference_type_copy_on_write(
		    p, val_reg, 0, array_size.reg, err);
	else
		data.reg = subtilis_reference_get_data(p, val_reg, 0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	subtilis_ir_section_add_instr4(p->current, SUBTILIS_OP_INSTR_BLOCK_GET,
				       ret, handle, data, array_size, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	subtilis_exp_handle_errors(p, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	if (check_dims)
		subtilis_ir_section_add_label(p->current, skip_label.label,
					      err);

	a1 = subtilis_exp_new_int32_var(ret.reg, err);
	if (el_size == 1)
		return a1;

	a2 = subtilis_exp_new_int32((int32_t)el_size, err);
	if (err->type != SUBTILIS_ERROR_OK) {
		subtilis_exp_delete(a1);
		return NULL;
	}

	return subtilis_type_if_div(p, a1, a2, err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
movb $0x0, 0xe(%rsp)
movq 0x48(%rdi), %rdi
callq 0x2b774
movq %rax, %r15
movq 0x48(%r14), %rdi
callq 0x2b774
movq %rax, %r12
movq (%r14), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x12e0e
cmpl $0x0, (%rbx)
jne 0x20303
movq %r13, %rdi
callq 0x12a25
cmpl $0x2, (%r13)
jne 0x202d3
cmpb $0x28, (%rax)
jne 0x202d3
cmpb $0x0, 0x1(%rax)
je 0x20318
movq (%r14), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x4d614(%rip), %r10     # 0x6d8f9
leaq 0x4def6(%rip), %rdx     # 0x6e1e2
pushq $0x1d
popq %rsi
movq %rbx, %rdi
movq %rax, %rcx
pushq $0x17f                  # imm = 0x17F
pushq %r10
callq 0x140cd
popq %rax
popq %rcx
xorl %r13d, %r13d
movq %r13, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
subq $0x8, %rsp
leaq 0x28(%rsp), %rax
leaq 0x17(%rsp), %r10
leaq 0x38(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x16(%rsp), %r9
movq %r14, %rdi
movq %r13, %rsi
pushq %rbx
pushq %rax
pushq %r10
callq 0x20541
addq $0x20, %rsp
cmpl $0x0, (%rbx)
jne 0x20303
movl %eax, %ebp
movq %r13, %rdi
callq 0x12a25
cmpl $0x2, (%r13)
jne 0x2036e
cmpb $0x29, (%rax)
jne 0x2036e
cmpb $0x0, 0x1(%rax)
je 0x2039a
movq (%r14), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x4d579(%rip), %r10     # 0x6d8f9
leaq 0x4d736(%rip), %rdx     # 0x6dabd
pushq $0x1d
popq %rsi
movq %rbx, %rdi
movq %rax, %rcx
pushq $0x18c                  # imm = 0x18C
jmp 0x202fa
movq (%r14), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x12e0e
cmpl $0x0, (%rbx)
jne 0x20303
cmpb $0x1, 0xf(%rsp)
jne 0x203e9
movq (%r14), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x4d52f(%rip), %rax     # 0x6d8f9
leaq 0x4d53f(%rip), %rdx     # 0x6d910
leaq 0x4d9ed(%rip), %rcx     # 0x6ddc5
pushq $0x53
popq %rsi
movq %rbx, %rdi
pushq $0x197                  # imm = 0x197
pushq %rax
jmp 0x202fc
movq 0x48(%r14), %rdi
movq 0x18(%rdi), %rdx
leaq 0x1(%rdx), %rax
movq %rax, 0x18(%rdi)
testb %bpl, %bpl
je 0x2045c
xorl %r13d, %r13d
pushq $0x1b
popq %rsi
movq %rdx, 0x18(%rsp)
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x2a9a4
cmpl $0x0, (%rbx)
jne 0x20306
movq 0x48(%r14), %rdi
movq 0x10(%rsp), %rdx
pushq $0x43
popq %rsi
movq %r12, %rcx
movq %r15, %r8
movq %rbx, %r9
callq 0x2a8c1
cmpl $0x0, (%rbx)
jne 0x20303
movq 0x48(%r14), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x2b781
cmpl $0x0, (%rbx)
movq 0x18(%rsp), %rdx
jne 0x20303
movq %rdx, %r12
movq 0x28(%rsp), %rsi
cmpb $0x1, 0xe(%rsp)
jne 0x2047f
movq 0x10(%rsp), %rcx
movq %r14, %rdi
xorl %edx, %edx
movq %rbx, %r8
callq 0x4aecb
jmp 0x2048c
movq %r14, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x4a690
cmpl $0x0, (%rbx)
jne 0x20303
movq 0x48(%r14), %rdi
movq 0x30(%rsp), %rcx
movq 0x10(%rsp), %r9
subq $0x8, %rsp
movl $0x91, %esi
movq %r12, %rdx
movq %rax, %r8
pushq %rbx
callq 0x2aa15
popq %rax
popq %rcx
cmpl $0x0, (%rbx)
jne 0x20303
movq %r14, %rdi
movq %rbx, %rsi
callq 0x29c49
cmpl $0x0, (%rbx)
jne 0x20303
testb %bpl, %bpl
je 0x204eb
movq 0x48(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2b781
movl %r12d, %edi
movq %rbx, %rsi
callq 0x2a336
movq %rax, %r13
movq 0x20(%rsp), %rdi
cmpq $0x1, %rdi
je 0x20306
movq %rbx, %rsi
callq 0x2a369
cmpl $0x0, (%rbx)
je 0x20522
movq %r13, %rdi
callq 0x29d88
jmp 0x20303
movq %r14, %rdi
movq %r13, %rsi
movq %rax, %rdx
movq %rbx, %rcx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x34efa