// File: /workspace/github_c_makefile_star2_O0/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
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 -0x18(%rbp), %rax
movl $0x0, (%rax)
jmp 0x8ac4
movq -0x20(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x3f(%rbp)
je 0x8af9
callq 0x3530
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, -0x3f(%rbp)
movb -0x3f(%rbp), %al
testb $0x1, %al
jne 0x8b02
jmp 0x8b10
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x8ac4
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
je 0x8e8e
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x8b42
callq 0x34a0
movq %rax, -0x28(%rbp)
jmp 0x8b44
cmpl $0x0, -0x3c(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x8b56
jmp 0x8e49
cmpl $0x0, -0x34(%rbp)
je 0x8cf9
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0x8bf2
movq -0x20(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x78, %eax
jne 0x8bf2
movq -0x20(%rbp), %rax
movsbl 0x2(%rax), %edi
callq 0x3450
cmpl $0x0, %eax
je 0x8bf2
movq -0x20(%rbp), %rax
movsbl 0x3(%rax), %edi
callq 0x3450
cmpl $0x0, %eax
je 0x8bf2
movq -0x20(%rbp), %rax
movsbl 0x2(%rax), %edi
callq 0x30a0
shll $0x4, %eax
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rax
movsbl 0x3(%rax), %edi
callq 0x30a0
movl %eax, %ecx
movl -0x44(%rbp), %eax
addl %ecx, %eax
movb %al, -0x3d(%rbp)
movq -0x28(%rbp), %rdi
leaq -0x3d(%rbp), %rsi
movl $0x1, %edx
callq 0x3420
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x20(%rbp)
jmp 0x8cf4
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0x8c82
movq -0x20(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
je 0x8c82
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 0x8c61
movq -0x50(%rbp), %rax
leaq 0x48d6(%rip), %rcx      # 0xd510
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0xa, -0x3e(%rbp)
jmp 0x8c6a
movb $0xd, -0x3e(%rbp)
jmp 0x8c6a
movb $0x9, -0x3e(%rbp)
jmp 0x8c6a
movb $0x8, -0x3e(%rbp)
jmp 0x8c6a
movb $0x7, -0x3e(%rbp)
jmp 0x8c6a
movq -0x20(%rbp), %rax
movb (%rax), %al
movb %al, -0x3e(%rbp)
movq -0x28(%rbp), %rdi
leaq -0x3e(%rbp), %rsi
movl $0x1, %edx
callq 0x3420
movq %rax, -0x28(%rbp)
jmp 0x8cf2
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x8cca
movq -0x20(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
je 0x8cc1
callq 0x3530
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 0x8cc1
jmp 0x8eb2
movl $0x1, -0x3c(%rbp)
jmp 0x8cf0
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x8cd8
jmp 0x8eb2
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x1, %edx
callq 0x3420
movq %rax, -0x28(%rbp)
jmp 0x8cf0
jmp 0x8cf2
jmp 0x8cf4
jmp 0x8e2f
cmpl $0x0, -0x38(%rbp)
je 0x8db5
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0x8d43
movq -0x20(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x27, %eax
jne 0x8d43
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x4886(%rip), %rsi      # 0xd5b9
movl $0x1, %edx
callq 0x3420
movq %rax, -0x28(%rbp)
jmp 0x8db3
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x27, %eax
jne 0x8d8b
movq -0x20(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
je 0x8d82
callq 0x3530
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 0x8d82
jmp 0x8eb2
movl $0x1, -0x3c(%rbp)
jmp 0x8db1
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x8d99
jmp 0x8eb2
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x1, %edx
callq 0x3420
movq %rax, -0x28(%rbp)
jmp 0x8db1
jmp 0x8db3
jmp 0x8e2d
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x54(%rbp)
testl %eax, %eax
je 0x8dfa
jmp 0x8dc5
movl -0x54(%rbp), %eax
addl $-0x9, %eax
subl $0x2, %eax
jb 0x8dfa
jmp 0x8dd2
movl -0x54(%rbp), %eax
subl $0xd, %eax
je 0x8dfa
jmp 0x8ddc
movl -0x54(%rbp), %eax
subl $0x20, %eax
je 0x8dfa
jmp 0x8de6
movl -0x54(%rbp), %eax
subl $0x22, %eax
je 0x8e03
jmp 0x8df0
movl -0x54(%rbp), %eax
subl $0x27, %eax
je 0x8e0c
jmp 0x8e15
movl $0x1, -0x3c(%rbp)
jmp 0x8e2b
movl $0x1, -0x34(%rbp)
jmp 0x8e2b
movl $0x1, -0x38(%rbp)
jmp 0x8e2b
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x1, %edx
callq 0x3420
movq %rax, -0x28(%rbp)
jmp 0x8e2d
jmp 0x8e2f
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
je 0x8e44
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x8b44
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0x33a0
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 0x8ead
cmpq $0x0, -0x30(%rbp)
jne 0x8ea3
movl $0x8, %edi
callq 0x3350
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x8f07
jmp 0x8ac2
jmp 0x8eb4
movq -0x18(%rbp), %rcx
movl (%rcx), %eax
movl %eax, %edx
addl $-0x1, %edx
movl %edx, (%rcx)
cmpl $0x0, %eax
je 0x8edc
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x3280
jmp 0x8eb4
movq -0x30(%rbp), %rdi
callq 0x3040
cmpq $0x0, -0x28(%rbp)
je 0x8ef5
movq -0x28(%rbp), %rdi
callq 0x3280
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)