// File: /workspace/github_c_makefile_star2_O3/AK6DN[P]dec-utilities-for-pdp/macro8x/macro8x.c
// Function: readLine
void readLine()
{
  BOOL    ffseen;
  WORD32  ix;
  WORD32  iy;
  char    mc;
  char    inpline[4*LINELEN];

  listLine();                   /* List previous line if needed.              */
  indirect_generated = FALSE;   /* Mark no indirect address generated.        */
  error_in_line = FALSE;        /* No error in line.                          */

  if( mac_ptr && ( *mac_ptr == '\0' )) /* End of macro?                       */
  {
    mac_ptr = NULL;
    for( ix = 0; ix < LINELEN; ix++ )
    {
      line[ix] = mac_line[ix];  /* Restore invoking line.                     */
    }
    cc = lexstartprev = mac_cc; /* Restore cc.                                */
    maxcc = strlen( line );     /* Restore maxcc.                             */
    listed = TRUE;              /* Already listed.                            */
    return;
  }

  cc = 0;                       /* Initialize column counter.                 */
  lexstartprev = 0;
  if( mac_ptr )                 /* Inside macro? */
  {
    maxcc = 0;
    do
    {
      mc = *mac_ptr++;          /* Next character.                            */
      if( is_lower( mc ))        /* Encoded argument number?                   */
      {
        ix = mc - 'a';          /* Convert to index.                          */
	iy = mac_arg_pos[ix];
        if( iy )
        {
          do                    /* Copy argument string.                      */
            {
              line[maxcc++] = mac_line[iy++];
            } while(( mac_line[iy] != ',' ) && ( !is_blank( mac_line[iy] )) &&
                    ( !is_end( mac_line[iy] )));
        }
      }
      else                      /* Ordinary character, just copy.             */
      {
      line[maxcc++] = mc;
      }
    } while( !is_end( mc ));
    line[maxcc] = '\0';
    listed = nomac_exp;
    return;
  }

  lineno++;                         /* Count lines read.                      */
  listed = FALSE;                   /* Mark as not listed.                    */
READ_LINE:
  if(( fgets( inpline, LINELEN - 1, infile )) == NULL )
  {
    filix_curr++;                   /* Advance to next file.                  */
    if( filix_curr < save_argc )    /* More files?                            */
    {
      fclose( infile );
      if(( infile = fopen( save_argv[filix_curr], "r" )) == NULL )
      {
        fprintf( stderr, "%s: cannot open \"%s\"\n", save_argv[0],
          save_argv[filix_curr] );
        exit( -1 );
      }
      goto READ_LINE;
    }
    else
    {
      inpline[0] = '$';
      inpline[1] = '\n';
      inpline[2] = '\0';
    }
  }

  /* Remove any tabs from the input line by inserting the required number     */
  /* of spaces to simulate 8 character tab stops.                             */
  ffseen = FALSE;
  for( ix = 0, iy = 0; inpline[ix] != '\0'; ix++ )
  {
    switch( inpline[ix] )
    {
    case '\t':
      do
      {
        line[iy] = ' ';
        iy++;
      }
      while(( iy % 8 ) != 0 );
      break;

    case '\f':
      if( !ffseen && list_title_set ) topOfForm( list_title, NULL );
      ffseen = TRUE;
      break;
      
    default:
      line[iy] = inpline[ix];
      iy++;
      break;
    }
  }
  line[iy] = '\0';

  /* If the line is terminated by CR-LF, remove, the CR.                      */
  if( iy >= 2 && line[iy - 2] == '\r' )
  {
    iy--;
    line[iy - 1] = line[iy - 0];
    line[iy] = '\0';
  }
  maxcc = iy;                   /* Save the current line length.              */
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3f0, %rsp            # imm = 0x3F0
callq 0x6971
xorl %eax, %eax
movb %al, 0x157f5(%rip)      # 0x19030
movb %al, 0x153cf(%rip)      # 0x18c10
movq 0x14790(%rip), %rbx     # 0x17fd8
testq %rbx, %rbx
je 0x3925
cmpb $0x0, (%rbx)
je 0x39bd
xorl %r14d, %r14d
movq %r14, 0x153cc(%rip)     # 0x18c30
movq %r14, 0x153bd(%rip)     # 0x18c28
movq %r14, 0x157c6(%rip)     # 0x19038
callq 0x21a0
leaq 0x14fa2(%rip), %rcx     # 0x18820
leaq 0x936b(%rip), %rdx      # 0xcbf0
leaq 0x153b4(%rip), %rsi     # 0x18c40
movabsq $0x4000100100001201, %rdi # imm = 0x4000100100001201
movq %rbx, %r8
incq %rbx
movq %rbx, 0x14735(%rip)     # 0x17fd8
movb (%r8), %r8b
movq (%rax), %r10
movsbq %r8b, %r9
testb $0x2, 0x1(%r10,%r9,2)
jne 0x38d4
movb %r8b, (%r14,%rcx)
incq %r14
movq %r14, 0x15775(%rip)     # 0x19038
movzbl %r8b, %r8d
cmpl $0xa, %r8d
je 0x390d
testl %r8d, %r8d
jne 0x3896
jmp 0x390d
movslq -0x184(%rdx,%r9,4), %r9
testq %r9, %r9
je 0x38c3
addq %rsi, %r9
incq %r9
movb -0x1(%r9), %r10b
movb %r10b, (%r14,%rcx)
incq %r14
movzbl (%r9), %r10d
incq %r9
cmpq $0x3e, %r10
ja 0x38eb
btq %r10, %rdi
jb 0x38bc
cmpq $0xa, %r10
jne 0x38eb
jmp 0x38bc
movb $0x0, (%r14,%rcx)
movzbl 0x9379(%rip), %eax      # 0xcc92
movq %rax, 0x14ed0(%rip)     # 0x187f0
jmp 0x3ac5
xorl %eax, %eax
movq %rax, 0x15302(%rip)     # 0x18c30
movq %rax, 0x152f3(%rip)     # 0x18c28
incl 0x14ec1(%rip)           # 0x187fc
movq %rax, 0x14eae(%rip)     # 0x187f0
movq 0x1354f(%rip), %rax     # 0x16e98
movq %rsp, %rbx
leaq 0x4959(%rip), %r14      # 0x82ac
movq %rbx, %rdi
movl $0xf9, %esi
movq %rax, %rdx
callq 0x20f0
testq %rax, %rax
jne 0x3a22
movl 0x14ea6(%rip), %eax     # 0x18818
incl %eax
movl %eax, 0x14e9e(%rip)     # 0x18818
cmpl 0x9300(%rip), %eax      # 0xcc80
jge 0x3a17
movq 0x1350b(%rip), %rdi     # 0x16e98
callq 0x20a0
movq 0x92ef(%rip), %rax      # 0xcc88
movslq 0x14e78(%rip), %rcx     # 0x18818
movq (%rax,%rcx,8), %rdi
movq %r14, %rsi
callq 0x2160
movq %rax, 0x134e5(%rip)     # 0x16e98
testq %rax, %rax
jne 0x3953
callq 0x23c5
movq $0x0, 0x14610(%rip) # 0x17fd8
leaq 0x14e51(%rip), %rbx     # 0x18820
leaq 0x1526a(%rip), %rsi     # 0x18c40
movl $0xfa, %edx
movq %rbx, %rdi
callq 0x2130
movq 0x1563e(%rip), %rax     # 0x19028
movq %rax, 0x15237(%rip)     # 0x18c28
movq %rax, 0x15238(%rip)     # 0x18c30
movq %rbx, %rdi
callq 0x20b0
movq %rax, 0x15631(%rip)     # 0x19038
movq $0x1, 0x14dde(%rip) # 0x187f0
jmp 0x3ac5
movw $0xa24, (%rsp)          # imm = 0xA24
movb $0x0, 0x2(%rsp)
xorl %r15d, %r15d
leaq 0x14df4(%rip), %r12     # 0x18820
leaq 0x1562d(%rip), %r14     # 0x19060
xorl %r13d, %r13d
movzbl (%rbx), %eax
cmpl $0x9, %eax
je 0x3a6d
cmpl $0xc, %eax
je 0x3a50
testl %eax, %eax
je 0x3a98
movb %al, (%r15,%r12)
incq %r15
jmp 0x3a93
testb %r13b, %r13b
movb $0x1, %r13b
jne 0x3a93
cmpb $0x0, 0x14da9(%rip)     # 0x18808
je 0x3a93
movq %r14, %rdi
xorl %esi, %esi
callq 0x6998
jmp 0x3a93
leaq (%r12,%r15), %rdi
movl %r15d, %eax
andl $0x7, %eax
movl $0x8, %edx
subq %rax, %rdx
movl $0x20, %esi
callq 0x20d0
movq %r15, %rax
orq $-0x8, %rax
subq %rax, %r15
incq %rbx
jmp 0x3a36
movb $0x0, (%r15,%r12)
cmpq $0x2, %r15
jl 0x3abe
cmpb $0xd, -0x2(%r15,%r12)
jne 0x3abe
movb -0x1(%r15,%r12), %al
movb %al, -0x2(%r15,%r12)
movb $0x0, -0x1(%r15,%r12)
decq %r15
movq %r15, 0x15573(%rip)     # 0x19038
addq $0x3f0, %rsp            # imm = 0x3F0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq