// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro1/macro1.c
// Function: readLine
void readLine()
{
    BOOL    ffseen;
    WORD32  ix;
    WORD32  iy;
    char    inpline[LINELEN];

    /* XXX panic if nrepeats > 0 (if self-feeding, do the backup here?) */

    listLine();				/* List previous line if needed. */
    error_in_line = FALSE;		/* No error in line. */

    if(curmacro && *curmacro->mac_ptr == '\0') { /* end of macro? */
	struct macinv *mp;

	listed = TRUE;			/* Already listed. */

	/* Restore invoking line. */
	strcpy(line, curmacro->mac_line);
	cc = lexstartprev = curmacro->mac_cc; /* Restore cc. */
	maxcc = strlen( line );		/* Restore maxcc. */

	mp = curmacro->prev;		/* pop stack */
	free(curmacro);
	curmacro = mp;

	return;
    } /* end of macro */

    cc = 0;				/* Initialize column counter. */
    lexstartprev = 0;
    if( curmacro ) {			/* Inside macro? */
	char mc;

	maxcc = 0;
	do {

	    mc = *curmacro->mac_ptr++;	/* Next character. */
	    /* watch for overflow? how could it?? */
	    line[maxcc++] = mc;
	} while( !ISEND( mc ));		/* note: terminates on tab?! */
	line[maxcc] = '\0';
	listed = nomac_exp;
	return;
    } /* inside macro */

    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 );
	    }
	    list_title_set = FALSE;
	    goto READ_LINE;
	}
	else
	    end_of_input = TRUE;
    } /* fgets failed */

    ffseen = FALSE;
    for( ix = 0, iy = 0; inpline[ix] != '\0'; ix++ ) {
	if( inpline[ix] == '\f' ) {
	    if( !ffseen && list_title_set ) topOfForm( list_title, NULL );
	    ffseen = TRUE;
	}
	else
	    line[iy++] = inpline[ix];
    }
    line[iy] = '\0';

    /* If the line is terminated by CR-LF, remove, the CR. */
    if( 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 $0x60, %rsp
callq 0x52c6
movb $0x0, 0x789c(%rip)      # 0xc138
movq 0x781d(%rip), %rbx      # 0xc0c0
testq %rbx, %rbx
je 0x491e
movq 0x68(%rbx), %rax
cmpb $0x0, (%rax)
je 0x49d8
xorl %eax, %eax
movl %eax, 0x77fb(%rip)      # 0xc0b8
movl %eax, 0x7881(%rip)      # 0xc144
testq %rbx, %rbx
je 0x492c
movl $0x0, 0x7862(%rip)      # 0xc134
xorl %edx, %edx
leaq 0x7775(%rip), %rax      # 0xc050
movl $0x601, %ecx            # imm = 0x601
movq 0x68(%rbx), %rsi
leaq 0x1(%rsi), %rdi
movq %rdi, 0x68(%rbx)
movzbl (%rsi), %esi
movb %sil, (%rdx,%rax)
incq %rdx
movl %edx, 0x7838(%rip)      # 0xc134
cmpl $0xa, %esi
ja 0x48e0
btl %esi, %ecx
jae 0x48e0
movl %edx, %ecx
movb $0x0, (%rcx,%rax)
movzbl 0x544e(%rip), %eax      # 0x9d61
movl %eax, 0x783f(%rip)      # 0xc158
jmp 0x4aa2
xorl %eax, %eax
movl %eax, 0x7792(%rip)      # 0xc0b8
movl %eax, 0x7818(%rip)      # 0xc144
incl 0x782a(%rip)            # 0xc15c
movl $0x0, 0x781c(%rip)      # 0xc158
movq 0x557d(%rip), %rdx      # 0x9ec0
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x5f, %esi
callq 0x20d0
testq %rax, %rax
jne 0x4a2d
leaq 0x17a9(%rip), %r14      # 0x610c
movq %rsp, %r15
movl 0x7800(%rip), %eax      # 0xc16c
incl %eax
movl %eax, 0x77f8(%rip)      # 0xc16c
cmpl 0x53da(%rip), %eax      # 0x9d54
jge 0x4a26
movq 0x5539(%rip), %rdi      # 0x9ec0
callq 0x2080
movq 0x53c5(%rip), %rax      # 0x9d58
movslq 0x77d2(%rip), %rcx      # 0xc16c
movq (%rax,%rcx,8), %rdi
movq %r14, %rsi
callq 0x2140
movq %rax, 0x5513(%rip)      # 0x9ec0
testq %rax, %rax
je 0x4ab0
movb $0x0, 0x770b(%rip)      # 0xc0c8
movq 0x54fc(%rip), %rdx      # 0x9ec0
movq %r15, %rdi
movl $0x5f, %esi
callq 0x20d0
testq %rax, %rax
je 0x4966
jmp 0x4a2d
movl $0x1, 0x7776(%rip)      # 0xc158
leaq 0x7667(%rip), %r14      # 0xc050
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2070
movl 0x60(%rbx), %eax
movl %eax, 0x7747(%rip)      # 0xc144
movl %eax, 0x76b5(%rip)      # 0xc0b8
movq %r14, %rdi
callq 0x2090
movl %eax, 0x7723(%rip)      # 0xc134
movq 0x78(%rbx), %r14
movq %rbx, %rdi
callq 0x2030
movq %r14, 0x769c(%rip)      # 0xc0c0
jmp 0x4aa2
movb $0x1, 0x7703(%rip)      # 0xc130
xorl %r15d, %r15d
leaq 0x7699(%rip), %r14      # 0xc0d0
leaq 0x7612(%rip), %r12      # 0xc050
xorl %r13d, %r13d
movzbl (%rbx), %ecx
cmpl $0xc, %ecx
je 0x4a5a
movslq %r15d, %rax
testl %ecx, %ecx
je 0x4a7a
leal 0x1(%rax), %r15d
movb %cl, (%rax,%r12)
jmp 0x4a75
testb %r13b, %r13b
movb $0x1, %r13b
jne 0x4a75
cmpb $0x0, 0x765f(%rip)      # 0xc0c8
je 0x4a75
movq %r14, %rdi
xorl %esi, %esi
callq 0x52ec
incq %rbx
jmp 0x4a41
movb $0x0, (%rax,%r12)
cmpb $0xd, -0x2(%rax,%r12)
jne 0x4a9b
leaq -0x1(%rax), %r15
movb -0x1(%rax,%r12), %cl
movb %cl, -0x2(%rax,%r12)
movb $0x0, -0x1(%rax,%r12)
movl %r15d, 0x7692(%rip)     # 0xc134
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x23cc