// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/crossassemblers/macro7/macro7.c
// Function: pseudoOperators
BOOL pseudoOperators( PSEUDO_T val )
{
  int     count;
  int     delim;
  int     index;
  int     ix;
  WORD32  length;
  int     level;
  int     lexstartsave;
  int     pack;
  int     pos;
  int     radixprev;
  BOOL    status;
  SYM_T  *sym;
  WORD32  value;
  WORD32  word;
  int     width;
  static int mask_tab[19] = { 0000000,
          0000001, 0000003, 0000007, 0000017, 0000037, 0000077,
          0000177, 0000377, 0000777, 0001777, 0003777, 0007777,
          0017777, 0037777, 0077777, 0177777, 0377777, 0777777 };

  status = TRUE;
  switch( (PSEUDO_T) val )
  {
  case DECIMAL:
    radix = 10;
    break;

  case DEFINE:
    count = 0;
    index = 0;
    lexstartsave = lexstart;
    while(( line[lexstart] != '<' ) && ( !isdone( line[lexstart] )) &&
          ( count < MAC_MAX_ARGS ))
    {
      if ( !isalpha( line[lexstart] ) && ( index == 0 ))
      {
        index = lexstart;
      }
      lexemeToName( &mac_arg_name[count++][0], lexstart, lexterm );
      nextLexeme();
    }
    if( count == 0 )                 /* No macro name.                        */
    {
      errorMessage( &no_macro_name, lexstartsave );
      index = 1;
    }
    else if( index )                 /* Bad argument name.                    */
    {
      errorMessage( &bad_dummy_arg, index );
    }
    else if( mac_count >= MAC_TABLE_LENGTH )
    {
      errorMessage( &macro_table_full, lexstartsave );
      index = 1;
    }
    else
    {
      value = mac_count;
      mac_count++;                  /* Value is entry in mac_bodies.         */
      defineSymbol( &mac_arg_name[0][0], value, MACRO, lexstartsave );
    }
    if( isend( line[lexstart] ) || ( line[lexstart] == '/' ))
    {
      readLine();
      nextLexeme();
    }
    if( index )
    {
      conditionFalse();             /* On error skip macro body.             */
    }
    else if( line[lexstart] == '<' )
    {
      /* Invariant: line[cc] is the next unexamined character.                */
      index = lexstart + 1;
      length = 0;
      level = 1;
      while( level > 0 )
      {
        if( end_of_input )
        {
          break;
        }
        if( isend( line[cc] ) || ( line[cc] == '/' ))
        {
          length = copyMacLine( length, index, cc, count - 1 );
          readLine();
          index = 0;
        }
        else
        {
          switch( line[cc] )
          {
          case '>':
            level--;
            cc++;
            break;

          case '<':
            level++;
            cc++;
            break;

          default:
            cc++;
            break;
          } /* end switch                                                     */
        } /* end if                                                           */
      } /* end while                                                          */
      length = copyMacLine( length, index, cc - 1, count - 1 );
      if( length < 0 )
      {
        errorMessage (&macro_too_long, lexstart );
      }
      else if( length == 0 )
      {
        mac_bodies[value] = NULL;
      }
      else
      {
        mac_bodies[value] = (char *) malloc( length + 1 );
        if( mac_bodies[value] )
        {
           strncpy( mac_bodies[value], mac_buffer, length );
           *( mac_bodies[value] + length ) = 0;
        }
        else
        {
           errorMessage( &no_virtual_memory, lexstart );
        }
      }
      nextLexeme();
    }
    else
    {
      errorMessage( &lt_expected, lexstart );
    } /* end if                                                               */
    break;
      
  case EJECT:
    page_lineno = LIST_LINES_PER_PAGE;  /* This will force a page break.      */
    status = FALSE;             /* This will force reading of next line       */
    break;

  case IFDEF:
    if( isalpha( line[lexstart] ))
    {
      sym = evalSymbol();
      nextLexeme();
      if( M_DEFINED_CONDITIONALLY( sym->type ))
      {
        conditionTrue();
      }
      else
      {
        conditionFalse();
      }
    }
    else
    {
      errorLexeme( &label_syntax, lexstart );
    }
    break;

  case IFNDEF:
    if( isalpha( line[lexstart] ))
    {
      sym = evalSymbol();
      nextLexeme();
      if( M_DEFINED_CONDITIONALLY( sym->type ))
      {
        conditionFalse();
      }
      else
      {
        conditionTrue();
      }
    }
    else
    {
      errorLexeme( &label_syntax, lexstart );
    }
    break;

  case IFNZERO:
    if( (getExpr())->val == 0 )
    {
      conditionFalse();
    }
    else
    {
      conditionTrue();
    }
    break;

  case IFZERO:
    if( (getExpr())->val == 0 )
    {
      conditionTrue();
    }
    else
    {
      conditionFalse();
    }
    break;

  case LIST:
    listfile = listsave;
    break;

  case NOLIST:
    listfile = NULL;
    break;

  case OCTAL:
    radix = 8;
    break;

  case START:
    if( !isdone( line[lexstart] ))
    {
      start_addr = (getExpr())->val & 077777;
      nextLexeme();
    }
    printLine( line, 0, start_addr, LINE_VAL );
    status = FALSE;
    break;

  case TEXT:
    delim = line[lexstart];
    pack = 0;
    count = 0;
    index = lexstart + 1;
    while( line[index] != delim && !isend( line[index] ))
    {
      pack = ( pack << 6 ) | ( line[index] & 077 );
      count++;
      if( count > 2 )
      {
        punchOutObject( clc, pack );
        incrementClc();
        count = 0;
        pack = 0;
      }
      index++;
    }

    if( count == 2 )
    {
      punchOutObject( clc, pack << 6 );
    }
    else if (count == 1)
    {
      punchOutObject( clc, pack << 12 );
    }
    else
    {
      punchOutObject( clc, 0 );
    }
    incrementClc();

    if( isend( line[index] ))
    {
      cc = index;
      lexterm = cc;
      errorMessage( &text_string, cc );
    }
    else
    {
      cc = index + 1;
      lexterm = cc;
    }
    nextLexeme();
    break;

  case TITLE:
    delim = line[lexstart];
    ix = lexstart + 1;
    /* Find string delimiter.                                                 */
    do
    {
      if( list_title[ix] == delim && list_title[ix + 1] == delim )
      {
        ix++;
      }
      ix++;
    } while( line[ix] != delim && !isend(line[ix]) );

    if( !isend( line[ix] ) )
    {
      count = 0;
      ix = lexstart + 1;
      do
      {
        if( list_title[ix] == delim && list_title[ix + 1] == delim )
        {
          ix++;
        }
        list_title[count] = line[ix];
        count++;
        ix++;
      } while( line[ix] != delim && !isend(line[ix]) );

      if( strlen( list_title ) > TITLELEN )
      {
        list_title[TITLELEN] = '\0';
      }

      cc = ix + 1;
      lexterm = cc;
      page_lineno = LIST_LINES_PER_PAGE;/* Force top of page for new titles.  */
      list_title_set = TRUE;
    }
    else
    {
      cc = ix;
      lexterm = cc;
      errorMessage( &text_string, cc );
    }

    nextLexeme();
    break;

  case VFD:
    pos = 0;
    word = 0;
    radixprev = radix;
    while( !isdone (line[lexstart] ))
    {
      lexstartsave = lexstart;
      radix = 10;
  	  width = (getExpr())->val;     /* Get field width.                       */ 
      radix = radixprev;
      if( (width <= 0) || ((width + pos) > 18) || (line[lexstart] != ':') )
      {
        errorMessage( &illegal_vfd_value, lexstartsave );
      }
      nextLexBlank();               /* Skip colon.                            */
      value = (getExpr())->val;     /* Get field value.                       */
      if( line[lexterm] == ',' ) cc++;
      nextLexeme();                 /* Advance to next field.                 */
      pos = pos + width;
	  if( pos <= 18 )
	  {
        word = word | ((value & mask_tab[width]) << (18 - pos));
	  }
    }
    punchOutObject( clc, word );
    incrementClc();
    break;

  default:
    break;
  } /* end switch for pseudo-ops                                              */
  return( status );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movb $0x1, %bl
cmpl $0xd, %edi
ja 0x4829
movl %edi, %eax
leaq 0x1ef8(%rip), %rcx      # 0x6074
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xa, 0xfe05(%rip)      # 0x13f94
jmp 0x4829
movslq 0xff85(%rip), %r12      # 0x14120
leaq 0xfdfe(%rip), %r15      # 0x13fa0
movb (%r12,%r15), %bpl
movb 0x1(%r12,%r15), %cl
leaq 0x1(%r12), %r14
cmpb %bpl, %cl
jne 0x452f
addq %r14, %r15
jmp 0x45af
callq 0x2180
movq (%rax), %rax
movslq 0xff50(%rip), %r14      # 0x14120
leaq 0xfdc9(%rip), %rcx      # 0x13fa0
movsbq (%r14,%rcx), %rcx
testb $0x4, 0x1(%rax,%rcx,2)
jne 0x4608
movl 0xff43(%rip), %edx      # 0x14130
leaq 0x11(%rsp), %r15
jmp 0x42a8
movslq 0xff22(%rip), %rdx      # 0x14120
leaq 0xfd9b(%rip), %rax      # 0x13fa0
movzbl (%rdx,%rax), %ecx
leal 0x1(%rdx), %edi
leaq 0x100bd(%rip), %rdx     # 0x142d0
movl %edi, %esi
movslq %esi, %r8
cmpb %cl, (%r8,%rdx)
jne 0x422e
cmpb %cl, 0x1(%r8,%rdx)
leaq 0x1(%r8), %rsi
cmovel %esi, %r8d
movl %r8d, %esi
movslq %esi, %rsi
movzbl 0x1(%rsi,%rax), %r8d
incq %rsi
cmpb %cl, %r8b
je 0x467b
testl %r8d, %r8d
je 0x4688
cmpl $0xa, %r8d
jne 0x4215
jmp 0x4688
movl $0x8, 0xfd33(%rip)      # 0x13f94
jmp 0x4829
movl $0x3c, 0xfd20(%rip)     # 0x13f90
xorl %ebx, %ebx
jmp 0x4829
callq 0x2180
movq (%rax), %rax
movslq 0xfe9a(%rip), %r14      # 0x14120
leaq 0xfd13(%rip), %rcx      # 0x13fa0
movsbq (%r14,%rcx), %rcx
testb $0x4, 0x1(%rax,%rcx,2)
jne 0x4634
movl 0xfe8d(%rip), %edx      # 0x14130
leaq 0xa(%rsp), %r15
movq %r15, %rdi
movl %r14d, %esi
callq 0x3de8
leaq 0x5b36(%rip), %rdi      # 0x9df0
movq %r15, %rsi
movl %r14d, %edx
callq 0x3e58
jmp 0x4829
movq 0x7f67(%rip), %rax      # 0xc238
movq %rax, 0x7f58(%rip)      # 0xc230
jmp 0x4829
xorl %r14d, %r14d
leaq 0x102a9(%rip), %r12     # 0x14590
movl 0xfe32(%rip), %r13d     # 0x14120
movabsq $0x1000800000000401, %rbp # imm = 0x1000800000000401
movl %r13d, 0x4(%rsp)
xorl %r15d, %r15d
movslq %r13d, %rax
leaq 0xfc96(%rip), %rcx      # 0x13fa0
movzbl (%rax,%rcx), %ebx
cmpq $0x3c, %rbx
ja 0x431a
btq %rbx, %rbp
jb 0x436e
cmpb $0x9, %bl
je 0x436e
cmpq $0x13, %r14
ja 0x436e
callq 0x2180
movl %r13d, %ecx
testl %r15d, %r15d
je 0x4335
movl %r15d, %ecx
movsbq %bl, %rdx
movq (%rax), %rax
movzwl (%rax,%rdx,2), %eax
btl $0xa, %eax
cmovael %ecx, %r15d
incq %r14
movl 0xfddf(%rip), %edx      # 0x14130
movq %r12, %rdi
movl %r13d, %esi
callq 0x3de8
callq 0x3816
movl 0xfdb8(%rip), %r13d     # 0x14120
addq $0x7, %r12
jmp 0x4300
testq %r14, %r14
je 0x4672
testl %r15d, %r15d
je 0x46be
leaq 0x5bb9(%rip), %rdi      # 0x9f40
movl %r15d, %esi
jmp 0x46dd
callq 0x3963
cmpl $0x0, 0x5c09(%rip)      # 0x9fa4
jne 0x465e
jmp 0x4668
xorl %r12d, %r12d
movl 0xfbe4(%rip), %r13d     # 0x13f94
leaq 0xfbe9(%rip), %rbp      # 0x13fa0
leaq 0x5b22(%rip), %r14      # 0x9ee0
movl $0x0, 0x4(%rsp)
movslq 0xfd53(%rip), %r15      # 0x14120
movzbl (%r15,%rbp), %eax
cmpq $0x2f, %rax
ja 0x43ec
movabsq $0x800000000601, %rcx   # imm = 0x800000000601
btq %rax, %rcx
jb 0x4486
movl $0xa, 0xfb9e(%rip)      # 0x13f94
callq 0x3963
movl 0x5ba3(%rip), %ebx      # 0x9fa4
movl %r13d, 0xfb8c(%rip)     # 0x13f94
testl %ebx, %ebx
setle %al
addl %ebx, %r12d
cmpl $0x13, %r12d
setge %cl
orb %al, %cl
jne 0x4428
movslq 0xfcfe(%rip), %rax      # 0x14120
cmpb $0x3a, (%rax,%rbp)
je 0x4433
movq %r14, %rdi
movl %r15d, %esi
callq 0x4d39
callq 0x3f6c
callq 0x3963
movl 0x5b60(%rip), %r15d     # 0x9fa4
movslq 0xfce5(%rip), %rax      # 0x14130
cmpb $0x2c, (%rax,%rbp)
jne 0x4457
incl 0xfcd5(%rip)            # 0x1412c
callq 0x3816
cmpl $0x12, %r12d
jg 0x43c6
movslq %ebx, %rax
leaq 0x1c40(%rip), %rcx      # 0x60b0
andl (%rcx,%rax,4), %r15d
movb $0x12, %cl
subb %r12b, %cl
shll %cl, %r15d
orl %r15d, 0x4(%rsp)
jmp 0x43c6
movl 0x7ed4(%rip), %edi      # 0xc360
movl 0x4(%rsp), %esi
callq 0x4962
movl 0x7ec5(%rip), %edi      # 0xc360
callq 0x4df7
movl 0x7eba(%rip), %eax      # 0xc360
incl %eax
andl $0x1fff, %eax           # imm = 0x1FFF
movl %eax, 0x7ead(%rip)      # 0xc360
jmp 0x4827
callq 0x3963
cmpl $0x0, 0x5ae0(%rip)      # 0x9fa4
jne 0x4668
jmp 0x465e
movslq 0xfc4a(%rip), %rax      # 0x14120
leaq 0xfac3(%rip), %rcx      # 0x13fa0
movzbl (%rax,%rcx), %eax
cmpq $0x2f, %rax
ja 0x4848
movabsq $0x800000000601, %rcx   # imm = 0x800000000601
btq %rax, %rcx
jae 0x4848
movl 0x7e5f(%rip), %edx      # 0xc364
leaq 0xfa94(%rip), %rdi      # 0x13fa0
xorl %ebx, %ebx
xorl %esi, %esi
movl $0x1, %ecx
callq 0x3b9d
jmp 0x4829
movq $0x0, 0x7d06(%rip) # 0xc230
jmp 0x4829
xorl %eax, %eax
xorl %esi, %esi
testb %cl, %cl
je 0x458f
movzbl %cl, %edx
cmpl $0xa, %edx
je 0x458f
movl %esi, %edx
shll $0x6, %edx
andb $0x3f, %cl
movzbl %cl, %esi
orl %edx, %esi
cmpl $0x2, %eax
jge 0x4555
incl %eax
jmp 0x4582
movl 0x7e05(%rip), %edi      # 0xc360
callq 0x4962
movl 0x7dfa(%rip), %edi      # 0xc360
callq 0x4df7
movl 0x7def(%rip), %eax      # 0xc360
incl %eax
andl $0x1fff, %eax           # imm = 0x1FFF
movl %eax, 0x7de2(%rip)      # 0xc360
xorl %esi, %esi
xorl %eax, %eax
movb 0x1(%r14,%r15), %cl
incq %r14
cmpb %bpl, %cl
jne 0x4533
leal -0x1(%r14), %r12d
addq %r14, %r15
cmpl $0x1, %eax
je 0x4868
cmpl $0x2, %eax
jne 0x45af
movl 0x7db6(%rip), %edi      # 0xc360
shll $0x6, %esi
jmp 0x45b7
movl 0x7dab(%rip), %edi      # 0xc360
xorl %esi, %esi
callq 0x4962
movl 0x7d9e(%rip), %edi      # 0xc360
callq 0x4df7
movl 0x7d93(%rip), %eax      # 0xc360
incl %eax
andl $0x1fff, %eax           # imm = 0x1FFF
movl %eax, 0x7d86(%rip)      # 0xc360
movzbl (%r15), %eax
cmpl $0xa, %eax
je 0x45eb
testl %eax, %eax
jne 0x46aa
movl %r14d, 0xfb3a(%rip)     # 0x1412c
movl %r14d, 0xfb37(%rip)     # 0x14130
leaq 0x5900(%rip), %rdi      # 0x9f00
movl %r14d, %esi
jmp 0x469b
callq 0x40fb
movq %rax, %r14
callq 0x3816
movl (%r14), %eax
movl 0x7ad2(%rip), %ecx      # 0xc0f0
cmpl $0x1, %ecx
sete %dl
testb %dl, %al
jne 0x4668
andl $0x1, %eax
xorl $0x2, %ecx
orl %eax, %ecx
jne 0x465e
jmp 0x4668
callq 0x40fb
movq %rax, %r14
callq 0x3816
movl (%r14), %eax
movl 0x7aa6(%rip), %ecx      # 0xc0f0
cmpl $0x1, %ecx
sete %dl
testb %dl, %al
jne 0x465e
andl $0x1, %eax
xorl $0x2, %ecx
orl %eax, %ecx
jne 0x4668
callq 0x5631
jmp 0x4829
callq 0x5594
jmp 0x4829
leaq 0x58b7(%rip), %rdi      # 0x9f30
jmp 0x46d9
testl %ecx, %ecx
je 0x4688
cmpl $0xa, %ecx
jne 0x489f
movl %esi, 0xfa9e(%rip)      # 0x1412c
movl %esi, 0xfa9c(%rip)      # 0x14130
leaq 0x5865(%rip), %rdi      # 0x9f00
callq 0x4d39
callq 0x3816
jmp 0x4829
addl $0x2, %r12d
movl %r12d, 0xfa77(%rip)     # 0x1412c
movl %r12d, 0xfa74(%rip)     # 0x14130
jmp 0x46a0
movslq 0x7ca7(%rip), %r15      # 0xc36c
cmpq $0x400, %r15            # imm = 0x400
jl 0x4876
leaq 0x5897(%rip), %rdi      # 0x9f70
movl 0x4(%rsp), %esi
callq 0x4d39
xorl %ebx, %ebx
xorl %r15d, %r15d
movslq 0xfa32(%rip), %rax      # 0x14120
leaq 0xf8ab(%rip), %rcx      # 0x13fa0
movzbl (%rax,%rcx), %eax
cmpq $0x2f, %rax
ja 0x4719
movabsq $0x800000000401, %rcx   # imm = 0x800000000401
btq %rax, %rcx
jae 0x4719
callq 0x3582
callq 0x3816
testb %bl, %bl
je 0x4822
movslq 0xf9f8(%rip), %rsi      # 0x14120
leaq 0xf871(%rip), %rax      # 0x13fa0
cmpb $0x3c, (%rsi,%rax)
movb $0x1, %bl
jne 0x483a
incl %esi
decq %r14
xorl %ebp, %ebp
cmpb $0x0, 0xf84f(%rip)      # 0x13f98
movl 0xf9dd(%rip), %edx      # 0x1412c
jne 0x47c6
xorl %ebp, %ebp
movl $0x1, %r12d
movslq %edx, %rax
leaq 0xf83d(%rip), %rcx      # 0x13fa0
movzbl (%rax,%rcx), %eax
cmpl $0x2e, %eax
jle 0x477d
cmpl $0x3e, %eax
je 0x47ab
cmpl $0x3c, %eax
je 0x47b0
cmpl $0x2f, %eax
je 0x4786
jmp 0x47b3
testl %eax, %eax
je 0x4786
cmpl $0xa, %eax
jne 0x47b3
movl %ebp, %edi
movl %r14d, %ecx
callq 0x52ac
movl %eax, %ebp
callq 0x3582
movl 0xf98f(%rip), %edx      # 0x1412c
cmpb $0x0, 0xf7f4(%rip)      # 0x13f98
setne %al
xorl %esi, %esi
jmp 0x47bd
decl %r12d
jmp 0x47b3
incl %r12d
incl %edx
movl %edx, 0xf971(%rip)      # 0x1412c
xorl %eax, %eax
testl %r12d, %r12d
jle 0x47c6
testb %al, %al
je 0x4759
decl %edx
movl %ebp, %edi
movl %r14d, %ecx
callq 0x52ac
testl %eax, %eax
js 0x492a
je 0x493c
movl %eax, %r14d
leal 0x1(%r14), %edi
callq 0x2120
movq %rax, %r12
leaq 0x586a(%rip), %rax      # 0xa060
movq %r12, (%rax,%r15,8)
testq %r12, %r12
je 0x4950
movl %r14d, %r14d
leaq 0xfe13(%rip), %rsi      # 0x14620
movq %r12, %rdi
movq %r14, %rdx
callq 0x2050
movb $0x0, (%r12,%r14)
jmp 0x46a0
callq 0x5594
movb $0x1, %bl
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x56cf(%rip), %rdi      # 0x9f10
callq 0x4d39
jmp 0x4829
callq 0x3963
movl $0x7fff, %eax           # imm = 0x7FFF
andl 0x574c(%rip), %eax      # 0x9fa4
movl %eax, 0x7b06(%rip)      # 0xc364
callq 0x3816
jmp 0x44ff
movl 0x7af2(%rip), %edi      # 0xc360
shll $0xc, %esi
jmp 0x45b7
leal 0x1(%r15), %eax
movl %eax, 0x7aec(%rip)      # 0xc36c
leaq 0xfd09(%rip), %rdi      # 0x14590
movl %r15d, %esi
movl $0x101, %edx            # imm = 0x101
movl 0x4(%rsp), %ecx
callq 0x2a90
movb $0x1, %bl
jmp 0x46e7
movq %rdx, %rsi
movslq %edi, %r8
cmpb %cl, (%r8,%rdx)
jne 0x48c0
movslq %edi, %r8
cmpb %cl, 0x1(%r8,%rdx)
leaq 0x1(%r8), %r14
cmovnel %edi, %r14d
movslq %r14d, %r8
jmp 0x48c3
movl %edi, %r14d
movb (%r8,%rax), %dil
movb %dil, (%rsi)
movslq %r14d, %rdi
movzbl 0x1(%rdi,%rax), %r8d
cmpb %cl, %r8b
je 0x48e9
cmpl $0xa, %r8d
je 0x48e9
incq %rdi
incq %rsi
testl %r8d, %r8d
jne 0x48a2
leaq 0xf9e0(%rip), %rdi      # 0x142d0
callq 0x20a0
cmpq $0x40, %rax
jb 0x4902
movb $0x0, 0xfa0d(%rip)      # 0x1430f
addl $0x2, %r14d
movl %r14d, 0xf81f(%rip)     # 0x1412c
movl %r14d, 0xf81c(%rip)     # 0x14130
movl $0x3c, 0xf672(%rip)     # 0x13f90
movb $0x1, 0xf667(%rip)      # 0x13f8c
jmp 0x46a0
movl 0xf7f0(%rip), %esi      # 0x14120
leaq 0x5619(%rip), %rdi      # 0x9f50
jmp 0x469b
leaq 0x571d(%rip), %rax      # 0xa060
movq $0x0, (%rax,%r15,8)
jmp 0x46a0
movl 0xf7ca(%rip), %esi      # 0x14120
leaq 0x5603(%rip), %rdi      # 0x9f60
jmp 0x469b