// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpl $0x0, 0x889bd(%rip)     # 0xa1478
jne 0x18aca
movq $0x0, -0x8(%rbp)
jmp 0x18cc2
movq -0x10(%rbp), %rdi
callq 0x101a0
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x20e50
movq %rax, -0x38(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x2c(%rbp)
movb %al, -0x59(%rbp)
je 0x18b20
callq 0x106e0
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movl -0x2c(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x18b4a
movq -0x38(%rbp), %rdi
movl -0x28(%rbp), %esi
callq 0x20ad0
movq $0x0, -0x8(%rbp)
jmp 0x18cc2
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl 0x88a8a(%rip), %eax     # 0xa15e4
jge 0x18cae
movq 0x88a81(%rip), %rax     # 0xa15e8
movslq -0x24(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x18b81
jmp 0x18ca0
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movq 0x88a59(%rip), %rax     # 0xa15e8
movslq -0x24(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
callq 0x10060
cmpl $0x0, %eax
jne 0x18c9e
movq -0x18(%rbp), %rax
movl $0x5a, (%rax)
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movq 0x88a21(%rip), %rax     # 0xa15e8
movslq -0x24(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x1ed70
movq %rax, -0x48(%rbp)
movl -0x28(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x4c(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x4c(%rbp)
movb %al, -0x5a(%rbp)
jle 0x18c0a
movq -0x48(%rbp), %rdi
callq 0x17c20
cmpq $0x0, %rax
setne %al
movb %al, -0x5a(%rbp)
movb -0x5a(%rbp), %al
testb $0x1, %al
jne 0x18c13
jmp 0x18c4b
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5b, %eax
jne 0x18c21
jmp 0x18c4b
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x18c36
movl -0x4c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4c(%rbp)
movq -0x48(%rbp), %rdi
movl $0x1, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x20610
jmp 0x18bec
cmpl $0x0, -0x3c(%rbp)
jne 0x18c88
leaq 0x7331c(%rip), %rdi     # 0x8bf74
movl $0x1, %esi
callq 0x1eaa0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x1f970
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rdi
callq 0x1ee80
movq -0x58(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
movl -0x28(%rbp), %esi
callq 0x20ad0
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x18cc2
jmp 0x18ca0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x18b51
movq -0x38(%rbp), %rdi
movl -0x28(%rbp), %esi
callq 0x20ad0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)