// File: /workspace/github_c_makefile_star2_O3/mist64[P]cbm6502asm/src/pass2.c
// Function: pass2
void pass2() {
	char linestat[FIRSTCHAR + 1], spec, c;
	int i;
	long filepos, fileeof;

	fileeof = ftell(file_tmp);
	fseek(file_tmp, 0L, 0);
	while ((filepos = ftell(file_tmp)) < fileeof) {
		for (c = i = 0; i < 5; i++)
			c = linestat[i] = error_field[i] = fgetc(file_tmp);
		for (; i < FIRSTCHAR; i++) c = linestat[i] = fgetc(file_tmp);
		linestat[FIRSTCHAR] = 0;
		spec = fgetc(file_tmp);
		for (c = i = 0; i < 2 * LINELENG && c != '\n'; i++)
			c = line[i] = fgetc(file_tmp);
		line[--i] = 0;
		if (spec != ' ' && spec != 'M') continue;
		addr = data = equ = 0;
		print = known = 1;
		sscanf(&linestat[21], "%8d", &linenum);
		forcelong = !isspace(linestat[17]);
		maclev = linestat[29];
		old_loc = loc_cntr;
		parselin();
		if ((spechar = spec) == 'M') {
			addr = TRUE;
			*s2 = *s3 = 0;
		}
		if (*s2 || strchr(s1, '=')) {
			if (!direct2()) {
				s1 = p1;
				s2 = p2;
				s3 = p3;
				if (*s1)
					if (good_label(s1)) get_label(s1, 1);
				opcode();
			}
		} else if (*s1)
			if (good_label(s1)) get_label(s1, 1);
		fseek(file_tmp, filepos, 0);
		outline(addr, data, d, equ, known);
		fseek(file_tmp, ftell(file_tmp), 0);
	}
	fseek(file_tmp, fileeof, 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x52db(%rip), %r15      # 0xd748
movq (%r15), %rdi
callq 0x1150
movq %rax, %rbx
movq (%r15), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x11a0
movq (%r15), %rdi
callq 0x1150
movq %rbx, (%rsp)
cmpq %rbx, %rax
jge 0x874a
leaq 0x57d0(%rip), %r13      # 0xdc70
leaq 0x5c09(%rip), %rbx      # 0xe0b0
movq %rax, 0x8(%rsp)
xorl %r14d, %r14d
movq (%r15), %rdi
callq 0x1100
movb %al, (%r13,%r14)
movb %al, 0x10(%rsp,%r14)
incq %r14
cmpq $0x5, %r14
jne 0x84af
movl $0x5, %r14d
movq (%r15), %rdi
callq 0x1100
movb %al, 0x10(%rsp,%r14)
incq %r14
cmpq $0x20, %r14
jne 0x84d0
movb $0x0, 0x30(%rsp)
movq (%r15), %rdi
callq 0x1100
movl %eax, %r14d
movl %eax, %r12d
xorl %ecx, %ecx
movq %rcx, %rbp
movq (%r15), %rdi
callq 0x1100
movb %al, (%rbx,%rbp)
leaq 0x1(%rbp), %rcx
cmpq $0x10a, %rbp            # imm = 0x10A
ja 0x851e
movzbl %al, %eax
cmpl $0xa, %eax
jne 0x84fb
movb $0x0, -0x1(%rbx,%rcx)
shll $0x18, %r14d
cmpl $0x4d000000, %r14d      # imm = 0x4D000000
je 0x853d
cmpl $0x20000000, %r14d      # imm = 0x20000000
jne 0x8707
xorl %eax, %eax
leaq 0x5d7c(%rip), %rcx      # 0xe2c2
movb %al, (%rcx)
leaq 0x5d72(%rip), %rcx      # 0xe2c1
movb %al, (%rcx)
leaq 0x5d68(%rip), %rcx      # 0xe2c0
movb %al, (%rcx)
leaq 0x5d62(%rip), %rax      # 0xe2c3
movb $0x1, (%rax)
leaq 0x5881(%rip), %rax      # 0xddec
movl $0x1, (%rax)
leaq 0x25(%rsp), %rdi
leaq 0x26c5(%rip), %rsi      # 0xac42
leaq 0x55f4(%rip), %rdx      # 0xdb78
xorl %eax, %eax
callq 0x1190
callq 0x1230
movq (%rax), %rax
movsbq 0x21(%rsp), %rcx
movzwl (%rax,%rcx,2), %eax
xorl %ecx, %ecx
btl $0xd, %eax
setae %cl
leaq 0x5513(%rip), %rax      # 0xdac0
movl %ecx, (%rax)
movb 0x2d(%rsp), %al
leaq 0x5708(%rip), %rcx      # 0xdcc2
movb %al, (%rcx)
leaq 0x524d(%rip), %rax      # 0xd810
movq (%rax), %rax
leaq 0x5803(%rip), %rcx      # 0xddd0
movq %rax, (%rcx)
xorl %eax, %eax
callq 0x4f3c
leaq 0x5638(%rip), %rax      # 0xdc16
movb %r12b, (%rax)
cmpl $0x4d000000, %r14d      # imm = 0x4D000000
jne 0x860e
leaq 0x5ccf(%rip), %rax      # 0xe2c0
movb $0x1, (%rax)
leaq 0x5aa5(%rip), %rax      # 0xe0a0
movq (%rax), %rax
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x5a8f(%rip), %rax      # 0xe098
movq (%rax), %rax
movb %cl, (%rax)
leaq 0x5a83(%rip), %rax      # 0xe098
movq (%rax), %rax
cmpb $0x0, (%rax)
jne 0x863d
leaq 0x5464(%rip), %rax      # 0xda88
movq (%rax), %r14
movq %r14, %rdi
movl $0x3d, %esi
callq 0x10d0
testq %rax, %rax
je 0x871b
xorl %eax, %eax
callq 0x30a4
testl %eax, %eax
jne 0x86ab
leaq 0x5439(%rip), %rax      # 0xda88
leaq 0x53aa(%rip), %rcx      # 0xda00
movq %rcx, (%rax)
leaq 0x5a38(%rip), %rax      # 0xe098
leaq 0x5919(%rip), %rdx      # 0xdf80
movq %rdx, (%rax)
leaq 0x5a2f(%rip), %rax      # 0xe0a0
leaq 0x5998(%rip), %rdx      # 0xe010
movq %rdx, (%rax)
cmpb $0x0, (%rcx)
je 0x86a4
leaq 0x5379(%rip), %rdi      # 0xda00
callq 0x7da0
testl %eax, %eax
je 0x86a4
leaq 0x53f1(%rip), %rax      # 0xda88
movq (%rax), %rdi
movl $0x1, %esi
callq 0x7e7b
xorl %eax, %eax
callq 0x5cd0
movq (%r15), %rdi
movq 0x8(%rsp), %rsi
xorl %edx, %edx
callq 0x11a0
leaq 0x5bff(%rip), %rax      # 0xe2c0
movsbl (%rax), %edi
leaq 0x5bf6(%rip), %rax      # 0xe2c1
movsbl (%rax), %esi
leaq 0x5bed(%rip), %rax      # 0xe2c2
movsbl (%rax), %ecx
leaq 0x5be4(%rip), %rax      # 0xe2c3
movsbl (%rax), %r8d
leaq 0x5ad6(%rip), %rdx      # 0xe1c0
callq 0x7be8
movq (%r15), %r14
movq %r14, %rdi
callq 0x1150
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x11a0
movq (%r15), %rdi
callq 0x1150
cmpq (%rsp), %rax
jl 0x84a7
jmp 0x874a
cmpb $0x0, (%r14)
je 0x86ab
movq %r14, %rdi
callq 0x7da0
testl %eax, %eax
je 0x86ab
leaq 0x5350(%rip), %rax      # 0xda88
movq (%rax), %rdi
movl $0x1, %esi
callq 0x7e7b
jmp 0x86ab
movq (%r15), %rdi
movq (%rsp), %rsi
xorl %edx, %edx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11a0
nop