// File: /workspace/github_c_makefile_star2_O3/zenlinux[P]cwm/linux.c
// Function: fparseln
char *
fparseln(FILE *fp, size_t *size, size_t *lineno, const char str[3],
    int flags)
{
	static const char dstr[3] = { '\\', '\\', '#' };
	char	*buf = NULL, *ptr, *cp, esc, con, nl, com;
	size_t	s, len = 0;
	int	cnt = 1;

	if (str == NULL)
		str = dstr;

	esc = str[0];
	con = str[1];
	com = str[2];

	/*
	 * XXX: it would be cool to be able to specify the newline character,
	 * but unfortunately, fgetln does not let us
	 */
	nl  = '\n';

	while (cnt) {
		cnt = 0;

		if (lineno)
			(*lineno)++;

		if ((ptr = fgetln(fp, &s)) == NULL)
			break;

		if (s && com) {		/* Check and eliminate comments */
			for (cp = ptr; cp < ptr + s; cp++)
				if (*cp == com && !isescaped(ptr, cp, esc)) {
					s = cp - ptr;
					cnt = s == 0 && buf == NULL;
					break;
				}
		}

		if (s && nl) {		/* Check and eliminate newlines */
			cp = &ptr[s - 1];

			if (*cp == nl)
				s--;	/* forget newline */
		}

		if (s && con) {		/* Check and eliminate continuations */
			cp = &ptr[s - 1];

			if (*cp == con && !isescaped(ptr, cp, esc)) {
				s--;	/* forget escape */
				cnt = 1;
			}
		}

		if (s == 0 && buf != NULL)
			continue;

		if ((cp = realloc(buf, len + s + 1)) == NULL) {
			free(buf);
			return NULL;
		}
		buf = cp;

		(void) memcpy(buf + len, ptr, s);
		len += s;
		buf[len] = '\0';
	}

	if ((flags & FPARSELN_UNESCALL) != 0 && esc && buf != NULL &&
	    strchr(buf, esc) != NULL) {
		ptr = cp = buf;
		while (cp[0] != '\0') {
			int skipesc;

			while (cp[0] != '\0' && cp[0] != esc)
				*ptr++ = *cp++;
			if (cp[0] == '\0' || cp[1] == '\0')
				break;

			skipesc = 0;
			if (cp[1] == com)
				skipesc += (flags & FPARSELN_UNESCCOMM);
			if (cp[1] == con)
				skipesc += (flags & FPARSELN_UNESCCONT);
			if (cp[1] == esc)
				skipesc += (flags & FPARSELN_UNESCESC);
			if (cp[1] != com && cp[1] != con && cp[1] != esc)
				skipesc = (flags & FPARSELN_UNESCREST);

			if (skipesc)
				cp++;
			else
				*ptr++ = *cp++;
			*ptr++ = *cp++;
		}
		*ptr = '\0';
		len = strlen(buf);
	}

	if (size)
		*size = len;
	return buf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r8d, 0x2c(%rsp)
movq %rdx, 0x40(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdi, 0x38(%rsp)
testq %rcx, %rcx
leaq 0x1a36(%rip), %rax      # 0xee77
cmovneq %rcx, %rax
movb (%rax), %bl
movb 0x1(%rax), %cl
movb %cl, 0xf(%rsp)
movsbl %bl, %ecx
movl %ecx, 0x28(%rsp)
movb 0x2(%rax), %r12b
movl $0x1, %r13d
xorl %edi, %edi
movq $0x0, 0x10(%rsp)
movq %rdi, %r14
testl %r13d, %r13d
je 0xd5fa
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0xd483
incq (%rax)
movq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xd2df
testq %rax, %rax
movq %r14, %rdi
je 0xd5fa
movq %rax, %rbp
testb %r12b, %r12b
setne %al
movq 0x18(%rsp), %r15
testq %r15, %r15
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xd504
testq %r15, %r15
jle 0xd511
leaq (%r15,%rbp), %rcx
movq %rbp, %rax
testb %bl, %bl
sete %dl
cmpb %r12b, (%rax)
setne %sil
orb %dl, %sil
jne 0xd4fc
leaq -0x1(%rax), %rsi
cmpq %rbp, %rsi
jb 0xd585
xorl %edx, %edx
cmpb %bl, (%rsi)
jne 0xd4f3
incl %edx
decq %rsi
cmpq %rbp, %rsi
jae 0xd4e5
testb $0x1, %dl
je 0xd585
incq %rax
cmpq %rcx, %rax
jb 0xd4c5
xorl %r13d, %r13d
testq %r15, %r15
jne 0xd514
xorl %r15d, %r15d
jmp 0xd575
xorl %r13d, %r13d
cmpb $0xa, -0x1(%rbp,%r15)
jne 0xd524
decq %r15
movq %r15, 0x18(%rsp)
movb 0xf(%rsp), %dl
testb %dl, %dl
setne %al
testq %r15, %r15
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xd575
cmpb %dl, -0x1(%rbp,%r15)
jne 0xd5a2
testb %bl, %bl
je 0xd5a2
leaq (%r15,%rbp), %rax
addq $-0x2, %rax
cmpq %rbp, %rax
jb 0xd567
xorl %ecx, %ecx
cmpb %bl, (%rax)
jne 0xd562
incl %ecx
decq %rax
cmpq %rbp, %rax
jae 0xd554
testb $0x1, %cl
jne 0xd575
decq %r15
movq %r15, 0x18(%rsp)
movl $0x1, %r13d
testq %r15, %r15
jne 0xd5a2
testq %rdi, %rdi
jne 0xd46d
jmp 0xd5a2
movq %rax, %r15
subq %rbp, %r15
movq %r15, 0x18(%rsp)
xorq %rbp, %rax
xorl %r13d, %r13d
orq %rdi, %rax
sete %r13b
jmp 0xd507
movq 0x10(%rsp), %rax
leaq (%r15,%rax), %rsi
incq %rsi
movq %rdi, 0x20(%rsp)
callq 0x57d0
testq %rax, %rax
je 0xd72d
movq %rax, %r14
movq 0x10(%rsp), %rax
leaq (%r15,%rax), %rcx
movq %rcx, 0x20(%rsp)
movq %r14, %rdi
addq %rax, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x5860
movq 0x20(%rsp), %rax
movb $0x0, (%r14,%rax)
movq %r14, %rdi
movq %rax, 0x10(%rsp)
jmp 0xd46a
movl 0x2c(%rsp), %ebp
testb $0xf, %bpl
je 0xd706
testb %bl, %bl
je 0xd706
testq %rdi, %rdi
je 0xd706
movl 0x28(%rsp), %esi
callq 0x5520
testq %rax, %rax
movq 0x10(%rsp), %rcx
je 0xd70b
movq %r14, %rcx
movb (%r14), %r8b
testb %r8b, %r8b
movb 0xf(%rsp), %r15b
je 0xd6f6
movl %ebp, %eax
andl $0x4, %eax
movl %ebp, %edx
andl $0x2, %edx
movl %ebp, %esi
andl $0x1, %esi
andl $0x8, %ebp
movq %r14, %rdi
movq %r14, %rcx
cmpb %bl, %r8b
jne 0xd666
movl %ebx, %r8d
jmp 0xd682
movb %r8b, (%rcx)
incq %rcx
movb 0x1(%rdi), %r8b
incq %rdi
testb %r8b, %r8b
je 0xd67d
cmpb %bl, %r8b
jne 0xd666
testb %r8b, %r8b
je 0xd6f6
movb 0x1(%rdi), %r9b
testb %r9b, %r9b
je 0xd6f6
cmpb %r12b, %r9b
movl $0x0, %r10d
cmovel %eax, %r10d
cmpb %r15b, %r9b
movl $0x0, %r11d
cmovel %edx, %r11d
orl %r10d, %r11d
cmpb %bl, %r9b
movl $0x0, %r10d
cmovel %esi, %r10d
orl %r11d, %r10d
cmpb %bl, %r9b
movl %ebp, %r11d
cmovel %r10d, %r11d
cmpb %r15b, %r9b
cmovel %r10d, %r11d
cmpb %r12b, %r9b
cmovel %r10d, %r11d
testl %r11d, %r11d
jne 0xd6df
movb %r8b, (%rcx)
incq %rcx
movb 0x1(%rdi), %r9b
movb %r9b, (%rcx)
incq %rcx
movb 0x2(%rdi), %r8b
addq $0x2, %rdi
testb %r8b, %r8b
jne 0xd65c
movb $0x0, (%rcx)
movq %r14, %rdi
callq 0x5320
movq %rax, %rcx
jmp 0xd70b
movq 0x10(%rsp), %rcx
cmpq $0x0, 0x30(%rsp)
je 0xd71b
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
movq %r14, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%rsp), %rdi
callq 0x52f0
xorl %eax, %eax
jmp 0xd71e