// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: cliSendCommand
static int cliSendCommand(int argc, char **argv, int repeat) {
    char *command = argv[0];
    size_t *argvlen;
    int j, output_raw;

    if (!config.eval_ldb && /* In debugging mode, let's pass "help" to Redis. */
        (!strcasecmp(command,"help") || !strcasecmp(command,"?"))) {
        cliOutputHelp(--argc, ++argv);
        return REDIS_OK;
    }

    if (context == NULL) return REDIS_ERR;

    output_raw = 0;
    if (!strcasecmp(command,"info") ||
        (argc >= 2 && !strcasecmp(command,"debug") &&
                      ((!strcasecmp(argv[1],"jemalloc") && !strcasecmp(argv[2],"info")) ||
                       !strcasecmp(argv[1],"htstats"))) ||
        (argc == 2 && !strcasecmp(command,"cluster") &&
                      (!strcasecmp(argv[1],"nodes") ||
                       !strcasecmp(argv[1],"info"))) ||
        (argc == 2 && !strcasecmp(command,"client") &&
                       !strcasecmp(argv[1],"list")) ||
        (argc == 3 && !strcasecmp(command,"latency") &&
                       !strcasecmp(argv[1],"graph")) ||
        (argc == 2 && !strcasecmp(command,"latency") &&
                       !strcasecmp(argv[1],"doctor")))
    {
        output_raw = 1;
    }

    if (!strcasecmp(command,"shutdown")) config.shutdown = 1;
    if (!strcasecmp(command,"monitor")) config.monitor_mode = 1;
    if (!strcasecmp(command,"subscribe") ||
        !strcasecmp(command,"psubscribe")) config.pubsub_mode = 1;
    if (!strcasecmp(command,"sync") ||
        !strcasecmp(command,"psync")) config.slave_mode = 1;

    /* When the user manually calls SCRIPT DEBUG, setup the activation of
     * debugging mode on the next eval if needed. */
    if (argc == 3 && !strcasecmp(argv[0],"script") &&
                     !strcasecmp(argv[1],"debug"))
    {
        if (!strcasecmp(argv[2],"yes") || !strcasecmp(argv[2],"sync")) {
            config.enable_ldb_on_eval = 1;
        } else {
            config.enable_ldb_on_eval = 0;
        }
    }

    /* Actually activate LDB on EVAL if needed. */
    if (!strcasecmp(command,"eval") && config.enable_ldb_on_eval) {
        config.eval_ldb = 1;
        config.output = OUTPUT_RAW;
    }

    /* Setup argument length */
    argvlen = zmalloc(argc*sizeof(size_t));
    for (j = 0; j < argc; j++)
        argvlen[j] = sdslen(argv[j]);

    while(repeat--) {
        redisAppendCommandArgv(context,argc,(const char**)argv,argvlen);
        while (config.monitor_mode) {
            if (cliReadReply(output_raw) != REDIS_OK) exit(1);
            fflush(stdout);
        }

        if (config.pubsub_mode) {
            if (config.output != OUTPUT_RAW)
                printf("Reading messages... (press Ctrl-C to quit)\n");
            while (1) {
                if (cliReadReply(output_raw) != REDIS_OK) exit(1);
            }
        }

        if (config.slave_mode) {
            printf("Entering slave output mode...  (press Ctrl-C to quit)\n");
            slaveMode();
            config.slave_mode = 0;
            zfree(argvlen);
            return REDIS_ERR;  /* Error = slaveMode lost connection to master */
        }

        if (cliReadReply(output_raw) != REDIS_OK) {
            zfree(argvlen);
            return REDIS_ERR;
        } else {
            /* Store database number when SELECT was successfully executed. */
            if (!strcasecmp(command,"select") && argc == 2 && config.last_cmd_type != REDIS_REPLY_ERROR) {
                config.dbnum = atoi(argv[1]);
                cliRefreshPrompt();
            } else if (!strcasecmp(command,"auth") && argc == 2) {
                cliSelect();
            }
        }
        if (config.interval) usleep(config.interval);
        fflush(stdout); /* Make it grep friendly */
    }

    zfree(argvlen);
    return REDIS_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, 0x8870c(%rip)     # 0xa15c0
jne 0x18f06
movq -0x20(%rbp), %rdi
leaq 0x72009(%rip), %rsi     # 0x8aeca
callq 0x10060
cmpl $0x0, %eax
je 0x18ee0
movq -0x20(%rbp), %rdi
leaq 0x73b3b(%rip), %rsi     # 0x8ca11
callq 0x10060
cmpl $0x0, %eax
jne 0x18f06
movl -0x8(%rbp), %edi
addl $-0x1, %edi
movl %edi, -0x8(%rbp)
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
movq %rsi, -0x10(%rbp)
callq 0x193f0
movl $0x0, -0x4(%rbp)
jmp 0x193da
cmpq $0x0, 0x886ca(%rip)     # 0xa15d8
jne 0x18f1c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x193da
movl $0x0, -0x30(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x73ae5(%rip), %rsi     # 0x8ca13
callq 0x10060
cmpl $0x0, %eax
je 0x1909b
cmpl $0x2, -0x8(%rbp)
jl 0x18faa
movq -0x20(%rbp), %rdi
leaq 0x76668(%rip), %rsi     # 0x8f5b5
callq 0x10060
cmpl $0x0, %eax
jne 0x18faa
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x73ab2(%rip), %rsi     # 0x8ca18
callq 0x10060
cmpl $0x0, %eax
jne 0x18f8d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x73a94(%rip), %rsi     # 0x8ca13
callq 0x10060
cmpl $0x0, %eax
je 0x1909b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x73a85(%rip), %rsi     # 0x8ca21
callq 0x10060
cmpl $0x0, %eax
je 0x1909b
cmpl $0x2, -0x8(%rbp)
jne 0x18fff
movq -0x20(%rbp), %rdi
leaq 0x73a06(%rip), %rsi     # 0x8c9c1
callq 0x10060
cmpl $0x0, %eax
jne 0x18fff
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x73a55(%rip), %rsi     # 0x8ca29
callq 0x10060
cmpl $0x0, %eax
je 0x1909b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x73a22(%rip), %rsi     # 0x8ca13
callq 0x10060
cmpl $0x0, %eax
je 0x1909b
cmpl $0x2, -0x8(%rbp)
jne 0x19033
movq -0x20(%rbp), %rdi
leaq 0x6e99d(%rip), %rsi     # 0x879ad
callq 0x10060
cmpl $0x0, %eax
jne 0x19033
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x6feec(%rip), %rsi     # 0x88f15
callq 0x10060
cmpl $0x0, %eax
je 0x1909b
cmpl $0x3, -0x8(%rbp)
jne 0x19067
movq -0x20(%rbp), %rdi
leaq 0x71eb7(%rip), %rsi     # 0x8aefb
callq 0x10060
cmpl $0x0, %eax
jne 0x19067
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x739d2(%rip), %rsi     # 0x8ca2f
callq 0x10060
cmpl $0x0, %eax
je 0x1909b
cmpl $0x2, -0x8(%rbp)
jne 0x190a2
movq -0x20(%rbp), %rdi
leaq 0x71e83(%rip), %rsi     # 0x8aefb
callq 0x10060
cmpl $0x0, %eax
jne 0x190a2
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x739a4(%rip), %rsi     # 0x8ca35
callq 0x10060
cmpl $0x0, %eax
jne 0x190a2
movl $0x1, -0x30(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x7398f(%rip), %rsi     # 0x8ca3c
callq 0x10060
cmpl $0x0, %eax
jne 0x190c1
movl $0x1, 0x883f7(%rip)     # 0xa14b8
movq -0x20(%rbp), %rdi
leaq 0x73979(%rip), %rsi     # 0x8ca45
callq 0x10060
cmpl $0x0, %eax
jne 0x190e0
movl $0x1, 0x883dc(%rip)     # 0xa14bc
movq -0x20(%rbp), %rdi
leaq 0x73963(%rip), %rsi     # 0x8ca4e
callq 0x10060
cmpl $0x0, %eax
je 0x1910a
movq -0x20(%rbp), %rdi
leaq 0x7394d(%rip), %rsi     # 0x8ca4d
callq 0x10060
cmpl $0x0, %eax
jne 0x19114
movl $0x1, 0x883ac(%rip)     # 0xa14c0
movq -0x20(%rbp), %rdi
leaq 0x73c8f(%rip), %rsi     # 0x8cdae
callq 0x10060
cmpl $0x0, %eax
je 0x1913e
movq -0x20(%rbp), %rdi
leaq 0x73924(%rip), %rsi     # 0x8ca58
callq 0x10060
cmpl $0x0, %eax
jne 0x19148
movl $0x1, 0x883a0(%rip)     # 0xa14e8
cmpl $0x3, -0x8(%rbp)
jne 0x191c9
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0x709f1(%rip), %rsi     # 0x89b4d
callq 0x10060
cmpl $0x0, %eax
jne 0x191c9
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x76440(%rip), %rsi     # 0x8f5b5
callq 0x10060
cmpl $0x0, %eax
jne 0x191c9
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x73c32(%rip), %rsi     # 0x8cdc0
callq 0x10060
cmpl $0x0, %eax
je 0x191b1
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x73c07(%rip), %rsi     # 0x8cdae
callq 0x10060
cmpl $0x0, %eax
jne 0x191bd
movl $0x1, 0x88411(%rip)     # 0xa15cc
jmp 0x191c7
movl $0x0, 0x88405(%rip)     # 0xa15cc
jmp 0x191c9
movq -0x20(%rbp), %rdi
leaq 0x71dbe(%rip), %rsi     # 0x8af92
callq 0x10060
cmpl $0x0, %eax
jne 0x191fb
cmpl $0x0, 0x883e7(%rip)     # 0xa15cc
je 0x191fb
movl $0x1, 0x883cf(%rip)     # 0xa15c0
movl $0x1, 0x8832d(%rip)     # 0xa1528
movslq -0x8(%rbp), %rdi
shlq $0x3, %rdi
callq 0x19760
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x19246
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x17c20
movq %rax, %rdx
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x19213
jmp 0x19248
movl -0x14(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x14(%rbp)
cmpl $0x0, %eax
je 0x193ca
movq 0x88375(%rip), %rdi     # 0xa15d8
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x1d6a0
cmpl $0x0, 0x88242(%rip)     # 0xa14bc
je 0x192a4
movl -0x30(%rbp), %edi
callq 0x17150
cmpl $0x0, %eax
je 0x19293
movl $0x1, %edi
callq 0x10600
movq 0x85d26(%rip), %rax     # 0x9efc0
movq (%rax), %rdi
callq 0x10430
jmp 0x19273
cmpl $0x0, 0x88215(%rip)     # 0xa14c0
je 0x192df
cmpl $0x1, 0x88274(%rip)     # 0xa1528
je 0x192c4
leaq 0x737a1(%rip), %rdi     # 0x8ca5e
movb $0x0, %al
callq 0x101d0
jmp 0x192c6
movl -0x30(%rbp), %edi
callq 0x17150
cmpl $0x0, %eax
je 0x192dd
movl $0x1, %edi
callq 0x10600
jmp 0x192c6
cmpl $0x0, 0x88202(%rip)     # 0xa14e8
je 0x1931a
leaq 0x7379b(%rip), %rdi     # 0x8ca8a
movb $0x0, %al
callq 0x101d0
callq 0x14a70
movl $0x0, 0x881e3(%rip)     # 0xa14e8
movq -0x28(%rbp), %rdi
callq 0x19a30
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x193da
movl -0x30(%rbp), %edi
callq 0x17150
cmpl $0x0, %eax
je 0x1933c
movq -0x28(%rbp), %rdi
callq 0x19a30
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x193da
movq -0x20(%rbp), %rdi
leaq 0x7377a(%rip), %rsi     # 0x8cac1
callq 0x10060
cmpl $0x0, %eax
jne 0x1937a
cmpl $0x2, -0x8(%rbp)
jne 0x1937a
cmpl $0x6, 0x88272(%rip)     # 0xa15d0
je 0x1937a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x105c0
movl %eax, 0x8813d(%rip)     # 0xa14b0
callq 0x17480
jmp 0x1939c
movq -0x20(%rbp), %rdi
leaq 0x73743(%rip), %rsi     # 0x8cac8
callq 0x10060
cmpl $0x0, %eax
jne 0x1939a
cmpl $0x2, -0x8(%rbp)
jne 0x1939a
callq 0x16ea0
jmp 0x1939c
jmp 0x1939e
cmpq $0x0, 0x88102(%rip)     # 0xa14a8
je 0x193b6
movq 0x880f9(%rip), %rax     # 0xa14a8
movl %eax, %edi
callq 0x106f0
movq 0x85c03(%rip), %rax     # 0x9efc0
movq (%rax), %rdi
callq 0x10430
jmp 0x19248
movq -0x28(%rbp), %rdi
callq 0x19a30
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)