// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/common.c
// Function: slPairNameToString
char *slPairNameToString(struct slPair *list, char delimiter,boolean quoteIfSpaces)
// Return string created by joining all names (ignoring vals) with the delimiter.
// If requested, will wrap name in quotes if contain spaces: [name1,"name 2" ...]
{
int elCount = 0;
int count = 0;
struct slPair *pair = list;
for (; pair != NULL; pair = pair->next, elCount++)
    {
    assert(pair->name != NULL);
    count += strlen(pair->name);
    if (quoteIfSpaces && hasWhiteSpace(pair->name))
        count += 2;
    }
count += elCount;
if (count == 0)
    return NULL;

char *str = needMem(count+5); // A bit of slop

char *strPtr = str;
for (pair = list; pair != NULL; pair = pair->next, strPtr += strlen(strPtr))
    {
    if (pair != list)
        *strPtr++ = delimiter;
    if (hasWhiteSpace(pair->name))
        {
        if (quoteIfSpaces)
            sprintf(strPtr,"\"%s\"",pair->name);
        else
            {
            if (delimiter == ' ')  // if delimied by commas, this is entirely okay!
                warn("slPairListToString() Unexpected white space in name delimied by space: "
                     "[%s]\n", pair->name);
            sprintf(strPtr,"%s",pair->name); // warn but still make string
            }
        }
    else
        sprintf(strPtr,"%s",pair->name);
    }
return str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movl %esi, 0x4(%rsp)
movq %rdi, %r12
testq %rdi, %rdi
movq %rdi, 0x8(%rsp)
je 0x8015
xorl %r14d, %r14d
xorl %r13d, %r13d
movq 0x8(%r12), %r15
testq %r15, %r15
je 0x80fa
movq %r15, %rdi
callq 0x3200
addl %eax, %r14d
testl %ebx, %ebx
je 0x7fff
movsbq (%r15), %rbp
testq %rbp, %rbp
je 0x7ff1
incq %r15
callq 0x37a0
movq (%rax), %rax
testb $0x20, 0x1(%rax,%rbp,2)
je 0x7fd6
leal 0x2(%r14), %eax
testb %bpl, %bpl
cmovel %r14d, %eax
movl %eax, %r14d
movq (%r12), %r12
incl %r13d
testq %r12, %r12
jne 0x7fb9
addl %r13d, %r14d
movq 0x8(%rsp), %r12
jmp 0x8018
xorl %r14d, %r14d
testl %r14d, %r14d
je 0x80e9
addl $0x5, %r14d
movslq %r14d, %rdi
callq 0xf07d
testq %r12, %r12
je 0x80eb
movq %rax, 0x10(%rsp)
movq %rax, %r15
movq %r12, %r14
cmpq %r12, %r14
je 0x8050
movl 0x4(%rsp), %eax
movb %al, (%r15)
incq %r15
movq 0x8(%r14), %r13
movq %r13, %r12
movsbq (%r12), %rbp
testq %rbp, %rbp
je 0x8092
incq %r12
callq 0x37a0
movq (%rax), %rax
testb $0x20, 0x1(%rax,%rbp,2)
je 0x8057
testb %bpl, %bpl
je 0x8092
testl %ebx, %ebx
je 0x80b7
movq %r15, %rdi
leaq 0x12b44(%rip), %rsi     # 0x1abca
movq %r13, %rdx
xorl %eax, %eax
callq 0x36d0
jmp 0x809d
movq %r15, %rdi
movq %r13, %rsi
callq 0x30e0
movq 0x8(%rsp), %r12
movq (%r14), %r14
movq %r15, %rdi
callq 0x3200
addq %rax, %r15
testq %r14, %r14
jne 0x8041
jmp 0x80e2
cmpb $0x20, 0x4(%rsp)
movq 0x8(%rsp), %r12
jne 0x80d4
leaq 0x113de(%rip), %rdi     # 0x194a8
movq %r13, %rsi
xorl %eax, %eax
callq 0xb632
movq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x30e0
jmp 0x80a2
movq 0x10(%rsp), %rax
jmp 0x80eb
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1135f(%rip), %rdi     # 0x19460
leaq 0x112a1(%rip), %rsi     # 0x193a9
leaq 0x11364(%rip), %rcx     # 0x19473
movl $0x4af, %edx            # imm = 0x4AF
callq 0x32e0