// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
cmpb $0x0, 0xa076(%rip)      # 0xe0c8
jne 0x40c3
leaq 0xa075(%rip), %rdi      # 0xe0d0
leaq 0x9fee(%rip), %rsi      # 0xe050
callq 0x2070
leaq 0xa062(%rip), %rdi      # 0xe0d0
movl $0xa, %esi
callq 0x20a0
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x4089
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
cmpb $0x0, 0xa040(%rip)      # 0xe0d0
je 0x40be
movb $0x1, 0xa02f(%rip)      # 0xe0c8
movq 0x6f58(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movl 0x7cd7(%rip), %ecx      # 0xbd80
leaq 0x4749(%rip), %rsi      # 0x87f9
leaq 0xa019(%rip), %rdx      # 0xe0d0
movb $0x0, %al
callq 0x2110
jmp 0x4646
jmp 0x40c5
xorl %edi, %edi
callq 0x3e10
cmpb $0x0, 0xa05d(%rip)      # 0xe130
je 0x40da
jmp 0x4646
movslq 0x9fcf(%rip), %rcx      # 0xe0b0
leaq 0x9f68(%rip), %rax      # 0xe050
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x411f
movslq 0x9fb8(%rip), %rcx      # 0xe0b0
leaq 0x9f51(%rip), %rax      # 0xe050
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
je 0x411f
movslq 0x9fa1(%rip), %rcx      # 0xe0b0
leaq 0x9f3a(%rip), %rax      # 0xe050
movsbl (%rax,%rcx), %eax
cmpl $0x9, %eax
jne 0x413d
movslq 0x9f8a(%rip), %rcx      # 0xe0b0
leaq 0x9f23(%rip), %rax      # 0xe050
movsbl (%rax,%rcx), %eax
cmpl $0x9, %eax
je 0x413b
jmp 0x4646
jmp 0x40c5
movslq 0x9f6c(%rip), %rcx      # 0xe0b0
leaq 0x9f05(%rip), %rax      # 0xe050
movsbl (%rax,%rcx), %eax
cmpl $0x2f, %eax
jne 0x4159
jmp 0x4646
movl 0x9f51(%rip), %eax      # 0xe0b0
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl 0x9fc9(%rip), %eax      # 0xe134
jge 0x41fb
movslq -0xc(%rbp), %rcx
leaq 0x9ed4(%rip), %rax      # 0xe050
movsbl (%rax,%rcx), %eax
cmpl $0x20, %eax
je 0x41e9
movslq -0xc(%rbp), %rcx
leaq 0x9ec0(%rip), %rax      # 0xe050
movsbl (%rax,%rcx), %eax
cmpl $0xc, %eax
je 0x41e9
movslq -0xc(%rbp), %rcx
leaq 0x9eac(%rip), %rax      # 0xe050
movsbl (%rax,%rcx), %eax
cmpl $0x2f, %eax
je 0x41e9
movslq -0xc(%rbp), %rcx
leaq 0x9e98(%rip), %rax      # 0xe050
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x41e9
movslq -0xc(%rbp), %rcx
leaq 0x9e84(%rip), %rax      # 0xe050
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
je 0x41e9
movslq -0xc(%rbp), %rcx
leaq 0x9e70(%rip), %rax      # 0xe050
movsbl (%rax,%rcx), %eax
cmpl $0x9, %eax
jne 0x41eb
jmp 0x41fb
jmp 0x41ed
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x4162
movslq -0xc(%rbp), %rcx
leaq 0x9e4a(%rip), %rax      # 0xe050
movsbl (%rax,%rcx), %eax
cmpl $0x2f, %eax
jne 0x4257
callq 0x3ff0
movl %eax, -0x28(%rbp)
cmpb $0x0, 0x9f1a(%rip)      # 0xe138
jne 0x4229
movl -0x28(%rbp), %eax
movl %eax, 0x9e8b(%rip)      # 0xe0b4
movl -0x28(%rbp), %esi
leaq 0x9e1d(%rip), %rdi      # 0xe050
xorl %edx, %edx
movl $0x4, %ecx
callq 0x4650
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, 0x9e6d(%rip)      # 0xe0b8
xorl %edi, %edi
callq 0x3e10
jmp 0x40c5
movslq 0x9ede(%rip), %rax      # 0xe13c
leaq 0x9deb(%rip), %rcx      # 0xe050
movsbl (%rax,%rcx), %eax
movl %eax, -0x80(%rbp)
subl $0x2c, %eax
je 0x4284
jmp 0x4273
movl -0x80(%rbp), %eax
subl $0x3d, %eax
je 0x4486
jmp 0x450c
callq 0x68b0
cmpb $0x0, %al
je 0x4346
leaq -0x3f(%rbp), %rdi
movl 0x9e15(%rip), %esi      # 0xe0b0
movl 0x9e9b(%rip), %edx      # 0xe13c
callq 0x4b80
movq %rax, %rdi
xorl %esi, %esi
callq 0x4850
movq %rax, -0x38(%rbp)
cmpq $0x0, 0x9e04(%rip)      # 0xe0c0
je 0x42d7
movl 0x9df0(%rip), %eax      # 0xe0b4
movq 0x9df5(%rip), %rcx      # 0xe0c0
movq 0x70(%rcx), %rcx
subl 0x10(%rcx), %eax
movl %eax, -0x2c(%rbp)
jmp 0x42e0
movl 0x9dd7(%rip), %eax      # 0xe0b4
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x1, %eax
jne 0x4328
movq -0x38(%rbp), %rax
movl 0xc(%rax), %eax
cmpl -0x2c(%rbp), %eax
je 0x431d
cmpl $0x2, 0x7a7f(%rip)      # 0xbd80
jne 0x431d
movq -0x38(%rbp), %rsi
addq $0x4, %rsi
movl 0x9d9f(%rip), %edx      # 0xe0b0
leaq 0x7758(%rip), %rdi      # 0xba70
callq 0x4c10
movq -0x38(%rbp), %rax
movl (%rax), %ecx
orl $0x21, %ecx
movl %ecx, (%rax)
movl 0x9d82(%rip), %edi      # 0xe0b0
movl 0x9e08(%rip), %esi      # 0xe13c
movl -0x2c(%rbp), %edx
movl $0x9, %ecx
callq 0x4ce0
jmp 0x447a
callq 0x21b0
movq (%rax), %rax
movslq 0x9d5b(%rip), %rdx      # 0xe0b0
leaq 0x9cf4(%rip), %rcx      # 0xe050
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x4466
movl $0x0, -0x48(%rbp)
movl 0x9d2e(%rip), %eax      # 0xe0b0
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl 0x9dae(%rip), %eax      # 0xe13c
jge 0x4431
callq 0x21b0
movq (%rax), %rax
movslq -0x44(%rbp), %rdx
leaq 0x9ca9(%rip), %rcx      # 0xe050
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x4406
movslq -0x44(%rbp), %rcx
leaq 0x9c89(%rip), %rax      # 0xe050
movsbl (%rax,%rcx), %eax
subl $0x30, %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl 0x9d66(%rip), %eax      # 0xe140
jl 0x43f4
movl -0x44(%rbp), %esi
leaq 0x76ea(%rip), %rdi      # 0xbad0
callq 0x4d20
movl $0x0, -0x48(%rbp)
jmp 0x4431
movl -0x48(%rbp), %eax
imull 0x9d42(%rip), %eax      # 0xe140
addl -0x4c(%rbp), %eax
movl %eax, -0x48(%rbp)
jmp 0x4421
movl 0x9ca4(%rip), %esi      # 0xe0b0
leaq 0x76ad(%rip), %rdi      # 0xbac0
callq 0x4d20
movl $0x0, -0x48(%rbp)
jmp 0x4431
jmp 0x4423
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x4385
movl -0x44(%rbp), %eax
cmpl 0x9d02(%rip), %eax      # 0xe13c
jne 0x4464
movl 0x9c72(%rip), %eax      # 0xe0b4
cmpl -0x48(%rbp), %eax
je 0x4462
cmpl $0x2, 0x7932(%rip)      # 0xbd80
jne 0x4462
movl 0x9c5a(%rip), %esi      # 0xe0b0
leaq 0x7613(%rip), %rdi      # 0xba70
callq 0x4d20
jmp 0x4464
jmp 0x4478
movl 0x9c44(%rip), %esi      # 0xe0b0
leaq 0x763d(%rip), %rdi      # 0xbab0
callq 0x4d20
jmp 0x447a
xorl %edi, %edi
callq 0x3e10
jmp 0x40c5
callq 0x68b0
cmpb $0x0, %al
je 0x44e2
movl 0x9c1b(%rip), %eax      # 0xe0b0
movl %eax, -0x50(%rbp)
movl 0x9c9e(%rip), %eax      # 0xe13c
movl %eax, -0x54(%rbp)
xorl %edi, %edi
callq 0x3e10
xorl %edi, %edi
callq 0x3e10
callq 0x3ff0
movl %eax, -0x58(%rbp)
movl -0x50(%rbp), %edi
movl -0x54(%rbp), %esi
movl -0x58(%rbp), %edx
movl $0x1, %ecx
callq 0x4ce0
movl -0x58(%rbp), %edx
leaq 0x9b7c(%rip), %rdi      # 0xe050
xorl %esi, %esi
movl $0x1, %ecx
callq 0x4650
jmp 0x4507
movl 0x9c5c(%rip), %esi      # 0xe144
leaq 0x75f1(%rip), %rdi      # 0xbae0
callq 0x4d20
xorl %edi, %edi
callq 0x3e10
xorl %edi, %edi
callq 0x3e10
callq 0x3ff0
jmp 0x40c5
callq 0x68b0
cmpb $0x0, %al
je 0x4578
callq 0x4d70
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x60(%rbp), %rax
movl (%rax), %eax
andl $0x101, %eax            # imm = 0x101
cmpl $0x101, %eax            # imm = 0x101
jne 0x4553
movl -0x64(%rbp), %edi
callq 0x3aa0
cmpl $0x0, %eax
jne 0x454e
xorl %edi, %edi
callq 0x3e10
jmp 0x40c5
movq -0x60(%rbp), %rax
movl (%rax), %eax
andl $0x43, %eax
cmpl $0x43, %eax
jne 0x4574
movl -0x64(%rbp), %edi
andl $0x3ffff, %edi          # imm = 0x3FFFF
callq 0x4e00
jmp 0x40c5
jmp 0x4576
jmp 0x4578
leaq -0x7c(%rbp), %rdi
callq 0x5020
movq -0x7c(%rbp), %rax
movq %rax, -0x24(%rbp)
movq -0x74(%rbp), %rax
movq %rax, -0x1c(%rbp)
movq -0x6c(%rbp), %rax
movq %rax, -0x14(%rbp)
cmpl $0x43, -0x24(%rbp)
je 0x4641
movslq 0x9b06(%rip), %rcx      # 0xe0b0
leaq 0x9a9f(%rip), %rax      # 0xe050
movsbl (%rax,%rcx), %eax
cmpl $0x2c, %eax
jne 0x45e2
movl -0x18(%rbp), %eax
cmpl 0x9af1(%rip), %eax      # 0xe0b4
je 0x45e0
cmpl $0x2, 0x77b4(%rip)      # 0xbd80
jne 0x45e0
movl 0x9adc(%rip), %esi      # 0xe0b0
leaq 0x7495(%rip), %rdi      # 0xba70
callq 0x4d20
jmp 0x463f
movslq 0x9ac7(%rip), %rcx      # 0xe0b0
leaq 0x9a60(%rip), %rax      # 0xe050
movsbl (%rax,%rcx), %eax
cmpl $0x2f, %eax
jne 0x4624
movl -0x18(%rbp), %eax
movl %eax, 0x9ab2(%rip)      # 0xe0b4
movl 0x9aac(%rip), %esi      # 0xe0b4
leaq 0x9a41(%rip), %rdi      # 0xe050
xorl %edx, %edx
movl $0x4, %ecx
callq 0x4650
xorl %edi, %edi
callq 0x3e10
jmp 0x463d
movl 0x9a8a(%rip), %edi      # 0xe0b4
movl -0x18(%rbp), %esi
andl $0x3ffff, %esi          # imm = 0x3FFFF
callq 0x5300
callq 0x5340
jmp 0x463f
jmp 0x4641
jmp 0x40c5
addq $0x80, %rsp
popq %rbp
retq
nop