// File: /workspace/github_c_makefile_star2_O0/JimKent[P]linearSat/lib/common.c
// Function: chopByWhiteRespectDoubleQuotes
int chopByWhiteRespectDoubleQuotes(char *in, char *outArray[], int outSize)
/* Like chopString, but specialized for white space separators.
 * Further, any doubleQuotes (") are respected.
 * If doubleQuote is encloses whole string, then they are removed:
 *   "Fred and Ethyl" results in word [Fred and Ethyl]
 * If doubleQuotes exist inside string they are retained:
 *   Fred" and Ethyl" results in word [Fred" and Ethyl"]
 * Special note "" is a valid, though empty word. */
{
int recordCount = 0;
char c;
char *quoteBegins = NULL;
boolean quoting = FALSE;
for (;;)
    {
    if (outArray != NULL && recordCount >= outSize)
        break;

    /* Skip initial separators. */
    while (isspace(*in)) ++in;
    if (*in == 0)
        break;

    /* Store start of word and look for end of word. */
    if (outArray != NULL)
        {
        outArray[recordCount] = in;
        if ((*in == '"'))
            quoteBegins = (in+1);
        else
            quoteBegins = NULL;
        }
    recordCount += 1;
    quoting = FALSE;
    for (;;)
        {
        if ((c = *in) == 0)
            break;
        if (quoting)
            {
            if (c == '"')
                {
                quoting = FALSE;
                if (quoteBegins != NULL) // implies out array
                    {
                    if ((c = *(in+1) == 0 )|| isspace(c)) // whole word is quoted.
                        {
                        outArray[recordCount-1] = quoteBegins; // Fix beginning of word
                        quoteBegins = NULL;
                        break;
                        }
                    }
                }
            }
        else
            {
            quoting = (c == '"');
            if (isspace(c))
                break;
            }
        ++in;
        }
    if (*in == 0)
        break;

    /* Tag end of word with zero. */
    if (outArray != NULL)
        *in = 0;
    /* And skip over the zero. */
    in += 1;
    }
return recordCount;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xb98d
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jl 0xb98d
jmp 0xbb1d
jmp 0xb98f
callq 0x3760
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0xb9bd
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0xb98f
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xb9ce
jmp 0xbb1d
cmpq $0x0, -0x10(%rbp)
je 0xba09
movq -0x8(%rbp), %rdx
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0xb9ff
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xba07
movq $0x0, -0x28(%rbp)
jmp 0xba09
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movb (%rax), %al
movb %al, -0x19(%rbp)
movsbl %al, %eax
cmpl $0x0, %eax
jne 0xba2f
jmp 0xbaf0
cmpl $0x0, -0x2c(%rbp)
je 0xbaac
movsbl -0x19(%rbp), %eax
cmpl $0x22, %eax
jne 0xbaaa
movl $0x0, -0x2c(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xbaa8
movq -0x8(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movb %al, -0x19(%rbp)
movsbl %al, %eax
cmpl $0x0, %eax
jne 0xba87
callq 0x3760
movq (%rax), %rax
movsbl -0x19(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0xbaa6
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq $0x0, -0x28(%rbp)
jmp 0xbaf0
jmp 0xbaa8
jmp 0xbaaa
jmp 0xbadf
movsbl -0x19(%rbp), %eax
cmpl $0x22, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x2c(%rbp)
callq 0x3760
movq (%rax), %rax
movsbl -0x19(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0xbadd
jmp 0xbaf0
jmp 0xbadf
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0xba19
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xbafe
jmp 0xbb1d
cmpq $0x0, -0x10(%rbp)
je 0xbb0c
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0xb979
movl -0x18(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)