// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/parser_loops.c
// Function: prv_assign_range_var
static void prv_assign_range_var(subtilis_parser_t *p,
				 subtilis_ir_operand_t ptr,
				 const subtilis_range_var_t *var,
				 bool new_locals, subtilis_error_t *err)
{
	subtilis_exp_t *val;

	if (var->for_ctx.type.type == SUBTILIS_TYPE_REC) {
		if (new_locals)
			/*
			 * Special handling for RECs.  We just memcpy.
			 */

			subtilis_rec_type_tmp_copy(
			    p, &var->for_ctx.type, var->for_ctx.reg,
			    var->for_ctx.loc, ptr.reg, err);
		else
			subtilis_rec_type_copy(
			    p, &var->for_ctx.type, var->for_ctx.reg,
			    var->for_ctx.loc, ptr.reg, false, err);
		return;
	}

	val = subtilis_type_if_load_from_mem(p, &var->for_ctx.type, ptr.reg, 0,
					     err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	if (!subtilis_type_if_is_numeric(&var->for_ctx.type) &&
	    var->for_ctx.type.type != SUBTILIS_TYPE_FN) {
		/*
		 * If we have a reference type and it's a new local, there's
		 * no need to go through all the reference counting.  We know
		 * that the array has references to every element we're
		 * iterating through, so this saves some code.
		 */

		if (!new_locals)
			subtilis_type_if_assign_ref(p, &var->type,
						    var->for_ctx.reg,
						    var->for_ctx.loc, val, err);
		else
			subtilis_type_if_assign_ref_no_rc(
			    p, &var->type, var->for_ctx.reg, var->for_ctx.loc,
			    val, err);

	} else if (var->for_ctx.is_reg) {
		subtilis_type_if_assign_to_reg(p, var->for_ctx.loc, val, err);
	} else {
		subtilis_type_if_assign_to_mem(p, var->for_ctx.reg,
					       var->for_ctx.loc, val, err);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %cl, %al
movq %rsi, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq %r8, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x16, 0x168(%rax)
jne 0x2cb00
testb $0x1, -0x19(%rbp)
je 0x2cabe
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x150, %rsi            # imm = 0x150
addq $0x18, %rsi
movq -0x18(%rbp), %rax
movq 0x158(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x160(%rax), %rcx
movq -0x8(%rbp), %r8
movq -0x28(%rbp), %r9
callq 0x627a0
jmp 0x2cafb
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x150, %rsi            # imm = 0x150
addq $0x18, %rsi
movq -0x18(%rbp), %rax
movq 0x158(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x160(%rax), %rcx
movq -0x8(%rbp), %r8
movq -0x28(%rbp), %rax
xorl %r9d, %r9d
movq %rax, (%rsp)
callq 0x62680
jmp 0x2cc17
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x150, %rsi            # imm = 0x150
addq $0x18, %rsi
movq -0x8(%rbp), %rdx
movq -0x28(%rbp), %r8
xorl %eax, %eax
movl %eax, %ecx
callq 0x48080
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2cb36
jmp 0x2cc17
movq -0x18(%rbp), %rdi
addq $0x150, %rdi            # imm = 0x150
addq $0x18, %rdi
callq 0x49d10
testb $0x1, %al
jne 0x2cbc3
movq -0x18(%rbp), %rax
cmpl $0x9, 0x168(%rax)
je 0x2cbc3
testb $0x1, -0x19(%rbp)
jne 0x2cb92
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
movq -0x18(%rbp), %rax
movq 0x158(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x160(%rax), %rcx
movq -0x30(%rbp), %r8
movq -0x28(%rbp), %r9
callq 0x477a0
jmp 0x2cbc1
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
movq -0x18(%rbp), %rax
movq 0x158(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x160(%rax), %rcx
movq -0x30(%rbp), %r8
movq -0x28(%rbp), %r9
callq 0x47830
jmp 0x2cc17
movq -0x18(%rbp), %rax
testb $0x1, 0x150(%rax)
je 0x2cbee
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x160(%rax), %rsi
movq -0x30(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x47ea0
jmp 0x2cc15
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x158(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x160(%rax), %rdx
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x47f20
jmp 0x2cc17
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)