// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_expression.c
// Function: prv_priority3
static subtilis_arm_exp_val_t *prv_priority3(subtilis_arm_ass_context_t *c,
					     subtilis_error_t *err)
{
	const char *tbuf;
	subtilis_arm_exp_val_t *e1 = NULL;
	subtilis_arm_exp_val_t *e2 = NULL;
	subtilis_token_type_t tt;
	char op[4];
	int keyword = SUBTILIS_ARM_KEYWORD_MAX;

	e1 = prv_priority2(c, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;
	while ((c->t->type == SUBTILIS_TOKEN_OPERATOR) ||
	       (c->t->type == SUBTILIS_TOKEN_KEYWORD)) {
		tbuf = subtilis_token_get_text(c->t);
		tt = c->t->type;
		if (tt == SUBTILIS_TOKEN_OPERATOR) {
			if (strcmp(tbuf, "*") && strcmp(tbuf, "/"))
				break;
			strcpy(op, tbuf);
		} else {
			keyword = c->t->tok.keyword.type;
			if ((keyword != SUBTILIS_ARM_KEYWORD_DIV) &&
			    (keyword != SUBTILIS_ARM_KEYWORD_MOD))
				break;
		}

		subtilis_lexer_get(c->l, c->t, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
		e2 = prv_priority2(c, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;

		if (tt == SUBTILIS_TOKEN_KEYWORD) {
			if (keyword == SUBTILIS_ARM_KEYWORD_DIV)
				e1 = prv_binary_int(c, e1, e2, prv_div_int32_fn,
						    err);
			else if (keyword == SUBTILIS_ARM_KEYWORD_MOD)
				e1 = prv_binary_int(c, e1, e2, prv_mod_int32_fn,
						    err);
			else
				break;
		} else if (!strcmp(op, "*")) {
			e1 = prv_binary_numeric(c, e1, e2, prv_mul_int32_fn,
						prv_mul_real_fn, err);
		} else {
			e1 = prv_binary_real(c, e1, e2, prv_div_real_fn, err);
		}

		e2 = NULL;
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
	}

	return e1;

cleanup:

	subtilis_arm_exp_val_free(e2);
	subtilis_arm_exp_val_free(e1);
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
callq 0x6a38b
movq %rax, %rbx
cmpl $0x0, (%r14)
je 0x6a21e
xorl %eax, %eax
movq %rax, %rdi
callq 0x69167
movq %rbx, %rdi
callq 0x69167
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x34, %r13d
movq 0x10(%r15), %rdi
movl (%rdi), %eax
decl %eax
cmpl $0x1, %eax
ja 0x6a20c
movl %r13d, (%rsp)
callq 0x12ad0
movq 0x10(%r15), %rbp
movl (%rbp), %r12d
cmpl $0x2, %r12d
jne 0x6a284
movq %rax, %r13
movq %rax, %rdi
leaq 0xea99(%rip), %rsi      # 0x78cee
callq 0x12160
testl %eax, %eax
je 0x6a271
movq %r13, %rdi
leaq 0x966f(%rip), %rsi      # 0x738d7
callq 0x12160
testl %eax, %eax
jne 0x6a20c
leaq 0x4(%rsp), %rdi
movq %r13, %rsi
callq 0x12070
movl (%rsp), %r13d
jmp 0x6a298
movl 0x8(%rbp), %r13d
cmpl $0x18, %r13d
je 0x6a298
cmpl $0xd, %r13d
jne 0x6a20c
movq 0x8(%r15), %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x12eda
cmpl $0x0, (%r14)
jne 0x6a1f8
movq %r15, %rdi
movq %r14, %rsi
callq 0x6a38b
cmpl $0x0, (%r14)
jne 0x6a1fa
cmpl $0x1, %r12d
jne 0x6a2ee
cmpl $0x18, %r13d
je 0x6a310
cmpl $0xd, %r13d
jne 0x6a20c
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
leaq 0x184(%rip), %rcx       # 0x6a470
jmp 0x6a320
cmpw $0x2a, 0x4(%rsp)
je 0x6a32a
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
leaq 0x27e(%rip), %rcx       # 0x6a584
movq %r14, %r8
callq 0x6a4f7
jmp 0x6a349
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
leaq 0x18d(%rip), %rcx       # 0x6a4ad
movq %r14, %r8
callq 0x69eb7
jmp 0x6a349
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
leaq 0x1b2(%rip), %rcx       # 0x6a4ec
leaq 0x1b1(%rip), %r8        # 0x6a4f2
movq %r14, %r9
callq 0x6a36e
movq %rax, %rbx
cmpl $0x0, (%r14)
je 0x6a224
jmp 0x6a1f8