// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: hintsCallback
static char *hintsCallback(const char *buf, int *color, int *bold) {
    if (!pref.hints) return NULL;

    int i, argc, buflen = strlen(buf);
    sds *argv = sdssplitargs(buf,&argc);
    int endspace = buflen && isspace(buf[buflen-1]);

    /* Check if the argument list is empty and return ASAP. */
    if (argc == 0) {
        sdsfreesplitres(argv,argc);
        return NULL;
    }

    for (i = 0; i < helpEntriesLen; i++) {
        if (!(helpEntries[i].type & CLI_HELP_COMMAND)) continue;

        if (strcasecmp(argv[0],helpEntries[i].full) == 0)
        {
            *color = 90;
            *bold = 0;
            sds hint = sdsnew(helpEntries[i].org->params);

            /* Remove arguments from the returned hint to show only the
             * ones the user did not yet typed. */
            int toremove = argc-1;
            while(toremove > 0 && sdslen(hint)) {
                if (hint[0] == '[') break;
                if (hint[0] == ' ') toremove--;
                sdsrange(hint,1,-1);
            }

            /* Add an initial space if needed. */
            if (!endspace) {
                sds newhint = sdsnewlen(" ",1);
                newhint = sdscatsds(newhint,hint);
                sdsfree(hint);
                hint = newhint;
            }

            sdsfreesplitres(argv,argc);
            return hint;
        }
    }
    sdsfreesplitres(argv,argc);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpb $0x1, 0x4057a(%rip)     # 0x5a3f8
jne 0x19f26
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0x101c0
movq %rax, %r13
leaq 0x4(%rsp), %rsi
movq %r12, %rdi
callq 0x1f4e7
movq %rax, %rbx
testl %r13d, %r13d
je 0x19ecc
callq 0x10710
movq (%rax), %rax
decl %r13d
movslq %r13d, %rcx
movsbq (%r12,%rcx), %rcx
movb 0x1(%rax,%rcx,2), %r12b
andb $0x20, %r12b
shrb $0x5, %r12b
jmp 0x19ecf
xorl %r12d, %r12d
movl 0x4(%rsp), %ebp
testl %ebp, %ebp
je 0x19f2e
movq %r15, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movslq 0x4067c(%rip), %r13     # 0x5a564
testq %r13, %r13
jle 0x19f1c
movq 0x40674(%rip), %r14     # 0x5a568
shlq $0x5, %r13
xorl %r15d, %r15d
testb $0x1, (%r14,%r15)
je 0x19f13
movq (%rbx), %rdi
movq 0x10(%r14,%r15), %rsi
callq 0x10080
testl %eax, %eax
je 0x19f3b
addq $0x20, %r15
cmpq %r15, %r13
jne 0x19efb
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1f2e1
xorl %r14d, %r14d
jmp 0x1a011
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x1a00c
movq 0x8(%rsp), %rax
movl $0x5a, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
movq 0x18(%r14,%r15), %rax
movq 0x8(%rax), %rdi
callq 0x1d989
movq %rax, %r14
movl 0x4(%rsp), %ebp
cmpl $0x2, %ebp
jl 0x19fd6
decl %ebp
leaq 0x263b4(%rip), %r15     # 0x40328
movzbl -0x1(%r14), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x19fd6
movslq (%r15,%rcx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x19fa9
movq -0x11(%r14), %rax
jmp 0x19fa9
movzwl -0x5(%r14), %eax
jmp 0x19fa9
movl -0x9(%r14), %eax
jmp 0x19fa9
movzbl -0x3(%r14), %eax
testq %rax, %rax
je 0x19fd6
movzbl (%r14), %eax
cmpl $0x20, %eax
je 0x19fbe
cmpl $0x5b, %eax
jne 0x19fc0
jmp 0x19fd6
decl %ebp
movq %r14, %rdi
movl $0x1, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1ee8f
testl %ebp, %ebp
jg 0x19f74
testb %r12b, %r12b
jne 0x1a005
leaq 0x2be04(%rip), %rdi     # 0x45de6
movl $0x1, %esi
callq 0x1d854
movq %rax, %rdi
movq %r14, %rsi
callq 0x1e2a0
movq %rax, %r15
movq %r14, %rdi
callq 0x1da09
movq %r15, %r14
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0x1f2e1
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq