// File: /workspace/github_c_makefile_star2_O0/mist64[P]cbm6502asm/src/express.c
// Function: evalsym
long evalsym() {
	char sym[32]; /* save symbol */
	int i = 0;    /* position of last character added to sym */

	sym[i++] = toupper(*(lp - 1));
	while (isalpha(*lp) || isdigit(*lp) || *lp == '$' || *lp == '.' ||
	       *lp == '_') {
		sym[i] = toupper(*lp); /* gather the symbol name */
		lp++;
		if (i < 31) i++;
	}
	sym[i] = 0;             /* terminate the symbol name */
	ptr = find_symbol(sym); /* get a pointer to the symbol table entry */
	if (!ptr)
		insert_symbol(sym, 0L, 0, 0,
		              0); /* insert an undefined symbol */
	else
		addref(&ptr->xref,
		       0); /* add a reference to symbol is it exists */
	if (ptr->section)  /* bad idea to use section names in expressions */
		display_error(error = 'S');
	if (ptr->multiple) /* use of multiply defined symbol */
		display_error(error = 'S');
	if (ptr->known)              /* is the value of the symbol known? */
		return (ptr->value); /* value of symbol */
	if (pass == 2) display_error(error = 'U');
	expdef = FALSE; /* symbol value is unknown */
	return (0L);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl $0x0, -0x34(%rbp)
movq 0xb72a(%rip), %rax      # 0x112c0
movsbl -0x1(%rax), %edi
callq 0x1080
movb %al, %cl
movl -0x34(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x34(%rbp)
cltq
movb %cl, -0x30(%rbp,%rax)
callq 0x1200
movq (%rax), %rax
movq 0xb6ff(%rip), %rcx      # 0x112c0
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x400, %ecx            # imm = 0x400
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x35(%rbp)
jne 0x5c3f
callq 0x1200
movq (%rax), %rax
movq 0xb6d6(%rip), %rcx      # 0x112c0
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x800, %ecx            # imm = 0x800
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x35(%rbp)
jne 0x5c3f
movq 0xb6b5(%rip), %rax      # 0x112c0
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x24, %ecx
movb %al, -0x35(%rbp)
je 0x5c3f
movq 0xb6a1(%rip), %rax      # 0x112c0
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x2e, %ecx
movb %al, -0x35(%rbp)
je 0x5c3f
movq 0xb68d(%rip), %rax      # 0x112c0
movsbl (%rax), %eax
cmpl $0x5f, %eax
sete %al
movb %al, -0x35(%rbp)
movb -0x35(%rbp), %al
testb $0x1, %al
jne 0x5c48
jmp 0x5c87
movq 0xb671(%rip), %rax      # 0x112c0
movsbl (%rax), %edi
callq 0x1080
movb %al, %cl
movslq -0x34(%rbp), %rax
movb %cl, -0x30(%rbp,%rax)
movq 0xb658(%rip), %rax      # 0x112c0
addq $0x1, %rax
movq %rax, 0xb64d(%rip)      # 0x112c0
cmpl $0x1f, -0x34(%rbp)
jge 0x5c82
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x5bb2
movslq -0x34(%rbp), %rax
movb $0x0, -0x30(%rbp,%rax)
leaq -0x30(%rbp), %rdi
callq 0xc810
movq %rax, %rcx
leaq 0xaf8d(%rip), %rax      # 0x10c30
movq %rcx, (%rax)
leaq 0xaf83(%rip), %rax      # 0x10c30
cmpq $0x0, (%rax)
jne 0x5ccb
leaq -0x30(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %r8d, %r8d
movl %r8d, %edx
movl %r8d, %ecx
callq 0xc340
jmp 0x5ce0
leaq 0xaf5e(%rip), %rax      # 0x10c30
movq (%rax), %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0xc150
leaq 0xaf49(%rip), %rax      # 0x10c30
movq (%rax), %rax
movw 0x20(%rax), %ax
shrw $0x4, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x5d12
leaq 0xb0db(%rip), %rax      # 0x10de0
movb $0x53, (%rax)
movl $0x53, %edi
callq 0x2350
leaq 0xaf17(%rip), %rax      # 0x10c30
movq (%rax), %rax
movw 0x20(%rax), %ax
shrw $0x3, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x5d44
leaq 0xb0a9(%rip), %rax      # 0x10de0
movb $0x53, (%rax)
movl $0x53, %edi
callq 0x2350
leaq 0xaee5(%rip), %rax      # 0x10c30
movq (%rax), %rax
movw 0x20(%rax), %ax
shrw $0x8, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x5d76
leaq 0xaec7(%rip), %rax      # 0x10c30
movq (%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x5dab
leaq 0xaa67(%rip), %rax      # 0x107e4
cmpl $0x2, (%rax)
jne 0x5d96
leaq 0xb057(%rip), %rax      # 0x10de0
movb $0x55, (%rax)
movl $0x55, %edi
callq 0x2350
leaq 0xb02b(%rip), %rax      # 0x10dc8
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)