// File: /workspace/github_c_makefile_star2_O2/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 0x6d23(%rip), %r12      # 0xd758
movq (%r12), %rdi
callq 0x10a0
leaq 0x6e9b(%rip), %rdi      # 0xd8e0
leaq 0x27e2(%rip), %rsi      # 0x922e
callq 0x11d0
movq %rax, %rdi
movq %rax, (%r12)
movl $0x3e7, %r13d           # imm = 0x3E7
pushq $0x1
popq %rax
movl %eax, 0x10(%rsp)
movb $0xa, 0xb(%rsp)
leaq 0x764f(%rip), %rbx      # 0xe0c0
leaq 0x7118(%rip), %r14      # 0xdb90
leaq 0x71e1(%rip), %rax      # 0xdc60
addq $0x4, %rax
movq %rax, 0x18(%rsp)
movl $0x0, 0xc(%rsp)
callq 0x1160
testl %eax, %eax
jne 0x6d6f
movb $0x0, 0x40(%rsp)
xorl %r15d, %r15d
xorl %eax, %eax
cmpb $0xa, %al
je 0x6ac4
cmpq $0x1f, %r15
ja 0x6ac4
movq (%r12), %rdi
callq 0x1100
movb %al, 0x20(%rsp,%r15)
incq %r15
jmp 0x6aa7
cmpb $0xa, %al
jne 0x6b84
xorl %eax, %eax
movb %al, 0x1f(%rsp,%r15)
movb %al, (%rbx)
pushq $0x20
popq %rbp
cmpl (%r14), %r13d
jle 0x6bf5
leaq 0x6fb8(%rip), %r13      # 0xdaa0
movq (%r13), %rdi
movzbl 0xb(%rsp), %edx
movl 0x10(%rsp), %eax
movl %eax, (%rsp)
leaq 0x2fac(%rip), %rsi      # 0x9aab
leaq 0x709a(%rip), %rcx      # 0xdba0
leaq 0x2fc6(%rip), %r8       # 0x9ad3
movq 0x18(%rsp), %r9
xorl %eax, %eax
callq 0x1140
movl 0xc(%rsp), %eax
testl %eax, %eax
je 0x6b3b
movq (%r13), %rdi
leaq 0x2fac(%rip), %rsi      # 0x9ad8
movl 0xc(%rsp), %edx
xorl %eax, %eax
callq 0x1140
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0xc(%rsp)
movq (%r13), %rdi
leaq 0x2f90(%rip), %rsi      # 0x9adc
leaq 0x6f8d(%rip), %rdx      # 0xdae0
leaq 0x6b76(%rip), %rcx      # 0xd6d0
xorl %eax, %eax
callq 0x1140
movq (%r13), %rcx
leaq 0x2f7a(%rip), %rdi      # 0x9ae6
pushq $0x33
popq %rsi
pushq $0x1
popq %rdx
callq 0x1220
movb $0xc, 0xb(%rsp)
pushq $0x6
popq %rax
movl %eax, %r15d
jmp 0x6bff
movq (%r12), %rdi
callq 0x1100
movl %eax, %r15d
xorl %ebp, %ebp
xorl %eax, %eax
cmpq $0x10c, %rbp            # imm = 0x10C
je 0x6bbd
cmpb $0xa, %al
je 0x6bbd
movzbl %al, %ecx
cmpl $0xff, %ecx
je 0x6bbd
movq (%r12), %rdi
callq 0x1100
movb %al, (%rbx,%rbp)
incq %rbp
jmp 0x6b94
movb $0x0, -0x1(%rbx,%rbp)
cmpb $-0x1, %al
je 0x6d42
cmpb $0x53, %r15b
je 0x6d4b
movsbl %r15b, %ebp
cmpl $0x46, %ebp
jne 0x6ad8
leaq 0x6ae8(%rip), %rdi      # 0xd6d0
movq %rbx, %rsi
callq 0x1080
jmp 0x6d42
movl %r13d, %r15d
leaq 0x6ea1(%rip), %r13      # 0xdaa0
cmpl $0x4c, %ebp
je 0x6d20
cmpl $0x66, %ebp
je 0x6c37
cmpl $0x6c, %ebp
je 0x6d3f
cmpl $0x73, %ebp
je 0x6c5b
cmpl $0x70, %ebp
jne 0x6c9c
incl 0x10(%rsp)
movl $0x3e7, %r13d           # imm = 0x3E7
movl $0x0, 0xc(%rsp)
jmp 0x6d42
andl $0x0, (%r14)
xorl %ecx, %ecx
movq %rbx, %rax
movsbl (%rax), %edx
testl %edx, %edx
je 0x6d3f
imull $0xa, %ecx, %ecx
addl %edx, %ecx
addl $-0x30, %ecx
movl %ecx, (%r14)
incq %rax
jmp 0x6c40
xorl %ebp, %ebp
movq %rbx, %rdi
leaq 0x2e69(%rip), %rsi      # 0x9ad0
leaq 0x14(%rsp), %rdx
xorl %eax, %eax
callq 0x1190
leal (%r15,%rbp), %r13d
cmpl 0x14(%rsp), %ebp
jge 0x6d42
cmpl (%r14), %r13d
jge 0x6c98
leaq 0x6e13(%rip), %rax      # 0xdaa0
movq (%rax), %rsi
pushq $0xa
popq %rdi
callq 0x1110
incl %ebp
jmp 0x6c73
movb 0x3d(%rsp), %al
xorl %ecx, %ecx
cmpb $0x20, %al
setne %cl
leaq 0x6ebe(%rip), %rdx      # 0xdb6c
movl %ecx, (%rdx)
cmpl $0x4d, %ebp
setne %dl
orb %dl, %cl
testb $0x1, %cl
jne 0x6cc2
movb $0x2b, 0x3d(%rsp)
leaq 0x7608(%rip), %rcx      # 0xe2d1
movb $0x0, (%rcx)
leaq 0x6eb1(%rip), %rcx      # 0xdb84
cmpl $0x0, (%rcx)
je 0x6d3f
cmpb $0x20, %al
setne %al
leaq 0x6e9c(%rip), %rcx      # 0xdb80
cmpl $0x1, (%rcx)
setne %cl
testb %al, %cl
jne 0x6d3f
leaq 0x6c7f(%rip), %rax      # 0xd974
cmpl $0x0, (%rax)
jne 0x6d01
movw $0x20, 0x3d(%rsp)
movq (%r13), %rdi
leaq 0x2e0e(%rip), %rsi      # 0x9b1a
leaq 0x20(%rsp), %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1140
incl %r15d
jmp 0x6d3f
movsbl (%rbx), %eax
addl $-0x31, %eax
leaq 0x6e53(%rip), %rcx      # 0xdb80
movl %eax, (%rcx)
movsbl 0x1(%rbx), %eax
addl $-0x30, %eax
leaq 0x6e47(%rip), %rcx      # 0xdb84
movl %eax, (%rcx)
movl %r15d, %r13d
movq (%r12), %rdi
jmp 0x6a90
xorl %eax, %eax
callq 0x4c00
leaq 0x7357(%rip), %rax      # 0xe0b0
movq (%rax), %rsi
leaq 0x6d7d(%rip), %rdi      # 0xdae0
callq 0x1080
pushq $0x53
jmp 0x6ad7
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq