// File: /workspace/github_c_makefile_star2_O1/mist64[P]cbm6502asm/src/line.c
// Function: get_line
int get_line(char *macprmbgn, char **maclinptr, char *macargbgn) {
        /*
            get a line from current source or include file
            or from the expansion of the current macro
        */
	int i, c;
	char *macprmptr, *macargptr, *maclinp;

	error_field[5] = error = line[0] = 0;
	error_field[0] = error_field[1] = error_field[2] = error_field[3] =
	        error_field[4] = ' ';
	if (macrolevel) {
		c = '\n';
		maclinp = *maclinptr; /* address of next line of macro def */
		                      /*
		                              expand current macro
		                      */
		if (*maclinp) {       /* if more lines left of this macro */
			char *subbed;
			subbed = (char *)calloc(LINELENG, 2);
			strcpy(line, maclinp); /* copy the line */
			while (*maclinp++)
				; /* point to start of next line */
			*maclinptr =
			        maclinp; /* for next call to this function */
			                 /*
			                         make substitutions
			                 */
			macprmptr = macprmbgn; /* start of parameter list */
			macargptr = macargbgn; /* start of argument list */
			while (*macprmptr) {   /* check if any parameters remain
				                */
				macsubst(macprmptr, macargptr,
				         subbed); /* make substitutions */
				while (*macprmptr++)
					; /* next parameter */
				if (*macargptr)
					while (*macargptr++)
						; /* next argument */
			}
			free(subbed);
		} else
			c = EOF;
	} else
		/*
		        read source line
		*/
		for (i = 0; (c = fgetc(file_src)) != EOF; i++)
			if (c != '\n')
				if (i < LINELENG - 1)
					line[i] = c;
				else {
					error_msg("Error reading source file",
					          "", error = 1);
					for (c = fgetc(file_src);
					     c != EOF && c != '\n';
					     c = fgetc(file_src))
						;
				}
			else {
				if (endflag) {
					i = 0;
					if (endflag++ ==
					    1) /* only display error once */
						error_msg(
						        "Additional input "
						        "after end statement "
						        "ignored",
						        "", 0);
				}
				line[i] = 0; /* terminate line */
				break;
			}

	if (c == EOF)
		line[0] = 0;
	else
		parselin();
	return (c);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x8ad2(%rip), %rcx      # 0xe0b0
xorl %eax, %eax
movb %al, (%rcx)
leaq 0x8807(%rip), %r13      # 0xddf0
movb %al, (%r13)
leaq 0x867c(%rip), %rax      # 0xdc70
movl $0x20202020, (%rax)     # imm = 0x20202020
movw $0x20, 0x4(%rax)
leaq 0x8555(%rip), %rax      # 0xdb5c
cmpl $0x0, (%rax)
je 0x56a0
movq %rsi, %r12
movq (%rsi), %r13
cmpb $0x0, (%r13)
je 0x5710
movq %rdx, %r14
movq %rdi, %rbx
movl $0x86, %edi
movl $0x2, %esi
callq 0x1120
movq %rax, %r15
leaq 0x8a70(%rip), %rdi      # 0xe0b0
movq %r13, %rsi
callq 0x1080
cmpb $0x0, (%r13)
leaq 0x1(%r13), %r13
jne 0x5648
movq %r13, (%r12)
cmpb $0x0, (%rbx)
je 0x5693
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5363
cmpb $0x0, (%rbx)
leaq 0x1(%rbx), %rbx
jne 0x566a
cmpb $0x0, (%r14)
je 0x5688
leaq 0x1(%r14), %rax
cmpb $0x0, (%r14)
movq %rax, %r14
jne 0x5679
jmp 0x568b
movq %r14, %rax
cmpb $0x0, (%rbx)
movq %rax, %r14
jne 0x565c
movq %r15, %rdi
callq 0x1040
jmp 0x575b
xorl %r15d, %r15d
leaq 0x812e(%rip), %r12      # 0xd7d8
leaq 0x52de(%rip), %rbx      # 0xa98f
leaq 0x547f(%rip), %r14      # 0xab37
movq (%r12), %rdi
callq 0x1100
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x5715
cmpl $0xa, %ebp
je 0x5719
cmpq $0x84, %r15
ja 0x56e3
leaq 0x89d3(%rip), %rax      # 0xe0b0
movb %bpl, (%rax,%r15)
jmp 0x570b
movb $0x1, (%r13)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x1e94
movq (%r12), %rdi
callq 0x1100
cmpl $-0x1, %eax
je 0x570b
cmpl $0xa, %eax
jne 0x56f8
incq %r15
jmp 0x56b8
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movb $0x1, %al
jmp 0x5762
leaq 0x8438(%rip), %rax      # 0xdb58
movl (%rax), %ecx
testl %ecx, %ecx
je 0x574d
leal 0x1(%rcx), %edx
movl %edx, (%rax)
cmpl $0x1, %ecx
jne 0x574a
leaq 0x5272(%rip), %rdi      # 0xa9a9
leaq 0x53f9(%rip), %rsi      # 0xab37
xorl %r15d, %r15d
xorl %edx, %edx
callq 0x1e94
jmp 0x574d
xorl %r15d, %r15d
movl %r15d, %eax
leaq 0x8959(%rip), %rcx      # 0xe0b0
movb $0x0, (%rcx,%rax)
movl $0xa, %ebp
xorl %eax, %eax
testb %al, %al
je 0x5772
leaq 0x8943(%rip), %rax      # 0xe0b0
movb $0x0, (%rax)
jmp 0x5777
callq 0x4e6c
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq