// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/parser_assignment.c
// Function: prv_assign_col_field
static void prv_assign_col_field(subtilis_parser_t *p, subtilis_token_t *t,
				 size_t dims, subtilis_exp_t **indices,
				 const char *var_name,
				 const subtilis_type_t *array_type,
				 subtilis_error_t *err)
{
	subtilis_exp_t *offset;
	size_t mem_reg;
	bool new_global;
	const subtilis_symbol_t *s;
	subtilis_type_t el_type;

	if ((array_type->type != SUBTILIS_TYPE_ARRAY_REC) &&
	    (array_type->type != SUBTILIS_TYPE_VECTOR_REC)) {
		subtilis_error_set_expected(err, "Collection of RECs",
					    subtilis_type_name(array_type),
					    p->l->stream->name, p->l->line);
		return;
	}

	if (dims == 0) {
		subtilis_error_set_expected(err, "Collection of RECs",
					    "Collection reference",
					    p->l->stream->name, p->l->line);
		return;
	}

	subtilis_parser_lookup_assignment_var(p, t, var_name, &s, &mem_reg,
					      &new_global, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;
	if (new_global) {
		subtilis_error_set_unknown_variable(
		    err, var_name, p->l->stream->name, p->l->line);
		return;
	}

	offset = subtilis_array_index_calc(p, var_name, &s->t, mem_reg, s->loc,
					   indices, dims, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_type_if_element_type(p, &s->t, &el_type, err);
	if (err->type != SUBTILIS_ERROR_OK) {
		subtilis_exp_delete(offset);
		return;
	}

	prv_assign_field(p, t, &el_type, offset->exp.ir_op.reg, 0, err);
	subtilis_exp_delete(offset);
	subtilis_type_free(&el_type);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq 0x10(%rbp), %rax
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 -0x30(%rbp), %rax
cmpl $0xf, (%rax)
je 0x1d6a6
movq -0x30(%rbp), %rax
cmpl $0x15, (%rax)
je 0x1d6a6
movq 0x10(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x30(%rbp), %rdi
callq 0x3e190
movq -0x1a0(%rbp), %rdi
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %r9d
movl $0x1d, %esi
leaq 0x8ce8e(%rip), %rdx     # 0xaa517
leaq 0x8cf2c(%rip), %rax     # 0xaa5bc
movq %rax, (%rsp)
movl $0xc0, 0x8(%rsp)
callq 0x156d0
jmp 0x1d828
cmpq $0x0, -0x18(%rbp)
jne 0x1d6f7
movq 0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %r9d
movl $0x1d, %esi
leaq 0x8ce44(%rip), %rdx     # 0xaa517
leaq 0x8cf3c(%rip), %rcx     # 0xaa616
leaq 0x8cedb(%rip), %rax     # 0xaa5bc
movq %rax, (%rsp)
movl $0xc7, 0x8(%rsp)
callq 0x156d0
jmp 0x1d828
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq 0x10(%rbp), %rax
leaq -0x50(%rbp), %rcx
leaq -0x40(%rbp), %r8
leaq -0x41(%rbp), %r9
movq %rax, (%rsp)
callq 0x1b6a0
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x1d72a
jmp 0x1d828
testb $0x1, -0x41(%rbp)
je 0x1d777
movq 0x10(%rbp), %rdi
movq -0x28(%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 $0x1b, %esi
leaq 0x8db1c(%rip), %rcx     # 0xab276
leaq 0x8ce5b(%rip), %rax     # 0xaa5bc
movq %rax, (%rsp)
movl $0xd1, 0x8(%rsp)
callq 0x156d0
jmp 0x1d828
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq $0x8, %rdx
movq -0x40(%rbp), %rcx
movq -0x50(%rbp), %rax
movq (%rax), %r8
movq -0x20(%rbp), %r9
movq -0x18(%rbp), %r10
movq 0x10(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x5edb0
movq %rax, -0x38(%rbp)
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x1d7bb
jmp 0x1d828
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rsi
addq $0x8, %rsi
movq 0x10(%rbp), %rcx
leaq -0x198(%rbp), %rdx
callq 0x47b70
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x1d7eb
movq -0x38(%rbp), %rdi
callq 0x36ee0
jmp 0x1d828
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rax
movq 0x148(%rax), %rcx
movq 0x10(%rbp), %r9
leaq -0x198(%rbp), %rdx
xorl %eax, %eax
movl %eax, %r8d
callq 0x1c440
movq -0x38(%rbp), %rdi
callq 0x36ee0
leaq -0x198(%rbp), %rdi
callq 0x3e100
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
nopw %cs:(%rax,%rax)