// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
leaq 0x4e69(%rip), %rax      # 0x10738
movq (%rax), %rdi
callq 0x1130
movq %rax, -0x48(%rbp)
leaq 0x4e56(%rip), %rax      # 0x10738
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x1180
leaq 0x4e41(%rip), %rax      # 0x10738
movq (%rax), %rdi
callq 0x1130
movq %rax, -0x40(%rbp)
cmpq -0x48(%rbp), %rax
jge 0xbc6b
movl $0x0, -0x38(%rbp)
movb $0x0, -0x32(%rbp)
cmpl $0x5, -0x38(%rbp)
jge 0xb951
leaq 0x4e13(%rip), %rax      # 0x10738
movq (%rax), %rdi
callq 0x10f0
movslq -0x38(%rbp), %rdx
leaq 0x5328(%rip), %rcx      # 0x10c60
movb %al, (%rcx,%rdx)
movslq -0x38(%rbp), %rcx
movb %al, -0x30(%rbp,%rcx)
movb %al, -0x32(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xb918
jmp 0xb953
cmpl $0x20, -0x38(%rbp)
jge 0xb97e
leaq 0x4dd8(%rip), %rax      # 0x10738
movq (%rax), %rdi
callq 0x10f0
movslq -0x38(%rbp), %rcx
movb %al, -0x30(%rbp,%rcx)
movb %al, -0x32(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xb953
movb $0x0, -0x10(%rbp)
leaq 0x4daf(%rip), %rax      # 0x10738
movq (%rax), %rdi
callq 0x10f0
movb %al, -0x31(%rbp)
movl $0x0, -0x38(%rbp)
movb $0x0, -0x32(%rbp)
xorl %eax, %eax
cmpl $0x10c, -0x38(%rbp)     # imm = 0x10C
movb %al, -0x49(%rbp)
jge 0xb9ba
movsbl -0x32(%rbp), %eax
cmpl $0xa, %eax
setne %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0xb9c3
jmp 0xb9ee
leaq 0x4d6e(%rip), %rax      # 0x10738
movq (%rax), %rdi
callq 0x10f0
movslq -0x38(%rbp), %rdx
leaq 0x56c3(%rip), %rcx      # 0x110a0
movb %al, (%rcx,%rdx)
movb %al, -0x32(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xb99f
movl -0x38(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x38(%rbp)
movslq %eax, %rcx
leaq 0x569f(%rip), %rax      # 0x110a0
movb $0x0, (%rax,%rcx)
movsbl -0x31(%rbp), %eax
cmpl $0x20, %eax
je 0xba1c
movsbl -0x31(%rbp), %eax
cmpl $0x4d, %eax
je 0xba1c
jmp 0xb8f0
leaq 0x588f(%rip), %rax      # 0x112b2
movb $0x0, (%rax)
leaq 0x5884(%rip), %rax      # 0x112b1
movb $0x0, (%rax)
leaq 0x5879(%rip), %rax      # 0x112b0
movb $0x0, (%rax)
leaq 0x5872(%rip), %rax      # 0x112b3
movb $0x1, (%rax)
leaq 0x5391(%rip), %rax      # 0x10ddc
movl $0x1, (%rax)
leaq -0x30(%rbp), %rdi
addq $0x15, %rdi
leaq 0x214d(%rip), %rsi      # 0xdbad
leaq 0x5101(%rip), %rdx      # 0x10b68
movb $0x0, %al
callq 0x1170
callq 0x1200
movq (%rax), %rax
movsbl -0x1f(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %ecx
leaq 0x5016(%rip), %rax      # 0x10ab0
movl %ecx, (%rax)
movb -0x13(%rbp), %cl
leaq 0x520c(%rip), %rax      # 0x10cb2
movb %cl, (%rax)
leaq 0x4d51(%rip), %rax      # 0x10800
movq (%rax), %rcx
leaq 0x5307(%rip), %rax      # 0x10dc0
movq %rcx, (%rax)
movb $0x0, %al
callq 0x6cb0
movb -0x31(%rbp), %al
leaq 0x5139(%rip), %rcx      # 0x10c06
movb %al, (%rcx)
movsbl %al, %eax
cmpl $0x4d, %eax
jne 0xbafb
leaq 0x57d2(%rip), %rax      # 0x112b0
movb $0x1, (%rax)
leaq 0x55a8(%rip), %rax      # 0x11090
movq (%rax), %rax
movb $0x0, (%rax)
leaq 0x5593(%rip), %rax      # 0x11088
movq (%rax), %rax
movb $0x0, (%rax)
leaq 0x5586(%rip), %rax      # 0x11088
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xbb2b
leaq 0x4f64(%rip), %rax      # 0x10a78
movq (%rax), %rdi
movl $0x3d, %esi
callq 0x10c0
cmpq $0x0, %rax
je 0xbbac
movb $0x0, %al
callq 0x3eb0
cmpl $0x0, %eax
jne 0xbbaa
leaq 0x4f3a(%rip), %rax      # 0x10a78
leaq 0x4eab(%rip), %rcx      # 0x109f0
movq %rcx, (%rax)
leaq 0x5539(%rip), %rax      # 0x11088
leaq 0x541a(%rip), %rcx      # 0x10f70
movq %rcx, (%rax)
leaq 0x5530(%rip), %rax      # 0x11090
leaq 0x5499(%rip), %rcx      # 0x11000
movq %rcx, (%rax)
leaq 0x4f07(%rip), %rax      # 0x10a78
movq (%rax), %rax
cmpb $0x0, (%rax)
je 0xbba3
leaq 0x4ef8(%rip), %rax      # 0x10a78
movq (%rax), %rdi
callq 0xafb0
cmpl $0x0, %eax
je 0xbba1
leaq 0x4ee4(%rip), %rax      # 0x10a78
movq (%rax), %rdi
movl $0x1, %esi
callq 0xb100
jmp 0xbba3
movb $0x0, %al
callq 0x8100
jmp 0xbbe7
leaq 0x4ec5(%rip), %rax      # 0x10a78
movq (%rax), %rax
cmpb $0x0, (%rax)
je 0xbbe5
leaq 0x4eb6(%rip), %rax      # 0x10a78
movq (%rax), %rdi
callq 0xafb0
cmpl $0x0, %eax
je 0xbbe3
leaq 0x4ea2(%rip), %rax      # 0x10a78
movq (%rax), %rdi
movl $0x1, %esi
callq 0xb100
jmp 0xbbe5
jmp 0xbbe7
leaq 0x4b4a(%rip), %rax      # 0x10738
movq (%rax), %rdi
movq -0x40(%rbp), %rsi
xorl %edx, %edx
callq 0x1180
leaq 0x56ad(%rip), %rax      # 0x112b0
movb (%rax), %dil
leaq 0x56a4(%rip), %rax      # 0x112b1
movb (%rax), %sil
leaq 0x569b(%rip), %rax      # 0x112b2
movb (%rax), %cl
leaq 0x5590(%rip), %rdx      # 0x111b0
leaq 0x568c(%rip), %rax      # 0x112b3
movsbl %dil, %edi
movsbl %sil, %esi
movsbl %cl, %ecx
movsbl (%rax), %r8d
callq 0xacb0
leaq 0x4af6(%rip), %rax      # 0x10738
movq (%rax), %rax
movq %rax, -0x58(%rbp)
leaq 0x4ae8(%rip), %rax      # 0x10738
movq (%rax), %rdi
callq 0x1130
movq -0x58(%rbp), %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x1180
jmp 0xb8f0
leaq 0x4ac6(%rip), %rax      # 0x10738
movq (%rax), %rdi
movq -0x48(%rbp), %rsi
xorl %edx, %edx
callq 0x1180
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)