// File: /workspace/github_c_makefile_star2_O0/AK6DN[P]dec-utilities-for-pdp/macro8x/macro8x.c
// Function: eval
SYM_T *eval()
{
  WORD32  digit;
  WORD32  from;
  WORD32  loc;
  SYM_T  *sym;
  WORD32  val;

  val = 0;

  delimiter = line[lexterm];
  if( is_alpha( 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( is_digit( line[lexstart] ))
  {
    from = lexstart;
    val = 0;
    while( from < lexterm )
    {
      if( is_digit( 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( lexstart + 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.             */
      nextLexBlank();           /* Skip bracket                               */
      val = getExprs() & 07777;
      if( line[lexstart] == ']' )
      {
        delimiter = line[lexterm];
        nextLexeme();           /* Skip end bracket                           */
      }
      else
      {
        /* errorMessage( "parens", lexstart );                                */
      }
      sym_eval.val = insertLiteral( &pz, field, val );
      return( &sym_eval );

    case '(':                   /* Generate literal on current page.          */
      nextLexBlank();           /* Skip paren                                 */
      val = getExprs() & 07777;

      if( line[lexstart] == ')' )
      {
        delimiter = line[lexterm];
        nextLexeme();           /* Skip end paren                             */
      }
      else
      {
        /* errorMessage( "parens", NULL );                                    */
      }
      if( testZeroPool( val ))
      {
        sym_eval.val = insertLiteral( &pz, field, val );
      }
      else
      {
        loc = insertLiteral( &cp, clc, val );
        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 $0x40, %rsp
movq $0x0, -0x30(%rbp)
movq 0x13bd1(%rip), %rcx     # 0x1acb8
leaq 0x137d2(%rip), %rax     # 0x1a8c0
movb (%rax,%rcx), %al
movb %al, 0x13bc9(%rip)      # 0x1acc0
callq 0x2190
movq (%rax), %rax
movq 0x13ba2(%rip), %rdx     # 0x1aca8
leaq 0x137b3(%rip), %rcx     # 0x1a8c0
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x7280
callq 0x5560
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x1, %eax
je 0x7174
cmpq $0x2, 0x9c8b(%rip)      # 0x10dd0
jne 0x7162
movq -0x28(%rbp), %rsi
addq $0x4, %rsi
movq 0x13b52(%rip), %rdx     # 0x1aca8
leaq 0x78c3(%rip), %rdi      # 0xea20
callq 0x5140
callq 0x4550
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x763c
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl $0x43, %eax
cmpl $0x43, %eax
jne 0x720b
movq -0x28(%rbp), %rax
cmpq $0x4, 0x10(%rax)
jne 0x719e
movq $0xa, 0x13714(%rip) # 0x1a8b0
jmp 0x71df
movq -0x28(%rbp), %rax
cmpq $0x19, 0x10(%rax)
jne 0x71b6
movq $0x8, 0x136fc(%rip) # 0x1a8b0
jmp 0x71dd
cmpq $0x2, 0x9c12(%rip)      # 0x10dd0
jne 0x71db
movq -0x28(%rbp), %rsi
addq $0x4, %rsi
movq 0x13ad9(%rip), %rdx     # 0x1aca8
leaq 0x785a(%rip), %rdi      # 0xea30
callq 0x5140
jmp 0x71dd
jmp 0x71df
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, 0x7995(%rip)      # 0xeb80
movq $0x0, 0x799a(%rip) # 0xeb90
callq 0x4550
leaq 0x797e(%rip), %rax      # 0xeb80
movq %rax, -0x8(%rbp)
jmp 0x763c
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl $0x101, %eax            # imm = 0x101
cmpl $0x101, %eax            # imm = 0x101
jne 0x726e
cmpq $0x2, 0x9bab(%rip)      # 0x10dd0
jne 0x7242
movq -0x28(%rbp), %rsi
addq $0x4, %rsi
movq 0x13a72(%rip), %rdx     # 0x1aca8
leaq 0x77f3(%rip), %rdi      # 0xea30
callq 0x5140
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, 0x7932(%rip)      # 0xeb80
movq $0x0, 0x7937(%rip) # 0xeb90
callq 0x4550
leaq 0x791b(%rip), %rax      # 0xeb80
movq %rax, -0x8(%rbp)
jmp 0x763c
callq 0x4550
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x763c
callq 0x2190
movq (%rax), %rax
movq 0x13a19(%rip), %rdx     # 0x1aca8
leaq 0x1362a(%rip), %rcx     # 0x1a8c0
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x73b5
movq 0x139f2(%rip), %rax     # 0x1aca8
movq %rax, -0x18(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpq 0x139eb(%rip), %rax     # 0x1acb8
jge 0x7395
callq 0x2190
movq (%rax), %rax
movq -0x18(%rbp), %rdx
leaq 0x135da(%rip), %rcx     # 0x1a8c0
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x736a
movq -0x18(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
leaq 0x135af(%rip), %rax     # 0x1a8c0
movsbq (%rax,%rcx), %rax
subq $0x30, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq 0x13587(%rip), %rax     # 0x1a8b0
jge 0x7341
movq -0x30(%rbp), %rax
imulq 0x13579(%rip), %rax     # 0x1a8b0
addq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x7368
movq -0x18(%rbp), %rsi
subq $0x1, %rsi
leaq 0x7680(%rip), %rdi      # 0xe9d0
callq 0x5260
movq $0x0, -0x30(%rbp)
movq 0x13954(%rip), %rax     # 0x1acb8
movq %rax, -0x18(%rbp)
jmp 0x7390
movq 0x13937(%rip), %rsi     # 0x1aca8
leaq 0x7648(%rip), %rdi      # 0xe9c0
callq 0x5260
movq $0x0, -0x30(%rbp)
movq 0x1392c(%rip), %rax     # 0x1acb8
movq %rax, -0x18(%rbp)
jmp 0x72c2
callq 0x4550
movq -0x30(%rbp), %rax
movq %rax, 0x77eb(%rip)      # 0xeb90
leaq 0x77d4(%rip), %rax      # 0xeb80
movq %rax, -0x8(%rbp)
jmp 0x763c
movq 0x138ec(%rip), %rax     # 0x1aca8
leaq 0x134fd(%rip), %rcx     # 0x1a8c0
movsbl (%rax,%rcx), %eax
movl %eax, -0x34(%rbp)
subl $0x22, %eax
je 0x73fe
jmp 0x73d1
movl -0x34(%rbp), %eax
subl $0x28, %eax
je 0x750e
jmp 0x73df
movl -0x34(%rbp), %eax
subl $0x2e, %eax
je 0x7479
jmp 0x73ed
movl -0x34(%rbp), %eax
subl $0x5b, %eax
je 0x7495
jmp 0x75d1
movq 0x138a3(%rip), %rax     # 0x1aca8
addq $0x2, %rax
cmpq 0x13cc8(%rip), %rax     # 0x1b0d8
jge 0x745c
movq 0x1388f(%rip), %rcx     # 0x1aca8
leaq 0x134a0(%rip), %rax     # 0x1a8c0
movsbl 0x1(%rax,%rcx), %eax
orl $0x80, %eax
cltq
movq %rax, -0x30(%rbp)
movq 0x13871(%rip), %rcx     # 0x1aca8
leaq 0x13482(%rip), %rax     # 0x1a8c0
movb 0x2(%rax,%rcx), %al
movb %al, 0x13878(%rip)      # 0x1acc0
movq 0x13859(%rip), %rax     # 0x1aca8
addq $0x2, %rax
movq %rax, 0x13876(%rip)     # 0x1acd0
jmp 0x746f
movq 0x13845(%rip), %rsi     # 0x1aca8
leaq 0x7676(%rip), %rdi      # 0xeae0
callq 0x7650
callq 0x4550
jmp 0x7622
movq 0x11bd0(%rip), %rax     # 0x19050
addq 0x11be1(%rip), %rax     # 0x19068
movq %rax, -0x30(%rbp)
callq 0x4550
jmp 0x7622
callq 0x52b0
callq 0x5320
andq $0xfff, %rax            # imm = 0xFFF
movq %rax, -0x30(%rbp)
movq 0x137f8(%rip), %rcx     # 0x1aca8
leaq 0x13409(%rip), %rax     # 0x1a8c0
movsbl (%rax,%rcx), %eax
cmpl $0x5d, %eax
jne 0x74de
movq 0x137f1(%rip), %rcx     # 0x1acb8
leaq 0x133f2(%rip), %rax     # 0x1a8c0
movb (%rax,%rcx), %al
movb %al, 0x137e9(%rip)      # 0x1acc0
callq 0x4550
jmp 0x74e0
jmp 0x74e0
movq 0x11b71(%rip), %rsi     # 0x19058
movq -0x30(%rbp), %rdx
leaq 0x12f96(%rip), %rdi     # 0x1a488
callq 0x6fc0
movq %rax, 0x7692(%rip)      # 0xeb90
leaq 0x767b(%rip), %rax      # 0xeb80
movq %rax, -0x8(%rbp)
jmp 0x763c
callq 0x52b0
callq 0x5320
andq $0xfff, %rax            # imm = 0xFFF
movq %rax, -0x30(%rbp)
movq 0x1377f(%rip), %rcx     # 0x1aca8
leaq 0x13390(%rip), %rax     # 0x1a8c0
movsbl (%rax,%rcx), %eax
cmpl $0x29, %eax
jne 0x7557
movq 0x13778(%rip), %rcx     # 0x1acb8
leaq 0x13379(%rip), %rax     # 0x1a8c0
movb (%rax,%rcx), %al
movb %al, 0x13770(%rip)      # 0x1acc0
callq 0x4550
jmp 0x7559
jmp 0x7559
movq -0x30(%rbp), %rdi
callq 0x6f40
cmpb $0x0, %al
je 0x7586
movq 0x11aeb(%rip), %rsi     # 0x19058
movq -0x30(%rbp), %rdx
leaq 0x12f10(%rip), %rdi     # 0x1a488
callq 0x6fc0
movq %rax, 0x760c(%rip)      # 0xeb90
jmp 0x75c4
movq 0x11ac3(%rip), %rsi     # 0x19050
movq -0x30(%rbp), %rdx
leaq 0x12ae8(%rip), %rdi     # 0x1a080
callq 0x6fc0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x11aa4(%rip), %rcx     # 0x19050
addq 0x11ab5(%rip), %rcx     # 0x19068
andq $0x7f80, %rcx           # imm = 0x7F80
addq %rcx, %rax
movq %rax, 0x75cc(%rip)      # 0xeb90
leaq 0x75b5(%rip), %rax      # 0xeb80
movq %rax, -0x8(%rbp)
jmp 0x763c
movq 0x136d0(%rip), %rax     # 0x1aca8
leaq 0x132e1(%rip), %rcx     # 0x1a8c0
movb (%rax,%rcx), %al
subb $0x3d, %al
jne 0x7602
jmp 0x75e8
movq 0x136b9(%rip), %rsi     # 0x1aca8
leaq 0x73fa(%rip), %rdi      # 0xe9f0
callq 0x7650
callq 0x76f0
jmp 0x7615
movq 0x1369f(%rip), %rsi     # 0x1aca8
leaq 0x7380(%rip), %rdi      # 0xe990
callq 0x7650
movq $0x0, -0x30(%rbp)
callq 0x52b0
jmp 0x7624
jmp 0x7626
movq -0x30(%rbp), %rax
movq %rax, 0x755f(%rip)      # 0xeb90
leaq 0x7548(%rip), %rax      # 0xeb80
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)