// File: /workspace/github_c_makefile_star2_O3/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 0x5326
movb $0x0, 0x782e(%rip)      # 0xc138
movq 0x77af(%rip), %rbx      # 0xc0c0
testq %rbx, %rbx
je 0x4981
movq 0x68(%rbx), %rax
cmpb $0x0, (%rax)
je 0x4a37
xorl %edx, %edx
movl %edx, 0x778d(%rip)      # 0xc0b8
movl %edx, 0x7813(%rip)      # 0xc144
movl %edx, 0x77fd(%rip)      # 0xc134
leaq 0x7712(%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, 0x77d5(%rip)      # 0xc134
cmpl $0xa, %esi
ja 0x4943
btl %esi, %ecx
jae 0x4943
movl %edx, %ecx
movb $0x0, (%rcx,%rax)
movzbl 0x53eb(%rip), %eax      # 0x9d61
movl %eax, 0x77dc(%rip)      # 0xc158
jmp 0x4afe
xorl %r12d, %r12d
incl 0x77d2(%rip)            # 0xc15c
movl %r12d, 0x7727(%rip)     # 0xc0b8
movl %r12d, 0x77ac(%rip)     # 0xc144
movl %r12d, 0x77b9(%rip)     # 0xc158
movq 0x551a(%rip), %rdx      # 0x9ec0
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x5f, %esi
callq 0x20d0
testq %rax, %rax
jne 0x4a8c
leaq 0x1776(%rip), %r14      # 0x613c
movq %rsp, %r15
movl 0x779d(%rip), %eax      # 0xc16c
incl %eax
movl %eax, 0x7795(%rip)      # 0xc16c
cmpl 0x5377(%rip), %eax      # 0x9d54
jge 0x4a85
movq 0x54d6(%rip), %rdi      # 0x9ec0
callq 0x2080
movq 0x5362(%rip), %rax      # 0x9d58
movslq 0x776f(%rip), %rcx      # 0xc16c
movq (%rax,%rcx,8), %rdi
movq %r14, %rsi
callq 0x2140
movq %rax, 0x54b0(%rip)      # 0x9ec0
testq %rax, %rax
je 0x4b0c
movb $0x0, 0x76a8(%rip)      # 0xc0c8
movq %r15, %rdi
movl $0x5f, %esi
movq %rax, %rdx
callq 0x20d0
testq %rax, %rax
je 0x49c9
jmp 0x4a8c
movl $0x1, 0x7717(%rip)      # 0xc158
leaq 0x7608(%rip), %r14      # 0xc050
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2070
movl 0x60(%rbx), %eax
movl %eax, 0x76e8(%rip)      # 0xc144
movl %eax, 0x7656(%rip)      # 0xc0b8
movq %r14, %rdi
callq 0x2090
movl %eax, 0x76c4(%rip)      # 0xc134
movq 0x78(%rbx), %r14
movq %rbx, %rdi
callq 0x2030
movq %r14, 0x763d(%rip)      # 0xc0c0
jmp 0x4afe
movb $0x1, 0x76a4(%rip)      # 0xc130
leaq 0x763d(%rip), %r14      # 0xc0d0
leaq 0x75b6(%rip), %r15      # 0xc050
xorl %r13d, %r13d
movzbl (%rbx), %ecx
cmpl $0xc, %ecx
je 0x4ab6
movslq %r12d, %rax
testl %ecx, %ecx
je 0x4ad6
leal 0x1(%rax), %r12d
movb %cl, (%rax,%r15)
jmp 0x4ad1
testb %r13b, %r13b
movb $0x1, %r13b
jne 0x4ad1
cmpb $0x0, 0x7603(%rip)      # 0xc0c8
je 0x4ad1
movq %r14, %rdi
xorl %esi, %esi
callq 0x534c
incq %rbx
jmp 0x4a9d
movb $0x0, (%rax,%r15)
cmpb $0xd, -0x2(%rax,%r15)
jne 0x4af7
leaq -0x1(%rax), %r12
movb -0x1(%rax,%r15), %cl
movb %cl, -0x2(%rax,%r15)
movb $0x0, -0x1(%rax,%r15)
movl %r12d, 0x7636(%rip)     # 0xc134
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x23cc