// File: /workspace/github_c_makefile_star2_O2/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 $0x18, %rsp
cmpb $0x0, 0x89db(%rip)      # 0xc0c8
je 0x3a65
leaq 0x8956(%rip), %rbx      # 0xc050
movabsq $0x800100001601, %r12   # imm = 0x800100001601
xorl %edi, %edi
callq 0x3575
cmpb $0x0, 0x8a1e(%rip)      # 0xc130
jne 0x3a97
movslq 0x8991(%rip), %r14      # 0xc0b0
movzbl (%r14,%rbx), %eax
cmpl $0x9, %eax
je 0x3704
testl %eax, %eax
je 0x3a97
cmpl $0xa, %eax
je 0x3a97
cmpl $0x2f, %eax
je 0x3a97
movsbq %al, %r15
movslq 0x89e6(%rip), %rax      # 0xc134
cmpl %r14d, %eax
movl %r14d, %r13d
cmovgl %eax, %r13d
movq %r14, %rcx
cmpq %rax, %rcx
jge 0x3778
movzbl (%rcx,%rbx), %edx
cmpq $0x2f, %rdx
ja 0x3770
btq %rdx, %r12
jb 0x3775
incq %rcx
jmp 0x375b
movl %ecx, %r13d
movslq %r13d, %rax
cmpb $0x2f, (%rax,%rbx)
jne 0x37ba
callq 0x369a
cmpb $0x0, 0x89ab(%rip)      # 0xc138
jne 0x3795
movl %eax, 0x891f(%rip)      # 0xc0b4
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
pushq $0x4
popq %rcx
callq 0x3ae0
incl %r13d
movl %r13d, 0x890a(%rip)     # 0xc0b8
xorl %edi, %edi
callq 0x3575
jmp 0x3704
movslq 0x897b(%rip), %r13      # 0xc13c
movzbl (%r13,%rbx), %ebp
callq 0x50c2
cmpl $0x3d, %ebp
je 0x3873
cmpl $0x2c, %ebp
jne 0x38b7
testb %al, %al
je 0x38e4
movq %rsp, %r15
movq %r15, %rdi
movl %r14d, %esi
movl %r13d, %edx
callq 0x3e5d
movq %r15, %rdi
xorl %esi, %esi
callq 0x3c2e
movq %rax, %r15
movq 0x88b5(%rip), %rax      # 0xc0c0
movl 0x88a2(%rip), %r14d     # 0xc0b4
testq %rax, %rax
je 0x381f
movq 0x70(%rax), %rax
subl 0x10(%rax), %r14d
movl (%r15), %eax
testb $0x1, %al
je 0x3857
cmpl %r14d, 0xc(%r15)
je 0x3851
cmpl $0x2, 0x654d(%rip)      # 0x9d80
jne 0x3851
movq %r15, %rsi
addq $0x4, %rsi
movl 0x886e(%rip), %edx      # 0xc0b0
leaq 0x6227(%rip), %rdi      # 0x9a70
callq 0x3ea0
movl (%r15), %eax
orl $0x21, %eax
movl %eax, (%r15)
movl 0x8853(%rip), %edi      # 0xc0b0
movl 0x88d9(%rip), %esi      # 0xc13c
movl %r14d, %edx
pushq $0x9
popq %rcx
callq 0x3f3c
jmp 0x37ae
testb %al, %al
je 0x390c
xorl %edi, %edi
callq 0x3575
xorl %edi, %edi
callq 0x3575
callq 0x369a
movl %eax, %r15d
movl %r14d, %edi
movl %r13d, %esi
movl %eax, %edx
pushq $0x1
popq %rbp
movl %ebp, %ecx
callq 0x3f3c
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
movl %ebp, %ecx
callq 0x3ae0
jmp 0x3704
testb %al, %al
je 0x394b
callq 0x3fb4
movl (%rax), %ecx
movl 0xc(%rax), %edi
notl %ecx
testw $0x101, %cx             # imm = 0x101
jne 0x3936
callq 0x339f
testl %eax, %eax
jne 0x3704
jmp 0x37ae
callq 0x21b0
movq (%rax), %rcx
testb $0x8, 0x1(%rcx,%r15,2)
jne 0x39a2
leaq 0x61b1(%rip), %rdi      # 0x9ab0
movl %r14d, %esi
callq 0x3f76
jmp 0x37ae
movl 0x8832(%rip), %esi      # 0xc144
leaq 0x61c7(%rip), %rdi      # 0x9ae0
callq 0x3f76
xorl %edi, %edi
callq 0x3575
xorl %edi, %edi
callq 0x3575
callq 0x369a
jmp 0x3704
testb $0x43, %cl
jne 0x394b
andl $0x3ffff, %edi          # imm = 0x3FFFF
callq 0x401a
jmp 0x3704
movq %rsp, %rdi
callq 0x41c3
cmpl $0x43, (%rsp)
je 0x3704
movl 0xc(%rsp), %esi
movslq 0x8748(%rip), %rax      # 0xc0b0
movzbl (%rax,%rbx), %ecx
cmpl $0x2f, %ecx
je 0x39cf
cmpl $0x2c, %ecx
jne 0x39e7
cmpl 0x8738(%rip), %esi      # 0xc0b4
je 0x3704
cmpl $0x2, 0x63f7(%rip)      # 0x9d80
jne 0x3704
leaq 0x60da(%rip), %rdi      # 0x9a70
movl %eax, %esi
callq 0x3f76
jmp 0x3704
xorl %eax, %eax
movl 0x8796(%rip), %edx      # 0xc140
movq %r14, %r15
cmpq %r13, %r15
jge 0x3a2d
movsbq (%r15,%rbx), %rsi
testb $0x8, 0x1(%rcx,%rsi,2)
je 0x3a10
addl $-0x30, %esi
cmpl %edx, %esi
jge 0x3a1c
imull %edx, %eax
addl %esi, %eax
incq %r15
jmp 0x39ad
movl %esi, 0x86df(%rip)      # 0xc0b4
movq %rbx, %rdi
xorl %edx, %edx
pushq $0x4
popq %rcx
callq 0x3ae0
jmp 0x37ae
movl 0x86c7(%rip), %edi      # 0xc0b4
andl $0x3ffff, %esi          # imm = 0x3FFFF
callq 0x433c
movl 0x86b6(%rip), %eax      # 0xc0b4
incl %eax
andl $0xfff, %eax            # imm = 0xFFF
movl %eax, 0x86a9(%rip)      # 0xc0b4
jmp 0x3704
leaq 0x60a9(%rip), %rdi      # 0x9ac0
movl %r14d, %esi
jmp 0x3a26
leaq 0x60ad(%rip), %rdi      # 0x9ad0
movl %r15d, %esi
callq 0x3f76
xorl %eax, %eax
cmpl 0x8708(%rip), %r15d     # 0xc13c
jne 0x37ae
cmpl %eax, 0x8674(%rip)      # 0xc0b4
je 0x37ae
cmpl $0x2, 0x6333(%rip)      # 0x9d80
jne 0x37ae
movl 0x8657(%rip), %esi      # 0xc0b0
leaq 0x6010(%rip), %rdi      # 0x9a70
jmp 0x3902
leaq 0x8664(%rip), %rbx      # 0xc0d0
leaq 0x85dd(%rip), %rsi      # 0xc050
movq %rbx, %rdi
callq 0x2070
pushq $0xa
popq %rsi
movq %rbx, %rdi
callq 0x20a0
testq %rax, %rax
je 0x3a8e
movb $0x0, (%rax)
cmpb $0x0, 0x863b(%rip)      # 0xc0d0
jne 0x3aa6
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, 0x861b(%rip)      # 0xc0c8
movq 0x5544(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
movl 0x62c3(%rip), %ecx      # 0x9d80
leaq 0x2c11(%rip), %rsi      # 0x66d5
leaq 0x8605(%rip), %rdx      # 0xc0d0
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2110