// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/common.c
// Function: chopByWhiteRespectDoubleQuotes
int chopByWhiteRespectDoubleQuotes(char *in, char *outArray[], int outSize)
// NOTE: this routine does not do what this comment says.  It did not ever remove quotes due to
// a coding error so I took out the code that pretended to be doing this.
/* 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;
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;
    recordCount += 1;
    quoting = FALSE;
    for (;;)
        {
        if ((c = *in) == 0)
            break;
        if (quoting)
            {
            if (c == '"')
                quoting = FALSE;
            }
        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 $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x2ea45
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jl 0x2ea45
jmp 0x2eb46
jmp 0x2ea47
callq 0x6780
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 0x2ea75
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x2ea47
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x2ea86
jmp 0x2eb46
cmpq $0x0, -0x10(%rbp)
je 0x2ea9d
movq -0x8(%rbp), %rdx
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movb (%rax), %al
movb %al, -0x19(%rbp)
movsbl %al, %eax
cmpl $0x0, %eax
jne 0x2eac0
jmp 0x2eb19
cmpl $0x0, -0x20(%rbp)
je 0x2ead8
movsbl -0x19(%rbp), %eax
cmpl $0x22, %eax
jne 0x2ead6
movl $0x0, -0x20(%rbp)
jmp 0x2eb0b
movsbl -0x19(%rbp), %eax
cmpl $0x22, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x20(%rbp)
callq 0x6780
movq (%rax), %rax
movsbl -0x19(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x2eb09
jmp 0x2eb19
jmp 0x2eb0b
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x2eaad
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x2eb27
jmp 0x2eb46
cmpq $0x0, -0x10(%rbp)
je 0x2eb35
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x2ea31
movl -0x18(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop