// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/arch/arm32/arm_expression.c
// Function: prv_priority1
static subtilis_arm_exp_val_t *prv_priority1(subtilis_arm_ass_context_t *c,
					     subtilis_error_t *err)
{
	const char *tbuf;
	subtilis_arm_exp_val_t *e = NULL;

	tbuf = subtilis_token_get_text(c->t);
	switch (c->t->type) {
	case SUBTILIS_TOKEN_STRING:
		e = subtilis_arm_exp_new_str(&c->t->buf, err);
		if (!e)
			goto cleanup;
		break;
	case SUBTILIS_TOKEN_INTEGER:
		e = subtilis_arm_exp_new_int32(c->t->tok.integer, err);
		if (!e)
			goto cleanup;
		break;
	case SUBTILIS_TOKEN_REAL:
		e = subtilis_arm_exp_new_real(c->t->tok.real, err);
		if (!e)
			goto cleanup;
		break;
	case SUBTILIS_TOKEN_OPERATOR:
		if (!strcmp(tbuf, "(")) {
			e = prv_process_bktd_exp(c, err);
			if (err->type != SUBTILIS_ERROR_OK)
				goto cleanup;
		} else {
			if (!strcmp(tbuf, "-")) {
				e = prv_unary_minus_exp(c, err);
				if (err->type != SUBTILIS_ERROR_OK)
					goto cleanup;

				/* we don't want to read another token here.It's
				 * already been read by the recursive call to
				 * prv_priority1.
				 */

				return e;
			}
			subtilis_error_set_exp_expected(
			    err, "( or - ", c->l->stream->name, c->l->line);
			goto cleanup;
		}
		break;
	case SUBTILIS_TOKEN_IDENTIFIER:
		e = subtilis_arm_exp_process_id(c, tbuf, err);
		break;

	case SUBTILIS_TOKEN_KEYWORD:
		switch (c->t->tok.keyword.type) {
		case SUBTILIS_ARM_KEYWORD_TRUE:
			e = subtilis_arm_exp_new_int32(-1, err);
			break;
		case SUBTILIS_ARM_KEYWORD_FALSE:
			e = subtilis_arm_exp_new_int32(0, err);
			break;
		case SUBTILIS_ARM_KEYWORD_NOT:
			e = prv_not(c, err);
			return e;
		case SUBTILIS_ARM_KEYWORD_INT:
			return prv_int(c, err);
		case SUBTILIS_ARM_KEYWORD_SIN:
			return prv_dbl_unary(c, sin, err);
		case SUBTILIS_ARM_KEYWORD_COS:
			return prv_dbl_unary(c, cos, err);
		case SUBTILIS_ARM_KEYWORD_TAN:
			return prv_dbl_unary(c, tan, err);
		case SUBTILIS_ARM_KEYWORD_ACS:
			return prv_dbl_unary(c, acos, err);
		case SUBTILIS_ARM_KEYWORD_ASN:
			return prv_dbl_unary(c, asin, err);
		case SUBTILIS_ARM_KEYWORD_ATN:
			return prv_dbl_unary(c, atan, err);
		case SUBTILIS_ARM_KEYWORD_SQR:
			return prv_dbl_unary(c, sqrt, err);
		case SUBTILIS_ARM_KEYWORD_EXP:
			return prv_dbl_unary(c, exp, err);
		case SUBTILIS_ARM_KEYWORD_LOG:
			return prv_dbl_unary(c, log10, err);
		case SUBTILIS_ARM_KEYWORD_LN:
			return prv_dbl_unary(c, log, err);
		case SUBTILIS_ARM_KEYWORD_RAD:
			return prv_rad(c, err);
		case SUBTILIS_ARM_KEYWORD_ABS:
			return prv_abs(c, err);
		case SUBTILIS_ARM_KEYWORD_SGN:
			return prv_sgn(c, err);
		case SUBTILIS_ARM_KEYWORD_PI:
			e = subtilis_arm_exp_new_real(22 / 7.0, err);
			break;
		case SUBTILIS_ARM_KEYWORD_CHR_STR:
			return prv_chr_str(c, err);
		case SUBTILIS_ARM_KEYWORD_ASC:
			return prv_asc(c, err);
		case SUBTILIS_ARM_KEYWORD_LEN:
			return prv_len(c, err);
		case SUBTILIS_ARM_KEYWORD_LEFT_STR:
			return prv_left_str(c, err);
		case SUBTILIS_ARM_KEYWORD_RIGHT_STR:
			return prv_right_str(c, err);
		case SUBTILIS_ARM_KEYWORD_MID_STR:
			return prv_mid_str(c, err);
		case SUBTILIS_ARM_KEYWORD_STRING_STR:
			return prv_string_str(c, err);
		case SUBTILIS_ARM_KEYWORD_STR_STR:
			return prv_str_str(c, err);
		default:
			subtilis_error_set_exp_expected(
			    err, "Unexpected keyword in expression",
			    c->l->stream->name, c->l->line);
			goto cleanup;
		}
		break;
	default:
		subtilis_error_set_exp_expected(err, tbuf, c->l->stream->name,
						c->l->line);
		goto cleanup;
	}

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

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

	return e;

cleanup:

	subtilis_arm_exp_val_free(e);
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%rdi), %rdi
callq 0x12ad0
movq 0x10(%r15), %rsi
movl (%rsi), %ecx
decl %ecx
cmpl $0x5, %ecx
ja 0x6a22c
leaq 0xcdbf(%rip), %rdx      # 0x76f28
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl 0x8(%rsi), %eax
addl $-0x4, %eax
cmpl $0x22, %eax
ja 0x6a520
leaq 0xcdb8(%rip), %rcx      # 0x76f40
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x6a8a0
movsd 0x8(%rsi), %xmm0
movq %r14, %rdi
callq 0x68c57
jmp 0x6a1cf
addq $0x158, %rsi            # imm = 0x158
movq %rsi, %rdi
movq %r14, %rsi
callq 0x68d67
jmp 0x6a1cf
movl 0x8(%rsi), %edi
movq %r14, %rsi
callq 0x68c10
testq %rax, %rax
jne 0x6a207
jmp 0x6a298
movzbl (%rax), %ecx
cmpl $0x2d, %ecx
je 0x6a25a
cmpl $0x28, %ecx
jne 0x6a260
cmpb $0x0, 0x1(%rax)
jne 0x6a260
movq %r15, %rdi
movq %r14, %rsi
callq 0x6a730
jmp 0x6a207
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x693c8
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x6a29a
movq 0x8(%r15), %rdi
movq 0x10(%r15), %rsi
movq %r14, %rdx
callq 0x12edc
cmpl $0x0, (%r14)
jne 0x6a29a
jmp 0x6a2a4
movq 0x8(%r15), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0xcdb5(%rip), %r10      # 0x76ff4
leaq 0x9bcf(%rip), %rcx      # 0x73e15
movq %r14, %rdi
movl $0x15, %esi
movq %rax, %rdx
pushq $0x602                  # imm = 0x602
pushq %r10
jmp 0x6a28f
cmpb $0x0, 0x1(%rax)
je 0x6a2ad
movq 0x8(%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0xcd81(%rip), %rax      # 0x76ff4
leaq 0xcdcb(%rip), %rdx      # 0x77045
leaq 0x9b94(%rip), %rcx      # 0x73e15
movq %r14, %rdi
movl $0x15, %esi
pushq $0x5b7                  # imm = 0x5B7
pushq %rax
callq 0x143da
addq $0x10, %rsp
xorl %ebx, %ebx
movq %rbx, %rdi
callq 0x68d41
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq 0x8(%r15), %rdi
movq %r14, %rdx
callq 0x12edc
cmpl $0x0, (%r14)
jne 0x6a298
movq %r15, %rdi
movq %r14, %rsi
callq 0x6a13d
cmpl $0x0, (%r14)
jne 0x6a298
movq %rax, %rbx
movl (%rax), %eax
cmpl $0x6, %eax
je 0x6a5d1
cmpl $0x7, %eax
jne 0x6a5d9
movsd 0x8(%rbx), %xmm0
xorpd 0xb11c(%rip), %xmm0     # 0x75410
movlpd %xmm0, 0x8(%rbx)
jmp 0x6a224
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x6abe6
movq %r15, %rdi
movq %r14, %rsi
callq 0x6b3ae
cmpl $0x0, (%r14)
jne 0x6a2a2
movq %rax, %rbx
movsd 0x8(%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x6a5c2
sqrtsd %xmm0, %xmm0
jmp 0x6a5c7
movq %r15, %rdi
movq %r14, %rsi
callq 0x6b3ae
cmpl $0x0, (%r14)
jne 0x6a2a2
movq %rax, %rbx
movsd 0x8(%rax), %xmm0
callq 0x122e8
jmp 0x6a5c7
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
jmp 0x6a555
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x6afa3
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x6ab76
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x6aa70
movq %r15, %rdi
movq %r14, %rsi
callq 0x6b3ae
cmpl $0x0, (%r14)
jne 0x6a2a2
movq %rax, %rbx
movsd 0x8(%rax), %xmm0
callq 0x122c8
jmp 0x6a5c7
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x6b21a
movq %r15, %rdi
movq %r14, %rsi
callq 0x6b3ae
cmpl $0x0, (%r14)
jne 0x6a2a2
movq %rax, %rbx
movsd 0x8(%rax), %xmm0
callq 0x122d0
jmp 0x6a5c7
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x6a92b
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x6a9cd
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x6aafe
movq %r15, %rdi
movq %r14, %rsi
callq 0x6b3ae
cmpl $0x0, (%r14)
jne 0x6a2a2
movq %rax, %rbx
movsd 0x8(%rax), %xmm0
callq 0x12300
jmp 0x6a5c7
movq %r15, %rdi
movq %r14, %rsi
callq 0x6b3ae
cmpl $0x0, (%r14)
jne 0x6a2a2
movq %rax, %rbx
movsd 0x8(%rax), %xmm0
callq 0x122e0
jmp 0x6a5c7
movq %r15, %rdi
movq %r14, %rsi
callq 0x6b3ae
cmpl $0x0, (%r14)
jne 0x6a2a2
movq %rax, %rbx
movsd 0x8(%rax), %xmm0
callq 0x122f0
jmp 0x6a5c7
movq %r15, %rdi
movq %r14, %rsi
callq 0x6b3ae
cmpl $0x0, (%r14)
jne 0x6a2a2
movq %rax, %rbx
movsd 0x8(%rax), %xmm0
callq 0x122d8
jmp 0x6a5c7
movq %r15, %rdi
movq %r14, %rsi
callq 0x6b3ae
cmpl $0x0, (%r14)
jne 0x6a2a2
movq %rax, %rbx
movsd 0x8(%rax), %xmm0
callq 0x12318
jmp 0x6a5c7
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x6ac65
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x6a7bd
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x6a824
movq 0x8(%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0xcac1(%rip), %rax      # 0x76ff4
leaq 0x93c3(%rip), %rdx      # 0x738fd
leaq 0x98d4(%rip), %rcx      # 0x73e15
movq %r14, %rdi
movl $0x15, %esi
pushq $0x5fc                  # imm = 0x5FC
jmp 0x6a28e
xorl %edi, %edi
movq %r14, %rsi
callq 0x68c10
jmp 0x6a207
movq %r15, %rdi
movq %r14, %rsi
callq 0x6b3ae
cmpl $0x0, (%r14)
jne 0x6a2a2
movq %rax, %rbx
movsd 0x8(%rax), %xmm0
mulsd 0x9429(%rip), %xmm0     # 0x739b0
jmp 0x6a5c7
movsd 0x9427(%rip), %xmm0     # 0x739b8
movq %r14, %rdi
callq 0x68c57
jmp 0x6a207
movq %r15, %rdi
movq %r14, %rsi
callq 0x6b3ae
cmpl $0x0, (%r14)
jne 0x6a2a2
movq %rax, %rbx
movsd 0x8(%rax), %xmm0
callq 0x122f8
jmp 0x6a5c7
callq 0x12308
movsd %xmm0, 0x8(%rbx)
jmp 0x6a2a4
negl 0x8(%rbx)
jmp 0x6a224
movq 0x8(%r15), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0xca09(%rip), %r8       # 0x76ff4
movq %r14, %rdi
movl $0x44, %esi
movl $0x2c8, %r9d            # imm = 0x2C8
callq 0x145c8
jmp 0x6a224