// File: /workspace/github_c_makefile_star2_O2/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 0x949b(%rip), %rbp      # 0xe0b0
leaq 0x4d46(%rip), %r14      # 0x9962
leaq 0x4d47(%rip), %r15      # 0x996a
movq %rsp, %r12
pushq $0x70
popq %r13
leaq 0x948f(%rip), %rdi      # 0xe0c0
pushq $0xc
popq %rsi
callq 0x10d0
movq %rbp, %rbx
movq %rax, (%rbp)
testq %rax, %rax
je 0x4c83
movb $0x0, 0x20(%rsp)
xorl %eax, %eax
cmpq $0x20, %rax
je 0x4c5b
movb $0x20, (%rsp,%rax)
incq %rax
jmp 0x4c4c
leaq 0x8af6(%rip), %rax      # 0xd758
movq (%rax), %rdi
movq %r14, %rsi
movq %r12, %rdx
movl %r13d, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x1140
movq %rbx, %rbp
movq (%rbx), %rax
movb $0x20, (%rax)
jmp 0x4c2a
leaq 0x9396(%rip), %r12      # 0xe020
xorl %eax, %eax
movb %al, (%r12)
leaq 0x92f9(%rip), %r13      # 0xdf90
movb %al, (%r13)
leaq 0x8d6e(%rip), %rcx      # 0xda10
movb %al, (%rcx)
leaq 0x8ded(%rip), %rax      # 0xda98
movq %rcx, (%rax)
leaq 0x93f3(%rip), %rax      # 0xe0a8
movq %r13, (%rax)
movq %r12, (%rbx)
leaq 0x93fe(%rip), %r14      # 0xe0c0
movq %r14, %rdi
callq 0x10b0
movq %rax, %r15
decl %r15d
js 0x4e50
callq 0x1240
movq %rax, %rbp
movl %r15d, %eax
movq (%rbp), %rcx
addl $-0x1, %eax
jae 0x4d08
movl %r15d, %edx
movsbq (%r14,%rdx), %rsi
movzwl (%rcx,%rsi,2), %esi
andl $0x2000, %esi           # imm = 0x2000
je 0x4d08
movb $0x0, (%r14,%rdx)
movl %eax, %r15d
jmp 0x4ce1
movzbl (%r14), %eax
testl %eax, %eax
je 0x4e44
cmpl $0x3b, %eax
je 0x4e44
movsbq %al, %rdx
movzwl (%rcx,%rdx,2), %ecx
btl $0xd, %ecx
jb 0x4d68
xorl %r15d, %r15d
testb %al, %al
je 0x4d6c
andl $0x2000, %ecx           # imm = 0x2000
jne 0x4d6c
movsbq %al, %r12
callq 0x1030
movq (%rax), %rax
movb (%rax,%r12,4), %al
leaq 0x8cbf(%rip), %rcx      # 0xda10
movb %al, (%rcx,%r15)
movq (%rbp), %rcx
movsbq 0x1(%r14,%r15), %rax
incq %r15
movzwl (%rcx,%rax,2), %ecx
jmp 0x4d2e
xorl %eax, %eax
jmp 0x4d6f
movl %r15d, %eax
movslq %r15d, %rcx
leaq 0x8c97(%rip), %rdx      # 0xda10
movb $0x0, (%rdx,%rcx)
movq (%rbp), %rdx
addq %rax, %r14
decq %r14
movsbq 0x1(%r14), %rax
incq %r14
movzwl (%rdx,%rax,2), %ecx
btl $0xd, %ecx
jb 0x4d87
xorl %r15d, %r15d
testb %al, %al
je 0x4dd2
andl $0x2000, %ecx           # imm = 0x2000
jne 0x4dd2
movsbq %al, %r12
callq 0x1030
movq (%rax), %rax
movb (%rax,%r12,4), %al
movb %al, (%r13,%r15)
incq %r15
movq (%rbp), %rcx
movsbq 0x1(%r14), %rax
incq %r14
movzwl (%rcx,%rax,2), %ecx
jmp 0x4d9c
movl %r15d, %eax
movb $0x0, (%r13,%rax)
movq (%rbp), %rcx
movsbq (%r14), %rax
incq %r14
testq %rax, %rax
je 0x4df7
movzwl (%rcx,%rax,2), %edx
andl $0x2000, %edx           # imm = 0x2000
jne 0x4ddf
movq %rbx, %rsi
leaq 0x92a7(%rip), %rdi      # 0xe0a8
testb %al, %al
je 0x4e19
movq (%rsi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rsi)
movb %al, (%rcx)
movb (%r14), %al
incq %r14
jmp 0x4e01
movq (%rsi), %rax
leaq 0x1(%rax), %rcx
movq %rcx, (%rsi)
xorl %ecx, %ecx
movb %cl, (%rax)
movq (%rsi), %rax
movb %cl, (%rax)
leaq 0x91ed(%rip), %r12      # 0xe020
movq %r12, (%rsi)
movq (%rdi), %rax
cmpb $0x3b, (%rax)
jne 0x4e44
movb $0x0, (%rax)
movq (%rbx), %r12
cmpb $0x3b, (%r12)
jne 0x4e50
movb $0x0, (%r12)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq