// File: /workspace/github_c_makefile_star2_O2/radekh[P]palbart/palbart-2.5.c
// Function: eval
SYM_T *eval()
{
  WORD16  digit;
  int     from;
  WORD16  loc;
  SYM_T  *sym;
  WORD16  val;

  val = 0;

  delimiter = line[lexterm];
  if( isalpha( line[lexstart] ))
  {
    sym = evalSymbol();
    if( M_UNDEFINED( sym->type ) && pass == 2 )
    {
      errorSymbol( &undefined_symbol, sym->name, lexstart );
      nextLexeme();
      return( sym );
    }
    else
    {
      nextLexeme();
      return( sym );
    }
  }
  else if( isdigit( line[lexstart] ))
  {
    from = lexstart;
    val = 0;
    while( from < lexterm )
    {
      if( isdigit( line[from] ))
      {
        digit = (WORD16) line[from++] - (WORD16) '0';
        if( digit < radix )
        {
          val = val * radix + digit;
        }
        else
        {
          errorLexeme( &number_not_radix, from - 1 );
          val = 0;
          from = lexterm;
        }
      }
      else
      {
        errorLexeme( &not_a_number, lexstart );
        val = 0;
        from = lexterm;
      }
    }
    nextLexeme();
    sym_eval.val = val;
    return( &sym_eval );
  }
  else
  {
    switch( line[lexstart] )
    {
    case '"':                   /* Character literal                          */
      if( cc + 2 < maxcc )
      {
        val = line[lexstart + 1] | 0200;
        delimiter = line[lexstart + 2];
        cc = lexstart + 2;
      }
      else
      {
        errorMessage( &no_literal_value, lexstart );
      }
      nextLexeme();
      break;

    case '.':                   /* Value of Current Location Counter          */
      val = clc + reloc;
      nextLexeme();
      break;

    case '[':                   /* Generate literal on page zero.             */
      if( !literals_on )
      {
        errorMessage( &literal_gen_off, lexstart );
      }
      nextLexBlank();           /* Skip bracket                               */
      val = (getExpr())->val & 07777;
      if( line[lexstart] == ']' )
      {
        nextLexBlank();         /* Skip end bracket                           */
      }
      else
      {
        /* errorMessage( "parens", lexstart );                                */
      }
      sym_eval.val = literals_on ? insertLiteral( &pz, val ) : 0;
      return( &sym_eval );

    case '(':                   /* Generate literal on current page.          */
      if( !literals_on )
      {
        errorMessage( &literal_gen_off, lexstart );
      }

      nextLexBlank();           /* Skip paren                                 */
      val = getExprs() & 07777;

      if( line[lexstart] == ')' )
      {
        nextLexBlank();         /* Skip end paren                             */
      }
      else
      {
        /* errorMessage( "parens", NULL );                                    */
      }

      loc = literals_on ? insertLiteral( &cp, val ) : 0;
      sym_eval.val = loc + (( clc + reloc ) & 077600 );
      return( &sym_eval );

    default:
      switch( line[lexstart] )
      {
      case '=':
        errorMessage( &illegal_equals, lexstart );
        moveToEndOfLine();
        break;

      default:
        errorMessage( &illegal_character, lexstart );
        break;
      }
      val = 0;                  /* On error, set value to zero.               */
      nextLexBlank();           /* Go past illegal character.                 */
    }
  }
  sym_eval.val = val;
  return( &sym_eval );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq 0x5dea(%rip), %r13      # 0xa6f8
leaq 0x5d7b(%rip), %r12      # 0xa690
movb (%r13,%r12), %al
movb %al, 0x5ddc(%rip)       # 0xa6fc
callq 0x2170
movq %rax, %rbx
movq (%rax), %rdx
movl 0x5dbf(%rip), %esi      # 0xa6f0
movslq %esi, %rax
movsbq (%rax,%r12), %rcx
movzwl (%rdx,%rcx,2), %edx
btl $0xa, %edx
jb 0x49bb
btl $0xb, %edx
jb 0x49f4
movzbl %cl, %ecx
cmpl $0x5b, %ecx
je 0x4af6
cmpl $0x28, %ecx
je 0x4a63
cmpl $0x2e, %ecx
je 0x4ad1
cmpl $0x3d, %ecx
je 0x4abe
cmpl $0x22, %ecx
jne 0x4ae1
movl 0x5d85(%rip), %ecx      # 0xa708
addl $0x2, %ecx
cmpl 0x5d80(%rip), %ecx      # 0xa70c
jge 0x4b4f
movsbl 0x1(%rax,%r12), %ebx
orl $0x80, %ebx
movq %rax, %rcx
addq $0x2, %rcx
movb 0x2(%rax,%r12), %al
movb %al, 0x5d4c(%rip)       # 0xa6fc
movl %ecx, 0x5d52(%rip)      # 0xa708
jmp 0x4b5d
callq 0x3da9
movq %rax, %rbx
testb $0x1, (%rax)
jne 0x49ea
cmpl $0x2, 0x5821(%rip)      # 0xa1f0
jne 0x49ea
movq %rbx, %rsi
addq $0x4, %rsi
movl 0x5d12(%rip), %edx      # 0xa6f0
leaq 0x55fb(%rip), %rdi      # 0x9fe0
callq 0x3af4
callq 0x3476
jmp 0x4b95
leaq 0x5585(%rip), %r14      # 0x9f80
leaq 0x558e(%rip), %r15      # 0x9f90
movswl 0x5c81(%rip), %eax      # 0xa68a
movslq %esi, %rsi
xorl %ebp, %ebp
cmpl %r13d, %esi
jge 0x4a52
movq (%rbx), %rdx
movsbq (%rsi,%r12), %rcx
testb $0x8, 0x1(%rdx,%rcx,2)
je 0x4a33
addl $-0x30, %ecx
cmpl %eax, %ecx
jge 0x4a3e
imull %eax, %ebp
addl %ecx, %ebp
incq %rsi
jmp 0x4a0e
movl 0x5cb7(%rip), %esi      # 0xa6f0
movq %r14, %rdi
jmp 0x4a41
movq %r15, %rdi
callq 0x3bcc
movl 0x5cab(%rip), %r13d     # 0xa6f8
movl %r13d, %esi
jmp 0x4a02
callq 0x3476
movw %bp, 0x569e(%rip)       # 0xa0fc
jmp 0x4b8e
cmpb $0x0, 0x56e0(%rip)      # 0xa14a
jne 0x4a78
leaq 0x561d(%rip), %rdi      # 0xa090
callq 0x4ba7
callq 0x3c0a
callq 0x3c5a
movl %eax, %ebx
movslq 0x5c65(%rip), %rax      # 0xa6f0
cmpb $0x29, (%rax,%r12)
jne 0x4a97
callq 0x3c0a
cmpb $0x0, 0x56ac(%rip)      # 0xa14a
je 0x4b6b
andl $0xfff, %ebx            # imm = 0xFFF
movzwl %bx, %esi
leaq 0x59b4(%rip), %rdi      # 0xa468
callq 0x48b8
jmp 0x4b6d
leaq 0x54eb(%rip), %rdi      # 0x9fb0
callq 0x4ba7
callq 0x4c29
jmp 0x4aed
movzwl 0x598e(%rip), %ebx      # 0xa466
addw 0x5981(%rip), %bx       # 0xa460
jmp 0x4b5d
leaq 0x5468(%rip), %rdi      # 0x9f50
callq 0x4ba7
callq 0x3c0a
xorl %ebx, %ebx
jmp 0x4b62
cmpb $0x0, 0x564d(%rip)      # 0xa14a
jne 0x4b0b
leaq 0x558a(%rip), %rdi      # 0xa090
callq 0x4ba7
callq 0x3c0a
callq 0x35f2
movzwl 0x55f8(%rip), %ebx      # 0xa114
movslq 0x5bcd(%rip), %rax      # 0xa6f0
cmpb $0x5d, (%rax,%r12)
jne 0x4b2f
callq 0x3c0a
cmpb $0x0, 0x5614(%rip)      # 0xa14a
je 0x4b85
andl $0xfff, %ebx            # imm = 0xFFF
movzwl %bx, %esi
leaq 0x5a24(%rip), %rdi      # 0xa56c
callq 0x48b8
jmp 0x4b87
leaq 0x554a(%rip), %rdi      # 0xa0a0
callq 0x4ba7
xorl %ebx, %ebx
callq 0x3476
movw %bx, 0x5593(%rip)       # 0xa0fc
jmp 0x4b8e
xorl %eax, %eax
movzwl 0x58f2(%rip), %ecx      # 0xa466
addw 0x58e5(%rip), %cx       # 0xa460
andl $0x7f80, %ecx           # imm = 0x7F80
addl %ecx, %eax
jmp 0x4b87
xorl %eax, %eax
movw %ax, 0x556e(%rip)       # 0xa0fc
leaq 0x555b(%rip), %rbx      # 0xa0f0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq