// File: /workspace/github_c_makefile_star2_O1/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
subq $0x18, %rsp
movslq 0x699b(%rip), %rax      # 0xb708
leaq 0x692c(%rip), %rbp      # 0xb6a0
movb (%rax,%rbp), %al
movb %al, 0x698f(%rip)       # 0xb70c
callq 0x2180
movq %rax, %r14
movq (%rax), %rdx
movl 0x6972(%rip), %ebx      # 0xb700
movslq %ebx, %rax
movsbq (%rax,%rbp), %rcx
movzwl (%rdx,%rcx,2), %edx
btl $0xa, %edx
jb 0x4e36
btl $0xb, %edx
jb 0x4e6f
movzbl %cl, %ecx
cmpl $0x2d, %ecx
jle 0x4f17
cmpl $0x2e, %ecx
je 0x4f85
cmpl $0x3d, %ecx
je 0x4f98
cmpl $0x5b, %ecx
jne 0x5013
cmpb $0x0, 0x637e(%rip)      # 0xb15a
jne 0x4dec
leaq 0x62bb(%rip), %rdi      # 0xb0a0
movl %ebx, %esi
callq 0x5084
callq 0x3ea0
callq 0x37cc
movzwl 0x6327(%rip), %ebx      # 0xb124
movslq 0x68fc(%rip), %rax      # 0xb700
cmpb $0x5d, (%rax,%rbp)
jne 0x4e0f
callq 0x3ea0
cmpb $0x0, 0x6344(%rip)      # 0xb15a
je 0x5048
andl $0xfff, %ebx            # imm = 0xFFF
movzwl %bx, %esi
leaq 0x6750(%rip), %rdi      # 0xb57c
callq 0x4cf2
jmp 0x5064
callq 0x4042
movq %rax, %rbx
testb $0x1, (%rax)
jne 0x4e65
cmpl $0x2, 0x63b6(%rip)      # 0xb200
jne 0x4e65
movq %rbx, %rsi
addq $0x4, %rsi
movl 0x68a7(%rip), %edx      # 0xb700
leaq 0x6190(%rip), %rdi      # 0xaff0
callq 0x3d8a
callq 0x3640
jmp 0x5072
movl 0x6893(%rip), %edx      # 0xb708
xorl %r12d, %r12d
cmpl %edx, %ebx
jge 0x4f05
leaq 0x11(%rsp), %r15
leaq 0xa(%rsp), %r13
movq (%r14), %rcx
movslq %ebx, %rax
movsbq (%rax,%rbp), %rax
testb $0x8, 0x1(%rcx,%rax,2)
jne 0x4eb8
movl 0x685e(%rip), %ebx      # 0xb700
movq %r15, %rdi
movl %ebx, %esi
callq 0x3d15
leaq 0x60dd(%rip), %rdi      # 0xaf90
movq %r15, %rsi
jmp 0x4eeb
addl $-0x30, %eax
movswl 0x67d8(%rip), %ecx      # 0xb69a
cmpl %ecx, %eax
jge 0x4ed3
incl %ebx
imull %r12d, %ecx
addl %eax, %ecx
movl %ecx, %r12d
jmp 0x4efb
movl 0x6827(%rip), %esi      # 0xb700
movq %r13, %rdi
callq 0x3d15
leaq 0x60b8(%rip), %rdi      # 0xafa0
movq %r13, %rsi
movl %ebx, %edx
callq 0x3d8a
xorl %r12d, %r12d
movl 0x680d(%rip), %ebx      # 0xb708
movl 0x6807(%rip), %edx      # 0xb708
cmpl %edx, %ebx
jl 0x4e8a
callq 0x3640
movw %r12w, 0x61fa(%rip)     # 0xb10c
jmp 0x506b
cmpl $0x22, %ecx
je 0x4fde
cmpl $0x28, %ecx
jne 0x5013
cmpb $0x0, 0x622a(%rip)      # 0xb15a
jne 0x4f40
leaq 0x6167(%rip), %rdi      # 0xb0a0
movl %ebx, %esi
callq 0x5084
callq 0x3ea0
callq 0x3ef0
movl %eax, %ebx
movslq 0x67ad(%rip), %rax      # 0xb700
cmpb $0x29, (%rax,%rbp)
jne 0x4f5e
callq 0x3ea0
cmpb $0x0, 0x61f5(%rip)      # 0xb15a
je 0x504c
andl $0xfff, %ebx            # imm = 0xFFF
movzwl %bx, %esi
leaq 0x64fd(%rip), %rdi      # 0xb478
callq 0x4cf2
jmp 0x504e
movzwl 0x64ea(%rip), %ebx      # 0xb476
addw 0x64dd(%rip), %bx       # 0xb470
jmp 0x503a
leaq 0x6021(%rip), %rdi      # 0xafc0
movl %ebx, %esi
callq 0x5084
movslq 0x676b(%rip), %rax      # 0xb718
addq %rax, %rbp
movzbl (%rbp), %ecx
testl %ecx, %ecx
je 0x4fca
cmpl $0xa, %ecx
je 0x4fca
incl %eax
movl %eax, 0x6753(%rip)      # 0xb718
incq %rbp
jmp 0x4fb0
movl %eax, 0x6730(%rip)      # 0xb700
movl %eax, 0x6732(%rip)      # 0xb708
movl %eax, 0x6734(%rip)      # 0xb710
jmp 0x5021
movl 0x6734(%rip), %ecx      # 0xb718
addl $0x2, %ecx
cmpl 0x672f(%rip), %ecx      # 0xb71c
jge 0x502a
movsbl 0x1(%rax,%rbp), %ebx
orl $0x80, %ebx
movq %rax, %rcx
addq $0x2, %rcx
movb 0x2(%rax,%rbp), %al
movb %al, 0x6701(%rip)       # 0xb70c
movl %ecx, 0x6707(%rip)      # 0xb718
jmp 0x503a
leaq 0x5f46(%rip), %rdi      # 0xaf60
movl %ebx, %esi
callq 0x5084
callq 0x3ea0
xorl %ebx, %ebx
jmp 0x503f
leaq 0x607f(%rip), %rdi      # 0xb0b0
movl %ebx, %esi
callq 0x5084
xorl %ebx, %ebx
callq 0x3640
movw %bx, 0x60c6(%rip)       # 0xb10c
jmp 0x506b
xorl %eax, %eax
jmp 0x5064
xorl %eax, %eax
movzwl 0x6421(%rip), %ecx      # 0xb476
addw 0x6414(%rip), %cx       # 0xb470
andl $0x7f80, %ecx           # imm = 0x7F80
addl %ecx, %eax
movw %ax, 0x60a1(%rip)       # 0xb10c
leaq 0x608e(%rip), %rbx      # 0xb100
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq