// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/sds.c
// Function: sdssplitargs
sds *sdssplitargs(const char *line, int *argc) {
    const char *p = line;
    char *current = NULL;
    char **vector = NULL;

    *argc = 0;
    while(1) {
        /* skip blanks */
        while(*p && isspace(*p)) p++;
        if (*p) {
            /* get a token */
            int inq=0;  /* set to 1 if we are in "quotes" */
            int insq=0; /* set to 1 if we are in 'single quotes' */
            int done=0;

            if (current == NULL) current = sdsempty();
            while(!done) {
                if (inq) {
                    if (*p == '\\' && *(p+1) == 'x' &&
                                             is_hex_digit(*(p+2)) &&
                                             is_hex_digit(*(p+3)))
                    {
                        unsigned char byte;

                        byte = (hex_digit_to_int(*(p+2))*16)+
                                hex_digit_to_int(*(p+3));
                        current = sdscatlen(current,(char*)&byte,1);
                        p += 3;
                    } else if (*p == '\\' && *(p+1)) {
                        char c;

                        p++;
                        switch(*p) {
                        case 'n': c = '\n'; break;
                        case 'r': c = '\r'; break;
                        case 't': c = '\t'; break;
                        case 'b': c = '\b'; break;
                        case 'a': c = '\a'; break;
                        default: c = *p; break;
                        }
                        current = sdscatlen(current,&c,1);
                    } else if (*p == '"') {
                        /* closing quote must be followed by a space or
                         * nothing at all. */
                        if (*(p+1) && !isspace(*(p+1))) goto err;
                        done=1;
                    } else if (!*p) {
                        /* unterminated quotes */
                        goto err;
                    } else {
                        current = sdscatlen(current,p,1);
                    }
                } else if (insq) {
                    if (*p == '\\' && *(p+1) == '\'') {
                        p++;
                        current = sdscatlen(current,"'",1);
                    } else if (*p == '\'') {
                        /* closing quote must be followed by a space or
                         * nothing at all. */
                        if (*(p+1) && !isspace(*(p+1))) goto err;
                        done=1;
                    } else if (!*p) {
                        /* unterminated quotes */
                        goto err;
                    } else {
                        current = sdscatlen(current,p,1);
                    }
                } else {
                    switch(*p) {
                    case ' ':
                    case '\n':
                    case '\r':
                    case '\t':
                    case '\0':
                        done=1;
                        break;
                    case '"':
                        inq=1;
                        break;
                    case '\'':
                        insq=1;
                        break;
                    default:
                        current = sdscatlen(current,p,1);
                        break;
                    }
                }
                if (*p) p++;
            }
            /* add the token to the vector */
            vector = realloc(vector,((*argc)+1)*sizeof(char*));
            vector[*argc] = current;
            (*argc)++;
            current = NULL;
        } else {
            /* Even on empty input string return something not NULL. */
            if (vector == NULL) vector = malloc(sizeof(void*));
            return vector;
        }
    }

err:
    while((*argc)--)
        sdsfree(vector[*argc]);
    free(vector);
    if (current) sdsfree(current);
    *argc = 0;
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r15
xorl %eax, %eax
xorl %r12d, %r12d
movl %eax, (%rbx)
movsbq (%r15), %r14
testq %r14, %r14
je 0x6463
callq 0x3540
movq %rax, %r13
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r14,2)
je 0x61ba
incq %r15
jmp 0x6195
movq %r12, 0x8(%rsp)
xorl %r12d, %r12d
callq 0x34a0
movq %rax, %rbp
xorl %r14d, %r14d
xorl %eax, %eax
testl %eax, %eax
jne 0x6402
testl %r12d, %r12d
je 0x61fb
movzbl (%r15), %eax
cmpl $0x22, %eax
je 0x62b2
cmpl $0x5c, %eax
je 0x6227
testl %eax, %eax
jne 0x62a7
jmp 0x6437
movzbl (%r15), %eax
testl %r14d, %r14d
je 0x62d6
cmpl $0x27, %eax
je 0x6335
cmpl $0x5c, %eax
je 0x6303
testl %eax, %eax
jne 0x6319
jmp 0x6437
movzbl 0x1(%r15), %eax
testl %eax, %eax
je 0x62a7
cmpl $0x78, %eax
jne 0x6359
movb 0x2(%r15), %cl
leal -0x3a(%rcx), %edx
cmpb $-0xb, %dl
ja 0x6256
movl %ecx, %edx
andb $-0x21, %dl
addb $-0x47, %dl
cmpb $-0x6, %dl
jb 0x6381
movb 0x3(%r15), %r12b
leal -0x3a(%r12), %edx
cmpb $-0xb, %dl
ja 0x6276
movl %r12d, %edx
andb $-0x21, %dl
addb $-0x47, %dl
cmpb $-0x6, %dl
jb 0x6381
addq $0x3, %r15
movsbl %cl, %edi
callq 0x30b0
shll $0x4, %eax
movl %eax, 0x14(%rsp)
movsbl %r12b, %edi
callq 0x30b0
orl 0x14(%rsp), %eax
movb %al, 0x7(%rsp)
movq %rbp, %rdi
leaq 0x7(%rsp), %rsi
jmp 0x6390
movq %rbp, %rdi
movq %r15, %rsi
jmp 0x6390
movsbq 0x1(%r15), %rax
testq %rax, %rax
je 0x62cb
movq (%r13), %rcx
testb $0x20, 0x1(%rcx,%rax,2)
je 0x6437
pushq $0x1
popq %rax
movl %eax, %r12d
jmp 0x63a1
cmpl $0x27, %eax
ja 0x63be
xorl %r12d, %r12d
movl %eax, %eax
movabsq $0x100002601, %rcx      # imm = 0x100002601
btq %rax, %rcx
jae 0x63ae
xorl %r14d, %r14d
pushq $0x1
popq %rax
jmp 0x63a1
cmpb $0x27, 0x1(%r15)
jne 0x6319
incq %r15
movq %rbp, %rdi
leaq 0x31fe(%rip), %rsi      # 0x9515
jmp 0x631f
movq %rbp, %rdi
movq %r15, %rsi
pushq $0x1
popq %rdx
callq 0x3430
movq %rax, %rbp
xorl %r12d, %r12d
pushq $0x1
popq %r14
xorl %eax, %eax
jmp 0x63a1
movsbq 0x1(%r15), %rax
xorl %r12d, %r12d
testq %rax, %rax
je 0x6351
movq (%r13), %rcx
testb $0x20, 0x1(%rcx,%rax,2)
je 0x6437
pushq $0x1
popq %rax
movl %eax, %r14d
jmp 0x63a1
cmpl $0x61, %eax
je 0x63fb
cmpl $0x62, %eax
je 0x63e6
cmpl $0x74, %eax
je 0x63f4
cmpl $0x72, %eax
je 0x63ed
cmpl $0x6e, %eax
jne 0x6381
movb $0xa, 0x6(%rsp)
jmp 0x6385
movb %al, 0x6(%rsp)
incq %r15
movq %rbp, %rdi
leaq 0x6(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x3430
movq %rax, %rbp
xorl %eax, %eax
pushq $0x1
popq %r12
cmpb $0x1, (%r15)
sbbq $-0x1, %r15
jmp 0x61cf
cmpq $0x22, %rax
je 0x63da
cmpq $0x27, %rax
je 0x632a
movq %rbp, %rdi
movq %r15, %rsi
pushq $0x1
popq %rdx
callq 0x3430
movq %rax, %rbp
xorl %r12d, %r12d
xorl %r14d, %r14d
jmp 0x6331
xorl %r14d, %r14d
pushq $0x1
popq %r12
jmp 0x6331
movb $0x8, 0x6(%rsp)
jmp 0x6385
movb $0xd, 0x6(%rsp)
jmp 0x6385
movb $0x9, 0x6(%rsp)
jmp 0x6385
movb $0x7, 0x6(%rsp)
jmp 0x6385
movslq (%rbx), %r14
leaq 0x8(,%r14,8), %rsi
movq 0x8(%rsp), %rdi
callq 0x33b0
movq %rax, %r12
movq %rbp, (%rax,%r14,8)
leal 0x1(%r14), %eax
jmp 0x6193
cltq
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x3290
movl (%rbx), %eax
subl $0x1, %eax
movl %eax, (%rbx)
jae 0x6427
movq 0x8(%rsp), %rdi
callq 0x3050
testq %rbp, %rbp
je 0x645b
addq $-0x8, %rbp
movq %rbp, %rdi
callq 0x3050
andl $0x0, (%rbx)
xorl %r12d, %r12d
jmp 0x6468
testq %r12, %r12
je 0x647a
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x8
popq %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3350