// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x18, %rsp
movslq 0x69ac(%rip), %r14      # 0xb708
leaq 0x693d(%rip), %r15      # 0xb6a0
movb (%r14,%r15), %al
movb %al, 0x699f(%rip)       # 0xb70c
callq 0x2180
movq (%rax), %rdx
movslq 0x6984(%rip), %rbx      # 0xb700
movsbq (%rbx,%r15), %rcx
movzwl (%rdx,%rcx,2), %edx
btl $0xa, %edx
jb 0x4e22
btl $0xb, %edx
jb 0x4e5b
movzbl %cl, %eax
cmpl $0x2d, %eax
jle 0x4ea0
cmpl $0x2e, %eax
je 0x4f38
cmpl $0x3d, %eax
je 0x4f4b
cmpl $0x5b, %eax
jne 0x4fcc
cmpb $0x0, 0x6393(%rip)      # 0xb15a
jne 0x4dd7
leaq 0x62d0(%rip), %rdi      # 0xb0a0
movl %ebx, %esi
callq 0x5062
callq 0x3ec0
callq 0x37f6
movzwl 0x633c(%rip), %ebx      # 0xb124
movslq 0x6911(%rip), %rax      # 0xb700
cmpb $0x5d, (%rax,%r15)
jne 0x4dfb
callq 0x3ec0
cmpb $0x0, 0x6358(%rip)      # 0xb15a
je 0x503d
andl $0xfff, %ebx            # imm = 0xFFF
movzwl %bx, %esi
leaq 0x6764(%rip), %rdi      # 0xb57c
callq 0x4d01
jmp 0x5059
callq 0x4062
movq %rax, %rbx
testb $0x1, (%rax)
jne 0x4e51
cmpl $0x2, 0x63ca(%rip)      # 0xb200
jne 0x4e51
movq %rbx, %rsi
addq $0x4, %rsi
movl 0x68bb(%rip), %edx      # 0xb700
leaq 0x61a4(%rip), %rdi      # 0xaff0
callq 0x3daa
callq 0x3671
jmp 0x501f
xorl %ebp, %ebp
cmpl %r14d, %ebx
jge 0x500c
movq (%rax), %rax
movswl 0x682a(%rip), %ecx      # 0xb69a
movsbq (%rbx,%r15), %rdx
testb $0x8, 0x1(%rax,%rdx,2)
je 0x4f0f
addl $-0x30, %edx
cmpl %ecx, %edx
jge 0x4fe3
movzwl %bp, %ebp
imull %ecx, %ebp
addl %edx, %ebp
incq %rbx
cmpl %r14d, %ebx
jl 0x4e70
jmp 0x500c
cmpl $0x22, %eax
je 0x4f91
cmpl $0x28, %eax
jne 0x4fcc
cmpb $0x0, 0x62a1(%rip)      # 0xb15a
jne 0x4ec9
leaq 0x61de(%rip), %rdi      # 0xb0a0
movl %ebx, %esi
callq 0x5062
callq 0x3ec0
callq 0x3f10
movl %eax, %ebx
movslq 0x6824(%rip), %rax      # 0xb700
cmpb $0x29, (%rax,%r15)
jne 0x4ee8
callq 0x3ec0
cmpb $0x0, 0x626b(%rip)      # 0xb15a
je 0x5041
andl $0xfff, %ebx            # imm = 0xFFF
movzwl %bx, %esi
leaq 0x6573(%rip), %rdi      # 0xb478
callq 0x4d01
jmp 0x5043
movl 0x67eb(%rip), %ebx      # 0xb700
leaq 0x11(%rsp), %r15
movq %r15, %rdi
movl %ebx, %esi
movl %r14d, %edx
callq 0x3d3a
leaq 0x6062(%rip), %rdi      # 0xaf90
movq %r15, %rsi
movl %ebx, %edx
jmp 0x5005
movzwl 0x6537(%rip), %ebp      # 0xb476
addw 0x652a(%rip), %bp       # 0xb470
jmp 0x500c
leaq 0x606e(%rip), %rdi      # 0xafc0
movl %ebx, %esi
callq 0x5062
movslq 0x67b8(%rip), %rax      # 0xb718
addq %rax, %r15
movzbl (%r15), %ecx
testl %ecx, %ecx
je 0x4f7d
cmpl $0xa, %ecx
je 0x4f7d
incl %eax
movl %eax, 0x67a0(%rip)      # 0xb718
incq %r15
jmp 0x4f63
movl %eax, 0x677d(%rip)      # 0xb700
movl %eax, 0x677f(%rip)      # 0xb708
movl %eax, 0x6781(%rip)      # 0xb710
jmp 0x4fda
movl 0x6781(%rip), %eax      # 0xb718
addl $0x2, %eax
cmpl 0x677c(%rip), %eax      # 0xb71c
jge 0x502d
movsbl 0x1(%rbx,%r15), %ebp
orl $0x80, %ebp
movq %rbx, %rax
addq $0x2, %rax
movb 0x2(%rbx,%r15), %cl
movb %cl, 0x6748(%rip)       # 0xb70c
movl %eax, 0x674e(%rip)      # 0xb718
jmp 0x500c
leaq 0x5f8d(%rip), %rdi      # 0xaf60
movl %ebx, %esi
callq 0x5062
callq 0x3ec0
xorl %ebp, %ebp
jmp 0x5011
movl 0x6717(%rip), %esi      # 0xb700
leaq 0xa(%rsp), %r15
movq %r15, %rdi
movl %r14d, %edx
callq 0x3d3a
leaq 0x5fa0(%rip), %rdi      # 0xafa0
movq %r15, %rsi
movl %ebx, %edx
callq 0x3daa
xorl %ebp, %ebp
callq 0x3671
movw %bp, 0x60f4(%rip)       # 0xb10c
leaq 0x60e1(%rip), %rbx      # 0xb100
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x607c(%rip), %rdi      # 0xb0b0
movl %ebx, %esi
callq 0x5062
jmp 0x500a
xorl %eax, %eax
jmp 0x5059
xorl %eax, %eax
movzwl 0x642c(%rip), %ecx      # 0xb476
addw 0x641f(%rip), %cx       # 0xb470
andl $0x7f80, %ecx           # imm = 0x7F80
addl %ecx, %eax
movw %ax, 0x60ac(%rip)       # 0xb10c
jmp 0x5018