// File: /workspace/github_c_makefile_star2_O3/mist64[P]cbm6502asm/src/line.c
// Function: parselin
void parselin() {
	int i = 0, j;
	char linestat[FIRSTCHAR + 1];

	while ((s3 = strchr(line, '\f'))) { /* search for form feeds */
		for (linestat[FIRSTCHAR] = j = 0; j < FIRSTCHAR;
		     linestat[j++] = ' ')
			;
		fprintf(file_tmp, "%s%c%s\n", linestat, 'p',
		        " .page"); /* generate .page */
		*s3 = ' ';
	}

	p1[0] = p2[0] = p3[0] = 0; /* fields */
	s1 = p1;
	s2 = p2;
	s3 = p3; /* pointers to fields */

	j = strlen(line) - 1; /* remove trailing spaces */
	if (j < 0) return;
	while (isspace(line[j]) && j) line[j--] = 0;
	if (j < 0) return;
	if (line[i] != ';' &&
	    line[i]) { /* don't get fields for comments & blank lines */
		if (!isspace(line[i]))
			for (j = 0; !isspace(line[i]) && line[i]; i++, j++)
				p1[j] = toupper(line[i]);
		p1[j] = 0;
		while (isspace(line[i])) i++;
		for (j = 0; !isspace(line[i]) && line[i]; j++, i++)
			p2[j] = toupper(line[i]);
		p2[j] = 0;
		while (isspace(line[i]) && line[i]) i++;
		while (line[i]) *s3++ = line[i++]; /* the rest of the line */
		*s3++ = 0;
		*s3++ = 0;
		s3 = p3;
	}
	if (*s2 == ';') *s2 = 0;
	if (*s3 == ';') *s3 = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x915f(%rip), %rdi      # 0xe0b0
movl $0xc, %esi
callq 0x10d0
leaq 0x913e(%rip), %r13      # 0xe0a0
movq %rax, (%r13)
testq %rax, %rax
je 0x4fd5
leaq 0x87d6(%rip), %rbp      # 0xd748
leaq 0x5a07(%rip), %rbx      # 0xa980
leaq 0x5a08(%rip), %r14      # 0xa988
movq %rsp, %r15
leaq 0x9126(%rip), %r12      # 0xe0b0
movb $0x0, 0x20(%rsp)
movaps 0x59da(%rip), %xmm0     # 0xa970
movaps %xmm0, (%rsp)
movaps %xmm0, 0x10(%rsp)
movq (%rbp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl $0x70, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x1140
movq (%r13), %rax
movb $0x20, (%rax)
movq %r12, %rdi
movl $0xc, %esi
callq 0x10d0
movq %rax, (%r13)
testq %rax, %rax
jne 0x4f8a
leaq 0x9034(%rip), %r12      # 0xe010
xorl %eax, %eax
movb %al, (%r12)
leaq 0x8f97(%rip), %rcx      # 0xdf80
movb %al, (%rcx)
leaq 0x8a0e(%rip), %rbp      # 0xda00
movb %al, (%rbp)
leaq 0x8a8c(%rip), %rax      # 0xda88
movq %rbp, (%rax)
leaq 0x9092(%rip), %rax      # 0xe098
movq %rcx, (%rax)
movq %r12, (%r13)
leaq 0x909c(%rip), %rbx      # 0xe0b0
movq %rbx, %rdi
callq 0x10b0
movq %rax, %r15
decl %r15d
js 0x51f5
callq 0x1230
movq %rax, %r14
movq (%rax), %rax
testl %r15d, %r15d
je 0x507b
movl %r15d, %ecx
movsbq (%rbx,%rcx), %rdx
movzwl (%rax,%rdx,2), %edx
andl $0x2000, %edx           # imm = 0x2000
leaq 0x8f2f(%rip), %rsi      # 0xdf80
je 0x5082
leaq -0x1(%rcx), %r15
movb $0x0, (%rbx,%rcx)
movq (%r14), %rax
cmpq $0x1, %rcx
je 0x5082
movsbq -0x1(%rbx,%rcx), %rcx
movzwl (%rax,%rcx,2), %edx
movq %r15, %rcx
andl $0x2000, %edx           # imm = 0x2000
jne 0x5053
jmp 0x5082
leaq 0x8efe(%rip), %rsi      # 0xdf80
movzbl (%rbx), %ecx
testl %ecx, %ecx
je 0x51e9
cmpl $0x3b, %ecx
je 0x51e9
movsbq %cl, %r12
testb $0x20, 0x1(%rax,%r12,2)
jne 0x50e0
xorl %r15d, %r15d
callq 0x1030
movq (%rax), %rcx
movb (%rcx,%r12,4), %cl
movb %cl, (%rbp,%r15)
movsbq 0x1(%rbx,%r15), %r12
incq %r15
testq %r12, %r12
je 0x50d4
movq (%r14), %rcx
movzwl (%rcx,%r12,2), %ecx
andl $0x2000, %ecx           # imm = 0x2000
je 0x50aa
movl %r15d, %r12d
leaq 0x8ea2(%rip), %rsi      # 0xdf80
jmp 0x50e3
xorl %r12d, %r12d
movslq %r15d, %rax
movb $0x0, (%rbp,%rax)
movq (%r14), %rax
decq %r12
movsbq 0x1(%rbx,%r12), %rcx
incq %r12
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x50f1
movl %r12d, %ecx
movsbq (%rbx,%rcx), %r15
xorl %edx, %edx
testq %r15, %r15
je 0x5160
movzwl (%rax,%r15,2), %eax
andl $0x2000, %eax           # imm = 0x2000
jne 0x5160
xorl %ebp, %ebp
callq 0x1030
leaq 0x8e56(%rip), %rsi      # 0xdf80
movq %rbp, %rcx
movq (%rax), %rdx
movb (%rdx,%r15,4), %dl
movb %dl, (%rsi,%rbp)
incq %rbp
addq %rbx, %rcx
movsbq 0x1(%r12,%rcx), %r15
testq %r15, %r15
je 0x5158
movq (%r14), %rcx
movzwl (%rcx,%r15,2), %ecx
andl $0x2000, %ecx           # imm = 0x2000
je 0x512a
addl %ebp, %r12d
movl %ebp, %edx
movq %r12, %rcx
movb $0x0, (%rsi,%rdx)
movq (%r14), %rdx
leaq 0x8f42(%rip), %rax      # 0xe0b0
addq %rcx, %rax
decq %rcx
movsbq (%rax), %rsi
incq %rax
incq %rcx
testq %rsi, %rsi
je 0x518f
movzwl (%rdx,%rsi,2), %esi
andl $0x2000, %esi           # imm = 0x2000
jne 0x5174
movl %ecx, %ecx
movb (%rbx,%rcx), %cl
leaq 0x8e75(%rip), %r12      # 0xe010
movq %r12, %rdx
testb %cl, %cl
leaq 0x8ef1(%rip), %rdi      # 0xe098
je 0x51c4
movq (%r13), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, (%r13)
movb %cl, (%rdx)
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x51a9
movq (%r13), %rdx
leaq 0x1(%rdx), %rax
movq %rax, (%r13)
xorl %eax, %eax
movb %al, (%rdx)
movq (%r13), %rcx
movb %al, (%rcx)
movq %r12, (%r13)
movq (%rdi), %rax
cmpb $0x3b, (%rax)
jne 0x51e9
movb $0x0, (%rax)
movq (%r13), %r12
cmpb $0x3b, (%r12)
jne 0x51f5
movb $0x0, (%r12)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq