// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq 0x9915(%rip), %rax      # 0x110a0
movb $0x0, (%rax)
leaq 0x964b(%rip), %rax      # 0x10de0
movb $0x0, (%rax)
leaq 0x94c1(%rip), %rax      # 0x10c60
movb $0x0, 0x5(%rax)
leaq 0x94b6(%rip), %rax      # 0x10c60
movb $0x20, 0x4(%rax)
leaq 0x94ab(%rip), %rax      # 0x10c60
movb $0x20, 0x3(%rax)
leaq 0x94a0(%rip), %rax      # 0x10c60
movb $0x20, 0x2(%rax)
leaq 0x9495(%rip), %rax      # 0x10c60
movb $0x20, 0x1(%rax)
leaq 0x948a(%rip), %rax      # 0x10c60
movb $0x20, (%rax)
leaq 0x936c(%rip), %rax      # 0x10b4c
cmpl $0x0, (%rax)
je 0x78c8
movl $0xa, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpb $0x0, (%rax)
je 0x78bc
movl $0x86, %edi
movl $0x2, %esi
callq 0x1100
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rsi
leaq 0x987a(%rip), %rdi      # 0x110a0
callq 0x1070
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
cmpb $0x0, (%rax)
je 0x7841
jmp 0x782b
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
je 0x78b1
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x74e0
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
cmpb $0x0, (%rax)
je 0x788c
jmp 0x7876
movq -0x30(%rbp), %rax
cmpb $0x0, (%rax)
je 0x78af
jmp 0x7897
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rbp)
cmpb $0x0, (%rax)
je 0x78ad
jmp 0x7897
jmp 0x78af
jmp 0x785c
movq -0x40(%rbp), %rdi
callq 0x1030
jmp 0x78c3
movl $0xffffffff, -0x20(%rbp) # imm = 0xFFFFFFFF
jmp 0x79e7
movl $0x0, -0x1c(%rbp)
leaq 0x8ef2(%rip), %rax      # 0x107c8
movq (%rax), %rdi
callq 0x10f0
movl %eax, -0x20(%rbp)
cmpl $-0x1, %eax
je 0x79e5
cmpl $0xa, -0x20(%rbp)
je 0x797e
cmpl $0x85, -0x1c(%rbp)
jge 0x7912
movl -0x20(%rbp), %eax
movb %al, %dl
movslq -0x1c(%rbp), %rcx
leaq 0x9793(%rip), %rax      # 0x110a0
movb %dl, (%rax,%rcx)
jmp 0x797c
leaq 0x94c7(%rip), %rax      # 0x10de0
movb $0x1, (%rax)
leaq 0x5fd5(%rip), %rdi      # 0xd8f8
leaq 0x6176(%rip), %rsi      # 0xdaa0
movl $0x1, %edx
callq 0x22f0
leaq 0x8e8d(%rip), %rax      # 0x107c8
movq (%rax), %rdi
callq 0x10f0
movl %eax, -0x20(%rbp)
xorl %eax, %eax
cmpl $-0x1, -0x20(%rbp)
movb %al, -0x41(%rbp)
je 0x795b
cmpl $0xa, -0x20(%rbp)
setne %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0x7964
jmp 0x797a
jmp 0x7966
leaq 0x8e5b(%rip), %rax      # 0x107c8
movq (%rax), %rdi
callq 0x10f0
movl %eax, -0x20(%rbp)
jmp 0x7946
jmp 0x797c
jmp 0x79d5
leaq 0x91c3(%rip), %rax      # 0x10b48
cmpl $0x0, (%rax)
je 0x79c4
movl $0x0, -0x1c(%rbp)
leaq 0x91b0(%rip), %rax      # 0x10b48
movl (%rax), %eax
movl %eax, %edx
addl $0x1, %edx
leaq 0x91a2(%rip), %rcx      # 0x10b48
movl %edx, (%rcx)
cmpl $0x1, %eax
jne 0x79c2
leaq 0x5f5e(%rip), %rdi      # 0xd912
leaq 0x60e5(%rip), %rsi      # 0xdaa0
xorl %edx, %edx
callq 0x22f0
jmp 0x79c4
movslq -0x1c(%rbp), %rcx
leaq 0x96d1(%rip), %rax      # 0x110a0
movb $0x0, (%rax,%rcx)
jmp 0x79e5
jmp 0x79d7
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x78cf
jmp 0x79e7
cmpl $-0x1, -0x20(%rbp)
jne 0x79f9
leaq 0x96ac(%rip), %rax      # 0x110a0
movb $0x0, (%rax)
jmp 0x79fe
callq 0x6cb0
movl -0x20(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)