// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/parser_exp.c
// Function: subtilis_exp_get_lvalue_with_sym
bool subtilis_exp_get_lvalue_with_sym(subtilis_parser_t *p, subtilis_token_t *t,
				      const subtilis_type_t *stype,
				      const char *var_name, size_t mem_reg,
				      size_t loc, subtilis_ir_operand_t *op,
				      subtilis_type_t *type, bool is_reg,
				      subtilis_error_t *err)
{
	const char *tbuf;

	if (subtilis_type_if_is_numeric(stype) ||
	    (stype->type == SUBTILIS_TYPE_FN) ||
	    (stype->type == SUBTILIS_TYPE_STRING)) {
		subtilis_type_copy(type, stype, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return false;
		subtilis_lexer_get(p->l, t, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return false;

		if (is_reg) {
			op->reg = loc;
			return true;
		}
		op->reg = subtilis_reference_get_pointer(p, mem_reg, loc, err);

		return false;
	}

	if (stype->type == SUBTILIS_TYPE_REC) {
		subtilis_lexer_get(p->l, 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_type_copy(type, stype, err);
			if (err->type != SUBTILIS_ERROR_OK)
				return false;
			op->reg = subtilis_reference_get_pointer(p, mem_reg,
								 loc, err);
			return false;
		}

		/*
		 * Otherwise we have a record field.  We'll recursively call
		 * into this function via subtilis_parser_rec_field_lvalue.
		 */

		op->reg = subtilis_parser_rec_field_lvalue(p, t, stype, mem_reg,
							   loc, type, err);
		return false;
	}

	/*
	 * Need special handling for arrays and vectors
	 */

	if (subtilis_type_if_is_array(stype)) {
		op->reg = subtils_parser_array_lvalue(
		    p, t, stype, loc, var_name, mem_reg, type, err);
		subtilis_lexer_get(p->l, t, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return false;
		return false;
	}

	if (subtilis_type_if_is_vector(stype)) {
		op->reg = subtils_parser_vector_lvalue(
		    p, t, stype, loc, var_name, mem_reg, type, err);
		subtilis_lexer_get(p->l, t, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return false;
		return false;
	}

	subtilis_error_set_assertion_failed(err);
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movq %r8, (%rsp)
movq %rcx, %rbp
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
movq 0x58(%rsp), %rbx
movq %rdx, %rdi
callq 0x37676
testb %al, %al
je 0x1e5d9
movq 0x48(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x2fa5f
cmpl $0x0, (%rbx)
jne 0x1e6ea
movq (%r14), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x12eda
cmpl $0x0, (%rbx)
jne 0x1e6ea
cmpb $0x0, 0x50(%rsp)
je 0x1e670
movq 0x40(%rsp), %rax
movq %r15, (%rax)
movb $0x1, %al
jmp 0x1e6ec
movl (%r12), %eax
cmpl $0x7, %eax
je 0x1e58f
cmpl $0x16, %eax
je 0x1e61e
cmpl $0x9, %eax
je 0x1e58f
movq %r12, %rdi
callq 0x377f7
testb %al, %al
je 0x1e68c
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %rbp, %r8
movq (%rsp), %r9
pushq %rbx
pushq 0x50(%rsp)
callq 0x15e28
jmp 0x1e6b5
movq (%r14), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x12eda
cmpl $0x0, (%rbx)
jne 0x1e6ea
movq %r13, %rdi
callq 0x12ad0
cmpl $0x2, (%r13)
jne 0x1e65b
leaq 0x54eb9(%rip), %rsi     # 0x73504
movq %rax, %rdi
callq 0x12160
testl %eax, %eax
je 0x1e6fb
movq 0x48(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x2fa5f
cmpl $0x0, (%rbx)
jne 0x1e6ea
movq %r14, %rdi
movq (%rsp), %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x4d763
movq 0x40(%rsp), %rcx
movq %rax, (%rcx)
jmp 0x1e6ea
movq %r12, %rdi
callq 0x37815
testb %al, %al
je 0x1e6d1
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %rbp, %r8
movq (%rsp), %r9
pushq %rbx
pushq 0x50(%rsp)
callq 0x16329
addq $0x10, %rsp
movq 0x40(%rsp), %rcx
movq %rax, (%rcx)
movq (%r14), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x12eda
jmp 0x1e6ea
leaq 0x551d4(%rip), %rdx     # 0x738ac
movq %rbx, %rdi
movl $0xf, %esi
movl $0xd7, %ecx
callq 0x145f4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
subq $0x8, %rsp
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq 0x8(%rsp), %rcx
movq %r15, %r8
movq 0x50(%rsp), %r9
pushq %rbx
callq 0x298b3
addq $0x10, %rsp
jmp 0x1e682