// File: /workspace/github_c_makefile_star2_O3/mist64[P]cbm6502asm/src/pass1.c
// Function: pass1
void pass1(char *macprmbgn, char **maclinptr, char *macargbgn) {
	int done, macro, savprint;

	incl_sp = MAXINCL;
	while (incl_sp <= MAXINCL) { /* consider nested includes */

		while (get_line(macprmbgn, maclinptr, macargbgn) !=
		       EOF) { /* read to end of file or macro */
			old_loc =
			        loc_cntr; /* save location couter for listing */
			macro = wrt = addr = data = equ = 0;
			print = known = 1; /* unless otherwise determined */

			if ((done = (*line == ';'))) /* don't process comments */
				spechar = *line;

			if (!*line) done = spechar = '1';

			if ((!*s2 || *s2 == ';') && condit && !done &&
			    !strchr(s1, '=')) {
				if (good_label(s1)) /* only label on line */
					get_label(s1, 1);
				done = 1;
			}

			s2[31] = 0;
			tmpmac = macro_head;
			while (tmpmac && !done &&
			       condit) { /* check if this is a macro expansion
				          */
				if (!strcmp(s2, tmpmac->name)) { /* is this a
					                            macro? */
					char *p;      /* temporary use to copy
					                 argument list */
					char *prmbgn; /* pointer to beginning of
					                 parameter list */
					char *defbgn; /* pointer to beginning of
					                 macro definition */
					char *argbgn; /* pointer to beginning of
					                 argument list */
					/* use heap for argument list - don't
					 * fill up stack */
					if (*s1)
						if (good_label(s1))
							get_label(s1, 1);
					p = argbgn =
					        (char *)malloc(strlen(s3) + 50);
					if (!p)
						error_msg(
						        "Memory allocation "
						        "failure during macro "
						        "expansion.",
						        "", 4);
					prmbgn = tmpmac->name;
					while (*prmbgn++)
						; /* point to start of parameter
						     list */
					defbgn = prmbgn + 2;
					while (*(defbgn - 1) || *(defbgn - 2))
						defbgn++; /* starts just after
						             the double null */
					parses3(1);       /* argument list */
					while (*s3 ||
					       *(s3 + 1)) /* copy arg list until
					                     double null */
						*p++ = *s3++;
					*p++ = 0;
					*p = 0;
					if (angleb | squote | dquote)
						display_error(
						        error = 'B'); /* unbalanced
						                         ",', or
						                         <> */
					print = macro = 1;
					spechar = 'M';
					outline((char)1, (char)0, (char *)0,
					        (char)0, (char)1);
					macrolevel++; /* increment macro depth
					               */
					int incl_sp_copy = incl_sp;
					pass1(prmbgn, &defbgn, argbgn);
					incl_sp = incl_sp_copy;
					macrolevel--; /* finished with macro */
					free(argbgn); /* free memory used for
					                 arguments */
					break; /* macro found - stop searching
					        */
				}
				tmpmac = tmpmac->nextmac; /* not this macro -
				                             try next if any */
			}
			if (macro) continue;
			if (!done) {
				savprint = print; /* save print flag - directive
				                     changes it */
				if (!direct1(macprmbgn, maclinptr,
				             macargbgn)) /* asm directive */
					if (!direct2()) {
						print = savprint; /* restore
						                     print flag
						                     if not
						                     directive
						                   */
						s1 = p1;
						s2 = p2;
						s3 = p3;
						if (*p1)
							if (good_label(p1))
								get_label(p1,
								          1);
						opcode(); /* better be an
						             instruction */
					}
			}

			if (!condit) print &= clist;
			outline(addr, data, d, equ, known);
		}
		if (macrolevel) return;
		fclose(file_src);
		if (incl_sp < MAXINCL) {
			strcpy(srcfile, &filename[fnptr = filnamptr[incl_sp]]);
			fprintf(file_tmp, "%32.32sF%s\n", STATLINE, srcfile);
		}
		file_src = incl_stack[incl_sp++];
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
leaq 0x5fca(%rip), %rax      # 0xdf78
movl $0x6, (%rax)
leaq 0x5855(%rip), %r13      # 0xd810
leaq 0x60d6(%rip), %r15      # 0xe098
leaq 0x60d7(%rip), %rbx      # 0xe0a0
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0x5663
cmpl $-0x1, %eax
je 0x839d
movq (%r13), %rax
leaq 0x5ddf(%rip), %rcx      # 0xddd0
movq %rax, (%rcx)
xorl %ebp, %ebp
leaq 0x62c5(%rip), %rax      # 0xe2c2
movb %bpl, (%rax)
leaq 0x62ba(%rip), %rax      # 0xe2c1
movb %bpl, (%rax)
leaq 0x62af(%rip), %rax      # 0xe2c0
movb %bpl, (%rax)
leaq 0x5dc1(%rip), %rax      # 0xdddc
movl $0x0, (%rax)
leaq 0x629b(%rip), %rax      # 0xe2c3
movb $0x1, (%rax)
leaq 0x5dba(%rip), %rax      # 0xddec
movl $0x1, (%rax)
leaq 0x6071(%rip), %rax      # 0xe0b0
movzbl (%rax), %ecx
cmpl $0x3b, %ecx
je 0x8056
movb $0x1, %al
testl %ecx, %ecx
jne 0x8066
movl $0x31, %ebp
movb $0x31, %cl
jmp 0x805b
movl $0x1, %ebp
leaq 0x5bb4(%rip), %rax      # 0xdc16
movb %cl, (%rax)
xorl %eax, %eax
movq (%r15), %rcx
movb (%rcx), %cl
testb %cl, %cl
je 0x808a
cmpb $0x3b, %cl
sete %cl
leaq 0x5aec(%rip), %rdx      # 0xdb68
cmpl $0x0, (%rdx)
setne %dl
andb %cl, %dl
testb %dl, %al
jne 0x809d
jmp 0x80e7
leaq 0x5ad7(%rip), %rcx      # 0xdb68
cmpl $0x0, (%rcx)
sete %cl
xorb $0x1, %al
orb %cl, %al
jne 0x80e7
leaq 0x59e4(%rip), %rax      # 0xda88
movq (%rax), %r12
movq %r12, %rdi
movl $0x3d, %esi
callq 0x10d0
xorl %ebp, %ebp
testq %rax, %rax
jne 0x80e7
movq %r12, %rdi
callq 0x7da0
testl %eax, %eax
je 0x80e2
leaq 0x59ba(%rip), %rax      # 0xda88
movq (%rax), %rdi
movl $0x1, %ebp
movl $0x1, %esi
callq 0x7e7b
jmp 0x80e7
movl $0x1, %ebp
movq (%r15), %r12
movb $0x0, 0x1f(%r12)
leaq 0x5a71(%rip), %rax      # 0xdb68
movl (%rax), %r14d
leaq 0x59a7(%rip), %r15      # 0xdaa8
movq (%r15), %r15
leaq 0x5b6d(%rip), %rax      # 0xdc78
movq %r15, (%rax)
testl %ebp, %ebp
jne 0x81ce
testq %r15, %r15
je 0x81ce
testl %r14d, %r14d
je 0x81ce
leaq 0xc(%r15), %rsi
movq %r12, %rdi
callq 0x1130
testl %eax, %eax
jne 0x8101
leaq 0x5949(%rip), %rax      # 0xda88
movq (%rax), %rdi
cmpb $0x0, (%rdi)
je 0x8164
callq 0x7da0
testl %eax, %eax
je 0x8164
leaq 0x5931(%rip), %rax      # 0xda88
movq (%rax), %rdi
movl $0x1, %esi
callq 0x7e7b
movq (%rbx), %rdi
callq 0x10b0
leaq 0x32(%rax), %rdi
callq 0x1180
movq %rax, %rbp
testq %rax, %rax
jne 0x8195
leaq 0x2a80(%rip), %rdi      # 0xac04
leaq 0x29ac(%rip), %rsi      # 0xab37
movl $0x4, %edx
callq 0x1e8b
leaq 0x5adc(%rip), %rax      # 0xdc78
movq (%rax), %r12
addq $0xc, %r12
cmpb $0x0, (%r12)
leaq 0x1(%r12), %r12
jne 0x81a3
leaq 0x2(%r12), %rax
movq %rax, 0x20(%rsp)
cmpb $0x0, -0x1(%rax)
jne 0x81c9
cmpb $0x0, -0x2(%rax)
je 0x82b9
incq %rax
jmp 0x81b4
testl %ebp, %ebp
leaq 0x5ec1(%rip), %r15      # 0xe098
leaq 0x5822(%rip), %r12      # 0xda00
jne 0x8268
leaq 0x5c01(%rip), %rax      # 0xddec
movl (%rax), %ebp
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0x1f5e
testl %eax, %eax
jne 0x825e
xorl %eax, %eax
callq 0x30a4
testl %eax, %eax
jne 0x825e
leaq 0x5bd5(%rip), %rax      # 0xddec
movl %ebp, (%rax)
leaq 0x5868(%rip), %rax      # 0xda88
movq %r12, (%rax)
leaq 0x5d56(%rip), %rax      # 0xdf80
movq %rax, (%r15)
leaq 0x5ddc(%rip), %rax      # 0xe010
movq %rax, (%rbx)
cmpb $0x0, (%r12)
je 0x8257
movq %r12, %rdi
callq 0x7da0
testl %eax, %eax
je 0x8257
movq %r12, %rdi
movl $0x1, %esi
callq 0x7e7b
xorl %eax, %eax
callq 0x5cd0
leaq 0x5903(%rip), %rax      # 0xdb68
movl (%rax), %r14d
testl %r14d, %r14d
jne 0x827f
leaq 0x5908(%rip), %rax      # 0xdb7c
movl (%rax), %eax
leaq 0x5b6f(%rip), %rcx      # 0xddec
andl %eax, (%rcx)
leaq 0x603a(%rip), %rax      # 0xe2c0
movsbl (%rax), %edi
leaq 0x6031(%rip), %rax      # 0xe2c1
movsbl (%rax), %esi
leaq 0x6028(%rip), %rax      # 0xe2c2
movsbl (%rax), %ecx
leaq 0x601f(%rip), %rax      # 0xe2c3
movsbl (%rax), %r8d
leaq 0x5f11(%rip), %rdx      # 0xe1c0
callq 0x7be8
jmp 0x7fc9
movl $0x1, %edi
callq 0x5204
movq (%rbx), %rcx
movl $0x1, %eax
cmpb $0x0, -0x1(%rcx,%rax)
jne 0x82d8
cmpb $0x0, (%rcx,%rax)
je 0x82f1
leaq (%rcx,%rax), %rdx
decq %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, (%rbx)
movb (%rdx), %dl
movb %dl, -0x1(%rbp,%rax)
incq %rax
jmp 0x82cb
movw $0x0, -0x1(%rbp,%rax)
leaq 0x5ae9(%rip), %rax      # 0xdde8
movl (%rax), %eax
leaq 0x5ad8(%rip), %rcx      # 0xdde0
orl (%rcx), %eax
leaq 0x5ad3(%rip), %rcx      # 0xdde4
orl (%rcx), %eax
je 0x8329
leaq 0x5ad4(%rip), %rax      # 0xddf0
movb $0x42, (%rax)
movl $0x42, %edi
callq 0x1ec8
leaq 0x5abc(%rip), %rax      # 0xddec
movl $0x1, (%rax)
leaq 0x58d9(%rip), %rax      # 0xdc16
movb $0x4d, (%rax)
movl $0x1, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x7be8
leaq 0x57ff(%rip), %r13      # 0xdb5c
incl (%r13)
leaq 0x5c10(%rip), %r15      # 0xdf78
movl (%r15), %r14d
movq %r12, %rdi
leaq 0x20(%rsp), %rsi
movq %rbp, %rdx
callq 0x7f8a
movl %r14d, (%r15)
decl (%r13)
movq %rbp, %rdi
callq 0x1040
leaq 0x547f(%rip), %r13      # 0xd810
leaq 0x5d00(%rip), %r15      # 0xe098
jmp 0x7fc9
leaq 0x57b8(%rip), %rax      # 0xdb5c
cmpl $0x0, (%rax)
jne 0x8446
leaq 0x5424(%rip), %rax      # 0xd7d8
movq (%rax), %rdi
callq 0x10a0
leaq 0x5bb5(%rip), %rdx      # 0xdf78
movslq (%rdx), %rax
cmpq $0x5, %rax
jg 0x8421
leaq 0x5b8d(%rip), %rcx      # 0xdf60
movslq (%rcx,%rax,4), %rsi
leaq 0x56e6(%rip), %rax      # 0xdac4
movl %esi, (%rax)
addq 0x4bf9(%rip), %rsi      # 0xcfe0
leaq 0x52d2(%rip), %r14      # 0xd6c0
movq %r14, %rdi
callq 0x1080
leaq 0x534b(%rip), %rax      # 0xd748
movq (%rax), %rdi
leaq 0x282f(%rip), %rsi      # 0xac36
leaq 0x1c5d(%rip), %rdx      # 0xa06b
movq %r14, %rcx
xorl %eax, %eax
callq 0x1140
leaq 0x5b59(%rip), %rdx      # 0xdf78
movl (%rdx), %eax
leal 0x1(%rax), %ecx
movl %ecx, (%rdx)
cltq
leaq 0x59d1(%rip), %rcx      # 0xde00
movq (%rcx,%rax,8), %rcx
leaq 0x539e(%rip), %rdx      # 0xd7d8
movq %rcx, (%rdx)
cmpl $0x6, %eax
jl 0x7fc9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)