// File: /workspace/github_c_makefile_star2_O0/michaelforney[P]cproc/expr.c
// Function: primaryexpr
static struct expr *
primaryexpr(struct scope *s)
{
	struct expr *e;
	struct decl *d;
	struct type *t;
	char *src, *end;
	uint_least32_t chr;
	int base;

	switch (tok.kind) {
	case TIDENT:
		d = scopegetdecl(s, tok.lit, 1);
		if (!d)
			error(&tok.loc, "undeclared identifier: %s", tok.lit);
		e = mkexpr(EXPRIDENT, d->type, NULL);
		e->qual = d->qual;
		e->lvalue = d->kind == DECLOBJECT;
		e->u.ident.decl = d;
		if (d->kind != DECLBUILTIN)
			e = decay(e);
		next();
		break;
	case TSTRINGLIT:
		e = mkexpr(EXPRSTRING, NULL, NULL);
		t = stringconcat(&e->u.string, false);
		e->type = mkarraytype(t, QUALNONE, e->u.string.size);
		e->lvalue = true;
		e = decay(e);
		break;
	case TCHARCONST:
		src = tok.lit;
		switch (*src) {
		case 'L': ++src; t = targ->typewchar; break;
		case 'u': ++src; t = *src == '8' ? ++src, &typeuchar : &typeushort; break;
		case 'U': ++src; t = &typeuint; break;
		default: t = &typeint;
		}
		assert(*src == '\'');
		++src;
		src += decodechar(src, &chr, NULL, "character constant", &tok.loc);
		e = mkconstexpr(t, chr);
		if (*src != '\'')
			error(&tok.loc, "character constant contains more than one character: %c", *src);
		next();
		break;
	case TNUMBER:
		e = mkexpr(EXPRCONST, NULL, NULL);
		if (tok.lit[0] == '0') {
			switch (tolower(tok.lit[1])) {
			case 'x': base = 16; break;
			case 'b': base = 2; break;
			default: base = 8; break;
			}
		} else {
			base = 10;
		}
		if (strpbrk(tok.lit, base == 16 ? ".pP" : ".eE")) {
			/* floating constant */
			e->u.constant.f = strtod(tok.lit, &end);
			if (end == tok.lit)
				error(&tok.loc, "invalid floating constant '%s'", tok.lit);
			if (!end[0])
				e->type = &typedouble;
			else if (tolower(end[0]) == 'f' && !end[1])
				e->type = &typefloat;
			else if (tolower(end[0]) == 'l' && !end[1])
				e->type = &typeldouble;
			else
				error(&tok.loc, "invalid floating constant suffix '%s'", end);
		} else {
			src = tok.lit;
			if (base == 2)
				src += 2;
			/* integer constant */
			e->u.constant.u = strtoull(src, &end, base);
			if (end == src)
				error(&tok.loc, "invalid integer constant '%s'", tok.lit);
			e->type = inttype(e->u.constant.u, base == 10, end);
		}
		next();
		break;
	case TTRUE:
	case TFALSE:
		e = mkexpr(EXPRCONST, &typebool, NULL);
		e->u.constant.u = tok.kind == TTRUE;
		next();
		break;
	case TNULLPTR:
		e = mkexpr(EXPRCONST, &typenullptr, NULL);
		e->u.constant.u = 0;
		next();
		break;
	case TLPAREN:
		next();
		e = expr(s);
		expect(TRPAREN, "after expression");
		break;
	case T_GENERIC:
		e = generic(s);
		break;
	default:
		error(&tok.loc, "expected primary expression");
		return NULL;  /* unreachable */
	}

	return e;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
leaq 0x175a5(%rip), %rax     # 0x221a8
movl (%rax), %eax
addl $-0x4, %eax
movl %eax, %ecx
movq %rcx, -0x48(%rbp)
subl $0x3e, %eax
ja 0xb176
movq -0x48(%rbp), %rax
leaq 0xea7e(%rip), %rcx      # 0x196a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
leaq 0x17572(%rip), %rax     # 0x221a8
movq 0x20(%rax), %rsi
movl $0x1, %edx
callq 0xfef0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xac73
leaq 0x17552(%rip), %rax     # 0x221a8
movq 0x20(%rax), %rdx
leaq 0x17547(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0xf19b(%rip), %rsi      # 0x19e07
movb $0x0, %al
callq 0x11190
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
xorl %edi, %edi
xorl %eax, %eax
movl %eax, %edx
callq 0x9040
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x20(%rbp), %rax
cmpl $0x1, 0x8(%rax)
sete %cl
movq -0x18(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x4(%rax)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x20(%rbp), %rax
cmpl $0x4, 0x8(%rax)
je 0xacd0
movq -0x18(%rbp), %rdi
callq 0xa660
movq %rax, -0x18(%rbp)
callq 0xd540
jmp 0xb199
movl $0x2, %edi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x9040
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
xorl %esi, %esi
callq 0x8390
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdx
xorl %esi, %esi
callq 0x117e0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x4(%rax)
movq -0x18(%rbp), %rdi
callq 0xa660
movq %rax, -0x18(%rbp)
jmp 0xb199
leaq 0x17467(%rip), %rax     # 0x221a8
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x4c(%rbp)
subl $0x4c, %eax
je 0xad71
jmp 0xad5a
movl -0x4c(%rbp), %eax
subl $0x55, %eax
je 0xadd9
jmp 0xad64
movl -0x4c(%rbp), %eax
subl $0x75, %eax
je 0xad91
jmp 0xadf2
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
leaq 0x1741c(%rip), %rax     # 0x221a0
movq (%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0xadfd
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x38, %eax
jne 0xadc2
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
leaq 0x16ddc(%rip), %rax     # 0x21b98
movq %rax, -0x58(%rbp)
jmp 0xadcf
leaq 0x16e7f(%rip), %rax     # 0x21c48
movq %rax, -0x58(%rbp)
jmp 0xadcf
movq -0x58(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0xadfd
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
leaq 0x16f0c(%rip), %rax     # 0x21cf8
movq %rax, -0x28(%rbp)
jmp 0xadfd
leaq 0x16ea7(%rip), %rax     # 0x21ca0
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x27, %eax
jne 0xae0b
jmp 0xae2a
leaq 0xf00f(%rip), %rdi      # 0x19e21
leaq 0xeb4c(%rip), %rsi      # 0x19965
movl $0x2a4, %edx            # imm = 0x2A4
leaq 0xf009(%rip), %rcx      # 0x19e2e
callq 0x30f0
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
leaq 0x105ac(%rip), %rcx     # 0x1b3f5
leaq 0x17358(%rip), %r8      # 0x221a8
addq $0x8, %r8
callq 0x8840
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movl -0x3c(%rbp), %eax
movl %eax, %esi
callq 0xb820
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x27, %eax
je 0xae9f
movq -0x30(%rbp), %rax
movsbl (%rax), %edx
leaq 0x1731b(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0xefbf(%rip), %rsi      # 0x19e57
movb $0x0, %al
callq 0x11190
callq 0xd540
jmp 0xb199
movl $0x1, %edi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x9040
movq %rax, -0x18(%rbp)
leaq 0x172e3(%rip), %rax     # 0x221a8
movq 0x20(%rax), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0xaf16
leaq 0x172d0(%rip), %rax     # 0x221a8
movq 0x20(%rax), %rax
movsbl 0x1(%rax), %edi
callq 0x31a0
movl %eax, %ecx
movl %ecx, -0x5c(%rbp)
subl $0x62, %eax
je 0xaf04
jmp 0xaef1
movl -0x5c(%rbp), %eax
subl $0x78, %eax
jne 0xaf0d
jmp 0xaefb
movl $0x10, -0x40(%rbp)
jmp 0xaf14
movl $0x2, -0x40(%rbp)
jmp 0xaf14
movl $0x8, -0x40(%rbp)
jmp 0xaf1d
movl $0xa, -0x40(%rbp)
leaq 0x17284(%rip), %rax     # 0x221a8
movq 0x20(%rax), %rdi
movl -0x40(%rbp), %ecx
leaq 0xef61(%rip), %rsi      # 0x19e93
leaq 0xef56(%rip), %rax      # 0x19e8f
cmpl $0x10, %ecx
cmoveq %rax, %rsi
callq 0x31e0
cmpq $0x0, %rax
je 0xb039
leaq 0x17252(%rip), %rax     # 0x221a8
movq 0x20(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3080
movq -0x18(%rbp), %rax
movsd %xmm0, 0x30(%rax)
movq -0x38(%rbp), %rax
leaq 0x17231(%rip), %rcx     # 0x221a8
cmpq 0x20(%rcx), %rax
jne 0xafa1
leaq 0x17224(%rip), %rax     # 0x221a8
movq 0x20(%rax), %rdx
leaq 0x17219(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0xeefd(%rip), %rsi      # 0x19e97
movb $0x0, %al
callq 0x11190
movq -0x38(%rbp), %rax
cmpb $0x0, (%rax)
jne 0xafbb
movq -0x18(%rbp), %rax
leaq 0x16f53(%rip), %rcx     # 0x21f08
movq %rcx, 0x8(%rax)
jmp 0xb034
movq -0x38(%rbp), %rax
movsbl (%rax), %edi
callq 0x31a0
cmpl $0x66, %eax
jne 0xafe7
movq -0x38(%rbp), %rax
cmpb $0x0, 0x1(%rax)
jne 0xafe7
movq -0x18(%rbp), %rax
leaq 0x16ecf(%rip), %rcx     # 0x21eb0
movq %rcx, 0x8(%rax)
jmp 0xb032
movq -0x38(%rbp), %rax
movsbl (%rax), %edi
callq 0x31a0
cmpl $0x6c, %eax
jne 0xb013
movq -0x38(%rbp), %rax
cmpb $0x0, 0x1(%rax)
jne 0xb013
movq -0x18(%rbp), %rax
leaq 0x16f53(%rip), %rcx     # 0x21f60
movq %rcx, 0x8(%rax)
jmp 0xb030
movq -0x38(%rbp), %rdx
leaq 0x1718a(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0xee8d(%rip), %rsi      # 0x19eb6
movb $0x0, %al
callq 0x11190
jmp 0xb032
jmp 0xb034
jmp 0xb0cc
leaq 0x17168(%rip), %rax     # 0x221a8
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
cmpl $0x2, -0x40(%rbp)
jne 0xb05a
movq -0x30(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movl -0x40(%rbp), %edx
leaq -0x38(%rbp), %rsi
callq 0x3150
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jne 0xb0a3
leaq 0x17122(%rip), %rax     # 0x221a8
movq 0x20(%rax), %rdx
leaq 0x17117(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0xee40(%rip), %rsi      # 0x19edc
movb $0x0, %al
callq 0x11190
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
cmpl $0xa, -0x40(%rbp)
sete %al
movq -0x38(%rbp), %rdx
movzbl %al, %esi
andl $0x1, %esi
callq 0xb920
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
callq 0xd540
jmp 0xb199
movl $0x1, %edi
leaq 0x169ae(%rip), %rsi     # 0x21a90
xorl %eax, %eax
movl %eax, %edx
callq 0x9040
movq %rax, -0x18(%rbp)
leaq 0x170b2(%rip), %rax     # 0x221a8
cmpl $0x2c, (%rax)
sete %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
callq 0xd540
jmp 0xb199
movl $0x1, %edi
leaq 0x16e96(%rip), %rsi     # 0x21fb8
xorl %eax, %eax
movl %eax, %edx
callq 0x9040
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, 0x30(%rax)
callq 0xd540
jmp 0xb199
callq 0xd540
movq -0x10(%rbp), %rdi
callq 0x8f10
movq %rax, -0x18(%rbp)
movl $0x43, %edi
leaq 0xed9a(%rip), %rsi      # 0x19efa
callq 0xd8d0
jmp 0xb199
movq -0x10(%rbp), %rdi
callq 0xbad0
movq %rax, -0x18(%rbp)
jmp 0xb199
leaq 0x1702b(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0xed83(%rip), %rsi      # 0x19f0b
movb $0x0, %al
callq 0x11190
movq $0x0, -0x8(%rbp)
jmp 0xb1a1
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)