// File: /workspace/github_c_makefile_star2_O1/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 0x68b6
xorl %eax, %eax
movb %al, 0x14829(%rip)      # 0x18030
movb %al, 0x14403(%rip)      # 0x17c10
movq 0x137c4(%rip), %rax     # 0x16fd8
testq %rax, %rax
je 0x38f3
cmpb $0x0, (%rax)
je 0x3a4f
xorl %ecx, %ecx
movq %rcx, 0x14401(%rip)     # 0x17c30
movq %rcx, 0x143f2(%rip)     # 0x17c28
testq %rax, %rax
je 0x3903
movq $0x0, 0x147ee(%rip) # 0x18038
xorl %ebx, %ebx
callq 0x21a0
leaq 0x13fc8(%rip), %rcx     # 0x17820
leaq 0x8391(%rip), %rdx      # 0xbbf0
leaq 0x143da(%rip), %rsi     # 0x17c40
movabsq $0x4000100100001201, %rdi # imm = 0x4000100100001201
movq 0x13761(%rip), %r8      # 0x16fd8
leaq 0x1(%r8), %r9
movq %r9, 0x13756(%rip)      # 0x16fd8
movb (%r8), %r8b
movsbq %r8b, %r9
movq (%rax), %r10
testb $0x2, 0x1(%r10,%r9,2)
jne 0x38ba
movb %r8b, (%rbx,%rcx)
incq %rbx
movq %rbx, 0x14796(%rip)     # 0x18038
movzbl %r8b, %r8d
cmpl $0xa, %r8d
je 0x3a34
testl %r8d, %r8d
jne 0x3870
jmp 0x3a34
movslq -0x184(%rdx,%r9,4), %r9
testq %r9, %r9
je 0x38a2
addq %rsi, %r9
incq %r9
movb -0x1(%r9), %r10b
movb %r10b, (%rbx,%rcx)
incq %rbx
movzbl (%r9), %r10d
incq %r9
cmpq $0x3e, %r10
ja 0x38cd
btq %r10, %rdi
jb 0x389b
cmpq $0xa, %r10
jne 0x38cd
jmp 0x389b
xorl %eax, %eax
movq %rax, 0x14334(%rip)     # 0x17c30
movq %rax, 0x14325(%rip)     # 0x17c28
incl 0x13ef3(%rip)           # 0x177fc
movq $0x0, 0x13edc(%rip) # 0x177f0
movq %rsp, %rbx
leaq 0x3932(%rip), %r14      # 0x7250
movq 0x12573(%rip), %rdx     # 0x15e98
movq %rbx, %rdi
movl $0xf9, %esi
callq 0x20f0
testq %rax, %rax
jne 0x398f
movl 0x13edb(%rip), %eax     # 0x17818
incl %eax
movl %eax, 0x13ed3(%rip)     # 0x17818
cmpl 0x8335(%rip), %eax      # 0xbc80
jge 0x3984
movq 0x12544(%rip), %rdi     # 0x15e98
callq 0x20a0
movq 0x8328(%rip), %rax      # 0xbc88
movslq 0x13eb1(%rip), %rcx     # 0x17818
movq (%rax,%rcx,8), %rdi
movq %r14, %rsi
callq 0x2160
movq %rax, 0x1251e(%rip)     # 0x15e98
testq %rax, %rax
jne 0x391e
callq 0x23c5
movw $0xa24, (%rsp)          # imm = 0xA24
movb $0x0, 0x2(%rsp)
xorl %r15d, %r15d
leaq 0x13e87(%rip), %r12     # 0x17820
leaq 0x146c0(%rip), %r14     # 0x18060
xorl %r13d, %r13d
movzbl (%rbx), %eax
cmpl $0x9, %eax
je 0x39da
cmpl $0xc, %eax
je 0x39bd
testl %eax, %eax
je 0x3a05
movb %al, (%r15,%r12)
incq %r15
jmp 0x3a00
testb %r13b, %r13b
movb $0x1, %r13b
jne 0x3a00
cmpb $0x0, 0x13e3c(%rip)     # 0x17808
je 0x3a00
movq %r14, %rdi
xorl %esi, %esi
callq 0x68dd
jmp 0x3a00
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 0x39a3
movb $0x0, (%r15,%r12)
cmpq $0x2, %r15
jl 0x3a2b
cmpb $0xd, -0x2(%r15,%r12)
jne 0x3a2b
movb -0x1(%r15,%r12), %al
movb %al, -0x2(%r15,%r12)
movb $0x0, -0x1(%r15,%r12)
decq %r15
movq %r15, 0x14606(%rip)     # 0x18038
jmp 0x3aa4
movq 0x145fd(%rip), %rax     # 0x18038
movb $0x0, (%rax,%rcx)
movzbl 0x824c(%rip), %eax      # 0xbc92
movq %rax, 0x13da3(%rip)     # 0x177f0
jmp 0x3aa4
movq $0x0, 0x1357e(%rip) # 0x16fd8
leaq 0x13dbf(%rip), %rbx     # 0x17820
leaq 0x141d8(%rip), %rsi     # 0x17c40
movl $0xfa, %edx
movq %rbx, %rdi
callq 0x2130
movq 0x145ac(%rip), %rax     # 0x18028
movq %rax, 0x141a5(%rip)     # 0x17c28
movq %rax, 0x141a6(%rip)     # 0x17c30
movq %rbx, %rdi
callq 0x20b0
movq %rax, 0x1459f(%rip)     # 0x18038
movq $0x1, 0x13d4c(%rip) # 0x177f0
addq $0x3f0, %rsp            # imm = 0x3F0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq