// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/arm_expression.c
// Function: prv_priority4
static subtilis_arm_exp_val_t *prv_priority4(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_ass_int_fn_t int_fn;
	subtilis_ass_real_fn_t real_fn;
	bool plus;

	e1 = prv_priority3(c, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;
	tbuf = subtilis_token_get_text(c->t);

	/*
	 * Special case for number too big.
	 */

	if ((c->t->type == SUBTILIS_TOKEN_INTEGER) &&
	    (c->t->tok.integer == -2147483648)) {
		subtilis_error_set_number_too_long(
		    err, tbuf, c->l->stream->name, c->l->line);
		goto cleanup;
	}

	while (c->t->type == SUBTILIS_TOKEN_OPERATOR) {
		plus = false;
		tbuf = subtilis_token_get_text(c->t);

		if (!strcmp(tbuf, "+")) {
			int_fn = prv_add_int32_fn;
			real_fn = prv_add_real_fn;
			plus = true;
		} else if (!strcmp(tbuf, "-")) {
			int_fn = prv_sub_int32_fn;
			real_fn = prv_sub_real_fn;
		} else {
			break;
		}

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

		e2 = prv_priority3(c, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;

		if (plus && e1->type == SUBTILIS_ARM_EXP_TYPE_STRING &&
		    e2->type == SUBTILIS_ARM_EXP_TYPE_STRING)
			e1 = prv_strcat(e1, e2, err);
		else
			e1 =
			    prv_binary_numeric(c, e1, e2, int_fn, 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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9c180
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9babf
jmp 0x9bc7c
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x12d70
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x4, (%rax)
jne 0x9bb3a
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq 0x8(%rax), %rax
cmpq $-0x80000000, %rax      # imm = 0x80000000
jne 0x9bb3a
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %r8
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x38(%rax), %r9d
movl $0x8, %esi
leaq 0xf759(%rip), %rcx      # 0xab276
leaq 0x128dc(%rip), %rax     # 0xae400
movq %rax, (%rsp)
movl $0x70b, 0x8(%rsp)       # imm = 0x70B
callq 0x156d0
jmp 0x9bc7c
jmp 0x9bb3c
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x2, (%rax)
jne 0x9bc72
movb $0x0, -0x41(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x12d70
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq 0xeda8(%rip), %rsi      # 0xaa915
callq 0x12140
cmpl $0x0, %eax
jne 0x9bb93
leaq 0x852(%rip), %rax       # 0x9c3d0
movq %rax, -0x38(%rbp)
leaq 0x867(%rip), %rax       # 0x9c3f0
movq %rax, -0x40(%rbp)
movb $0x1, -0x41(%rbp)
jmp 0x9bbc7
movq -0x20(%rbp), %rdi
leaq 0xe93e(%rip), %rsi      # 0xaa4dc
callq 0x12140
cmpl $0x0, %eax
jne 0x9bbc0
leaq 0x871(%rip), %rax       # 0x9c420
movq %rax, -0x38(%rbp)
leaq 0x886(%rip), %rax       # 0x9c440
movq %rax, -0x40(%rbp)
jmp 0x9bbc5
jmp 0x9bc72
jmp 0x9bbc7
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rdx
callq 0x133f0
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9bbee
jmp 0x9bc7c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9c180
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9bc0a
jmp 0x9bc7c
testb $0x1, -0x41(%rbp)
je 0x9bc39
movq -0x28(%rbp), %rax
cmpl $0x8, (%rax)
jne 0x9bc39
movq -0x30(%rbp), %rax
cmpl $0x8, (%rax)
jne 0x9bc39
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x9c470
movq %rax, -0x28(%rbp)
jmp 0x9bc5a
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0x18(%rbp), %r9
callq 0x9c4f0
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9bc6d
jmp 0x9bc7c
jmp 0x9bb3c
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x9bc96
movq -0x30(%rbp), %rdi
callq 0x9a4c0
movq -0x28(%rbp), %rdi
callq 0x9a4c0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq