// File: /workspace/github_c_makefile_star2_O3/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 0x647b(%rip), %r15      # 0xd748
movq (%r15), %rdi
callq 0x10a0
leaq 0x65f4(%rip), %rdi      # 0xd8d0
leaq 0x2f4b(%rip), %rsi      # 0xa22e
callq 0x11c0
movq %rax, (%r15)
movq %rax, %rdi
callq 0x1160
testl %eax, %eax
je 0x7306
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0xa, 0xf(%rsp)
movl $0x1, 0x10(%rsp)
movl $0x3e7, %r14d           # imm = 0x3E7
leaq 0x6d90(%rip), %rbx      # 0xe0b0
leaq 0x6929(%rip), %rax      # 0xdc50
addq $0x4, %rax
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
movb $0x0, 0x40(%rsp)
xorl %r12d, %r12d
movq (%r15), %rdi
callq 0x1100
movb %al, 0x20(%rsp,%r12)
leaq 0x1(%r12), %rcx
cmpb $0xa, %al
je 0x7359
cmpq $0x1f, %r12
movq %rcx, %r12
jb 0x733a
cmpb $0xa, %al
jne 0x744b
xorl %eax, %eax
movb %al, 0x1f(%rsp,%rcx)
movb %al, (%rbx)
movl $0x20, %r13d
leaq 0x680a(%rip), %rax      # 0xdb80
cmpl (%rax), %r14d
jle 0x7412
leaq 0x670a(%rip), %r14      # 0xda90
movq (%r14), %rdi
movzbl 0xf(%rsp), %edx
movl 0x10(%rsp), %eax
movl %eax, (%rsp)
leaq 0x372d(%rip), %rsi      # 0xaac9
leaq 0x67ed(%rip), %rcx      # 0xdb90
leaq 0x3747(%rip), %r8       # 0xaaf1
movq 0x18(%rsp), %r9
xorl %eax, %eax
callq 0x1140
testl %ebp, %ebp
je 0x73cd
movq (%r14), %rdi
leaq 0x3732(%rip), %rsi      # 0xaaf6
movl %ebp, %edx
xorl %eax, %eax
callq 0x1140
incl %ebp
movq (%r14), %rdi
leaq 0x3721(%rip), %rsi      # 0xaafa
leaq 0x66f0(%rip), %rdx      # 0xdad0
leaq 0x62d9(%rip), %rcx      # 0xd6c0
xorl %eax, %eax
callq 0x1140
movq (%r14), %rcx
movl $0x33, %esi
movl $0x1, %edx
leaq 0x3702(%rip), %rdi      # 0xab04
callq 0x1210
movl $0x6, %r14d
movb $0xc, 0xf(%rsp)
cmpl $0x6b, %r13d
jle 0x74c6
cmpl $0x6c, %r13d
je 0x762e
cmpl $0x73, %r13d
je 0x751a
cmpl $0x70, %r13d
jne 0x75a5
incl 0x10(%rsp)
movl $0x3e7, %r14d           # imm = 0x3E7
xorl %ebp, %ebp
jmp 0x762e
movq (%r15), %rdi
callq 0x1100
movl %eax, %r13d
xorl %r12d, %r12d
xorl %eax, %eax
cmpb $0xa, %al
je 0x7488
movzbl %al, %ecx
cmpl $0xff, %ecx
je 0x7488
movq (%r15), %rdi
callq 0x1100
movb %al, (%rbx,%r12)
incq %r12
cmpq $0x10c, %r12            # imm = 0x10C
jne 0x745b
movl $0x10c, %r12d           # imm = 0x10C
decl %r12d
movslq %r12d, %rcx
movb $0x0, (%rbx,%rcx)
cmpb $-0x1, %al
je 0x762e
cmpb $0x53, %r13b
je 0x7643
movsbl %r13b, %r13d
cmpl $0x46, %r13d
jne 0x736f
leaq 0x6207(%rip), %rdi      # 0xd6c0
movq %rbx, %rsi
callq 0x1080
jmp 0x762e
cmpl $0x4c, %r13d
je 0x7581
cmpl $0x66, %r13d
jne 0x75a5
leaq 0x669f(%rip), %rax      # 0xdb80
movl $0x0, (%rax)
movb (%rbx), %cl
testb %cl, %cl
je 0x762e
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 0x74f7
leaq 0x666d(%rip), %rax      # 0xdb80
movl %edx, (%rax)
jmp 0x762e
movq %rbx, %rdi
leaq 0x35ca(%rip), %rsi      # 0xaaee
leaq 0x14(%rsp), %rdx
xorl %eax, %eax
callq 0x1190
movl 0x14(%rsp), %eax
testl %eax, %eax
jle 0x762e
leaq 0x663d(%rip), %rcx      # 0xdb80
movl (%rcx), %ecx
xorl %r12d, %r12d
leal (%r14,%r12), %edx
cmpl %ecx, %edx
jge 0x7571
leaq 0x6539(%rip), %rax      # 0xda90
movq (%rax), %rsi
movl $0xa, %edi
callq 0x1110
leaq 0x6615(%rip), %rax      # 0xdb80
movl (%rax), %ecx
movl 0x14(%rsp), %eax
incl %r12d
cmpl %eax, %r12d
jl 0x7548
addl %r12d, %r14d
jmp 0x762e
movsbl (%rbx), %eax
addl $-0x31, %eax
leaq 0x65e2(%rip), %rcx      # 0xdb70
movl %eax, (%rcx)
movsbl 0x1(%rbx), %eax
addl $-0x30, %eax
leaq 0x65d6(%rip), %rcx      # 0xdb74
movl %eax, (%rcx)
jmp 0x762e
movb 0x3d(%rsp), %al
xorl %ecx, %ecx
cmpb $0x20, %al
setne %cl
leaq 0x65a5(%rip), %rdx      # 0xdb5c
movl %ecx, (%rdx)
cmpl $0x4d, %r13d
setne %dl
orb %dl, %cl
testb $0x1, %cl
jne 0x75cc
movb $0x2b, 0x3d(%rsp)
leaq 0x6cee(%rip), %rcx      # 0xe2c1
movb $0x0, (%rcx)
leaq 0x6597(%rip), %rcx      # 0xdb74
cmpl $0x0, (%rcx)
je 0x762e
cmpb $0x20, %al
setne %al
leaq 0x6582(%rip), %rcx      # 0xdb70
cmpl $0x1, (%rcx)
setne %cl
testb %al, %cl
jne 0x762e
leaq 0x6365(%rip), %rax      # 0xd964
cmpl $0x0, (%rax)
jne 0x760b
movw $0x20, 0x3d(%rsp)
leaq 0x647e(%rip), %rax      # 0xda90
movq (%rax), %rdi
leaq 0x351c(%rip), %rsi      # 0xab38
leaq 0x20(%rsp), %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1140
incl %r14d
movq (%r15), %rdi
callq 0x1160
testl %eax, %eax
je 0x7332
jmp 0x72f7
xorl %eax, %eax
callq 0x4f3c
leaq 0x6a4f(%rip), %rax      # 0xe0a0
movq (%rax), %rsi
leaq 0x6475(%rip), %rdi      # 0xdad0
callq 0x1080
movl $0x53, %r13d
jmp 0x736f