// File: /workspace/github_c_makefile_star2_O1/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 0x4857
movl %edi, %eax
leaq 0x1ec6(%rip), %rcx      # 0x6074
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xa, 0xfdd3(%rip)      # 0x13f94
jmp 0x4857
movslq 0xff53(%rip), %r12      # 0x14120
leaq 0xfdcc(%rip), %r15      # 0x13fa0
movb (%r12,%r15), %r13b
movb 0x1(%r12,%r15), %cl
leaq 0x1(%r12), %r14
xorl %ebp, %ebp
cmpb %r13b, %cl
jne 0x4560
xorl %esi, %esi
xorl %eax, %eax
jmp 0x45c4
callq 0x2180
movq (%rax), %rax
movslq 0xff1b(%rip), %r14      # 0x14120
leaq 0xfd94(%rip), %rcx      # 0x13fa0
movsbq (%r14,%rcx), %rcx
testb $0x4, 0x1(%rax,%rcx,2)
jne 0x45e4
movl 0xff0e(%rip), %edx      # 0x14130
leaq 0x11(%rsp), %r15
jmp 0x42dc
movslq 0xfeed(%rip), %rdx      # 0x14120
leaq 0xfd66(%rip), %rax      # 0x13fa0
movb (%rdx,%rax), %cl
leal 0x1(%rdx), %edi
leaq 0x10089(%rip), %rdx     # 0x142d0
movl %edi, %esi
movslq %esi, %r8
cmpb %cl, (%r8,%rdx)
jne 0x4262
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 0x465b
testl %r8d, %r8d
je 0x466a
cmpl $0xa, %r8d
jne 0x4249
jmp 0x466a
movl $0x8, 0xfcff(%rip)      # 0x13f94
jmp 0x4857
movl $0x3c, 0xfcec(%rip)     # 0x13f90
xorl %ebx, %ebx
jmp 0x4857
callq 0x2180
movq (%rax), %rax
movslq 0xfe66(%rip), %r14      # 0x14120
leaq 0xfcdf(%rip), %rcx      # 0x13fa0
movsbq (%r14,%rcx), %rcx
testb $0x4, 0x1(%rax,%rcx,2)
jne 0x4617
movl 0xfe59(%rip), %edx      # 0x14130
leaq 0xa(%rsp), %r15
movq %r15, %rdi
movl %r14d, %esi
callq 0x3dfe
leaq 0x5b02(%rip), %rdi      # 0x9df0
movq %r15, %rsi
movl %r14d, %edx
callq 0x3e73
jmp 0x4857
movq 0x7f33(%rip), %rax      # 0xc238
movq %rax, 0x7f24(%rip)      # 0xc230
jmp 0x4857
xorl %r14d, %r14d
leaq 0x10275(%rip), %r12     # 0x14590
movl 0xfdff(%rip), %eax      # 0x14120
movl %eax, 0x4(%rsp)
xorl %r15d, %r15d
movslq 0xfdf1(%rip), %r13      # 0x14120
leaq 0xfc6a(%rip), %rax      # 0x13fa0
movzbl (%r13,%rax), %ebp
cmpq $0x3c, %rbp
ja 0x4352
movabsq $0x1000800000000401, %rax # imm = 0x1000800000000401
btq %rbp, %rax
jb 0x43a0
cmpb $0x9, %bpl
je 0x43a0
cmpq $0x13, %r14
ja 0x43a0
callq 0x2180
movl %r13d, %ecx
testl %r15d, %r15d
je 0x436e
movl %r15d, %ecx
movsbq %bpl, %rdx
movq (%rax), %rax
movzwl (%rax,%rdx,2), %eax
btl $0xa, %eax
cmovael %ecx, %r15d
incq %r14
movl 0xfda6(%rip), %edx      # 0x14130
movq %r12, %rdi
movl %r13d, %esi
callq 0x3dfe
callq 0x380e
addq $0x7, %r12
jmp 0x4328
testq %r14, %r14
je 0x464f
testl %r15d, %r15d
je 0x46f2
leaq 0x5b87(%rip), %rdi      # 0x9f40
movl %r15d, %esi
jmp 0x4711
callq 0x396c
cmpl $0x0, 0x5bd7(%rip)      # 0x9fa4
jne 0x4645
jmp 0x4852
xorl %r12d, %r12d
movl 0xfbb2(%rip), %r13d     # 0x13f94
leaq 0xfbb7(%rip), %rbp      # 0x13fa0
movl $0x0, 0x4(%rsp)
movslq 0xfd28(%rip), %r15      # 0x14120
movzbl (%r15,%rbp), %eax
cmpq $0x2f, %rax
ja 0x4417
movabsq $0x800000000601, %rcx   # imm = 0x800000000601
btq %rax, %rcx
jb 0x44b7
movl $0xa, 0xfb73(%rip)      # 0x13f94
callq 0x396c
movl 0x5b77(%rip), %r14d     # 0x9fa4
movl %r13d, 0xfb60(%rip)     # 0x13f94
testl %r14d, %r14d
setle %al
addl %r14d, %r12d
cmpl $0x13, %r12d
setge %cl
orb %al, %cl
jne 0x4455
movslq 0xfcd1(%rip), %rax      # 0x14120
cmpb $0x3a, (%rax,%rbp)
je 0x4464
leaq 0x5a84(%rip), %rdi      # 0x9ee0
movl %r15d, %esi
callq 0x4d89
callq 0x3f87
callq 0x396c
movl 0x5b2f(%rip), %r15d     # 0x9fa4
movslq 0xfcb4(%rip), %rax      # 0x14130
cmpb $0x2c, (%rax,%rbp)
jne 0x4488
incl 0xfca4(%rip)            # 0x1412c
callq 0x380e
cmpl $0x12, %r12d
jg 0x43f1
movslq %r14d, %rax
leaq 0x1c0f(%rip), %rcx      # 0x60b0
andl (%rcx,%rax,4), %r15d
movb $0x12, %cl
subb %r12b, %cl
shll %cl, %r15d
orl %r15d, 0x4(%rsp)
jmp 0x43f1
movl 0x7ea3(%rip), %edi      # 0xc360
movl 0x4(%rsp), %esi
callq 0x497a
movl 0x7e94(%rip), %edi      # 0xc360
callq 0x4e47
movl 0x7e89(%rip), %eax      # 0xc360
incl %eax
andl $0x1fff, %eax           # imm = 0x1FFF
movl %eax, 0x7e7c(%rip)      # 0xc360
jmp 0x4857
callq 0x396c
cmpl $0x0, 0x5aaf(%rip)      # 0x9fa4
jne 0x4852
jmp 0x4645
movslq 0xfc19(%rip), %rax      # 0x14120
leaq 0xfa92(%rip), %rcx      # 0x13fa0
movzbl (%rax,%rcx), %eax
cmpq $0x2f, %rax
ja 0x4876
movabsq $0x800000000601, %rcx   # imm = 0x800000000601
btq %rax, %rcx
jae 0x4876
movl 0x7e2e(%rip), %edx      # 0xc364
leaq 0xfa63(%rip), %rdi      # 0x13fa0
xorl %ebx, %ebx
xorl %esi, %esi
movl $0x1, %ecx
callq 0x3bad
jmp 0x4857
movq $0x0, 0x7cd5(%rip) # 0xc230
jmp 0x4857
xorl %eax, %eax
xorl %esi, %esi
testb %cl, %cl
je 0x45c0
movzbl %cl, %edx
cmpl $0xa, %edx
je 0x45c0
movl %esi, %edx
shll $0x6, %edx
andb $0x3f, %cl
movzbl %cl, %esi
orl %edx, %esi
cmpl $0x2, %eax
jge 0x4586
incl %eax
jmp 0x45b3
movl 0x7dd4(%rip), %edi      # 0xc360
callq 0x497a
movl 0x7dc9(%rip), %edi      # 0xc360
callq 0x4e47
movl 0x7dbe(%rip), %eax      # 0xc360
incl %eax
andl $0x1fff, %eax           # imm = 0x1FFF
movl %eax, 0x7db1(%rip)      # 0xc360
xorl %esi, %esi
xorl %eax, %eax
movb 0x1(%r14,%r15), %cl
incq %r14
cmpb %r13b, %cl
jne 0x4564
leal -0x1(%r14), %r12d
movl 0x7d96(%rip), %edi      # 0xc360
cmpl $0x1, %eax
je 0x467f
cmpl $0x2, %eax
jne 0x4684
shll $0x6, %esi
jmp 0x4682
callq 0x412d
movq %rax, %r14
callq 0x380e
movl (%r14), %eax
movl 0x7af6(%rip), %ecx      # 0xc0f0
cmpl $0x1, %ecx
sete %dl
testb %dl, %al
jne 0x4852
andl $0x1, %eax
xorl $0x2, %ecx
orl %eax, %ecx
jne 0x4645
jmp 0x4852
callq 0x412d
movq %rax, %r14
callq 0x380e
movl (%r14), %eax
movl 0x7ac3(%rip), %ecx      # 0xc0f0
cmpl $0x1, %ecx
sete %dl
testb %dl, %al
jne 0x4645
andl $0x1, %eax
xorl $0x2, %ecx
orl %eax, %ecx
jne 0x4852
callq 0x55d1
jmp 0x4857
leaq 0x58da(%rip), %rdi      # 0x9f30
jmp 0x470d
testl %r8d, %r8d
je 0x466a
cmpl $0xa, %r8d
jne 0x48c0
movl %esi, 0xfabc(%rip)      # 0x1412c
movl %esi, 0xfaba(%rip)      # 0x14130
leaq 0x5883(%rip), %rdi      # 0x9f00
jmp 0x46cf
shll $0xc, %esi
movl %esi, %ebp
movl %ebp, %esi
callq 0x497a
movl 0x7ccf(%rip), %edi      # 0xc360
callq 0x4e47
movl 0x7cc4(%rip), %eax      # 0xc360
incl %eax
andl $0x1fff, %eax           # imm = 0x1FFF
movl %eax, 0x7cb7(%rip)      # 0xc360
movzbl (%r14,%r15), %eax
cmpl $0xa, %eax
je 0x46b7
testl %eax, %eax
jne 0x46de
movl %r14d, 0xfa6e(%rip)     # 0x1412c
movl %r14d, 0xfa6b(%rip)     # 0x14130
leaq 0x5834(%rip), %rdi      # 0x9f00
movl %r14d, %esi
callq 0x4d89
callq 0x380e
jmp 0x4857
addl $0x2, %r12d
movl %r12d, 0xfa43(%rip)     # 0x1412c
movl %r12d, 0xfa40(%rip)     # 0x14130
jmp 0x46d4
movslq 0x7c73(%rip), %r15      # 0xc36c
cmpq $0x400, %r15            # imm = 0x400
jl 0x4896
leaq 0x5863(%rip), %rdi      # 0x9f70
movl 0x4(%rsp), %esi
callq 0x4d89
xorl %r12d, %r12d
xorl %r15d, %r15d
movslq 0xf9fd(%rip), %rax      # 0x14120
leaq 0xf876(%rip), %rcx      # 0x13fa0
movzbl (%rax,%rcx), %eax
cmpq $0x2f, %rax
ja 0x474e
movabsq $0x800000000401, %rcx   # imm = 0x800000000401
btq %rax, %rcx
jae 0x474e
callq 0x356d
callq 0x380e
testb %r12b, %r12b
je 0x4852
movslq 0xf9c2(%rip), %rsi      # 0x14120
leaq 0xf83b(%rip), %rax      # 0x13fa0
cmpb $0x3c, (%rsi,%rax)
jne 0x4868
incl %esi
xorl %ebp, %ebp
cmpb $0x0, 0xf81e(%rip)      # 0x13f98
jne 0x47ed
leaq -0x1(%r14), %r12
xorl %ebp, %ebp
movl $0x1, %r13d
movslq 0xf99d(%rip), %rdx      # 0x1412c
leaq 0xf80a(%rip), %rax      # 0x13fa0
movzbl (%rdx,%rax), %eax
cmpl $0x2e, %eax
jle 0x47b0
cmpl $0x3e, %eax
je 0x47ce
cmpl $0x3c, %eax
je 0x47d3
cmpl $0x2f, %eax
je 0x47b9
jmp 0x47d6
testl %eax, %eax
je 0x47b9
cmpl $0xa, %eax
jne 0x47d6
movl %ebp, %edi
movl %r12d, %ecx
callq 0x52da
movl %eax, %ebp
callq 0x356d
xorl %esi, %esi
jmp 0x47df
decl %r13d
jmp 0x47d6
incl %r13d
leal 0x1(%rdx), %eax
movl %eax, 0xf94d(%rip)      # 0x1412c
testl %r13d, %r13d
jle 0x47ed
cmpb $0x0, 0xf7ad(%rip)      # 0x13f98
je 0x4788
movl 0xf939(%rip), %edx      # 0x1412c
decl %edx
decl %r14d
movl %ebp, %edi
movl %r14d, %ecx
callq 0x52da
testl %eax, %eax
js 0x4942
je 0x4954
movl %eax, %r14d
leal 0x1(%r14), %edi
callq 0x2120
movq %rax, %r12
leaq 0x583a(%rip), %rax      # 0xa060
movq %r12, (%rax,%r15,8)
testq %r12, %r12
je 0x4968
movl %r14d, %r14d
leaq 0xfde3(%rip), %rsi      # 0x14620
movq %r12, %rdi
movq %r14, %rdx
callq 0x2050
movb $0x0, (%r12,%r14)
jmp 0x46d4
callq 0x5543
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x56a1(%rip), %rdi      # 0x9f10
callq 0x4d89
jmp 0x4857
callq 0x396c
movl $0x7fff, %eax           # imm = 0x7FFF
andl 0x571e(%rip), %eax      # 0x9fa4
movl %eax, 0x7ad8(%rip)      # 0xc364
callq 0x380e
jmp 0x4530
leal 0x1(%r15), %eax
movl %eax, 0x7acc(%rip)      # 0xc36c
leaq 0xfce9(%rip), %rdi      # 0x14590
movl %r15d, %esi
movl $0x101, %edx            # imm = 0x101
movl 0x4(%rsp), %ecx
callq 0x2a9c
movb $0x1, %r12b
jmp 0x471c
movq %rdx, %rsi
movslq %edi, %r8
movl %edi, %ebp
cmpb %cl, (%r8,%rdx)
jne 0x48de
cmpb %cl, 0x1(%r8,%rdx)
leaq 0x1(%r8), %rdi
cmovel %edi, %r8d
movl %r8d, %ebp
movslq %ebp, %rdi
movb (%rdi,%rax), %r8b
movb %r8b, (%rsi)
movzbl 0x1(%rdi,%rax), %r8d
cmpb %cl, %r8b
je 0x4904
cmpl $0xa, %r8d
je 0x4904
incq %rdi
incq %rsi
testl %r8d, %r8d
jne 0x48c3
leaq 0xf9c5(%rip), %rdi      # 0x142d0
callq 0x20a0
cmpq $0x40, %rax
jb 0x491d
movb $0x0, 0xf9f2(%rip)      # 0x1430f
addl $0x2, %ebp
movl %ebp, 0xf806(%rip)      # 0x1412c
movl %ebp, 0xf804(%rip)      # 0x14130
movl $0x3c, 0xf65a(%rip)     # 0x13f90
movb $0x1, 0xf64f(%rip)      # 0x13f8c
jmp 0x46d4
movl 0xf7d8(%rip), %esi      # 0x14120
leaq 0x5601(%rip), %rdi      # 0x9f50
jmp 0x46cf
leaq 0x5705(%rip), %rax      # 0xa060
movq $0x0, (%rax,%r15,8)
jmp 0x46d4
movl 0xf7b2(%rip), %esi      # 0x14120
leaq 0x55eb(%rip), %rdi      # 0x9f60
jmp 0x46cf