// File: /workspace/github_c_makefile_star2_O1/mist64[P]cbm6502asm/src/outline.c
// Function: clean_list
void clean_list() {
	char linestat[FIRSTCHAR + 1], c, spec, formfeed = '\n';
	int i, j, page = 1, subpage = 0, nline = 999;

	fclose(file_tmp);
	file_tmp = fopen(tmpdev, "r");

	while (!feof(file_tmp)) {
		for (c = i = linestat[FIRSTCHAR] = 0;
		     i < FIRSTCHAR && c != '\n'; i++)
			c = linestat[i] = fgetc(file_tmp);

		if (c == '\n') {
			linestat[--i] = 0;
			spec = ' ';
			*line = 0;
		} else {
			spec = fgetc(file_tmp);
			for (c = i = 0;
			     i < 2 * LINELENG && c != '\n' && c != EOF; i++)
				c = line[i] = fgetc(file_tmp);
			line[--i] = 0;
		}

		if (c == EOF) continue;
		if (spec == 'F') {
			strcpy(srcfile, line);
			continue;
		}
		if (spec == 'S') { /* .subttl directive */
			parselin();
			strcpy(subttl, s3);
		}
		if (nline > formln) {
			nline = 6;
			fprintf(file_lst,
			        "%c%s  Commodore 6502ASM %s  %s  Page %d",
			        formfeed, name, VERSION, &datetime[4], page);
			formfeed = '\f';
			if (subpage) fprintf(file_lst, "-%d", subpage);
			subpage++;
			fprintf(file_lst, "\n%s   %s\n", subttl, srcfile);
			fprintf(file_lst,
			        "\nError Addr  Code          Seq   Source "
			        "statement\n\n");
		}
		if (spec == 'p') { /* .page directive */
			nline = 999;
			page++;
			subpage = 0;
			continue;
		}
		if (spec == 'f') { /* .formln directive */
			for (formln = i = 0; line[i]; i++)
				formln = formln * 10 + line[i] - '0';
			continue;
		}
		if (spec == 's') { /* .space or .skip directive */
			sscanf(line, "%d", &j);
			for (i = 0; i < j; i++, nline++)
				if (nline < formln) fprintf(file_lst, "\n");
			continue;
		}
		if (spec == 'L') { /* .mlist, .nmlist, .blist, .list, .nlist */
			mlist = line[0] - '1';
			list = line[1] - '0';
			continue;
		}
		if (spec == 'l') /* .clist and .nclist directive */
			continue;
		macrolevel = linestat[29] != ' ';
		if (spec == 'M' && !macrolevel) linestat[29] = '+';
		data = isxdigit(linestat[12]);
		if (list)
			if (mlist == 1 || !macrolevel || (mlist == 0 && data)) {
				if (!wide) {
					linestat[FIRSTCHAR - 2] = 0;
					linestat[FIRSTCHAR - 3] = ' ';
				}
				fprintf(file_lst, "%s%s\n", linestat, line);
				nline++;
			}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
leaq 0x642b(%rip), %r14      # 0xd748
movq (%r14), %rdi
callq 0x10a0
leaq 0x65a4(%rip), %rdi      # 0xd8d0
leaq 0x2efb(%rip), %rsi      # 0xa22e
callq 0x11c0
movq %rax, (%r14)
movq %rax, %rdi
callq 0x1160
testl %eax, %eax
jne 0x7685
movb $0xa, 0xb(%rsp)
movl $0x1, 0x10(%rsp)
movl $0x3e7, %r13d           # imm = 0x3E7
leaq 0x6d4b(%rip), %rbx      # 0xe0b0
leaq 0x6814(%rip), %r15      # 0xdb80
leaq 0x68dd(%rip), %rax      # 0xdc50
addq $0x4, %rax
movq %rax, 0x18(%rsp)
movl $0x0, 0xc(%rsp)
movb $0x0, 0x40(%rsp)
xorl %r12d, %r12d
movq (%r14), %rdi
callq 0x1100
movb %al, 0x20(%rsp,%r12)
leaq 0x1(%r12), %rcx
cmpb $0xa, %al
je 0x73ab
cmpq $0x1f, %r12
movq %rcx, %r12
jb 0x738c
cmpb $0xa, %al
jne 0x73be
xorl %eax, %eax
movb %al, 0x1f(%rsp,%rcx)
movb %al, (%rbx)
movl $0x20, %ebp
jmp 0x740d
movq (%r14), %rdi
callq 0x1100
movl %eax, %ebp
xorl %r12d, %r12d
xorl %eax, %eax
cmpb $0xa, %al
je 0x73fa
movzbl %al, %ecx
cmpl $0xff, %ecx
je 0x73fa
movq (%r14), %rdi
callq 0x1100
movb %al, (%rbx,%r12)
incq %r12
cmpq $0x10c, %r12            # imm = 0x10C
jne 0x73cd
movl $0x10c, %r12d           # imm = 0x10C
decl %r12d
movslq %r12d, %rcx
movb $0x0, (%rbx,%rcx)
cmpb $-0x1, %al
sete %al
movsbl %bpl, %ebp
testb %al, %al
jne 0x7675
cmpl $0x53, %ebp
je 0x7433
cmpl $0x46, %ebp
jne 0x7450
leaq 0x629a(%rip), %rdi      # 0xd6c0
movq %rbx, %rsi
callq 0x1080
jmp 0x7675
xorl %eax, %eax
callq 0x4e6c
leaq 0x6c5f(%rip), %rax      # 0xe0a0
movq (%rax), %rsi
leaq 0x6685(%rip), %rdi      # 0xdad0
callq 0x1080
cmpl (%r15), %r13d
jle 0x74fd
leaq 0x6630(%rip), %r12      # 0xda90
movq (%r12), %rdi
movzbl 0xb(%rsp), %edx
movl 0x10(%rsp), %eax
movl %eax, (%rsp)
leaq 0x3652(%rip), %rsi      # 0xaac9
leaq 0x6712(%rip), %rcx      # 0xdb90
leaq 0x366c(%rip), %r8       # 0xaaf1
movq 0x18(%rsp), %r9
xorl %eax, %eax
callq 0x1140
movl 0xc(%rsp), %r13d
testl %r13d, %r13d
je 0x74b0
movq (%r12), %rdi
leaq 0x3650(%rip), %rsi      # 0xaaf6
movl %r13d, %edx
xorl %eax, %eax
callq 0x1140
incl %r13d
movl %r13d, 0xc(%rsp)
movq (%r12), %rdi
leaq 0x3637(%rip), %rsi      # 0xaafa
leaq 0x6606(%rip), %rdx      # 0xdad0
leaq 0x61ef(%rip), %rcx      # 0xd6c0
xorl %eax, %eax
callq 0x1140
movq (%r12), %rcx
movl $0x33, %esi
movl $0x1, %edx
leaq 0x3617(%rip), %rdi      # 0xab04
callq 0x1210
movl $0x6, %r13d
movb $0xc, 0xb(%rsp)
cmpl $0x6b, %ebp
jle 0x7530
cmpl $0x6c, %ebp
je 0x7675
cmpl $0x73, %ebp
je 0x7576
cmpl $0x70, %ebp
jne 0x75ed
incl 0x10(%rsp)
movl $0x3e7, %r13d           # imm = 0x3E7
movl $0x0, 0xc(%rsp)
jmp 0x7675
cmpl $0x4c, %ebp
je 0x75c9
cmpl $0x66, %ebp
jne 0x75ed
movl $0x0, (%r15)
movb (%rbx), %cl
testb %cl, %cl
je 0x7675
leaq 0x1(%rbx), %rax
xorl %edx, %edx
leal (%rdx,%rdx,4), %edx
movsbl %cl, %ecx
leal (%rcx,%rdx,2), %edx
addl $-0x30, %edx
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x7559
movl %edx, (%r15)
jmp 0x7675
movq %rbx, %rdi
leaq 0x356e(%rip), %rsi      # 0xaaee
leaq 0x14(%rsp), %rdx
xorl %eax, %eax
callq 0x1190
cmpl $0x0, 0x14(%rsp)
jle 0x7675
xorl %r12d, %r12d
leal (%r12,%r13), %eax
cmpl (%r15), %eax
jge 0x75b7
leaq 0x64e6(%rip), %rax      # 0xda90
movq (%rax), %rsi
movl $0xa, %edi
callq 0x1110
incl %r12d
cmpl 0x14(%rsp), %r12d
jl 0x759a
addl %r12d, %r13d
jmp 0x7675
movsbl (%rbx), %eax
addl $-0x31, %eax
leaq 0x659a(%rip), %rcx      # 0xdb70
movl %eax, (%rcx)
movsbl 0x1(%rbx), %eax
addl $-0x30, %eax
leaq 0x658e(%rip), %rcx      # 0xdb74
movl %eax, (%rcx)
jmp 0x7675
movb 0x3d(%rsp), %al
xorl %ecx, %ecx
cmpb $0x20, %al
setne %cl
leaq 0x655d(%rip), %rdx      # 0xdb5c
movl %ecx, (%rdx)
cmpl $0x4d, %ebp
setne %dl
orb %dl, %cl
testb $0x1, %cl
jne 0x7613
movb $0x2b, 0x3d(%rsp)
leaq 0x6ca7(%rip), %rcx      # 0xe2c1
movb $0x0, (%rcx)
leaq 0x6550(%rip), %rcx      # 0xdb74
cmpl $0x0, (%rcx)
je 0x7675
cmpb $0x20, %al
setne %al
leaq 0x653b(%rip), %rcx      # 0xdb70
cmpl $0x1, (%rcx)
setne %cl
testb %al, %cl
jne 0x7675
leaq 0x631e(%rip), %rax      # 0xd964
cmpl $0x0, (%rax)
jne 0x7652
movw $0x20, 0x3d(%rsp)
leaq 0x6437(%rip), %rax      # 0xda90
movq (%rax), %rdi
leaq 0x34d5(%rip), %rsi      # 0xab38
leaq 0x20(%rsp), %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1140
incl %r13d
movq (%r14), %rdi
callq 0x1160
testl %eax, %eax
je 0x7384
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq