// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
callq 0x5fc3
xorl %eax, %eax
movb %al, 0x149af(%rip)      # 0x18020
movb %al, 0x14589(%rip)      # 0x17c00
movq 0x1394a(%rip), %rbx     # 0x16fc8
testq %rbx, %rbx
je 0x375e
cmpb $0x0, (%rbx)
je 0x3827
andq $0x0, 0x14588(%rip)     # 0x17c20
andq $0x0, 0x14578(%rip)     # 0x17c18
andq $0x0, 0x14980(%rip)     # 0x18028
xorl %r14d, %r14d
callq 0x2190
leaq 0x14159(%rip), %rcx     # 0x17810
leaq 0x8522(%rip), %rdx      # 0xbbe0
leaq 0x1456b(%rip), %rsi     # 0x17c30
movabsq $0x4000100100001201, %rdi # imm = 0x4000100100001201
movq %rbx, %r8
incq %rbx
movq %rbx, 0x138ec(%rip)     # 0x16fc8
movb (%r8), %r8b
movq (%rax), %r10
movsbq %r8b, %r9
testb $0x2, 0x1(%r10,%r9,2)
jne 0x370d
movb %r8b, (%r14,%rcx)
incq %r14
movq %r14, 0x1492c(%rip)     # 0x18028
movzbl %r8b, %r8d
cmpl $0xa, %r8d
je 0x3746
testl %r8d, %r8d
jne 0x36cf
jmp 0x3746
movslq -0x184(%rdx,%r9,4), %r9
testq %r9, %r9
je 0x36fc
addq %rsi, %r9
incq %r9
movb -0x1(%r9), %r10b
movb %r10b, (%r14,%rcx)
incq %r14
movzbl (%r9), %r10d
incq %r9
cmpq $0x3e, %r10
ja 0x3724
btq %r10, %rdi
jb 0x36f5
cmpq $0xa, %r10
jne 0x3724
jmp 0x36f5
movb $0x0, (%r14,%rcx)
movzbl 0x8530(%rip), %eax      # 0xbc82
movq %rax, 0x14087(%rip)     # 0x177e0
jmp 0x3939
andq $0x0, 0x144ba(%rip)     # 0x17c20
andq $0x0, 0x144aa(%rip)     # 0x17c18
incl 0x14078(%rip)           # 0x177ec
andq $0x0, 0x14064(%rip)     # 0x177e0
movq 0x12705(%rip), %rax     # 0x15e88
movq %rsp, %rbx
leaq 0x3aef(%rip), %r14      # 0x727c
movq %rbx, %rdi
movl $0xf9, %esi
movq %rax, %rdx
callq 0x20f0
testq %rax, %rax
jne 0x3897
movl 0x1405c(%rip), %eax     # 0x17808
incl %eax
movl %eax, 0x14054(%rip)     # 0x17808
cmpl 0x84b6(%rip), %eax      # 0xbc70
jge 0x388c
movq 0x126c1(%rip), %rdi     # 0x15e88
callq 0x20a0
movq 0x84a5(%rip), %rax      # 0xbc78
movslq 0x1402e(%rip), %rcx     # 0x17808
movq (%rax,%rcx,8), %rdi
movq %r14, %rsi
callq 0x2150
movq %rax, 0x1269b(%rip)     # 0x15e88
testq %rax, %rax
jne 0x378d
movq 0x67ff(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movq 0x8475(%rip), %rax      # 0xbc78
movq (%rax), %rdx
movslq 0x13ffb(%rip), %rcx     # 0x17808
movq (%rax,%rcx,8), %rcx
leaq 0x4035(%rip), %rsi      # 0x784d
xorl %eax, %eax
callq 0x2120
pushq $-0x1
popq %rdi
callq 0x2170
andq $0x0, 0x13799(%rip)     # 0x16fc8
xorl %eax, %eax
leaq 0x143f8(%rip), %rcx     # 0x17c30
leaq 0x13fd1(%rip), %rdx     # 0x17810
cmpq $0xfa, %rax
je 0x3854
movb (%rax,%rcx), %sil
movb %sil, (%rax,%rdx)
incq %rax
jmp 0x383f
movq 0x147bd(%rip), %rax     # 0x18018
movq %rax, 0x143b6(%rip)     # 0x17c18
movq %rax, 0x143b7(%rip)     # 0x17c20
leaq 0x13fa0(%rip), %rdi     # 0x17810
callq 0x20b0
movq %rax, 0x147ac(%rip)     # 0x18028
movq $0x1, 0x13f59(%rip) # 0x177e0
jmp 0x3939
movw $0xa24, (%rsp)          # imm = 0xA24
movb $0x0, 0x2(%rsp)
xorl %r15d, %r15d
leaq 0x13f6f(%rip), %r12     # 0x17810
pushq $0x8
popq %r13
pushq $0x20
popq %rbp
xorl %r14d, %r14d
movzbl (%rbx), %eax
cmpl $0x9, %eax
je 0x38e6
cmpl $0xc, %eax
je 0x38c5
testl %eax, %eax
je 0x390c
movb %al, (%r15,%r12)
incq %r15
jmp 0x3907
testb %r14b, %r14b
movb $0x1, %r14b
jne 0x3907
cmpb $0x0, 0x13f24(%rip)     # 0x177f8
je 0x3907
leaq 0x14773(%rip), %rdi     # 0x18050
xorl %esi, %esi
callq 0x5fea
jmp 0x3907
leaq (%r12,%r15), %rdi
movl %r15d, %eax
andl $0x7, %eax
movq %r13, %rdx
subq %rax, %rdx
movl %ebp, %esi
callq 0x20d0
movq %r15, %rax
orq $-0x8, %rax
subq %rax, %r15
incq %rbx
jmp 0x38ab
movb $0x0, (%r15,%r12)
cmpq $0x2, %r15
jl 0x3932
cmpb $0xd, -0x2(%r15,%r12)
jne 0x3932
movb -0x1(%r15,%r12), %al
movb %al, -0x2(%r15,%r12)
movb $0x0, -0x1(%r15,%r12)
decq %r15
movq %r15, 0x146ef(%rip)     # 0x18028
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq