// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/parser_loops.c
// Function: prv_for_step_generic_var
static void prv_for_step_generic_var(subtilis_parser_t *p, subtilis_token_t *t,
				     subtilis_exp_t *to, subtilis_exp_t *step,
				     const subtilis_for_context_t *for_ctx,
				     subtilis_error_t *err)
{
	subtilis_ir_operand_t start_label;
	subtilis_ir_operand_t true_label;
	subtilis_ir_operand_t true_label2;
	subtilis_ir_operand_t inc_label;
	subtilis_ir_operand_t dec_label;
	subtilis_exp_t *step_dup = NULL;
	subtilis_exp_t *var = NULL;
	subtilis_exp_t *var_dup = NULL;
	subtilis_exp_t *to_dup = NULL;
	subtilis_exp_t *conde = NULL;
	subtilis_exp_t *zero = NULL;

	prv_for_loop_start(p, t, &start_label, &true_label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	step_dup = subtilis_type_if_dup(step, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	var = prv_increment_var(p, step, for_ctx, err);
	step = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	if (!subtilis_type_if_is_numeric(&var->type)) {
		subtilis_error_set_assertion_failed(err);
		goto cleanup;
	}

	var_dup = subtilis_type_if_dup(var, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	to_dup = subtilis_type_if_dup(to, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	zero = subtilis_type_if_zero(p, &step_dup->type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	conde = subtilis_exp_gt(p, step_dup, zero, err);
	step_dup = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	inc_label.reg = subtilis_ir_section_new_label(p->current);
	dec_label.reg = subtilis_ir_section_new_label(p->current);

	subtilis_ir_section_add_instr_reg(p->current, SUBTILIS_OP_INSTR_JMPC,
					  conde->exp.ir_op, inc_label,
					  dec_label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_ir_section_add_label(p->current, inc_label.reg, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_exp_delete(conde);
	conde = subtilis_exp_gt(p, var, to, err);
	var = NULL;
	to = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_ir_section_add_instr_reg(p->current, SUBTILIS_OP_INSTR_JMPC,
					  conde->exp.ir_op, true_label,
					  start_label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_ir_section_add_label(p->current, dec_label.reg, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_exp_delete(conde);
	conde = subtilis_exp_lt(p, var_dup, to_dup, err);
	var_dup = NULL;
	to_dup = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	true_label2.reg = subtilis_ir_section_new_label(p->current);

	subtilis_ir_section_add_instr_reg(p->current, SUBTILIS_OP_INSTR_JMPC,
					  conde->exp.ir_op, true_label2,
					  start_label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_ir_section_add_label(p->current, true_label.reg, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_ir_section_add_label(p->current, true_label2.reg, err);

cleanup:

	subtilis_exp_delete(conde);
	subtilis_exp_delete(var_dup);
	subtilis_exp_delete(to_dup);
	subtilis_exp_delete(var);
	subtilis_exp_delete(to);
	subtilis_exp_delete(step_dup);
	subtilis_exp_delete(step);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %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 $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x78(%rbp)
movq $0x0, -0x80(%rbp)
movq $0x0, -0x88(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %r8
leaq -0x38(%rbp), %rdx
leaq -0x40(%rbp), %rcx
callq 0x2b5e0
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x298fd
jmp 0x29bda
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x47d20
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2991c
jmp 0x29bda
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x2b690
movq %rax, -0x68(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2994b
jmp 0x29bda
movq -0x68(%rbp), %rdi
callq 0x49d10
testb $0x1, %al
jne 0x29977
movq -0x30(%rbp), %rdi
movl $0xf, %esi
leaq 0x81042(%rip), %rdx     # 0xaa9aa
movl $0x20d, %ecx            # imm = 0x20D
callq 0x158e0
jmp 0x29bda
movq -0x68(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x47d20
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x29996
jmp 0x29bda
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x47d20
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x299b5
jmp 0x29bda
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x47580
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x299db
jmp 0x29bda
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x37c10
movq %rax, -0x80(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x29a0d
jmp 0x29bda
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x80(%rbp), %rax
movq -0x30(%rbp), %r9
movq 0x148(%rax), %rdx
movq -0x50(%rbp), %rcx
movq -0x58(%rbp), %r8
movl $0x43, %esi
callq 0x38360
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x29a66
jmp 0x29bda
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x50(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x39960
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x29a89
jmp 0x29bda
movq -0x80(%rbp), %rdi
callq 0x36ee0
movq -0x8(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x37c10
movq %rax, -0x80(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x29ac9
jmp 0x29bda
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x80(%rbp), %rax
movq -0x30(%rbp), %r9
movq 0x148(%rax), %rdx
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %r8
movl $0x43, %esi
callq 0x38360
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x29b00
jmp 0x29bda
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x58(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x39960
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x29b23
jmp 0x29bda
movq -0x80(%rbp), %rdi
callq 0x36ee0
movq -0x8(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x37c90
movq %rax, -0x80(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x78(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x29b60
jmp 0x29bda
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x80(%rbp), %rax
movq -0x30(%rbp), %r9
movq 0x148(%rax), %rdx
movq -0x48(%rbp), %rcx
movq -0x38(%rbp), %r8
movl $0x43, %esi
callq 0x38360
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x29ba5
jmp 0x29bda
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x40(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x39960
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x29bc5
jmp 0x29bda
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x48(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x39960
movq -0x80(%rbp), %rdi
callq 0x36ee0
movq -0x70(%rbp), %rdi
callq 0x36ee0
movq -0x78(%rbp), %rdi
callq 0x36ee0
movq -0x68(%rbp), %rdi
callq 0x36ee0
movq -0x18(%rbp), %rdi
callq 0x36ee0
movq -0x60(%rbp), %rdi
callq 0x36ee0
movq -0x20(%rbp), %rdi
callq 0x36ee0
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)