// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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, 0x41e8a(%rip)     # 0x60438
jne 0x1e656
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0x111d0
movq %rax, %r13
leaq 0x4(%rsp), %rsi
movq %r12, %rdi
callq 0x23b0c
movq %rax, %rbx
testl %r13d, %r13d
je 0x1e5fc
callq 0x11720
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 0x1e5ff
xorl %r12d, %r12d
movl 0x4(%rsp), %ebp
testl %ebp, %ebp
je 0x1e65e
movq %r15, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movslq 0x41f8c(%rip), %r13     # 0x605a4
testq %r13, %r13
jle 0x1e64c
movq 0x41f84(%rip), %r14     # 0x605a8
shlq $0x5, %r13
xorl %r15d, %r15d
testb $0x1, (%r14,%r15)
je 0x1e643
movq (%rbx), %rdi
movq 0x10(%r14,%r15), %rsi
callq 0x11080
testl %eax, %eax
je 0x1e66b
addq $0x20, %r15
cmpq %r15, %r13
jne 0x1e62b
movq %rbx, %rdi
movl %ebp, %esi
callq 0x23906
xorl %r14d, %r14d
jmp 0x1e745
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x1e740
movq 0x8(%rsp), %rax
movl $0x5a, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
movq 0x18(%r14,%r15), %rax
movq 0x8(%rax), %rdi
callq 0x21fd2
movq %rax, %r14
movl 0x4(%rsp), %ebp
cmpl $0x2, %ebp
jl 0x1e70a
decl %ebp
leaq 0x25c28(%rip), %r15     # 0x442cc
movzbl -0x1(%r14), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x1e6db
movslq (%r15,%rcx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x1e6dd
movq -0x11(%r14), %rax
jmp 0x1e6dd
movzwl -0x5(%r14), %eax
jmp 0x1e6dd
movl -0x9(%r14), %eax
jmp 0x1e6dd
movzbl -0x3(%r14), %eax
jmp 0x1e6dd
xorl %eax, %eax
testq %rax, %rax
je 0x1e70a
movzbl (%r14), %eax
cmpl $0x20, %eax
je 0x1e6f2
cmpl $0x5b, %eax
jne 0x1e6f4
jmp 0x1e70a
decl %ebp
movq %r14, %rdi
movl $0x1, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x234c2
testl %ebp, %ebp
jg 0x1e6a4
testb %r12b, %r12b
jne 0x1e739
leaq 0x2b687(%rip), %rdi     # 0x49d9d
movl $0x1, %esi
callq 0x21e9c
movq %rax, %rdi
movq %r14, %rsi
callq 0x228d4
movq %rax, %r15
movq %r14, %rdi
callq 0x22043
movq %r15, %r14
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0x23906
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq