// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/parser_loops.c
// Function: prv_range_loop_start
static size_t prv_range_loop_start(subtilis_parser_t *p, subtilis_exp_t *e,
				   const subtilis_range_var_t *range_vars,
				   subtilis_ir_operand_t start_label,
				   subtilis_ir_operand_t end_label,
				   bool new_locals, subtilis_error_t *err)
{
	subtilis_ir_operand_t size;
	subtilis_ir_operand_t end;
	subtilis_ir_operand_t condee;
	subtilis_ir_operand_t iter_label;
	subtilis_ir_operand_t ptr;

	size.reg =
	    subtilis_reference_type_get_size(p, e->exp.ir_op.reg, 0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	ptr.reg = subtilis_reference_get_data(p, e->exp.ir_op.reg, 0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	end.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_ADD_I32, ptr, size, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	subtilis_ir_section_add_label(p->current, start_label.label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	condee.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_LT_I32, ptr, end, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	iter_label.label = subtilis_ir_section_new_label(p->current);
	subtilis_ir_section_add_instr_reg(p->current, SUBTILIS_OP_INSTR_JMPC,
					  condee, iter_label, end_label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	subtilis_ir_section_add_label(p->current, iter_label.label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	subtilis_parser_handle_escape(p, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	if (range_vars[0].name) {
		prv_assign_range_var(p, ptr, &range_vars[0], new_locals, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return SIZE_MAX;
	}

	return ptr.reg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %r9b, %al
movq 0x10(%rbp), %r9
movq %rcx, -0x10(%rbp)
movq %r8, -0x18(%rbp)
movq %rdi, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movq %rdx, -0x30(%rbp)
andb $0x1, %al
movb %al, -0x31(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x148(%rax), %rsi
movq 0x10(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0x6dc00
movq %rax, -0x40(%rbp)
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2c17e
movq $-0x1, -0x8(%rbp)
jmp 0x2c321
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x148(%rax), %rsi
movq 0x10(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0x6d1e0
movq %rax, -0x60(%rbp)
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2c1b4
movq $-0x1, -0x8(%rbp)
jmp 0x2c321
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rdi
movq 0x10(%rbp), %r8
movq -0x60(%rbp), %rdx
movq -0x40(%rbp), %rcx
xorl %esi, %esi
callq 0x38230
movq %rax, -0x48(%rbp)
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2c1e9
movq $-0x1, -0x8(%rbp)
jmp 0x2c321
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x10(%rbp), %rsi
movq 0x10(%rbp), %rdx
callq 0x39960
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2c214
movq $-0x1, -0x8(%rbp)
jmp 0x2c321
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rdi
movq 0x10(%rbp), %r8
movq -0x60(%rbp), %rdx
movq -0x48(%rbp), %rcx
movl $0x3b, %esi
callq 0x38230
movq %rax, -0x50(%rbp)
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2c24c
movq $-0x1, -0x8(%rbp)
jmp 0x2c321
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rdi
movq 0x10(%rbp), %r9
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq -0x18(%rbp), %r8
movl $0x43, %esi
callq 0x38360
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2c295
movq $-0x1, -0x8(%rbp)
jmp 0x2c321
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x58(%rbp), %rsi
movq 0x10(%rbp), %rdx
callq 0x39960
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2c2bd
movq $-0x1, -0x8(%rbp)
jmp 0x2c321
movq -0x20(%rbp), %rdi
movq 0x10(%rbp), %rsi
callq 0x2d400
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2c2dd
movq $-0x1, -0x8(%rbp)
jmp 0x2c321
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2c319
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rdx
movb -0x31(%rbp), %al
movq 0x10(%rbp), %r8
movq -0x60(%rbp), %rsi
andb $0x1, %al
movzbl %al, %ecx
callq 0x2ca50
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2c317
movq $-0x1, -0x8(%rbp)
jmp 0x2c321
jmp 0x2c319
movq -0x60(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)