// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
movq 0x10(%rdi), %rdi
callq 0x12ad0
movq %rax, %r12
movq 0x10(%r15), %r14
movl (%r14), %eax
decl %eax
cmpl $0x5, %eax
ja 0x6a6fa
leaq 0xc8ce(%rip), %rcx      # 0x76ec4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x8(%r14), %eax
addl $-0x4, %eax
cmpl $0x22, %eax
ja 0x6a9ea
leaq 0xc8c6(%rip), %rcx      # 0x76edc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6acb4
movsd 0x8(%r14), %xmm0
movq %rbx, %rdi
callq 0x69080
jmp 0x6a665
addq $0x158, %r14            # imm = 0x158
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6918d
jmp 0x6a665
movl 0x8(%r14), %edi
movq %rbx, %rsi
callq 0x6903c
testq %rax, %rax
jne 0x6a6db
jmp 0x6a72e
leaq 0x9b9c(%rip), %rsi      # 0x74212
movq %r12, %rdi
callq 0x12160
testl %eax, %eax
je 0x6a74b
leaq 0xc39c(%rip), %rsi      # 0x76a29
movq %r12, %rdi
callq 0x12160
movq 0x8(%r15), %rdi
testl %eax, %eax
je 0x6a763
movq 0x30(%rdi), %r8
movl 0x38(%rdi), %r9d
leaq 0xc8e0(%rip), %rax      # 0x76f90
leaq 0xc92a(%rip), %rdx      # 0x76fe1
leaq 0x9737(%rip), %rcx      # 0x73df5
movq %rbx, %rdi
movl $0x15, %esi
pushq $0x5b7                  # imm = 0x5B7
jmp 0x6a724
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x6981a
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x6a731
movq 0x8(%r15), %rdi
movq 0x10(%r15), %rsi
movq %rbx, %rdx
callq 0x12eda
cmpl $0x0, (%rbx)
jne 0x6a731
jmp 0x6a73c
movq 0x8(%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0xc883(%rip), %rax      # 0x76f90
leaq 0x96e1(%rip), %rcx      # 0x73df5
movq %rbx, %rdi
movl $0x15, %esi
movq %r12, %rdx
pushq $0x602                  # imm = 0x602
pushq %rax
callq 0x1442a
addq $0x10, %rsp
xorl %r14d, %r14d
movq %r14, %rdi
callq 0x69167
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6ab40
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x6a731
jmp 0x6a6de
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12eda
cmpl $0x0, (%rbx)
jne 0x6a787
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6a5c3
cmpl $0x0, (%rbx)
je 0x6aa8d
xorl %r14d, %r14d
jmp 0x6a6f3
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6affb
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6b82c
cmpl $0x0, (%rbx)
jne 0x6a739
movq %rax, %r14
movsd 0x8(%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x6aae8
sqrtsd %xmm0, %xmm0
jmp 0x6aaed
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6b82c
cmpl $0x0, (%rbx)
jne 0x6a739
movq %rax, %r14
movsd 0x8(%rax), %xmm0
callq 0x122e8
jmp 0x6aaed
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
jmp 0x6aa1f
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6b3f1
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6af8b
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6ae85
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6b82c
cmpl $0x0, (%rbx)
jne 0x6a739
movq %rax, %r14
movsd 0x8(%rax), %xmm0
callq 0x122c8
jmp 0x6aaed
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6b68a
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6b82c
cmpl $0x0, (%rbx)
jne 0x6a739
movq %rax, %r14
movsd 0x8(%rax), %xmm0
callq 0x122d0
jmp 0x6aaed
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6ad3f
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6addf
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6af13
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6b82c
cmpl $0x0, (%rbx)
jne 0x6a739
movq %rax, %r14
movsd 0x8(%rax), %xmm0
callq 0x12300
jmp 0x6aaed
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6b82c
cmpl $0x0, (%rbx)
jne 0x6a739
movq %rax, %r14
movsd 0x8(%rax), %xmm0
callq 0x122e0
jmp 0x6aaed
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6b82c
cmpl $0x0, (%rbx)
jne 0x6a739
movq %rax, %r14
movsd 0x8(%rax), %xmm0
callq 0x122f0
jmp 0x6aaed
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6b82c
cmpl $0x0, (%rbx)
jne 0x6a739
movq %rax, %r14
movsd 0x8(%rax), %xmm0
callq 0x122d8
jmp 0x6aaed
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6b82c
cmpl $0x0, (%rbx)
jne 0x6a739
movq %rax, %r14
movsd 0x8(%rax), %xmm0
callq 0x12318
jmp 0x6aaed
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6b07a
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6abd1
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6ac38
movq 0x8(%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0xc593(%rip), %rax      # 0x76f90
leaq 0x8ed7(%rip), %rdx      # 0x738db
leaq 0x93ea(%rip), %rcx      # 0x73df5
movq %rbx, %rdi
movl $0x15, %esi
pushq $0x5fc                  # imm = 0x5FC
jmp 0x6a724
xorl %edi, %edi
movq %rbx, %rsi
callq 0x6903c
jmp 0x6a6db
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6b82c
cmpl $0x0, (%rbx)
jne 0x6a739
movq %rax, %r14
movsd 0x8(%rax), %xmm0
mulsd 0x8f40(%rip), %xmm0     # 0x73990
jmp 0x6aaed
movsd 0x8f3b(%rip), %xmm0     # 0x73998
movq %rbx, %rdi
callq 0x69080
jmp 0x6a6db
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6b82c
cmpl $0x0, (%rbx)
jne 0x6a739
movq %rax, %r14
movsd 0x8(%rax), %xmm0
callq 0x122f8
jmp 0x6aaed
movq %rax, %r14
movl (%rax), %eax
cmpl $0x6, %eax
je 0x6aab5
cmpl $0x7, %eax
jne 0x6aabe
movsd 0x8(%r14), %xmm0
xorpd 0xa946(%rip), %xmm0     # 0x753f0
movlpd %xmm0, 0x8(%r14)
jmp 0x6a6f3
negl 0x8(%r14)
jmp 0x6a6f3
movq 0x8(%r15), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0xc4c0(%rip), %r8       # 0x76f90
movq %rbx, %rdi
movl $0x44, %esi
movl $0x2c8, %r9d            # imm = 0x2C8
callq 0x14618
jmp 0x6a6f3
callq 0x12308
movsd %xmm0, 0x8(%r14)
jmp 0x6a73c