// File: Fohlen[P]cubescript-standalone/command.cpp
// Function: parselist(char const*&, char const*&, char const*&, char const*&, char const*&)
static bool parselist(const char *&s, const char *&start = liststart, const char *&end = listend, const char *&quotestart = listquotestart, const char *&quoteend = listquoteend)
{
    skiplist(s);
    switch(*s)
    {
        case '"': quotestart = s++; start = s; s = parsestring(s); end = s; if(*s == '"') s++; quoteend = s; break;
        case '(': case '[':
            quotestart = s;
            start = s+1;
            for(int braktype = *s++, brak = 1;;)
            {
                s += strcspn(s, "\"/;()[]\0");
                int c = *s++;
                switch(c)
                {
                    case '\0': s--; quoteend = end = s; return true;
                    case '"': s = parsestring(s); if(*s == '"') s++; break;
                    case '/': if(*s == '/') s += strcspn(s, "\n\0"); break;
                    case '(': case '[': if(c == braktype) brak++; break;
                    case ')': if(braktype == '(' && --brak <= 0) goto endblock; break;
                    case ']': if(braktype == '[' && --brak <= 0) goto endblock; break;
                } 
            }
        endblock:
            end = s-1;
            quoteend = s;
            break;
        case '\0': case ')': case ']': return false;
        default: quotestart = start = s; s = parseword(s); quoteend = end = s; break;
    }
    skiplist(s);
    if(*s == ';') s++;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0xca50
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
movl %eax, -0x40(%rbp)
testl %eax, %eax
je 0xc4dd
jmp 0xc24c
movl -0x40(%rbp), %eax
subl $0x22, %eax
je 0xc291
jmp 0xc256
movl -0x40(%rbp), %eax
subl $0x28, %eax
je 0xc30b
jmp 0xc264
movl -0x40(%rbp), %eax
subl $0x29, %eax
je 0xc4dd
jmp 0xc272
movl -0x40(%rbp), %eax
subl $0x5b, %eax
je 0xc30b
jmp 0xc280
movl -0x40(%rbp), %eax
subl $0x5d, %eax
je 0xc4dd
jmp 0xc4e3
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, (%rax)
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x6280
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0xc2f8
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0xc523
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq (%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, (%rcx)
movsbl (%rax), %eax
movl %eax, -0x34(%rbp)
movl $0x1, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0x11a70(%rip), %rsi     # 0x1ddc7
callq 0x2040
movq %rax, %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq %rdx, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq (%rcx), %rax
movq %rax, %rdx
incq %rdx
movq %rdx, (%rcx)
movsbl (%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x44(%rbp)
testl %eax, %eax
je 0xc3e1
jmp 0xc38e
movl -0x44(%rbp), %eax
subl $0x22, %eax
je 0xc40d
jmp 0xc398
movl -0x44(%rbp), %eax
subl $0x28, %eax
je 0xc473
jmp 0xc3a6
movl -0x44(%rbp), %eax
subl $0x29, %eax
je 0xc486
jmp 0xc3b4
movl -0x44(%rbp), %eax
subl $0x2f, %eax
je 0xc442
jmp 0xc3c2
movl -0x44(%rbp), %eax
subl $0x5b, %eax
je 0xc473
jmp 0xc3d0
movl -0x44(%rbp), %eax
subl $0x5d, %eax
je 0xc49e
jmp 0xc4b6
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0xc54d
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x6280
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0xc440
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0xc4b6
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0xc471
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0x1194a(%rip), %rsi     # 0x1dda9
callq 0x2040
movq %rax, %rcx
movq -0x10(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0xc4b6
movl -0x3c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jne 0xc484
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xc4b6
cmpl $0x28, -0x34(%rbp)
jne 0xc49c
movl -0x38(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, %eax
jg 0xc49c
jmp 0xc4bb
jmp 0xc4b6
cmpl $0x5b, -0x34(%rbp)
jne 0xc4b4
movl -0x38(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, %eax
jg 0xc4b4
jmp 0xc4bb
jmp 0xc4b6
jmp 0xc349
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0xc523
movb $0x0, -0x1(%rbp)
jmp 0xc54d
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x12370
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
callq 0xca50
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
jne 0xc549
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)