// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq 0x5ccd(%rip), %rax      # 0x10f68
movl $0x6, (%rax)
leaq 0x5cc0(%rip), %rax      # 0x10f68
cmpl $0x6, (%rax)
jg 0xb8b3
jmp 0xb2b3
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x7770
cmpl $-0x1, %eax
je 0xb7f8
leaq 0x552c(%rip), %rax      # 0x10800
movq (%rax), %rcx
leaq 0x5ae2(%rip), %rax      # 0x10dc0
movq %rcx, (%rax)
leaq 0x5fca(%rip), %rax      # 0x112b2
movb $0x0, (%rax)
leaq 0x5fbf(%rip), %rax      # 0x112b1
movb $0x0, (%rax)
leaq 0x5fb4(%rip), %rax      # 0x112b0
movb $0x0, (%rax)
leaq 0x5ac6(%rip), %rax      # 0x10dcc
movl $0x0, (%rax)
movl $0x0, -0x20(%rbp)
leaq 0x5f99(%rip), %rax      # 0x112b3
movb $0x1, (%rax)
leaq 0x5ab8(%rip), %rax      # 0x10ddc
movl $0x1, (%rax)
leaq 0x5d6f(%rip), %rax      # 0x110a0
movsbl (%rax), %eax
cmpl $0x3b, %eax
sete %al
movb %al, %cl
andb $0x1, %cl
movzbl %cl, %ecx
movl %ecx, -0x1c(%rbp)
testb $0x1, %al
jne 0xb34b
jmp 0xb35d
leaq 0x5d4e(%rip), %rax      # 0x110a0
movb (%rax), %cl
leaq 0x58ab(%rip), %rax      # 0x10c06
movb %cl, (%rax)
leaq 0x5d3c(%rip), %rax      # 0x110a0
cmpb $0x0, (%rax)
jne 0xb37a
leaq 0x5896(%rip), %rax      # 0x10c06
movb $0x31, (%rax)
movl $0x31, -0x1c(%rbp)
leaq 0x5d07(%rip), %rax      # 0x11088
movq (%rax), %rax
cmpb $0x0, (%rax)
je 0xb39b
leaq 0x5cf8(%rip), %rax      # 0x11088
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
jne 0xb3f6
leaq 0x57b6(%rip), %rax      # 0x10b58
cmpl $0x0, (%rax)
je 0xb3f6
cmpl $0x0, -0x1c(%rbp)
jne 0xb3f6
leaq 0x56c4(%rip), %rax      # 0x10a78
movq (%rax), %rdi
movl $0x3d, %esi
callq 0x10c0
cmpq $0x0, %rax
jne 0xb3f6
leaq 0x56aa(%rip), %rax      # 0x10a78
movq (%rax), %rdi
callq 0xafb0
cmpl $0x0, %eax
je 0xb3ef
leaq 0x5696(%rip), %rax      # 0x10a78
movq (%rax), %rdi
movl $0x1, %esi
callq 0xb100
movl $0x1, -0x1c(%rbp)
leaq 0x5c8b(%rip), %rax      # 0x11088
movq (%rax), %rax
movb $0x0, 0x1f(%rax)
leaq 0x568d(%rip), %rax      # 0x10a98
movq (%rax), %rcx
leaq 0x5853(%rip), %rax      # 0x10c68
movq %rcx, (%rax)
xorl %eax, %eax
leaq 0x5847(%rip), %rcx      # 0x10c68
cmpq $0x0, (%rcx)
movb %al, -0x4d(%rbp)
je 0xb445
xorl %eax, %eax
cmpl $0x0, -0x1c(%rbp)
movb %al, -0x4d(%rbp)
jne 0xb445
leaq 0x571c(%rip), %rax      # 0x10b58
cmpl $0x0, (%rax)
setne %al
movb %al, -0x4d(%rbp)
movb -0x4d(%rbp), %al
testb $0x1, %al
jne 0xb451
jmp 0xb6cc
leaq 0x5c30(%rip), %rax      # 0x11088
movq (%rax), %rdi
leaq 0x5806(%rip), %rax      # 0x10c68
movq (%rax), %rsi
addq $0xc, %rsi
callq 0x1110
cmpl $0x0, %eax
jne 0xb6b0
leaq 0x55fa(%rip), %rax      # 0x10a78
movq (%rax), %rax
cmpb $0x0, (%rax)
je 0xb4b0
leaq 0x55eb(%rip), %rax      # 0x10a78
movq (%rax), %rdi
callq 0xafb0
cmpl $0x0, %eax
je 0xb4ae
leaq 0x55d7(%rip), %rax      # 0x10a78
movq (%rax), %rdi
movl $0x1, %esi
callq 0xb100
jmp 0xb4b0
leaq 0x5bd9(%rip), %rax      # 0x11090
movq (%rax), %rdi
callq 0x10a0
movq %rax, %rdi
addq $0x32, %rdi
callq 0x1160
movq %rax, -0x48(%rbp)
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0xb4f2
leaq 0x268e(%rip), %rdi      # 0xdb6f
leaq 0x25b8(%rip), %rsi      # 0xdaa0
movl $0x4, %edx
callq 0x22f0
leaq 0x576f(%rip), %rax      # 0x10c68
movq (%rax), %rax
addq $0xc, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
cmpb $0x0, (%rax)
je 0xb51a
jmp 0xb504
movq -0x38(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movsbl -0x1(%rax), %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x4e(%rbp)
jne 0xb549
movq -0x40(%rbp), %rax
movsbl -0x2(%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x4e(%rbp)
movb -0x4e(%rbp), %al
testb $0x1, %al
jne 0xb552
jmp 0xb560
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xb526
movl $0x1, %edi
callq 0x7120
leaq 0x5b1f(%rip), %rax      # 0x11090
movq (%rax), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x4f(%rbp)
jne 0xb598
leaq 0x5b08(%rip), %rax      # 0x11090
movq (%rax), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x4f(%rbp)
movb -0x4f(%rbp), %al
testb $0x1, %al
jne 0xb5a1
jmp 0xb5d1
leaq 0x5ae8(%rip), %rax      # 0x11090
movq (%rax), %rax
movq %rax, %rdx
addq $0x1, %rdx
leaq 0x5ad7(%rip), %rcx      # 0x11090
movq %rdx, (%rcx)
movb (%rax), %cl
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
jmp 0xb56a
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rbp)
movb $0x0, (%rax)
movq -0x30(%rbp), %rax
movb $0x0, (%rax)
leaq 0x57df(%rip), %rax      # 0x10dd0
movl (%rax), %eax
leaq 0x57de(%rip), %rcx      # 0x10dd8
orl (%rcx), %eax
leaq 0x57d1(%rip), %rcx      # 0x10dd4
orl (%rcx), %eax
cmpl $0x0, %eax
je 0xb61e
leaq 0x57cf(%rip), %rax      # 0x10de0
movb $0x42, (%rax)
movl $0x42, %edi
callq 0x2350
movl $0x1, -0x20(%rbp)
leaq 0x57b0(%rip), %rax      # 0x10ddc
movl $0x1, (%rax)
leaq 0x55cd(%rip), %rax      # 0x10c06
movb $0x4d, (%rax)
movl $0x1, %r8d
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %edx
movl %r8d, %edi
movl %ecx, %esi
callq 0xacb0
leaq 0x54f3(%rip), %rax      # 0x10b4c
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x54e7(%rip), %rax      # 0x10b4c
movl %ecx, (%rax)
leaq 0x58fa(%rip), %rax      # 0x10f68
movl (%rax), %eax
movl %eax, -0x4c(%rbp)
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rdx
leaq -0x40(%rbp), %rsi
callq 0xb280
movl -0x4c(%rbp), %ecx
leaq 0x58da(%rip), %rax      # 0x10f68
movl %ecx, (%rax)
leaq 0x54b5(%rip), %rax      # 0x10b4c
movl (%rax), %ecx
addl $-0x1, %ecx
leaq 0x54a9(%rip), %rax      # 0x10b4c
movl %ecx, (%rax)
movq -0x48(%rbp), %rdi
callq 0x1030
jmp 0xb6cc
leaq 0x55b1(%rip), %rax      # 0x10c68
movq (%rax), %rax
movq (%rax), %rcx
leaq 0x55a4(%rip), %rax      # 0x10c68
movq %rcx, (%rax)
jmp 0xb418
cmpl $0x0, -0x20(%rbp)
je 0xb6d7
jmp 0xb2b3
cmpl $0x0, -0x1c(%rbp)
jne 0xb78d
leaq 0x56f4(%rip), %rax      # 0x10ddc
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x24b0
cmpl $0x0, %eax
jne 0xb78b
movb $0x0, %al
callq 0x3eb0
cmpl $0x0, %eax
jne 0xb789
movl -0x24(%rbp), %ecx
leaq 0x56bf(%rip), %rax      # 0x10ddc
movl %ecx, (%rax)
leaq 0x5352(%rip), %rax      # 0x10a78
leaq 0x52c3(%rip), %rcx      # 0x109f0
movq %rcx, (%rax)
leaq 0x5951(%rip), %rax      # 0x11088
leaq 0x5832(%rip), %rcx      # 0x10f70
movq %rcx, (%rax)
leaq 0x5948(%rip), %rax      # 0x11090
leaq 0x58b1(%rip), %rcx      # 0x11000
movq %rcx, (%rax)
leaq 0x5297(%rip), %rax      # 0x109f0
cmpb $0x0, (%rax)
je 0xb782
leaq 0x528b(%rip), %rdi      # 0x109f0
callq 0xafb0
cmpl $0x0, %eax
je 0xb780
leaq 0x527a(%rip), %rdi      # 0x109f0
movl $0x1, %esi
callq 0xb100
jmp 0xb782
movb $0x0, %al
callq 0x8100
jmp 0xb78b
jmp 0xb78d
leaq 0x53c4(%rip), %rax      # 0x10b58
cmpl $0x0, (%rax)
jne 0xb7b4
leaq 0x53cc(%rip), %rax      # 0x10b6c
movl (%rax), %ecx
leaq 0x5633(%rip), %rax      # 0x10ddc
andl (%rax), %ecx
leaq 0x562a(%rip), %rax      # 0x10ddc
movl %ecx, (%rax)
leaq 0x5af5(%rip), %rax      # 0x112b0
movb (%rax), %dil
leaq 0x5aec(%rip), %rax      # 0x112b1
movb (%rax), %sil
leaq 0x5ae3(%rip), %rax      # 0x112b2
movb (%rax), %cl
leaq 0x59d8(%rip), %rdx      # 0x111b0
leaq 0x5ad4(%rip), %rax      # 0x112b3
movsbl %dil, %edi
movsbl %sil, %esi
movsbl %cl, %ecx
movsbl (%rax), %r8d
callq 0xacb0
jmp 0xb2b3
leaq 0x534d(%rip), %rax      # 0x10b4c
cmpl $0x0, (%rax)
je 0xb809
jmp 0xb8b3
leaq 0x4fb8(%rip), %rax      # 0x107c8
movq (%rax), %rdi
callq 0x1090
leaq 0x5749(%rip), %rax      # 0x10f68
cmpl $0x6, (%rax)
jge 0xb87f
leaq 0x573d(%rip), %rax      # 0x10f68
movslq (%rax), %rcx
leaq 0x571b(%rip), %rax      # 0x10f50
movl (%rax,%rcx,4), %eax
leaq 0x5275(%rip), %rcx      # 0x10ab4
movl %eax, (%rcx)
cltq
leaq 0x55d6(%rip), %rsi      # 0x10e20
addq %rax, %rsi
leaq 0x4e5c(%rip), %rdi      # 0x106b0
callq 0x1070
leaq 0x4ed8(%rip), %rax      # 0x10738
movq (%rax), %rdi
leaq 0x2337(%rip), %rsi      # 0xdba1
leaq 0x17ff(%rip), %rdx      # 0xd070
leaq 0x4e38(%rip), %rcx      # 0x106b0
movb $0x0, %al
callq 0x1120
leaq 0x56e2(%rip), %rax      # 0x10f68
movl (%rax), %eax
movl %eax, %edx
addl $0x1, %edx
leaq 0x56d4(%rip), %rcx      # 0x10f68
movl %edx, (%rcx)
movslq %eax, %rcx
leaq 0x5550(%rip), %rax      # 0x10df0
movq (%rax,%rcx,8), %rcx
leaq 0x4f1d(%rip), %rax      # 0x107c8
movq %rcx, (%rax)
jmp 0xb2a1
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)