// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: getKeySizes
static void getKeySizes(redisReply *keys, int *types,
                        unsigned long long *sizes)
{
    redisReply *reply;
    char *sizecmds[] = {"STRLEN","LLEN","SCARD","HLEN","ZCARD"};
    unsigned int i;

    /* Pipeline size commands */
    for(i=0;i<keys->elements;i++) {
        /* Skip keys that were deleted */
        if(types[i]==TYPE_NONE)
            continue;

        redisAppendCommand(context, "%s %s", sizecmds[types[i]],
            keys->element[i]->str);
    }

    /* Retreive sizes */
    for(i=0;i<keys->elements;i++) {
        /* Skip keys that dissapeared between SCAN and TYPE */
        if(types[i] == TYPE_NONE) {
            sizes[i] = 0;
            continue;
        }

        /* Retreive size */
        if(redisGetReply(context, (void**)&reply)!=REDIS_OK) {
            fprintf(stderr, "Error getting size for key '%s' (%d: %s)\n",
                keys->element[i]->str, context->err, context->errstr);
            exit(1);
        } else if(reply->type != REDIS_REPLY_INTEGER) {
            /* Theoretically the key could have been removed and
             * added as a different type between TYPE and SIZE */
            fprintf(stderr,
                "Warning:  %s on '%s' failed (may have changed type)\n",
                 sizecmds[types[i]], keys->element[i]->str);
            sizes[i] = 0;
        } else {
            sizes[i] = reply->integer;
        }

        freeReplyObject(reply);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0x853d1(%rip), %rsi     # 0x9d420
movl $0x28, %edx
callq 0x103b0
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x180bf
movq -0x10(%rbp), %rax
movl -0x54(%rbp), %ecx
cmpl $0x5, (%rax,%rcx,4)
jne 0x1807c
jmp 0x180b4
movq 0x89555(%rip), %rdi     # 0xa15d8
movq -0x10(%rbp), %rax
movl -0x54(%rbp), %ecx
movslq (%rax,%rcx,4), %rax
movq -0x50(%rbp,%rax,8), %rdx
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x54(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rcx
leaq 0x744ec(%rip), %rsi     # 0x8c599
movb $0x0, %al
callq 0x1d600
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x18060
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x181d7
movq -0x10(%rbp), %rax
movl -0x54(%rbp), %ecx
cmpl $0x5, (%rax,%rcx,4)
jne 0x180f8
movq -0x18(%rbp), %rax
movl -0x54(%rbp), %ecx
movq $0x0, (%rax,%rcx,8)
jmp 0x181c9
movq 0x894d9(%rip), %rdi     # 0xa15d8
leaq -0x20(%rbp), %rsi
callq 0x1d3b0
cmpl $0x0, %eax
je 0x18156
movq 0x86edc(%rip), %rax     # 0x9eff0
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x54(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rdx
movq 0x894a7(%rip), %rax     # 0xa15d8
movl (%rax), %ecx
movq 0x8949e(%rip), %r8      # 0xa15d8
addq $0x4, %r8
leaq 0x7445a(%rip), %rsi     # 0x8c59f
movb $0x0, %al
callq 0x10360
movl $0x1, %edi
callq 0x10600
movq -0x20(%rbp), %rax
cmpl $0x3, (%rax)
je 0x181ab
movq 0x86e8a(%rip), %rax     # 0x9eff0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl -0x54(%rbp), %ecx
movslq (%rax,%rcx,4), %rax
movq -0x50(%rbp,%rax,8), %rdx
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x54(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rcx
leaq 0x74436(%rip), %rsi     # 0x8c5c9
movb $0x0, %al
callq 0x10360
movq -0x18(%rbp), %rax
movl -0x54(%rbp), %ecx
movq $0x0, (%rax,%rcx,8)
jmp 0x181be
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x18(%rbp), %rax
movl -0x54(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
jmp 0x181c0
movq -0x20(%rbp), %rdi
callq 0x1b290
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x180c6
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)