// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
callq 0x4d1f
movb $0x0, 0x7da5(%rip)      # 0xc138
movq 0x7d26(%rip), %rbx      # 0xc0c0
testq %rbx, %rbx
je 0x440d
movq 0x68(%rbx), %rax
cmpb $0x0, (%rax)
je 0x44ab
andl $0x0, 0x7d05(%rip)      # 0xc0b8
andl $0x0, 0x7d8a(%rip)      # 0xc144
andl $0x0, 0x7d73(%rip)      # 0xc134
xorl %edx, %edx
leaq 0x7c86(%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, 0x7d49(%rip)      # 0xc134
cmpl $0xa, %esi
ja 0x43cf
btl %esi, %ecx
jae 0x43cf
movl %edx, %ecx
movb $0x0, (%rcx,%rax)
movzbl 0x595f(%rip), %eax      # 0x9d61
movl %eax, 0x7d50(%rip)      # 0xc158
jmp 0x4575
andl $0x0, 0x7ca4(%rip)      # 0xc0b8
andl $0x0, 0x7d29(%rip)      # 0xc144
incl 0x7d3b(%rip)            # 0xc15c
andl $0x0, 0x7d30(%rip)      # 0xc158
movq 0x5a91(%rip), %rax      # 0x9ec0
movq %rsp, %rbx
pushq $0x5f
popq %rbp
leaq 0x1cd0(%rip), %r14      # 0x610c
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x20d0
testq %rax, %rax
jne 0x4500
movl 0x7d14(%rip), %eax      # 0xc16c
incl %eax
movl %eax, 0x7d0c(%rip)      # 0xc16c
cmpl 0x58ee(%rip), %eax      # 0x9d54
jge 0x44f9
movq 0x5a4d(%rip), %rdi      # 0x9ec0
callq 0x2080
movq 0x58d9(%rip), %rax      # 0x9d58
movslq 0x7ce6(%rip), %rcx      # 0xc16c
movq (%rax,%rcx,8), %rdi
movq %r14, %rsi
callq 0x2140
movq %rax, 0x5a27(%rip)      # 0x9ec0
testq %rax, %rax
je 0x4584
movb $0x0, 0x7c1f(%rip)      # 0xc0c8
jmp 0x443c
movl $0x1, 0x7ca3(%rip)      # 0xc158
leaq 0x7b94(%rip), %r14      # 0xc050
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2070
movl 0x60(%rbx), %eax
movl %eax, 0x7c74(%rip)      # 0xc144
movl %eax, 0x7be2(%rip)      # 0xc0b8
movq %r14, %rdi
callq 0x2090
movl %eax, 0x7c50(%rip)      # 0xc134
movq 0x78(%rbx), %r14
movq %rbx, %rdi
callq 0x2030
movq %r14, 0x7bc9(%rip)      # 0xc0c0
jmp 0x4575
movb $0x1, 0x7c30(%rip)      # 0xc130
xorl %r15d, %r15d
leaq 0x7bc6(%rip), %r14      # 0xc0d0
leaq 0x7b3f(%rip), %r12      # 0xc050
xorl %r13d, %r13d
movzbl (%rbx), %ecx
cmpl $0xc, %ecx
je 0x452d
movslq %r15d, %rax
testl %ecx, %ecx
je 0x454d
leal 0x1(%rax), %r15d
movb %cl, (%rax,%r12)
jmp 0x4548
testb %r13b, %r13b
movb $0x1, %r13b
jne 0x4548
cmpb $0x0, 0x7b8c(%rip)      # 0xc0c8
je 0x4548
movq %r14, %rdi
xorl %esi, %esi
callq 0x4d45
incq %rbx
jmp 0x4514
movb $0x0, (%rax,%r12)
cmpb $0xd, -0x2(%rax,%r12)
jne 0x456e
leaq -0x1(%rax), %r15
movb -0x1(%rax,%r12), %cl
movb %cl, -0x2(%rax,%r12)
movb $0x0, -0x1(%rax,%r12)
movl %r15d, 0x7bbf(%rip)     # 0xc134
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4a6d(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
movq 0x57c3(%rip), %rax      # 0x9d58
movq (%rax), %rdx
movslq 0x7bcd(%rip), %rcx      # 0xc16c
movq (%rax,%rcx,8), %rcx
leaq 0x2139(%rip), %rsi      # 0x66e3
xorl %eax, %eax
callq 0x2110
pushq $-0x1
popq %rdi
callq 0x2170