// File: /workspace/github_c_makefile_star2_O0/winton[P]redis_parse/hiredis/sds.c
// Function: sdssplitargs
sds *sdssplitargs(char *line, int *argc) {
    char *p = line;
    char *current = NULL;
    char **vector = NULL, **_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 done=0;

            if (current == NULL) {
                current = sdsempty();
                if (current == NULL) goto err;
            }

            while(!done) {
                if (inq) {
                    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 */
                        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;
                    default:
                        current = sdscatlen(current,p,1);
                        break;
                    }
                }
                if (*p) p++;
                if (current == NULL) goto err;
            }
            /* add the token to the vector */
            _vector = realloc(vector,((*argc)+1)*sizeof(char*));
            if (_vector == NULL) goto err;

            vector = _vector;
            vector[*argc] = current;
            (*argc)++;
            current = NULL;
        } else {
            return vector;
        }
    }

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
jmp 0x74cc
movq -0x20(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x42(%rbp)
je 0x7501
callq 0x2450
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
movb %al, -0x42(%rbp)
movb -0x42(%rbp), %al
testb $0x1, %al
jne 0x750a
jmp 0x7518
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x74cc
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
je 0x774f
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x7551
callq 0x23f0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x754f
jmp 0x775e
jmp 0x7551
jmp 0x7553
cmpl $0x0, -0x40(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x7565
jmp 0x76f9
cmpl $0x0, -0x3c(%rbp)
je 0x7671
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0x75ff
movq -0x20(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
je 0x75ff
movq -0x20(%rbp), %rax
incq %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
addl $-0x61, %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x13, %eax
ja 0x75de
movq -0x50(%rbp), %rax
leaq 0x2f7d(%rip), %rcx      # 0xa534
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0xa, -0x41(%rbp)
jmp 0x75e7
movb $0xd, -0x41(%rbp)
jmp 0x75e7
movb $0x9, -0x41(%rbp)
jmp 0x75e7
movb $0x8, -0x41(%rbp)
jmp 0x75e7
movb $0x7, -0x41(%rbp)
jmp 0x75e7
movq -0x20(%rbp), %rax
movb (%rax), %al
movb %al, -0x41(%rbp)
movq -0x28(%rbp), %rdi
leaq -0x41(%rbp), %rsi
movl $0x1, %edx
callq 0x23a0
movq %rax, -0x28(%rbp)
jmp 0x766f
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x7647
movq -0x20(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
je 0x763e
callq 0x2450
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movsbl 0x1(%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x763e
jmp 0x775e
movl $0x1, -0x40(%rbp)
jmp 0x766d
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x7655
jmp 0x775e
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x1, %edx
callq 0x23a0
movq %rax, -0x28(%rbp)
jmp 0x766d
jmp 0x766f
jmp 0x76d6
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x54(%rbp)
testl %eax, %eax
je 0x76ac
jmp 0x7681
movl -0x54(%rbp), %eax
addl $-0x9, %eax
subl $0x2, %eax
jb 0x76ac
jmp 0x768e
movl -0x54(%rbp), %eax
subl $0xd, %eax
je 0x76ac
jmp 0x7698
movl -0x54(%rbp), %eax
subl $0x20, %eax
je 0x76ac
jmp 0x76a2
movl -0x54(%rbp), %eax
subl $0x22, %eax
je 0x76b5
jmp 0x76be
movl $0x1, -0x40(%rbp)
jmp 0x76d4
movl $0x1, -0x3c(%rbp)
jmp 0x76d4
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x1, %edx
callq 0x23a0
movq %rax, -0x28(%rbp)
jmp 0x76d6
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
je 0x76eb
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x76f4
jmp 0x775e
jmp 0x7553
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0x2340
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x771f
jmp 0x775e
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq (%rcx), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq $0x0, -0x28(%rbp)
jmp 0x7759
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x77b0
jmp 0x74ca
jmp 0x7760
movq -0x18(%rbp), %rcx
movl (%rcx), %eax
movl %eax, %edx
addl $-0x1, %edx
movl %edx, (%rcx)
cmpl $0x0, %eax
je 0x7788
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2250
jmp 0x7760
cmpq $0x0, -0x30(%rbp)
je 0x7798
movq -0x30(%rbp), %rdi
callq 0x2050
cmpq $0x0, -0x28(%rbp)
je 0x77a8
movq -0x28(%rbp), %rdi
callq 0x2250
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)