// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro1/macro1.c
// Function: processLine
void
processLine() {
    if (!list_title_set) {
	char *cp;

	/* assert(sizeof(title) >= sizeof(line)); */
	strcpy(list_title, line);

	if ((cp = strchr(list_title, '\n')))
	    *cp = '\0';

	if (list_title[0]) {
	    list_title_set = TRUE;
	    fprintf(stderr, "%s - pass %d\n", list_title, pass );
	    /* XXX punch title into tape  banner (until an '@' seen) */
	}
	return;
    }

    for (;;) {
	int jx;
	SYM_T evalue;

	next(0);
	if( end_of_input )
	    return;

	if( ISEND( line[lexstart] )) {
	    if (line[lexstart] != '\t')
		return;
	    continue;
	}
	if (line[lexstart] == '/')	/* comment? */
	    return;			/* done */

	/* look ahead for 'exp/' */
	/* skip until whitespace or terminator */
	for( jx = lexstart; jx < maxcc; jx++ )
	    if( ISBLANK(line[jx]) || ISDONE(line[jx]))
		break;
	if( line[jx] == '/') {		/* EXP/ set location */
	    WORD32  newclc;

	    newclc = getExprs();

	    /* Do not change Current Location Counter if an error occurred. */
	    if( !error_in_line )
		clc = newclc;

	    printLine( line, newclc, 0, LINE_LOC );
	    cc = jx + 1;
	    next(0);			/* discard slash */
	    continue;
	}

	switch( line[lexterm] ) {
	case ',':
	    if( isLexSymbol()) {
		WORD32 val;
		SYM_T *sym;
		char name[SYMLEN];

		/* Use lookup so symbol will not be counted as reference. */
		sym = lookup(lexemeToName(name, lexstart, lexterm), UNDEFINED);

		if (curmacro) {
		    /* relative during macro expansion!! */
		    val = clc - curmacro->defn->args[0].val;
		}
		else
		    val = clc;

		if( M_DEFINED( sym->type )) {
		    if( sym->val != val && pass == 2 )
			errorSymbol( &duplicate_label, sym->name, lexstart );
		    sym->type |= DUPLICATE;	/* XXX never used! */
		}
		/* Must call define on pass 2 to generate concordance. */
		defineLexeme( lexstart, lexterm, val, LABEL );
	    }
	    else if (isdigit(line[lexstart])) {	/* constant, */
		int i;
		WORD32 val = 0;

		for( i = lexstart; i < lexterm; i++ ) {
		    if( isdigit( line[i] )) {
			int digit;
			digit = line[i] - '0';
			if( digit >= radix ) {
			    errorLexeme( &number_not_radix, i );
			    val = 0;
			    break;
			}
			val = val * radix + digit;
		    }
		    else {
			errorLexeme( &not_a_number, lexstart );
			val = 0;
			break;
		    }
		}
		if (i == lexterm) {
		    if( clc != val && pass == 2 )
			errorLexeme( &duplicate_label, lexstart); /* XXX */
		}
	    }
	    else
		errorLexeme( &label_syntax, lexstart );
	    next(0);			/* skip comma */
	    continue;

	case '=':
	    if( isLexSymbol()) {
		WORD32 start, term, val;

		start = lexstart;
		term = lexterm;
		next(0);		/* skip symbol */
		next(0);		/* skip trailing = */
		val = getExprs();
		defineLexeme( start, term, val, DEFINED );
		printLine( line, 0, val, LINE_VAL );
	    }
	    else {
		errorLexeme( &symbol_syntax, lexstartprev );
		next(0);		/* skip symbol */
		next(0);		/* skip trailing = */
		getExprs();		/* skip expression */
	    }
	    continue;
	} /* switch on terminator */

	if( isLexSymbol()) {
	    SYM_T  *sym;
	    WORD32  val;

	    sym = evalSymbol();
	    val = sym->val;
	    if( M_MACRO(sym->type)) {
		if (!invokeMacro(val))
		    next(0);		/* bad defn? or body is empty! */
		continue;
	    } /* macro invocation */
	    else if( M_PSEUDO(sym->type)) {	/* NO EPSEUDOs */
		pseudo( (PSEUDO_T)val & 0777777 );
		continue;
	    } /* pseudo */
	} /* macro, or non-char pseudo */

	evalue = getExpr();
	if (evalue.type != PSEUDO) {	/* not a  bare pseudo-op? */
	    if (line[lexstart] == ',') {	/* EXP, */
		if(evalue.val != clc && pass == 2 )
		    errorLexeme( &duplicate_label, lexstart); /* XXX */
	    }
	    else if (line[lexstart] == '/') {	/* EXP/ */
		clc = evalue.val;
		printLine( line, clc, 0, LINE_LOC );
		next(0);
	    }
	    else {
		punchOutObject( clc, evalue.val & 0777777); /* punch it! */
		incrementClc();
	    }
	}
    } /* forever */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpb $0x0, 0x86eb(%rip)      # 0xc0c8
je 0x3e68
xorl %edi, %edi
callq 0x384a
cmpb $0x0, 0x873f(%rip)      # 0xc130
jne 0x3e9c
leaq 0x8652(%rip), %rbx      # 0xc050
movabsq $0x800100001601, %r12   # imm = 0x800100001601
movl 0x86a1(%rip), %r14d     # 0xc0b0
movslq %r14d, %r13
movzbl (%r13,%rbx), %r15d
cmpl $0x9, %r15d
jg 0x3a2e
je 0x3aae
testl %r15d, %r15d
jne 0x3a42
jmp 0x3e9c
cmpl $0xa, %r15d
je 0x3e9c
cmpl $0x2f, %r15d
je 0x3e9c
movl 0x86ec(%rip), %eax      # 0xc134
movl %r14d, %ebp
cmpl %eax, %r14d
jge 0x3a71
leaq (%rbx,%r13), %rcx
movl %r14d, %ebp
movzbl (%rcx), %edx
cmpq $0x2f, %rdx
ja 0x3a66
btq %rdx, %r12
jb 0x3a71
incl %ebp
incq %rcx
cmpl %ebp, %eax
jne 0x3a57
movl %eax, %ebp
movslq %ebp, %rax
cmpb $0x2f, (%rax,%rbx)
jne 0x3ac7
callq 0x398a
cmpb $0x0, 0x86b2(%rip)      # 0xc138
jne 0x3a8e
movl %eax, 0x8626(%rip)      # 0xc0b4
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
movl $0x4, %ecx
callq 0x3eb2
incl %ebp
movl %ebp, 0x8611(%rip)      # 0xc0b8
xorl %edi, %edi
callq 0x384a
xorl %edi, %edi
callq 0x384a
cmpb $0x0, 0x8674(%rip)      # 0xc130
je 0x3a08
jmp 0x3e9c
movq %rbx, %rax
movq %r12, %rbx
movslq 0x8668(%rip), %rbp      # 0xc13c
movzbl (%rbp,%rax), %r12d
callq 0x56bd
cmpl $0x3d, %r12d
je 0x3ba1
cmpl $0x2c, %r12d
jne 0x3c03
testb %al, %al
je 0x3c3f
leaq 0x21(%rsp), %r15
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x42ae
movq %r15, %rdi
xorl %esi, %esi
callq 0x4015
movq %rax, %r15
movq 0x859f(%rip), %rax      # 0xc0c0
movl 0x858d(%rip), %ebp      # 0xc0b4
testq %rax, %rax
je 0x3b33
movq 0x70(%rax), %rax
subl 0x10(%rax), %ebp
movq %rbx, %r12
testb $0x1, (%r15)
leaq 0x850f(%rip), %rbx      # 0xc050
je 0x3b6f
cmpl %ebp, 0xc(%r15)
je 0x3b6b
cmpl $0x2, 0x6230(%rip)      # 0x9d80
jne 0x3b6b
movq %r15, %rsi
addq $0x4, %rsi
movl 0x8551(%rip), %edx      # 0xc0b0
leaq 0x5f0a(%rip), %rdi      # 0x9a70
callq 0x42f3
orb $0x21, (%r15)
movl 0x853a(%rip), %r15d     # 0xc0b0
movl 0x85c0(%rip), %edx      # 0xc13c
movq %rsp, %r14
movq %r14, %rdi
movl %r15d, %esi
callq 0x42ae
movq %r14, %rdi
movl %ebp, %esi
movl $0x9, %edx
movl %r15d, %ecx
callq 0x292b
jmp 0x3aa7
testb %al, %al
movq %rbx, %r12
je 0x3c88
xorl %edi, %edi
callq 0x384a
xorl %edi, %edi
callq 0x384a
callq 0x398a
movl %eax, %r15d
movq %rsp, %rbx
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x42ae
movq %rbx, %rdi
movl %r15d, %esi
movl $0x1, %edx
movl %r14d, %ecx
callq 0x292b
leaq 0x8464(%rip), %rbx      # 0xc050
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
movl $0x1, %ecx
callq 0x3eb2
jmp 0x3aae
testb %al, %al
movq %rbx, %r12
leaq 0x8441(%rip), %rbx      # 0xc050
je 0x3ce5
callq 0x4407
movl (%rax), %ecx
movl 0xc(%rax), %edi
notl %ecx
testl $0x101, %ecx            # imm = 0x101
jne 0x3cd0
callq 0x3673
testl %eax, %eax
jne 0x3aae
jmp 0x3aa7
movsbq %r15b, %r12
callq 0x21b0
movq (%rax), %rcx
testb $0x8, 0x1(%rcx,%r12,2)
jne 0x3d44
movq %rsp, %r15
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x42ae
leaq 0x5e42(%rip), %rdi      # 0x9ab0
movq %r15, %rsi
movl %r14d, %edx
callq 0x42f3
movq %rbx, %r12
leaq 0x83cd(%rip), %rbx      # 0xc050
jmp 0x3aa7
movl 0x84b5(%rip), %r15d     # 0xc144
movq %rsp, %rbx
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x42ae
leaq 0x5e3a(%rip), %rdi      # 0x9ae0
movq %rbx, %rsi
movl %r15d, %edx
callq 0x42f3
xorl %edi, %edi
callq 0x384a
xorl %edi, %edi
callq 0x384a
callq 0x398a
leaq 0x8385(%rip), %rbx      # 0xc050
jmp 0x3aae
testb $0x43, %cl
jne 0x3ce5
andl $0x3ffff, %edi          # imm = 0x3FFFF
callq 0x446d
jmp 0x3aae
movq %rsp, %rdi
callq 0x461b
cmpl $0x43, (%rsp)
je 0x3aae
movl 0xc(%rsp), %esi
movslq 0x83ae(%rip), %rax      # 0xc0b0
movzbl (%rax,%rbx), %ecx
cmpl $0x2f, %ecx
je 0x3dd4
cmpl $0x2c, %ecx
jne 0x3dee
cmpl 0x8396(%rip), %esi      # 0xc0b4
je 0x3aae
cmpl $0x2, 0x6055(%rip)      # 0x9d80
jne 0x3aae
leaq 0x5d38(%rip), %rdi      # 0x9a70
movl %eax, %esi
callq 0x43c9
jmp 0x3aae
movl 0x83f2(%rip), %edx      # 0xc13c
xorl %esi, %esi
cmpl %edx, %r14d
movq %rbx, %r12
leaq 0x82f7(%rip), %rbx      # 0xc050
jge 0x3e2b
xorl %esi, %esi
movq %r13, %r14
movq %rax, 0x18(%rsp)
movq (%rax), %rcx
movsbq (%r14,%rbx), %r13
testb $0x8, 0x1(%rcx,%r13,2)
je 0x3e17
addl $-0x30, %r13d
movl 0x83b9(%rip), %ebp      # 0xc140
cmpl %ebp, %r13d
jge 0x3d94
imull %ebp, %esi
addl %r13d, %esi
jmp 0x3dbe
movl 0x8316(%rip), %esi      # 0xc0b0
movq %rsp, %r15
movq %r15, %rdi
callq 0x42ae
leaq 0x5d24(%rip), %rdi      # 0x9ad0
movq %r15, %rsi
movl %r14d, %edx
callq 0x42f3
movq 0x18(%rsp), %rax
xorl %esi, %esi
cmpl %ebp, %r13d
jge 0x3e2b
incq %r14
movslq 0x836f(%rip), %rdx      # 0xc13c
cmpq %rdx, %r14
jl 0x3d69
jmp 0x3e2b
movl %esi, 0x82da(%rip)      # 0xc0b4
movq %rbx, %rdi
xorl %edx, %edx
movl $0x4, %ecx
callq 0x3eb2
jmp 0x3aa7
movl 0x82c0(%rip), %edi      # 0xc0b4
andl $0x3ffff, %esi          # imm = 0x3FFFF
callq 0x4844
movl 0x82af(%rip), %eax      # 0xc0b4
incl %eax
andl $0xfff, %eax            # imm = 0xFFF
movl %eax, 0x82a2(%rip)      # 0xc0b4
jmp 0x3aae
movl 0x8293(%rip), %esi      # 0xc0b0
leaq 0x5c9c(%rip), %rdi      # 0x9ac0
callq 0x43c9
xorl %esi, %esi
cmpl 0x830a(%rip), %r14d     # 0xc13c
jne 0x3aa7
cmpl %esi, 0x8276(%rip)      # 0xc0b4
je 0x3aa7
cmpl $0x2, 0x5f35(%rip)      # 0x9d80
jne 0x3aa7
movl 0x8259(%rip), %esi      # 0xc0b0
leaq 0x5c12(%rip), %rdi      # 0x9a70
callq 0x43c9
jmp 0x3aa7
leaq 0x8261(%rip), %rbx      # 0xc0d0
leaq 0x81da(%rip), %rsi      # 0xc050
movq %rbx, %rdi
callq 0x2070
movq %rbx, %rdi
movl $0xa, %esi
callq 0x20a0
testq %rax, %rax
je 0x3e93
movb $0x0, (%rax)
cmpb $0x0, 0x8236(%rip)      # 0xc0d0
jne 0x3eab
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x23a0
jmp 0x3e9c