// File: /workspace/github_c_makefile_star2_O0/JimKent[P]linearSat/lib/linefile.c
// Function: lineFileNextFull
boolean lineFileNextFull(struct lineFile *lf, char **retFull, int *retFullSize,
                        char **retRaw, int *retRawSize)
// Fetch next line from file joining up any that are continued by ending '\'
// If requested, and was joined, the unjoined raw lines are also returned
// NOTE: comment lines can't be continued!  ("# comment \ \n more comment" is 2 lines.)
{
// May have requested reusing the last full line.
if (lf->fullLineReuse)
    {
    lf->fullLineReuse = FALSE;
    assert(lf->fullLine != NULL);
    *retFull = dyStringContents(lf->fullLine);
    if (retFullSize)
        *retFullSize = dyStringLen(lf->fullLine);
    if (retRaw != NULL)
        {
        assert(lf->rawLines != NULL);
        *retRaw = dyStringContents(lf->rawLines);
        if (retRawSize)
            *retRawSize = dyStringLen(lf->rawLines);
        }
    return TRUE;
    }

// Empty pointers
*retFull = NULL;
if (retRaw != NULL)
    *retRaw = NULL;

// Prepare lf buffers
if (lf->fullLine == NULL)
    {
    lf->fullLine = dyStringNew(1024);
    lf->rawLines = dyStringNew(1024); // Better to always create it than test every time
    }
else
    {
    dyStringClear(lf->fullLine);
    dyStringClear(lf->rawLines);
    }

char *line;
while (lineFileNext(lf, &line, NULL))
    {
    char *start = skipLeadingSpaces(line);

    // Will the next line continue this one?
    char *end = start;
    if (*start == '#')  // Comment lines can't be continued!
        end = start + strlen(start);
    else
        {
        while (*end != '\0')  // walking forward for efficiency (avoid strlens())
            {
            for (;*end != '\0' && *end != '\\'; end++) ; // Tight loop to find '\'
            if (*end == '\0')
                break;

            // This could be a continuation
            char *slash = end;
            if (*(++end) == '\\')  // escaped
                continue;
            end = skipLeadingSpaces(end);

            if (*end == '\0') // Just whitespace after '\', so true continuation mark
                {
                if (retRaw != NULL) // Only if actually requested.
                    {
                    dyStringAppendN(lf->rawLines,line,(end - line));
                    dyStringAppendC(lf->rawLines,'\n'); // New lines delimit raw lines.
                    }
                end = slash; // Don't need to zero, because of appending by length
                break;
                }
            }
        }

    // Stitch together full lines
    if (dyStringLen(lf->fullLine) == 0)
        dyStringAppendN(lf->fullLine,line,(end - line)); // includes first line's whitespace
    else if (start < end)             // don't include continued line's leading spaces
        dyStringAppendN(lf->fullLine,start,(end - start));

    if (*end == '\\')
        continue;

    // Got a full line now!
    *retFull = dyStringContents(lf->fullLine);
    if (retFullSize)
        *retFullSize = dyStringLen(lf->fullLine);

    if (retRaw != NULL && dyStringLen(lf->rawLines) > 0) // Only if actually requested & continued
        {
        // This is the final line which doesn't have a continuation char
        dyStringAppendN(lf->rawLines,line,(end - line));
        *retRaw = dyStringContents(lf->rawLines);
        if (retRawSize)
            *retRawSize = dyStringLen(lf->rawLines);
        }
    return TRUE;
    }
return FALSE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x78(%rax)
je 0x13228
movq -0x10(%rbp), %rax
movl $0x0, 0x78(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0x13172
jmp 0x13191
leaq 0x11e31(%rip), %rdi     # 0x24faa
leaq 0x11cb7(%rip), %rsi     # 0x24e37
movl $0x2dc, %edx            # imm = 0x2DC
leaq 0x11e5d(%rip), %rcx     # 0x24fe9
callq 0x32d0
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x131bc
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movl 0x14(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x28(%rbp)
je 0x1321c
movq -0x10(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0x131d0
jmp 0x131ef
leaq 0x11e5a(%rip), %rdi     # 0x25031
leaq 0x11c59(%rip), %rsi     # 0x24e37
movl $0x2e2, %edx            # imm = 0x2E2
leaq 0x11dff(%rip), %rcx     # 0x24fe9
callq 0x32d0
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x30(%rbp)
je 0x1321a
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
movl 0x14(%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
jmp 0x1321c
movl $0x1, -0x4(%rbp)
jmp 0x134ff
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
cmpq $0x0, -0x28(%rbp)
je 0x13245
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x68(%rax)
jne 0x1327c
movl $0x400, %edi            # imm = 0x400
callq 0xf030
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x68(%rax)
movl $0x400, %edi            # imm = 0x400
callq 0xf030
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
jmp 0x132b8
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movl $0x0, 0x14(%rax)
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq 0x8(%rax), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
movl $0x0, 0x14(%rax)
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
movq 0x8(%rax), %rax
movb $0x0, (%rax)
jmp 0x132ba
movq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x12650
cmpl $0x0, %eax
je 0x134f8
movq -0x38(%rbp), %rdi
callq 0x9bb0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x13319
movq -0x40(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rdi
callq 0x31f0
movq %rax, %rcx
movq -0x58(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x48(%rbp)
jmp 0x133fb
jmp 0x1331b
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x133f9
jmp 0x1332d
movq -0x48(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x59(%rbp)
je 0x1334e
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
setne %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0x13357
jmp 0x13367
jmp 0x13359
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x1332d
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x13378
jmp 0x133f9
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x48(%rbp)
movsbl 0x1(%rax), %eax
cmpl $0x5c, %eax
jne 0x1339a
jmp 0x1331b
movq -0x48(%rbp), %rdi
callq 0x9bb0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x133f4
cmpq $0x0, -0x28(%rbp)
je 0x133ea
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
movl %eax, %edx
callq 0xf200
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rdi
movl $0xa, %esi
callq 0xf2b0
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x133f9
jmp 0x1331b
jmp 0x133fb
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
cmpl $0x0, 0x14(%rax)
jne 0x13429
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
movl %eax, %edx
callq 0xf200
jmp 0x13453
movq -0x40(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x13451
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rcx
subq %rcx, %rax
movl %eax, %edx
callq 0xf200
jmp 0x13453
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0x13464
jmp 0x132ba
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x1348f
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movl 0x14(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x28(%rbp)
je 0x134ef
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
cmpl $0x0, 0x14(%rax)
jle 0x134ef
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
movl %eax, %edx
callq 0xf200
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x30(%rbp)
je 0x134ed
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
movl 0x14(%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
jmp 0x134ef
movl $0x1, -0x4(%rbp)
jmp 0x134ff
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)