// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/parser_loops.c
// Function: prv_init_range_var
static void prv_init_range_var(subtilis_parser_t *p, subtilis_token_t *t,
			       subtilis_for_context_t *for_ctx,
			       const char *var_name,
			       const subtilis_type_t *type,
			       subtilis_error_t *err)
{
	subtilis_ir_operand_t op1;
	const subtilis_symbol_t *s;
	subtilis_exp_t *e;
	bool new_global = false;

	subtilis_parser_lookup_assignment_var(p, t, var_name, &s, &op1.reg,
					      &new_global, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	if (new_global) {
		if (p->current->proc_called) {
			subtilis_error_set_global_after_proc(
			    err, var_name, p->l->stream->name, p->l->line);
			return;
		}

		subtilis_type_copy(&for_ctx->type, type, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;

		s = subtilis_symbol_table_insert(p->st, var_name,
						 &for_ctx->type, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		if (type->type == SUBTILIS_TYPE_REC)
			subtilis_rec_type_zero(p, &for_ctx->type,
					       SUBTILIS_IR_REG_GLOBAL, s->loc,
					       true, err);
		else if (subtilis_type_if_is_numeric(&for_ctx->type) ||
			 for_ctx->type.type == SUBTILIS_TYPE_FN) {
			e = subtilis_type_if_zero(p, &for_ctx->type, err);
			if (err->type != SUBTILIS_ERROR_OK)
				return;
			subtilis_type_if_assign_to_mem(
			    p, SUBTILIS_IR_REG_GLOBAL, s->loc, e, err);
			if (err->type != SUBTILIS_ERROR_OK)
				return;
		} else if (!subtilis_type_if_is_numeric(&for_ctx->type))
			subtilis_type_if_zero_ref(p, &for_ctx->type,
						  SUBTILIS_IR_REG_GLOBAL,
						  s->loc, true, err);
	} else {
		subtilis_type_copy(&for_ctx->type, &s->t, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
	}

	for_ctx->is_reg = s->is_reg;
	for_ctx->reg = op1.reg;
	for_ctx->loc = s->loc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %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)
movb $0x0, -0x49(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x30(%rbp), %rax
leaq -0x40(%rbp), %rcx
leaq -0x38(%rbp), %r8
leaq -0x49(%rbp), %r9
movq %rax, (%rsp)
callq 0x1b6a0
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2bca7
jmp 0x2be91
testb $0x1, -0x49(%rbp)
je 0x2be3d
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
testb $0x1, 0xe0(%rax)
je 0x2bd09
movq -0x30(%rbp), %rdi
movq -0x20(%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 $0x6c, %esi
leaq 0x7f58a(%rip), %rcx     # 0xab276
leaq 0x7ecb7(%rip), %rax     # 0xaa9aa
movq %rax, (%rsp)
movl $0x63c, 0x8(%rsp)       # imm = 0x63C
callq 0x156d0
jmp 0x2be91
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x3e4f0
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2bd2c
jmp 0x2be91
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x18, %rdx
movq -0x30(%rbp), %rcx
callq 0x3c480
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2bd5b
jmp 0x2be91
movq -0x28(%rbp), %rax
cmpl $0x16, (%rax)
jne 0x2bd90
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x18, %rsi
movq -0x40(%rbp), %rax
movq (%rax), %rcx
movq -0x30(%rbp), %r9
movl $0x1, %edx
movl $0x1, %r8d
callq 0x62290
jmp 0x2be3b
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
callq 0x49d10
testb $0x1, %al
jne 0x2bdab
movq -0x18(%rbp), %rax
cmpl $0x9, 0x18(%rax)
jne 0x2bdff
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x18, %rsi
movq -0x30(%rbp), %rdx
callq 0x47580
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2bdd2
jmp 0x2be91
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movq (%rax), %rdx
movq -0x48(%rbp), %rcx
movq -0x30(%rbp), %r8
movl $0x1, %esi
callq 0x47f20
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2bdfd
jmp 0x2be91
jmp 0x2be39
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
callq 0x49d10
testb $0x1, %al
jne 0x2be37
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x18, %rsi
movq -0x40(%rbp), %rax
movq (%rax), %rcx
movq -0x30(%rbp), %r9
movl $0x1, %edx
movl $0x1, %r8d
callq 0x47600
jmp 0x2be39
jmp 0x2be3b
jmp 0x2be63
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
movq -0x40(%rbp), %rsi
addq $0x8, %rsi
movq -0x30(%rbp), %rdx
callq 0x3e4f0
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2be61
jmp 0x2be91
jmp 0x2be63
movq -0x40(%rbp), %rax
movb 0x2a8(%rax), %cl
movq -0x18(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)