// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: statMode
static void statMode(void) {
    redisReply *reply;
    long aux, requests = 0;
    int i = 0;

    while(1) {
        char buf[64];
        int j;

        reply = reconnectingRedisCommand(context,"INFO");
        if (reply->type == REDIS_REPLY_ERROR) {
            printf("ERROR: %s\n", reply->str);
            exit(1);
        }

        if ((i++ % 20) == 0) {
            printf(
"------- data ------ --------------------- load -------------------- - child -\n"
"keys       mem      clients blocked requests            connections          \n");
        }

        /* Keys */
        aux = 0;
        for (j = 0; j < 20; j++) {
            long k;

            sprintf(buf,"db%d:keys",j);
            k = getLongInfoField(reply->str,buf);
            if (k == LONG_MIN) continue;
            aux += k;
        }
        sprintf(buf,"%ld",aux);
        printf("%-11s",buf);

        /* Used memory */
        aux = getLongInfoField(reply->str,"used_memory");
        bytesToHuman(buf,aux);
        printf("%-8s",buf);

        /* Clients */
        aux = getLongInfoField(reply->str,"connected_clients");
        sprintf(buf,"%ld",aux);
        printf(" %-8s",buf);

        /* Blocked (BLPOPPING) Clients */
        aux = getLongInfoField(reply->str,"blocked_clients");
        sprintf(buf,"%ld",aux);
        printf("%-8s",buf);

        /* Requets */
        aux = getLongInfoField(reply->str,"total_commands_processed");
        sprintf(buf,"%ld (+%ld)",aux,requests == 0 ? 0 : aux-requests);
        printf("%-19s",buf);
        requests = aux;

        /* Connections */
        aux = getLongInfoField(reply->str,"total_connections_received");
        sprintf(buf,"%ld",aux);
        printf(" %-12s",buf);

        /* Children */
        aux = getLongInfoField(reply->str,"bgsave_in_progress");
        aux |= getLongInfoField(reply->str,"aof_rewrite_in_progress") << 1;
        aux |= getLongInfoField(reply->str,"loading") << 2;
        switch(aux) {
        case 0: break;
        case 1:
            printf("SAVE");
            break;
        case 2:
            printf("AOF");
            break;
        case 3:
            printf("SAVE+AOF");
            break;
        case 4:
            printf("LOAD");
            break;
        }

        printf("\n");
        freeReplyObject(reply);
        usleep(config.interval);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq 0x8b937(%rip), %rdi     # 0xa15d8
leaq 0x723b5(%rip), %rsi     # 0x8805d
movb $0x0, %al
callq 0x16f40
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x6, (%rax)
jne 0x15cdc
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
leaq 0x76933(%rip), %rdi     # 0x8c5fe
movb $0x0, %al
callq 0x101d0
movl $0x1, %edi
callq 0x10600
movl -0x1c(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x1c(%rbp)
movl $0x14, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x15d02
leaq 0x7690e(%rip), %rdi     # 0x8c609
movb $0x0, %al
callq 0x101d0
movq $0x0, -0x10(%rbp)
movl $0x0, -0x64(%rbp)
cmpl $0x14, -0x64(%rbp)
jge 0x15d6a
leaq -0x60(%rbp), %rdi
movl -0x64(%rbp), %edx
leaq 0x76981(%rip), %rsi     # 0x8c6a6
movb $0x0, %al
callq 0x105f0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x60(%rbp), %rsi
callq 0x182e0
movq %rax, -0x70(%rbp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
cmpq %rax, -0x70(%rbp)
jne 0x15d53
jmp 0x15d5f
movq -0x70(%rbp), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x15d11
leaq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x76937(%rip), %rsi     # 0x8c6b0
movb $0x0, %al
callq 0x105f0
leaq -0x60(%rbp), %rsi
leaq 0x76929(%rip), %rdi     # 0x8c6b4
movb $0x0, %al
callq 0x101d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x76919(%rip), %rsi     # 0x8c6ba
callq 0x182e0
movq %rax, -0x10(%rbp)
leaq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x13440
leaq -0x60(%rbp), %rsi
leaq 0x76917(%rip), %rdi     # 0x8c6d9
movb $0x0, %al
callq 0x101d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x768ee(%rip), %rsi     # 0x8c6c6
callq 0x182e0
movq %rax, -0x10(%rbp)
leaq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x768c0(%rip), %rsi     # 0x8c6b0
movb $0x0, %al
callq 0x105f0
leaq -0x60(%rbp), %rsi
leaq 0x768d6(%rip), %rdi     # 0x8c6d8
movb $0x0, %al
callq 0x101d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x768c6(%rip), %rsi     # 0x8c6de
callq 0x182e0
movq %rax, -0x10(%rbp)
leaq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x76880(%rip), %rsi     # 0x8c6b0
movb $0x0, %al
callq 0x105f0
leaq -0x60(%rbp), %rsi
leaq 0x76897(%rip), %rdi     # 0x8c6d9
movb $0x0, %al
callq 0x101d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x76896(%rip), %rsi     # 0x8c6ee
callq 0x182e0
movq %rax, -0x10(%rbp)
leaq -0x60(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x15e83
xorl %eax, %eax
movq %rax, -0x88(%rbp)
jmp 0x15e92
movq -0x10(%rbp), %rax
subq -0x18(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x78(%rbp), %rdx
movq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rcx
leaq 0x7685f(%rip), %rsi     # 0x8c707
xorl %eax, %eax
movb %al, -0x91(%rbp)
callq 0x105f0
movb -0x91(%rbp), %al
leaq 0x76850(%rip), %rdi     # 0x8c712
leaq -0x60(%rbp), %rsi
movq %rsi, -0xa0(%rbp)
callq 0x101d0
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x7682f(%rip), %rsi     # 0x8c718
callq 0x182e0
movq -0xa0(%rbp), %rdi
movq %rax, %rcx
movb -0x91(%rbp), %al
movq %rcx, -0x10(%rbp)
movq -0x10(%rbp), %rdx
leaq 0x767a3(%rip), %rsi     # 0x8c6b0
callq 0x105f0
movq -0xa0(%rbp), %rsi
movb -0x91(%rbp), %al
leaq 0x7680d(%rip), %rdi     # 0x8c733
callq 0x101d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x76800(%rip), %rsi     # 0x8c73a
callq 0x182e0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x767fb(%rip), %rsi     # 0x8c74d
callq 0x182e0
movq %rax, %rcx
addq %rcx, %rcx
movq -0x10(%rbp), %rax
orq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x767ee(%rip), %rsi     # 0x8c765
callq 0x182e0
movq %rax, %rcx
shlq $0x2, %rcx
movq -0x10(%rbp), %rax
orq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
subq $0x4, %rax
ja 0x15ff6
movq -0x90(%rbp), %rax
leaq 0x71263(%rip), %rcx     # 0x87210
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x15ff6
leaq 0x71644(%rip), %rdi     # 0x87603
movb $0x0, %al
callq 0x101d0
jmp 0x15ff6
leaq 0x767a3(%rip), %rdi     # 0x8c772
movb $0x0, %al
callq 0x101d0
jmp 0x15ff6
leaq 0x7678e(%rip), %rdi     # 0x8c76d
movb $0x0, %al
callq 0x101d0
jmp 0x15ff6
leaq 0x73b59(%rip), %rdi     # 0x89b48
movb $0x0, %al
callq 0x101d0
leaq 0x7639e(%rip), %rdi     # 0x8c39b
movb $0x0, %al
callq 0x101d0
movq -0x8(%rbp), %rdi
callq 0x1b290
movq 0x8b494(%rip), %rax     # 0xa14a8
movl %eax, %edi
callq 0x106f0
jmp 0x15c9a