// File: /workspace/github_c_makefile_star2_O0/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.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 + 1 <= 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 & 07777) + reloc;
      nextLexeme();
      break;

    case '[':                   /* Generate literal on page zero.             */
      if( !literals_ok && LITERAL_ERROR)
      {
        errorMessage( &literal_gen_off, lexstart );
      }
      nextLexBlank();           /* Skip bracket                               */
      val = getExprs() & 07777;

      if( line[lexstart] == ']' )
      {
        nextLexBlank();         /* Skip end bracket                           */
      }

      sym_eval.val = (literals_ok || !LITERAL_ERROR) ? insertLiteral( cp , val,
        GET_PAGE_INDEX(field)) : 0;
      return( &sym_eval );

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

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

      if( line[lexstart] == ')' )
      {
        nextLexBlank();         /* Skip end paren                             */
      }

      loc = (literals_ok || !LITERAL_ERROR) ? insertLiteral( cp, val, GET_PAGE_INDEX(clc) ) : 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
movq %rsp, %rbp
subq $0x30, %rsp
movw $0x0, -0x22(%rbp)
movslq 0x8e47(%rip), %rcx      # 0xf87c
leaq 0x8db4(%rip), %rax      # 0xf7f0
movb (%rax,%rcx), %al
movb %al, 0x8e3b(%rip)       # 0xf880
callq 0x21b0
movq (%rax), %rax
movslq 0x8e20(%rip), %rdx      # 0xf874
leaq 0x8d95(%rip), %rcx      # 0xf7f0
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x6ace
callq 0x53d0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x1, %eax
je 0x6abc
cmpl $0x2, 0x69c2(%rip)      # 0xd450
jne 0x6abc
movq -0x20(%rbp), %rsi
addq $0x4, %rsi
movl 0x8dd6(%rip), %edx      # 0xf874
leaq 0x6713(%rip), %rdi      # 0xd1b8
callq 0x5030
callq 0x4330
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6ec2
callq 0x4330
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6ec2
callq 0x21b0
movq (%rax), %rax
movslq 0x8d97(%rip), %rdx      # 0xf874
leaq 0x8d0c(%rip), %rcx      # 0xf7f0
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x6bf6
movl 0x8d71(%rip), %eax      # 0xf874
movl %eax, -0x10(%rbp)
movw $0x0, -0x22(%rbp)
movl -0x10(%rbp), %eax
cmpl 0x8d67(%rip), %eax      # 0xf87c
jge 0x6bd6
callq 0x21b0
movq (%rax), %rax
movslq -0x10(%rbp), %rdx
leaq 0x8cc2(%rip), %rcx      # 0xf7f0
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x6bb0
movl -0x10(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x10(%rbp)
movslq %eax, %rcx
leaq 0x8c98(%rip), %rax      # 0xf7f0
movsbl (%rax,%rcx), %eax
cwtl
subl $0x30, %eax
movw %ax, -0xa(%rbp)
movswl -0xa(%rbp), %eax
movswl 0x8c73(%rip), %ecx      # 0xf7e2
cmpl %ecx, %eax
jge 0x6b8d
movswl -0x22(%rbp), %eax
movswl 0x8c64(%rip), %ecx      # 0xf7e2
imull %ecx, %eax
movswl -0xa(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x22(%rbp)
jmp 0x6bae
movl -0x10(%rbp), %esi
subl $0x1, %esi
leaq 0x65ce(%rip), %rdi      # 0xd168
callq 0x5150
movw $0x0, -0x22(%rbp)
movl 0x8cd1(%rip), %eax      # 0xf87c
movl %eax, -0x10(%rbp)
jmp 0x6bd1
movl 0x8cbe(%rip), %esi      # 0xf874
leaq 0x659b(%rip), %rdi      # 0xd158
callq 0x5150
movw $0x0, -0x22(%rbp)
movl 0x8cae(%rip), %eax      # 0xf87c
movl %eax, -0x10(%rbp)
jmp 0x6b0c
callq 0x4330
movw -0x22(%rbp), %ax
movw %ax, 0x66fe(%rip)       # 0xd2e4
leaq 0x66eb(%rip), %rax      # 0xd2d8
movq %rax, -0x8(%rbp)
jmp 0x6ec2
movslq 0x8c77(%rip), %rax      # 0xf874
leaq 0x8bec(%rip), %rcx      # 0xf7f0
movsbl (%rax,%rcx), %eax
movl %eax, -0x28(%rbp)
subl $0x22, %eax
je 0x6c3f
jmp 0x6c12
movl -0x28(%rbp), %eax
subl $0x28, %eax
je 0x6d8d
jmp 0x6c20
movl -0x28(%rbp), %eax
subl $0x2e, %eax
je 0x6cb9
jmp 0x6c2e
movl -0x28(%rbp), %eax
subl $0x5b, %eax
je 0x6cdc
jmp 0x6e5b
movl 0x8c47(%rip), %eax      # 0xf88c
addl $0x1, %eax
cmpl 0x8c42(%rip), %eax      # 0xf890
jg 0x6c9d
movl 0x8c1e(%rip), %eax      # 0xf874
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x8b8d(%rip), %rax      # 0xf7f0
movsbl (%rax,%rcx), %eax
orl $0x80, %eax
movw %ax, -0x22(%rbp)
movl 0x8bfe(%rip), %eax      # 0xf874
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x8b6d(%rip), %rax      # 0xf7f0
movb (%rax,%rcx), %al
movb %al, 0x8bf4(%rip)       # 0xf880
movl 0x8be2(%rip), %eax      # 0xf874
addl $0x2, %eax
movl %eax, 0x8bf1(%rip)      # 0xf88c
jmp 0x6caf
movl 0x8bd1(%rip), %esi      # 0xf874
leaq 0x65de(%rip), %rdi      # 0xd288
callq 0x6ed0
callq 0x4330
jmp 0x6ea8
movswl 0x8b00(%rip), %eax      # 0xf7c0
andl $0xfff, %eax            # imm = 0xFFF
movswl 0x8afa(%rip), %ecx      # 0xf7c6
addl %ecx, %eax
movw %ax, -0x22(%rbp)
callq 0x4330
jmp 0x6ea8
cmpb $0x0, 0x66c7(%rip)      # 0xd3aa
jne 0x6cff
xorl %eax, %eax
testb $0x1, %al
jne 0x6ced
jmp 0x6cff
movl 0x8b81(%rip), %esi      # 0xf874
leaq 0x657e(%rip), %rdi      # 0xd278
callq 0x6ed0
callq 0x51a0
callq 0x5210
cwtl
andl $0xfff, %eax            # imm = 0xFFF
movw %ax, -0x22(%rbp)
movslq 0x8b5a(%rip), %rcx      # 0xf874
leaq 0x8acf(%rip), %rax      # 0xf7f0
movsbl (%rax,%rcx), %eax
cmpl $0x5d, %eax
jne 0x6d2f
callq 0x51a0
movzbl 0x6674(%rip), %eax      # 0xd3aa
cmpl $0x0, %eax
jne 0x6d43
xorl %eax, %eax
testb $0x1, %al
jne 0x6d6c
jmp 0x6d43
movw -0x22(%rbp), %ax
movswl 0x8a74(%rip), %edx      # 0xf7c2
andl $0xf80, %edx            # imm = 0xF80
sarl $0x7, %edx
leaq 0x6962(%rip), %rdi      # 0xd6c0
movswl %ax, %esi
callq 0x6910
cwtl
movl %eax, -0x2c(%rbp)
jmp 0x6d73
xorl %eax, %eax
movl %eax, -0x2c(%rbp)
jmp 0x6d73
movl -0x2c(%rbp), %eax
movw %ax, 0x6567(%rip)       # 0xd2e4
leaq 0x6554(%rip), %rax      # 0xd2d8
movq %rax, -0x8(%rbp)
jmp 0x6ec2
cmpb $0x0, 0x6616(%rip)      # 0xd3aa
jne 0x6db0
xorl %eax, %eax
testb $0x1, %al
jne 0x6d9e
jmp 0x6db0
movl 0x8ad0(%rip), %esi      # 0xf874
leaq 0x64cd(%rip), %rdi      # 0xd278
callq 0x6ed0
callq 0x51a0
callq 0x5210
cwtl
andl $0xfff, %eax            # imm = 0xFFF
movw %ax, -0x22(%rbp)
movslq 0x8aa9(%rip), %rcx      # 0xf874
leaq 0x8a1e(%rip), %rax      # 0xf7f0
movsbl (%rax,%rcx), %eax
cmpl $0x29, %eax
jne 0x6de0
callq 0x51a0
movzbl 0x65c3(%rip), %eax      # 0xd3aa
cmpl $0x0, %eax
jne 0x6df4
xorl %eax, %eax
testb $0x1, %al
jne 0x6e1d
jmp 0x6df4
movw -0x22(%rbp), %ax
movswl 0x89c1(%rip), %edx      # 0xf7c0
andl $0xf80, %edx            # imm = 0xF80
sarl $0x7, %edx
leaq 0x68b1(%rip), %rdi      # 0xd6c0
movswl %ax, %esi
callq 0x6910
cwtl
movl %eax, -0x30(%rbp)
jmp 0x6e24
xorl %eax, %eax
movl %eax, -0x30(%rbp)
jmp 0x6e24
movl -0x30(%rbp), %eax
movw %ax, -0x12(%rbp)
movswl -0x12(%rbp), %eax
movswl 0x898a(%rip), %ecx      # 0xf7c0
movswl 0x8989(%rip), %edx      # 0xf7c6
addl %edx, %ecx
andl $0x7f80, %ecx           # imm = 0x7F80
addl %ecx, %eax
movw %ax, 0x6496(%rip)       # 0xd2e4
leaq 0x6483(%rip), %rax      # 0xd2d8
movq %rax, -0x8(%rbp)
jmp 0x6ec2
movslq 0x8a12(%rip), %rax      # 0xf874
leaq 0x8987(%rip), %rcx      # 0xf7f0
movb (%rax,%rcx), %al
subb $0x3d, %al
jne 0x6e8b
jmp 0x6e72
movl 0x89fc(%rip), %esi      # 0xf874
leaq 0x6309(%rip), %rdi      # 0xd188
callq 0x6ed0
callq 0x6f70
jmp 0x6e9d
movl 0x89e3(%rip), %esi      # 0xf874
leaq 0x6290(%rip), %rdi      # 0xd128
callq 0x6ed0
movw $0x0, -0x22(%rbp)
callq 0x51a0
jmp 0x6eaa
jmp 0x6eac
movw -0x22(%rbp), %ax
movw %ax, 0x642d(%rip)       # 0xd2e4
leaq 0x641a(%rip), %rax      # 0xd2d8
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)