// File: /workspace/github_c_makefile_star2_O3/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, 0x863c(%rip)      # 0xc0c8
je 0x3f18
xorl %edi, %edi
callq 0x3911
cmpb $0x0, 0x8690(%rip)      # 0xc130
jne 0x3f4c
leaq 0x85a3(%rip), %rbx      # 0xc050
movabsq $0x800100001601, %rbp   # imm = 0x800100001601
movl 0x85f2(%rip), %r12d     # 0xc0b0
movslq %r12d, %r14
movb (%r14,%rbx), %r15b
movzbl %r15b, %eax
cmpl $0x9, %eax
jg 0x3add
je 0x3b65
testl %eax, %eax
jne 0x3aef
jmp 0x3f4c
cmpl $0xa, %eax
je 0x3f4c
cmpl $0x2f, %eax
je 0x3f4c
movl 0x863f(%rip), %eax      # 0xc134
movl %r15d, %ecx
movl %r12d, %r13d
cmpl %eax, %r12d
jge 0x3b2a
leaq (%rbx,%r14), %rcx
movl %r12d, %r13d
movzbl (%rcx), %edx
cmpq $0x2f, %rdx
ja 0x3b16
btq %rdx, %rbp
jb 0x3b24
incl %r13d
incq %rcx
cmpl %r13d, %eax
jne 0x3b07
movl %eax, %r13d
movslq %r13d, %rax
movb (%rax,%rbx), %cl
cmpb $0x2f, %cl
jne 0x3b7e
callq 0x3a39
cmpb $0x0, 0x85fd(%rip)      # 0xc138
jne 0x3b43
movl %eax, 0x8571(%rip)      # 0xc0b4
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
movl $0x4, %ecx
callq 0x3f62
incl %r13d
movl %r13d, 0x855a(%rip)     # 0xc0b8
xorl %edi, %edi
callq 0x3911
xorl %edi, %edi
callq 0x3911
cmpb $0x0, 0x85bd(%rip)      # 0xc130
je 0x3ab7
jmp 0x3f4c
movq %rbx, %rax
movq %rbp, %rbx
movslq 0x85b1(%rip), %r13      # 0xc13c
movzbl (%r13,%rax), %ebp
callq 0x5721
cmpl $0x3d, %ebp
je 0x3c66
cmpl $0x2c, %ebp
jne 0x3ccb
testb %al, %al
je 0x3d07
leaq 0x21(%rsp), %r14
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x430e
movq %r14, %rdi
xorl %esi, %esi
callq 0x40cf
movq %rax, %r12
movq 0x84e9(%rip), %rax      # 0xc0c0
movl 0x84d6(%rip), %r15d     # 0xc0b4
testq %rax, %rax
je 0x3beb
movq 0x70(%rax), %rax
subl 0x10(%rax), %r15d
movq %rbx, %rbp
movl (%r12), %eax
testb $0x1, %al
leaq 0x8455(%rip), %rbx      # 0xc050
je 0x3c31
cmpl %r15d, 0xc(%r12)
je 0x3c2a
cmpl $0x2, 0x6175(%rip)      # 0x9d80
jne 0x3c2a
movq %r12, %rsi
addq $0x4, %rsi
movl 0x8496(%rip), %edx      # 0xc0b0
leaq 0x5e4f(%rip), %rdi      # 0x9a70
callq 0x4353
movl (%r12), %eax
orl $0x21, %eax
movl %eax, (%r12)
movl 0x8478(%rip), %r12d     # 0xc0b0
movl 0x84fe(%rip), %edx      # 0xc13c
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl %r12d, %esi
callq 0x430e
movq %r14, %rdi
movl %r15d, %esi
movl $0x9, %edx
movl %r12d, %ecx
callq 0x292b
jmp 0x3b5e
testb %al, %al
movq %rbx, %rbp
je 0x3d53
xorl %edi, %edi
callq 0x3911
xorl %edi, %edi
callq 0x3911
callq 0x3a39
movl %eax, %r15d
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x430e
movq %rbx, %rdi
movl %r15d, %esi
movl $0x1, %edx
movl %r12d, %ecx
callq 0x292b
leaq 0x839c(%rip), %rbx      # 0xc050
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
movl $0x1, %ecx
callq 0x3f62
jmp 0x3b65
testb %al, %al
movq %rbx, %rbp
leaq 0x8379(%rip), %rbx      # 0xc050
je 0x3db3
callq 0x4467
movl (%rax), %ecx
movl 0xc(%rax), %edi
notl %ecx
testl $0x101, %ecx            # imm = 0x101
jne 0x3d9e
callq 0x3648
testl %eax, %eax
jne 0x3b65
jmp 0x3b5e
movsbq %r15b, %r15
callq 0x21b0
movq (%rax), %rcx
testb $0x8, 0x1(%rcx,%r15,2)
movq %rbx, %rbp
jne 0x3e15
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x430e
leaq 0x5d74(%rip), %rdi      # 0x9ab0
movq %rbx, %rsi
movl %r12d, %edx
callq 0x4353
leaq 0x8302(%rip), %rbx      # 0xc050
jmp 0x3b5e
movl 0x83ea(%rip), %r15d     # 0xc144
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x430e
leaq 0x5d6c(%rip), %rdi      # 0x9ae0
movq %rbx, %rsi
movl %r15d, %edx
callq 0x4353
xorl %edi, %edi
callq 0x3911
xorl %edi, %edi
callq 0x3911
callq 0x3a39
leaq 0x82b7(%rip), %rbx      # 0xc050
jmp 0x3b65
testb $0x43, %cl
jne 0x3db3
andl $0x3ffff, %edi          # imm = 0x3FFFF
callq 0x44cd
jmp 0x3b65
leaq 0x8(%rsp), %rdi
callq 0x4691
cmpl $0x43, 0x8(%rsp)
je 0x3b65
movl 0x14(%rsp), %esi
movslq 0x82dd(%rip), %rax      # 0xc0b0
movzbl (%rax,%rbx), %ecx
cmpl $0x2f, %ecx
je 0x3e60
cmpl $0x2c, %ecx
jne 0x3e7a
cmpl 0x82c5(%rip), %esi      # 0xc0b4
je 0x3b65
cmpl $0x2, 0x5f84(%rip)      # 0x9d80
jne 0x3b65
leaq 0x5c67(%rip), %rdi      # 0x9a70
movl %eax, %esi
callq 0x4429
jmp 0x3b65
xorl %eax, %eax
cmpl %r13d, %r12d
leaq 0x822f(%rip), %rbx      # 0xc050
jge 0x3e5b
movl 0x8317(%rip), %edx      # 0xc140
addq %rbx, %r14
xorl %eax, %eax
movl %r12d, %r15d
movsbq (%r14), %rsi
testb $0x8, 0x1(%rcx,%rsi,2)
je 0x3ea3
addl $-0x30, %esi
cmpl %edx, %esi
jge 0x3eb4
imull %edx, %eax
addl %esi, %eax
incl %r15d
incq %r14
cmpl %r15d, %r13d
jne 0x3e31
movl %r13d, %r15d
jmp 0x3edb
movl %r12d, %r15d
jmp 0x3edb
movl %esi, 0x824e(%rip)      # 0xc0b4
movq %rbx, %rdi
xorl %edx, %edx
movl $0x4, %ecx
callq 0x3f62
jmp 0x3b5e
movl 0x8234(%rip), %edi      # 0xc0b4
andl $0x3ffff, %esi          # imm = 0x3FFFF
callq 0x48b2
movl 0x8223(%rip), %eax      # 0xc0b4
incl %eax
andl $0xfff, %eax            # imm = 0xFFF
movl %eax, 0x8216(%rip)      # 0xc0b4
jmp 0x3b65
leaq 0x5c16(%rip), %rdi      # 0x9ac0
movl %r12d, %esi
callq 0x4429
jmp 0x3ed9
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x430e
leaq 0x5c02(%rip), %rdi      # 0x9ad0
movq %r14, %rsi
movl %r15d, %edx
callq 0x4353
xorl %eax, %eax
cmpl 0x825a(%rip), %r15d     # 0xc13c
jne 0x3b5e
cmpl %eax, 0x81c6(%rip)      # 0xc0b4
je 0x3b5e
cmpl $0x2, 0x5e85(%rip)      # 0x9d80
jne 0x3b5e
movl 0x81a9(%rip), %esi      # 0xc0b0
leaq 0x5b62(%rip), %rdi      # 0x9a70
callq 0x4429
jmp 0x3b5e
leaq 0x81b1(%rip), %rbx      # 0xc0d0
leaq 0x812a(%rip), %rsi      # 0xc050
movq %rbx, %rdi
callq 0x2070
movq %rbx, %rdi
movl $0xa, %esi
callq 0x20a0
testq %rax, %rax
je 0x3f43
movb $0x0, (%rax)
cmpb $0x0, 0x8186(%rip)      # 0xc0d0
jne 0x3f5b
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x23a0
jmp 0x3f4c