// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/parser_assignment.c
// Function: prv_assign_fn_field
static void prv_assign_fn_field(subtilis_parser_t *p, subtilis_token_t *t,
				const subtilis_type_t *type, size_t reg,
				size_t loc, subtilis_error_t *err)
{
	subtilis_exp_t *e;
	const char *tbuf = subtilis_token_get_text(t);

	if ((t->type == SUBTILIS_TOKEN_OPERATOR) && !strcmp(tbuf, "(")) {
		/*
		 * We have a procedure call, and not an assignment.
		 */

		e = subtilis_type_if_load_from_mem(p, type, reg, loc, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;

		(void)subtilis_parser_call_known_ptr(p, t, type,
						     e->exp.ir_op.reg, err);
		subtilis_exp_delete(e);
		return;
	}

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

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

	if (e->partial_name)
		subtilis_parser_call_add_addr(p, type, e, err);
	else
		e = subtilis_type_if_coerce_type(p, e, type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_type_if_assign_to_mem(p, reg, loc, e, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x12d70
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x1db74
movq -0x40(%rbp), %rdi
leaq 0x8d78b(%rip), %rsi     # 0xab29c
callq 0x12140
cmpl $0x0, %eax
jne 0x1db74
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x48080
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x1db46
jmp 0x1dc5b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rax
movq 0x148(%rax), %rcx
movq -0x30(%rbp), %r8
callq 0x1fc30
movq -0x38(%rbp), %rdi
callq 0x36ee0
jmp 0x1dc5b
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x1db92
movq -0x40(%rbp), %rdi
leaq 0x8ca8c(%rip), %rsi     # 0xaa614
callq 0x12140
cmpl $0x0, %eax
je 0x1dbd9
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %r9d
movl $0x14, %esi
leaq 0x8d6ba(%rip), %rcx     # 0xab276
leaq 0x8c9f9(%rip), %rax     # 0xaa5bc
movq %rax, (%rsp)
movl $0x31c, 0x8(%rsp)       # imm = 0x31C
callq 0x156d0
jmp 0x1dc5b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x24a20
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x1dbf9
jmp 0x1dc5b
movq -0x38(%rbp), %rax
cmpq $0x0, 0x160(%rax)
je 0x1dc1e
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x21910
jmp 0x1dc37
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x4a2e0
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x1dc42
jmp 0x1dc5b
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x47f20
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)