// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_loops.c
// Function: prv_compute_step_type
static subtilis_step_type_t prv_compute_step_type(subtilis_parser_t *p,
						  subtilis_exp_t *step,
						  subtilis_error_t *err)
{
	subtilis_step_type_t retval;
	subtilis_exp_t *e = NULL;
	subtilis_exp_t *step_dup = NULL;

	if (!subtilis_type_if_is_numeric(&step->type)) {
		subtilis_error_set_numeric_exp_expected(err, p->l->stream->name,
							p->l->line);
		return SUBTILIS_STEP_MAX;
	}

	if (!subtilis_type_if_is_const(&step->type))
		return SUBTILIS_STEP_VAR;

	e = subtilis_type_if_zero(p, &step->type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SUBTILIS_STEP_MAX;

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

	e = subtilis_type_if_eq(p, step_dup, e, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	if (!subtilis_type_if_is_const(&e->type)) {
		subtilis_error_set_assertion_failed(err);
		goto on_error;
	}

	if (e->exp.ir_op.integer == -1) {
		subtilis_error_set_zero_step(err, p->l->stream->name,
					     p->l->line);
		goto on_error;
	}

	subtilis_exp_delete(e);
	e = subtilis_type_if_zero(p, &step->type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

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

	e = subtilis_type_if_lt(p, step_dup, e, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	if (!subtilis_type_if_is_const(&e->type)) {
		subtilis_error_set_assertion_failed(err);
		goto on_error;
	}

	retval = (e->exp.ir_op.integer == -1) ? SUBTILIS_STEP_CONST_DEC
					      : SUBTILIS_STEP_CONST_INC;
	subtilis_exp_delete(e);

	return retval;

on_error:

	subtilis_exp_delete(e);

	return SUBTILIS_STEP_MAX;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
movq %rsi, %rdi
callq 0x37534
testb %al, %al
je 0x2217a
movq %r13, %rdi
callq 0x368fd
movl $0x2, %ebx
testb %al, %al
je 0x221a4
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x35e20
movl $0x3, %ebx
cmpl $0x0, (%r14)
jne 0x221a4
movq %rax, %r15
movq %r13, %rdi
movq %r14, %rsi
callq 0x36182
cmpl $0x0, (%r14)
jne 0x221de
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x36d54
movq %rax, %r15
cmpl $0x0, (%r14)
jne 0x221de
movq %r15, %rdi
callq 0x368fd
testb %al, %al
je 0x221b0
cmpl $-0x1, 0x148(%r15)
je 0x221c6
movq %r15, %rdi
callq 0x2b166
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x35e20
movq %rax, %r15
cmpl $0x0, (%r14)
jne 0x221de
movq %r13, %rdi
movq %r14, %rsi
callq 0x36182
cmpl $0x0, (%r14)
jne 0x221de
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x3711a
movq %rax, %r15
cmpl $0x0, (%r14)
jne 0x221de
movq %r15, %rdi
callq 0x368fd
testb %al, %al
je 0x221e8
xorl %ebx, %ebx
cmpl $-0x1, 0x148(%r15)
sete %bl
jmp 0x221de
movq (%r12), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0x51800(%rip), %r8      # 0x7398c
movq %r14, %rdi
movl $0x44, %esi
movl $0x46, %r9d
callq 0x145c8
movl $0x3, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x517d5(%rip), %rdx     # 0x7398c
movq %r14, %rdi
movl $0xf, %esi
movl $0x5a, %ecx
jmp 0x221d9
movq (%r12), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
movq %r14, %rdi
movl $0x2b, %esi
callq 0x145a4
movq %r15, %rdi
callq 0x2b166
jmp 0x221a4
leaq 0x5179d(%rip), %rdx     # 0x7398c
movq %r14, %rdi
movl $0xf, %esi
movl $0x72, %ecx
jmp 0x221d9