// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: cliIntegrateHelp
static void cliIntegrateHelp(void) {
    if (cliConnect(0) == REDIS_ERR) return;

    redisReply *reply = redisCommand(context, "COMMAND");
    if(reply == NULL || reply->type != REDIS_REPLY_ARRAY) return;

    /* Scan the array reported by COMMAND and fill only the entries that
     * don't already match what we have. */
    for (size_t j = 0; j < reply->elements; j++) {
        redisReply *entry = reply->element[j];
        if (entry->type != REDIS_REPLY_ARRAY || entry->elements < 4 ||
            entry->element[0]->type != REDIS_REPLY_STRING ||
            entry->element[1]->type != REDIS_REPLY_INTEGER ||
            entry->element[3]->type != REDIS_REPLY_INTEGER) return;
        char *cmdname = entry->element[0]->str;
        int i;

        for (i = 0; i < helpEntriesLen; i++) {
            helpEntry *he = helpEntries+i;
            if (!strcasecmp(he->argv[0],cmdname))
                break;
        }
        if (i != helpEntriesLen) continue;

        helpEntriesLen++;
        helpEntries = zrealloc(helpEntries,sizeof(helpEntry)*helpEntriesLen);
        helpEntry *new = helpEntries+(helpEntriesLen-1);

        new->argc = 1;
        new->argv = zmalloc(sizeof(sds));
        new->argv[0] = sdsnew(cmdname);
        new->full = new->argv[0];
        new->type = CLI_HELP_COMMAND;
        sdstoupper(new->argv[0]);

        struct commandHelp *ch = zmalloc(sizeof(*ch));
        ch->name = new->argv[0];
        ch->params = sdsempty();
        int args = llabs(entry->element[1]->integer);
        if (entry->element[3]->integer == 1) {
            ch->params = sdscat(ch->params,"key ");
            args--;
        }
        while(args--) ch->params = sdscat(ch->params,"arg ");
        if (entry->element[1]->integer < 0)
            ch->params = sdscat(ch->params,"...options...");
        ch->summary = "Help not available";
        ch->group = 0;
        ch->since = "not known";
        new->org = ch;
    }
    freeReplyObject(reply);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
xorl %edi, %edi
callq 0x14530
cmpl $-0x1, %eax
jne 0x18629
jmp 0x1892e
movq 0x88fa8(%rip), %rdi     # 0xa15d8
leaq 0x6f983(%rip), %rsi     # 0x87fba
movb $0x0, %al
callq 0x1d7f0
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x18652
movq -0x8(%rbp), %rax
cmpl $0x2, (%rax)
je 0x18657
jmp 0x1892e
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x18925
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x186cb
movq -0x18(%rbp), %rax
cmpq $0x4, 0x20(%rax)
jb 0x186cb
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
cmpl $0x1, (%rax)
jne 0x186cb
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
cmpl $0x3, (%rax)
jne 0x186cb
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x18(%rax), %rax
cmpl $0x3, (%rax)
je 0x186d0
jmp 0x1892e
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl 0x88ef1(%rip), %eax     # 0xa15e4
jge 0x18733
movq 0x88eec(%rip), %rax     # 0xa15e8
movslq -0x24(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x10060
cmpl $0x0, %eax
jne 0x18726
jmp 0x18733
jmp 0x18728
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x186ea
movl -0x24(%rbp), %eax
cmpl 0x88ea8(%rip), %eax     # 0xa15e4
je 0x18743
jmp 0x18914
movl 0x88e9b(%rip), %eax     # 0xa15e4
addl $0x1, %eax
movl %eax, 0x88e92(%rip)     # 0xa15e4
movq 0x88e8f(%rip), %rdi     # 0xa15e8
movslq 0x88e84(%rip), %rsi     # 0xa15e4
shlq $0x5, %rsi
callq 0x198d0
movq %rax, 0x88e78(%rip)     # 0xa15e8
movq 0x88e71(%rip), %rax     # 0xa15e8
movl 0x88e67(%rip), %ecx     # 0xa15e4
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl $0x1, 0x4(%rax)
movl $0x8, %edi
callq 0x19760
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rdi
callq 0x1ed70
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movl $0x1, (%rax)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
callq 0x207b0
movl $0x28, %edi
callq 0x19760
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
callq 0x1ed50
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, %rcx
negq %rcx
cmovnsq %rcx, %rax
movl %eax, -0x44(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x18(%rax), %rax
cmpq $0x1, 0x8(%rax)
jne 0x1887a
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x7416c(%rip), %rsi     # 0x8c9cd
callq 0x1f930
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x1887c
movl -0x44(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x44(%rbp)
cmpl $0x0, %eax
je 0x188ad
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x74137(%rip), %rsi     # 0x8c9d2
callq 0x1f930
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x1887c
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
cmpq $0x0, 0x8(%rax)
jge 0x188df
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x74108(%rip), %rsi     # 0x8c9d7
callq 0x1f930
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
leaq 0x740fb(%rip), %rcx     # 0x8c9e5
movq %rcx, 0x10(%rax)
movq -0x40(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x40(%rbp), %rax
leaq 0x740f4(%rip), %rcx     # 0x8c9f8
movq %rcx, 0x20(%rax)
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x1865f
movq -0x8(%rbp), %rdi
callq 0x1b290
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)