// File: /workspace/github_c_makefile_star2_O0/simh[P]simtools/crossassemblers/macro7/macro7.c
// Function: eval
SYM_T *eval()
{
  WORD32  digit;
  WORD32  from;
  WORD32  loc;
  SYM_T  *sym;
  WORD32  val;

  val = 0;

  delimiter = line[lexterm];
  if( isalpha( line[lexstart] ))
  {
    sym = evalSymbol();
    if( M_UNDEFINED( sym->type ))
    {
      if( pass == 2 )
      {
        errorSymbol( &undefined_symbol, sym->name, lexstart );
      }
      nextLexeme();
      return( sym );
    }
    else if( M_PSEUDO( sym->type ))
    {
      if( sym->val == DECIMAL )
      {
        radix = 10;
      }
      else if( sym->val == OCTAL )
      {
        radix = 8;
      }
      else if( pass == 2 )
      {
        errorSymbol( &misplaced_symbol, sym->name, lexstart );
      }
      sym_eval.type = sym->type;
      sym_eval.val = 0;
      nextLexeme();
      return( &sym_eval );
    }
    else if( M_MACRO( sym->type ))
    {
      if( pass == 2 )
      {
        errorSymbol( &misplaced_symbol, sym->name, lexstart );
      }
      sym_eval.type = sym->type;
      sym_eval.val = 0;
      nextLexeme();
      return( &sym_eval );
    }
    else
    {
      nextLexeme();
      return( sym );
    }
  }
  else if( isdigit( line[lexstart] ))
  {
    from = lexstart;
    val = 0;
    while( from < lexterm )
    {
      if( isdigit( line[from] ))
      {
        digit = (WORD32) line[from++] - (WORD32) '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;
      nextLexeme();
      break;

    case '(':                   /* Generate literal on current page.          */
      nextLexBlank();           /* Skip paren                                 */
      val = getExprs() & 0777777;

      if( line[lexstart] == ')' )
      {
        delimiter = line[lexterm];
        nextLexeme();           /* Skip end paren                             */
      }
      else
      {
        /* errorMessage( "parens", NULL );                                    */
      }

      loc = insertLiteral( &cp, clc, val );
      sym_eval.val = loc + ( clc & 060000 );
      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
movl $0x0, -0x24(%rbp)
movslq 0xf3da(%rip), %rcx      # 0x15170
leaq 0xf243(%rip), %rax      # 0x14fe0
movb (%rax,%rcx), %al
movb %al, 0xf3ce(%rip)       # 0x15174
callq 0x2170
movq (%rax), %rax
movslq 0xf3ab(%rip), %rdx      # 0x15160
leaq 0xf224(%rip), %rcx      # 0x14fe0
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x5f1f
callq 0x5000
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x1, %eax
je 0x5e21
cmpl $0x2, 0x733d(%rip)      # 0xd130
jne 0x5e0f
movq -0x20(%rbp), %rsi
addq $0x4, %rsi
movl 0xf35d(%rip), %edx      # 0x15160
leaq 0x5046(%rip), %rdi      # 0xae50
callq 0x4ca0
callq 0x41d0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x61e8
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x43, %eax
cmpl $0x43, %eax
jne 0x5ead
movq -0x20(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x5e45
movl $0xa, 0xf191(%rip)      # 0x14fd4
jmp 0x5e82
movq -0x20(%rbp), %rax
cmpl $0x9, 0xc(%rax)
jne 0x5e5b
movl $0x8, 0xf17b(%rip)      # 0x14fd4
jmp 0x5e80
cmpl $0x2, 0x72ce(%rip)      # 0xd130
jne 0x5e7e
movq -0x20(%rbp), %rsi
addq $0x4, %rsi
movl 0xf2ee(%rip), %edx      # 0x15160
leaq 0x4fe7(%rip), %rdi      # 0xae60
callq 0x4ca0
jmp 0x5e80
jmp 0x5e82
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, 0x50e2(%rip)      # 0xaf70
movl $0x0, 0x50e4(%rip)      # 0xaf7c
callq 0x41d0
leaq 0x50cc(%rip), %rax      # 0xaf70
movq %rax, -0x8(%rbp)
jmp 0x61e8
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x101, %eax            # imm = 0x101
cmpl $0x101, %eax            # imm = 0x101
jne 0x5f0d
cmpl $0x2, 0x726a(%rip)      # 0xd130
jne 0x5ee2
movq -0x20(%rbp), %rsi
addq $0x4, %rsi
movl 0xf28a(%rip), %edx      # 0x15160
leaq 0x4f83(%rip), %rdi      # 0xae60
callq 0x4ca0
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, 0x5082(%rip)      # 0xaf70
movl $0x0, 0x5084(%rip)      # 0xaf7c
callq 0x41d0
leaq 0x506c(%rip), %rax      # 0xaf70
movq %rax, -0x8(%rbp)
jmp 0x61e8
callq 0x41d0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x61e8
callq 0x2170
movq (%rax), %rax
movslq 0xf232(%rip), %rdx      # 0x15160
leaq 0xf0ab(%rip), %rcx      # 0x14fe0
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x603a
movl 0xf20c(%rip), %eax      # 0x15160
movl %eax, -0x10(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x10(%rbp), %eax
cmpl 0xf209(%rip), %eax      # 0x15170
jge 0x601c
callq 0x2170
movq (%rax), %rax
movslq -0x10(%rbp), %rdx
leaq 0xf060(%rip), %rcx      # 0x14fe0
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x5ff5
movl -0x10(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x10(%rbp)
movslq %eax, %rcx
leaq 0xf036(%rip), %rax      # 0x14fe0
movsbl (%rax,%rcx), %eax
subl $0x30, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl 0xf017(%rip), %eax      # 0x14fd4
jge 0x5fd1
movl -0x24(%rbp), %eax
imull 0xf00b(%rip), %eax      # 0x14fd4
addl -0xc(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x5ff3
movl -0x10(%rbp), %esi
subl $0x1, %esi
leaq 0x4e22(%rip), %rdi      # 0xae00
callq 0x4db0
movl $0x0, -0x24(%rbp)
movl 0xf180(%rip), %eax      # 0x15170
movl %eax, -0x10(%rbp)
jmp 0x6017
movl 0xf165(%rip), %esi      # 0x15160
leaq 0x4dee(%rip), %rdi      # 0xadf0
callq 0x4db0
movl $0x0, -0x24(%rbp)
movl 0xf15c(%rip), %eax      # 0x15170
movl %eax, -0x10(%rbp)
jmp 0x5f5e
callq 0x41d0
movl -0x24(%rbp), %eax
movl %eax, 0x4f52(%rip)      # 0xaf7c
leaq 0x4f3f(%rip), %rax      # 0xaf70
movq %rax, -0x8(%rbp)
jmp 0x61e8
movslq 0xf11f(%rip), %rax      # 0x15160
leaq 0xef98(%rip), %rcx      # 0x14fe0
movsbl (%rax,%rcx), %eax
movl %eax, -0x28(%rbp)
subl $0x22, %eax
je 0x6071
jmp 0x6056
movl -0x28(%rbp), %eax
subl $0x28, %eax
je 0x60fd
jmp 0x6064
movl -0x28(%rbp), %eax
subl $0x2e, %eax
je 0x60ea
jmp 0x6182
movl 0xf0f5(%rip), %eax      # 0x1516c
addl $0x2, %eax
cmpl 0xf0e4(%rip), %eax      # 0x15164
jge 0x60ce
movl 0xf0d8(%rip), %eax      # 0x15160
addl $0x1, %eax
movslq %eax, %rcx
leaq 0xef4b(%rip), %rax      # 0x14fe0
movsbl (%rax,%rcx), %eax
orl $0x80, %eax
movl %eax, -0x24(%rbp)
movl 0xf0b9(%rip), %eax      # 0x15160
addl $0x2, %eax
movslq %eax, %rcx
leaq 0xef2c(%rip), %rax      # 0x14fe0
movb (%rax,%rcx), %al
movb %al, 0xf0b7(%rip)       # 0x15174
movl 0xf09d(%rip), %eax      # 0x15160
addl $0x2, %eax
movl %eax, 0xf0a0(%rip)      # 0x1516c
jmp 0x60e0
movl 0xf08c(%rip), %esi      # 0x15160
leaq 0x4e05(%rip), %rdi      # 0xaee0
callq 0x6200
callq 0x41d0
jmp 0x61d0
movl 0x72b0(%rip), %eax      # 0xd3a0
movl %eax, -0x24(%rbp)
callq 0x41d0
jmp 0x61d0
callq 0x4e00
callq 0x4e60
andl $0x3ffff, %eax          # imm = 0x3FFFF
movl %eax, -0x24(%rbp)
movslq 0xf04a(%rip), %rcx      # 0x15160
leaq 0xeec3(%rip), %rax      # 0x14fe0
movsbl (%rax,%rcx), %eax
cmpl $0x29, %eax
jne 0x6144
movslq 0xf043(%rip), %rcx      # 0x15170
leaq 0xeeac(%rip), %rax      # 0x14fe0
movb (%rax,%rcx), %al
movb %al, 0xf037(%rip)       # 0x15174
callq 0x41d0
jmp 0x6146
jmp 0x6146
movl 0x7254(%rip), %esi      # 0xd3a0
movl -0x24(%rbp), %edx
leaq 0x7262(%rip), %rdi      # 0xd3b8
callq 0x5cf0
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl 0x7239(%rip), %ecx      # 0xd3a0
andl $0x6000, %ecx           # imm = 0x6000
addl %ecx, %eax
movl %eax, 0x4e07(%rip)      # 0xaf7c
leaq 0x4df4(%rip), %rax      # 0xaf70
movq %rax, -0x8(%rbp)
jmp 0x61e8
movslq 0xefd7(%rip), %rax      # 0x15160
leaq 0xee50(%rip), %rcx      # 0x14fe0
movb (%rax,%rcx), %al
subb $0x3d, %al
jne 0x61b2
jmp 0x6199
movl 0xefc1(%rip), %esi      # 0x15160
leaq 0x4c7a(%rip), %rdi      # 0xae20
callq 0x6200
callq 0x6290
jmp 0x61c4
movl 0xefa8(%rip), %esi      # 0x15160
leaq 0x4c01(%rip), %rdi      # 0xadc0
callq 0x6200
movl $0x0, -0x24(%rbp)
callq 0x4e00
jmp 0x61d2
jmp 0x61d4
movl -0x24(%rbp), %eax
movl %eax, 0x4d9f(%rip)      # 0xaf7c
leaq 0x4d8c(%rip), %rax      # 0xaf70
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)