// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x49d10
testb $0x1, %al
jne 0x2921d
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %ecx
movl $0x44, %esi
leaq 0x817a4(%rip), %r8      # 0xaa9aa
movl $0x46, %r9d
callq 0x15930
movl $0x3, -0x4(%rbp)
jmp 0x293d7
movq -0x18(%rbp), %rdi
callq 0x48a90
testb $0x1, %al
jne 0x29236
movl $0x2, -0x4(%rbp)
jmp 0x293d7
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x47580
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x29260
movl $0x3, -0x4(%rbp)
jmp 0x293d7
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x47d20
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2927f
jmp 0x293c7
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x49200
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x292a6
jmp 0x293c7
movq -0x30(%rbp), %rdi
callq 0x48a90
testb $0x1, %al
jne 0x292d2
movq -0x20(%rbp), %rdi
movl $0xf, %esi
leaq 0x816e7(%rip), %rdx     # 0xaa9aa
movl $0x5a, %ecx
callq 0x158e0
jmp 0x293c7
movq -0x30(%rbp), %rax
cmpl $-0x1, 0x148(%rax)
jne 0x29307
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %ecx
movl $0x2b, %esi
callq 0x158e0
jmp 0x293c7
movq -0x30(%rbp), %rdi
callq 0x36ee0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x47580
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x29333
jmp 0x293c7
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x47d20
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2934f
jmp 0x293c7
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x49770
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x29373
jmp 0x293c7
movq -0x30(%rbp), %rdi
callq 0x48a90
testb $0x1, %al
jne 0x2939c
movq -0x20(%rbp), %rdi
movl $0xf, %esi
leaq 0x8161a(%rip), %rdx     # 0xaa9aa
movl $0x72, %ecx
callq 0x158e0
jmp 0x293c7
movq -0x30(%rbp), %rax
movl 0x148(%rax), %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $-0x1, %edx
cmovel %ecx, %eax
movl %eax, -0x24(%rbp)
movq -0x30(%rbp), %rdi
callq 0x36ee0
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x293d7
movq -0x30(%rbp), %rdi
callq 0x36ee0
movl $0x3, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq