// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
movq %rdi, %r15
movq %rsi, 0x18(%rsp)
movl $0x0, (%rsi)
xorl %r12d, %r12d
xorl %r13d, %r13d
movsbq (%r15), %r14
testq %r14, %r14
sete %bl
je 0x6f67
callq 0x3520
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r14,2)
je 0x6b94
movsbq 0x1(%r15), %rcx
testq %rcx, %rcx
sete %bl
je 0x6f67
incq %r15
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x6b79
testb %bl, %bl
jne 0x6f67
movq %r13, 0x10(%rsp)
testq %r12, %r12
jne 0x6bcc
movl $0x9, %edi
callq 0x3340
testq %rax, %rax
je 0x6bc9
movq %rax, %r12
addq $0x8, %r12
movb $0x0, 0x8(%rax)
movq $0x0, (%rax)
jmp 0x6bcc
xorl %r12d, %r12d
xorl %r13d, %r13d
movl $0x0, 0xc(%rsp)
xorl %ebx, %ebx
testl %ebx, %ebx
je 0x6c8c
movzbl (%r15), %eax
cmpl $0x5c, %eax
jne 0x6c61
cmpb $0x78, 0x1(%r15)
jne 0x6c2d
movb 0x2(%r15), %bpl
leal -0x3a(%rbp), %ecx
cmpb $-0xb, %cl
ja 0x6c0a
movl %ebp, %ecx
andb $-0x21, %cl
addb $-0x47, %cl
cmpb $-0x6, %cl
jb 0x6c2d
movb 0x3(%r15), %r14b
leal -0x3a(%r14), %ecx
cmpb $-0xb, %cl
ja 0x6da5
movl %r14d, %ecx
andb $-0x21, %cl
addb $-0x47, %cl
cmpb $-0x6, %cl
jae 0x6da5
cmpl $0x5c, %eax
jne 0x6c61
movb 0x1(%r15), %bpl
movzbl %bpl, %ecx
cmpl $0x6d, %ecx
jg 0x6d5f
testl %ecx, %ecx
je 0x6c61
cmpl $0x61, %ecx
je 0x6e51
cmpl $0x62, %ecx
jne 0x6e59
movb $0x8, %bpl
jmp 0x6e59
movl $0x9, %ebp
cmpl $0x22, %eax
je 0x6ce6
testl %eax, %eax
je 0x6f30
movslq -0x8(%r12), %r14
movl $0x1, %esi
movq %r12, %rdi
callq 0x31c0
movl $0x1, %ebx
jmp 0x6cce
movzbl (%r15), %eax
cmpl $0x0, 0xc(%rsp)
je 0x6cf5
movl $0x9, %ebp
cmpl $0x27, %eax
je 0x6e15
cmpl $0x5c, %eax
je 0x6d1f
testl %eax, %eax
je 0x6f30
movslq -0x8(%r12), %r14
movl $0x1, %esi
movq %r12, %rdi
callq 0x31c0
movl $0x1, 0xc(%rsp)
xorl %ebx, %ebx
testq %rax, %rax
je 0x6e95
movq %rax, %r12
movb (%r15), %al
movb %al, (%r12,%r14)
jmp 0x6e7f
movsbq 0x1(%r15), %r14
movl $0x1, %ebx
jmp 0x6e24
cmpl $0x27, %eax
ja 0x6eab
movl %eax, %eax
movabsq $0x100002601, %rcx      # imm = 0x100002601
btq %rax, %rcx
jae 0x6d82
movl $0x0, 0xc(%rsp)
xorl %ebx, %ebx
jmp 0x6e44
cmpb $0x27, 0x1(%r15)
jne 0x6e0c
incq %r15
movslq -0x8(%r12), %r14
movl $0x1, %esi
movq %r12, %rdi
callq 0x31c0
movl $0x1, 0xc(%rsp)
xorl %ebx, %ebx
testq %rax, %rax
je 0x6e95
movq %rax, %r12
movb $0x27, (%rax,%r14)
jmp 0x6e7f
cmpl $0x6e, %ecx
je 0x6e4c
cmpl $0x74, %ecx
je 0x6e56
cmpl $0x72, %ecx
jne 0x6e59
movb $0xd, %bpl
jmp 0x6e59
cmpq $0x22, %rax
je 0x6ee4
cmpq $0x27, %rax
jne 0x6eab
movl $0x1, 0xc(%rsp)
xorl %ebx, %ebx
jmp 0x6e98
addq $0x3, %r15
movslq -0x8(%r12), %rax
movq %rax, 0x20(%rsp)
movl $0x1, %esi
movq %r12, %rdi
callq 0x31c0
movl $0x1, %ebx
testq %rax, %rax
je 0x6e95
movq %rax, %r12
movsbl %bpl, %edi
callq 0x30a0
movl %eax, %ebp
shll $0x4, %ebp
movsbl %r14b, %edi
callq 0x30a0
orl %ebp, %eax
movq 0x20(%rsp), %rcx
movb %al, (%r12,%rcx)
leaq 0x1(%rcx), %rax
movl %eax, -0x8(%r12)
decl -0x4(%r12)
movb $0x0, 0x1(%r12,%rcx)
jmp 0x6e98
cmpl $0x27, %eax
jne 0x6caa
movsbq 0x1(%r15), %r14
xorl %ebx, %ebx
movl $0x1, 0xc(%rsp)
testq %r14, %r14
je 0x6e44
callq 0x3520
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r14,2)
movl $0x1, %r13d
jne 0x6e98
jmp 0x6f30
movl $0x1, %r13d
jmp 0x6e98
movb $0xa, %bpl
jmp 0x6e59
movb $0x7, %bpl
jmp 0x6e59
movb $0x9, %bpl
incq %r15
movslq -0x8(%r12), %r14
movl $0x1, %esi
movq %r12, %rdi
callq 0x31c0
movl $0x1, %ebx
testq %rax, %rax
je 0x6e95
movq %rax, %r12
movb %bpl, (%rax,%r14)
leaq 0x1(%r14), %rax
movl %eax, -0x8(%r12)
decl -0x4(%r12)
movb $0x0, 0x1(%r12,%r14)
jmp 0x6e98
xorl %r12d, %r12d
cmpb $0x1, (%r15)
sbbq $-0x1, %r15
testl %r13d, %r13d
je 0x6bd9
jmp 0x6f00
movslq -0x8(%r12), %r14
movl $0x1, %esi
movq %r12, %rdi
callq 0x31c0
xorl %ebx, %ebx
testq %rax, %rax
je 0x6ef3
movq %rax, %r12
movb (%r15), %al
movb %al, (%r12,%r14)
leaq 0x1(%r14), %rax
movl %eax, -0x8(%r12)
decl -0x4(%r12)
movb $0x0, 0x1(%r12,%r14)
jmp 0x6ef6
movl $0x0, 0xc(%rsp)
movl $0x1, %ebx
jmp 0x6e98
xorl %r12d, %r12d
movl $0x0, 0xc(%rsp)
jmp 0x6e98
movq 0x18(%rsp), %rbx
movslq (%rbx), %rax
leaq 0x8(,%rax,8), %rsi
movq 0x10(%rsp), %rdi
callq 0x33a0
movq %rax, %r13
movslq (%rbx), %rax
movq %r12, (%r13,%rax,8)
incl %eax
movl %eax, (%rbx)
xorl %r12d, %r12d
xorl %ebp, %ebp
jmp 0x6f35
movq 0x10(%rsp), %r13
testl %ebp, %ebp
je 0x6b59
cmpl $0x9, %ebp
jne 0x6f96
movq 0x18(%rsp), %rcx
movl (%rcx), %eax
subl $0x1, %eax
movl %eax, (%rcx)
jb 0x6f98
cltq
movq (%r13,%rax,8), %rdi
testq %rdi, %rdi
je 0x6f42
addq $-0x8, %rdi
callq 0x3050
jmp 0x6f42
testq %r13, %r13
je 0x6f7e
movq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x8, %edi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3340
jmp 0x6f6c
movq %r13, %rdi
callq 0x3050
testq %r12, %r12
je 0x6fb1
addq $-0x8, %r12
movq %r12, %rdi
callq 0x3050
movq 0x18(%rsp), %rax
movl $0x0, (%rax)
xorl %r13d, %r13d
jmp 0x6f6c