// File: /workspace/github_c_makefile_star2_O2/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, 0x24(%rsp)
movq %rdx, %r14
movq %rsi, 0x38(%rsp)
movq %rdi, 0x40(%rsp)
testq %rcx, %rcx
leaq 0x1f3d(%rip), %rax      # 0xee77
cmovneq %rcx, %rax
movsbl (%rax), %r15d
movb 0x1(%rax), %cl
movb %cl, 0x7(%rsp)
movb 0x2(%rax), %bl
pushq $0x1
popq %r13
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq %rdx, 0x28(%rsp)
testl %r13d, %r13d
je 0xd0d2
testq %r14, %r14
je 0xcf78
incq (%r14)
movq 0x40(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xcdfd
testq %rax, %rax
je 0xd0d2
movq %rax, %r12
testb %bl, %bl
setne %al
movq 0x18(%rsp), %r14
testq %r14, %r14
setne %cl
andb %al, %cl
xorl %r13d, %r13d
cmpb $0x1, %cl
jne 0xcfd4
leaq (%r12,%r14), %r13
xorl %ebp, %ebp
leaq (%r12,%rbp), %rsi
cmpq %r13, %rsi
jae 0xcfd9
cmpb %bl, (%rsi)
jne 0xcfcf
movq %r12, %rdi
movl %r15d, %edx
callq 0xd21a
testl %eax, %eax
je 0xcfe1
incq %rbp
jmp 0xcfb3
movq %r14, %rbp
jmp 0xcff5
movq %r14, %rbp
xorl %r13d, %r13d
jmp 0xcff5
movq %rbp, 0x18(%rsp)
xorl %r13d, %r13d
movq %rbp, %rax
orq 0x8(%rsp), %rax
sete %r13b
testq %rbp, %rbp
movq 0x28(%rsp), %r14
je 0xd050
cmpb $0xa, -0x1(%r12,%rbp)
jne 0xd00f
decq %rbp
movq %rbp, 0x18(%rsp)
movb 0x7(%rsp), %dl
testb %dl, %dl
setne %al
testq %rbp, %rbp
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xd052
cmpb %dl, -0x1(%r12,%rbp)
jne 0xd063
leaq (%r12,%rbp), %rsi
decq %rsi
movq %r12, %rdi
movl %r15d, %edx
callq 0xd21a
testl %eax, %eax
jne 0xd063
decq %rbp
movq %rbp, 0x18(%rsp)
pushq $0x1
popq %r13
jmp 0xd052
xorl %ebp, %ebp
testq %rbp, %rbp
jne 0xd063
cmpq $0x0, 0x8(%rsp)
jne 0xcf67
movl %r13d, 0x20(%rsp)
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %r13
leaq 0x1(,%r13), %rsi
addq %rbp, %rsi
movq %rdi, 0x8(%rsp)
callq 0x57d0
testq %rax, %rax
je 0xd205
movq %rax, %r14
movq %rbp, %rax
addq %r13, %rax
movq %rax, 0x30(%rsp)
movq %r14, %rdi
addq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x5860
movq 0x30(%rsp), %rax
movb $0x0, (%r14,%rax)
movq %r14, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %r14
movl 0x20(%rsp), %r13d
jmp 0xcf67
movl 0x24(%rsp), %r14d
testb $0xf, %r14b
je 0xd1df
testb %r15b, %r15b
movq 0x10(%rsp), %r12
je 0xd1e4
cmpq $0x0, 0x8(%rsp)
je 0xd1e4
movq 0x8(%rsp), %rdi
movl %r15d, %esi
callq 0x5520
testq %rax, %rax
je 0xd1e4
movl %r14d, %ecx
andl $0x4, %ecx
movl %r14d, %edx
andl $0x2, %edx
movl %r14d, %esi
andl $0x1, %esi
andl $0x8, %r14d
movq 0x8(%rsp), %rax
movq %rax, %rdi
movb 0x7(%rsp), %r12b
movb (%rdi), %r8b
testb %r8b, %r8b
je 0xd1cd
addq $0x2, %rdi
testb %r8b, %r8b
je 0xd15d
cmpb %r15b, %r8b
je 0xd15d
movb %r8b, (%rax)
incq %rax
movb -0x1(%rdi), %r8b
incq %rdi
jmp 0xd144
testb %r8b, %r8b
je 0xd1cd
movb -0x1(%rdi), %r9b
testb %r9b, %r9b
je 0xd1cd
cmpb %bl, %r9b
movl $0x0, %r10d
cmovel %ecx, %r10d
cmpb %r12b, %r9b
movl $0x0, %r11d
cmovel %edx, %r11d
orl %r10d, %r11d
cmpb %r15b, %r9b
sete %r10b
movl $0x0, %ebp
cmovel %esi, %ebp
orl %r11d, %ebp
testb $0x1, %r10b
movl %r14d, %r10d
cmovnel %ebp, %r10d
cmpb %r12b, %r9b
cmovel %ebp, %r10d
cmpb %bl, %r9b
cmovel %ebp, %r10d
testl %r10d, %r10d
jne 0xd1c2
movb %r8b, (%rax)
incq %rax
movb -0x1(%rdi), %r9b
movb %r9b, (%rax)
incq %rax
jmp 0xd134
movb $0x0, (%rax)
movq 0x8(%rsp), %rdi
callq 0x5320
movq %rax, %r12
jmp 0xd1e4
movq 0x10(%rsp), %r12
movq 0x38(%rsp), %rax
testq %rax, %rax
je 0xd1f1
movq %r12, (%rax)
movq 0x8(%rsp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdi
callq 0x52f0
movq $0x0, 0x8(%rsp)
jmp 0xd1f1