// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r15d
movq %rsi, %rbx
movl %edi, %ebp
movq (%rsi), %r12
cmpl $0x0, 0x41d62(%rip)     # 0x60580
je 0x1e964
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpq $0x0, 0x41d66(%rip)     # 0x60598
je 0x1edc3
leaq 0x2afca(%rip), %rsi     # 0x49809
movq %r12, %rdi
callq 0x11080
testl %eax, %eax
je 0x1ea42
cmpl $0x2, %ebp
jl 0x1e8ad
leaq 0x2ebf9(%rip), %rsi     # 0x4d454
movq %r12, %rdi
callq 0x11080
testl %eax, %eax
jne 0x1e8ad
movq 0x8(%rbx), %r14
leaq 0x2af9c(%rip), %rsi     # 0x4980e
movq %r14, %rdi
callq 0x11080
testl %eax, %eax
jne 0x1e896
movq 0x10(%rbx), %rdi
leaq 0x2af80(%rip), %rsi     # 0x49809
callq 0x11080
testl %eax, %eax
je 0x1ea42
leaq 0x2af7a(%rip), %rsi     # 0x49817
movq %r14, %rdi
callq 0x11080
testl %eax, %eax
je 0x1ea42
cmpl $0x2, %ebp
jne 0x1e8f4
leaq 0x2aefe(%rip), %rsi     # 0x497b7
movq %r12, %rdi
callq 0x11080
testl %eax, %eax
je 0x1ea14
leaq 0x261ef(%rip), %rsi     # 0x44abf
movq %r12, %rdi
callq 0x11080
testl %eax, %eax
jne 0x1e8f4
movq 0x8(%rbx), %rdi
leaq 0x27740(%rip), %rsi     # 0x46027
callq 0x11080
testl %eax, %eax
je 0x1ea42
cmpl $0x3, %ebp
jne 0x1e924
leaq 0x295e8(%rip), %rsi     # 0x47ee8
movq %r12, %rdi
callq 0x11080
testl %eax, %eax
jne 0x1e924
movq 0x8(%rbx), %rdi
leaq 0x2af0e(%rip), %rsi     # 0x49825
callq 0x11080
testl %eax, %eax
je 0x1ea42
xorl %r13d, %r13d
cmpl $0x2, %ebp
jne 0x1ea48
leaq 0x295b1(%rip), %rsi     # 0x47ee8
movq %r12, %rdi
callq 0x11080
testl %eax, %eax
jne 0x1ea48
movq 0x8(%rbx), %rdi
leaq 0x2aed9(%rip), %rsi     # 0x4982b
callq 0x11080
testl %eax, %eax
jne 0x1ea48
jmp 0x1ea42
leaq 0x2954c(%rip), %rsi     # 0x47eb7
movq %r12, %rdi
callq 0x11080
testl %eax, %eax
je 0x1e98e
leaq 0x2ae89(%rip), %rsi     # 0x49807
movq %r12, %rdi
callq 0x11080
testl %eax, %eax
jne 0x1e824
movl %ebp, %r12d
decl %r12d
je 0x1e9eb
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmpl $0x2, %ebp
jl 0x1eb53
movq 0x8(%rbx), %r14
cmpb $0x40, (%r14)
jne 0x1eb53
incq %r14
leaq 0x3d853(%rip), %r15     # 0x5c210
xorl %r13d, %r13d
movq (%r15), %rsi
movq %r14, %rdi
callq 0x11080
testl %eax, %eax
je 0x1eb50
incq %r13
addq $0x8, %r15
cmpq $0xe, %r13
jne 0x1e9c0
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x1eb53
callq 0x1d90e
movq %rax, %rbx
leaq 0x2ae90(%rip), %rdi     # 0x4988a
xorl %r14d, %r14d
movq %rax, %rsi
xorl %eax, %eax
callq 0x11200
movq %rbx, %rdi
callq 0x22043
jmp 0x1edc3
movq 0x8(%rbx), %r14
leaq 0x2ae00(%rip), %rsi     # 0x4981f
movq %r14, %rdi
callq 0x11080
testl %eax, %eax
je 0x1ea42
leaq 0x2add7(%rip), %rsi     # 0x49809
movq %r14, %rdi
callq 0x11080
testl %eax, %eax
jne 0x1e8c9
movl $0x1, %r13d
leaq 0x2ade3(%rip), %rsi     # 0x49832
movq %r12, %rdi
callq 0x11080
testl %eax, %eax
jne 0x1ea65
movl $0x1, 0x41a13(%rip)     # 0x60478
leaq 0x2adcf(%rip), %rsi     # 0x4983b
movq %r12, %rdi
callq 0x11080
testl %eax, %eax
jne 0x1ea82
movl $0x1, 0x419fa(%rip)     # 0x6047c
leaq 0x2adbb(%rip), %rsi     # 0x49844
movq %r12, %rdi
callq 0x11080
testl %eax, %eax
je 0x1eaa8
leaq 0x2ada7(%rip), %rsi     # 0x49843
movq %r12, %rdi
callq 0x11080
testl %eax, %eax
jne 0x1eab2
movl $0x1, 0x419ce(%rip)     # 0x60480
leaq 0x2afdd(%rip), %rsi     # 0x49a96
movq %r12, %rdi
callq 0x11080
testl %eax, %eax
je 0x1ead8
leaq 0x2ad82(%rip), %rsi     # 0x4984e
movq %r12, %rdi
callq 0x11080
testl %eax, %eax
jne 0x1eae2
movl $0x1, 0x419c6(%rip)     # 0x604a8
cmpl $0x3, %ebp
jne 0x1ec1f
leaq 0x2816d(%rip), %rsi     # 0x46c5f
movq %r12, %rdi
callq 0x11080
testl %eax, %eax
jne 0x1ec1f
movq 0x8(%rbx), %rdi
leaq 0x2e947(%rip), %rsi     # 0x4d454
callq 0x11080
testl %eax, %eax
jne 0x1ec1f
movq 0x10(%rbx), %r14
leaq 0x2af83(%rip), %rsi     # 0x49aa8
movq %r14, %rdi
callq 0x11080
testl %eax, %eax
je 0x1ec14
leaq 0x2af5a(%rip), %rsi     # 0x49a96
movq %r14, %rdi
callq 0x11080
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
jmp 0x1ec19
movl %r13d, %r15d
cmpl $0x2, %ebp
jl 0x1ee0a
cmpl $0x0, 0x41a41(%rip)     # 0x605a4
jle 0x1ec03
movl %r12d, %r13d
xorl %ebp, %ebp
movl %r12d, 0x8(%rsp)
movl %r15d, 0x14(%rsp)
movq 0x41a29(%rip), %rax     # 0x605a8
movq %rbp, %rcx
shlq $0x5, %rcx
cmpl $0x1, (%rax,%rcx)
jne 0x1ebf0
addq %rcx, %rax
movq 0x18(%rax), %r14
cmpl $-0x1, %r15d
je 0x1eba3
xorl %esi, %esi
cmpl 0x18(%r14), %r15d
je 0x1ebe8
jmp 0x1ebf0
cmpl %r12d, 0x4(%rax)
jne 0x1ebf0
movq 0x8(%rax), %r12
xorl %r15d, %r15d
movq 0x8(%rbx,%r15,8), %rdi
movq (%r12,%r15,8), %rsi
callq 0x11080
testl %eax, %eax
jne 0x1ebd4
incq %r15
cmpq %r15, %r13
jne 0x1ebb0
movl 0x8(%rsp), %r12d
movl %r12d, %r15d
jmp 0x1ebd9
movl 0x8(%rsp), %r12d
movl $0x1, %esi
cmpl %r12d, %r15d
movl 0x14(%rsp), %r15d
jne 0x1ebf0
movq %r14, %rdi
callq 0x1ee29
incq %rbp
movslq 0x419aa(%rip), %rax     # 0x605a4
cmpq %rax, %rbp
jl 0x1eb78
leaq 0x2a209(%rip), %rdi     # 0x48e13
callq 0x110e0
jmp 0x1edb0
movl $0x1, %ecx
movl %ecx, 0x4196d(%rip)     # 0x6058c
leaq 0x29359(%rip), %rsi     # 0x47f7f
movq %r12, %rdi
callq 0x11080
testl %eax, %eax
jne 0x1ec4c
cmpl $0x0, 0x41953(%rip)     # 0x6058c
je 0x1ec4c
movl $0x1, %eax
movl %eax, 0x4193a(%rip)     # 0x60580
movl %eax, 0x4189c(%rip)     # 0x604e8
movslq %ebp, %rdi
shlq $0x3, %rdi
callq 0x1ee9d
movq %rax, %r14
testl %ebp, %ebp
jle 0x1ecb3
movl %ebp, %eax
xorl %ecx, %ecx
leaq 0x25676(%rip), %rdx     # 0x442e0
movq (%rbx,%rcx,8), %rdi
movzbl -0x1(%rdi), %esi
movl %esi, %r8d
andl $0x7, %r8d
cmpl $0x4, %r8d
ja 0x1eca5
movslq (%rdx,%r8,4), %r8
addq %rdx, %r8
jmpq *%r8
shrl $0x3, %esi
jmp 0x1eca7
movq -0x11(%rdi), %rsi
jmp 0x1eca7
movzwl -0x5(%rdi), %esi
jmp 0x1eca7
movl -0x9(%rdi), %esi
jmp 0x1eca7
movzbl -0x3(%rdi), %esi
jmp 0x1eca7
xorl %esi, %esi
movq %rsi, (%r14,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x1ec6a
movq %r12, 0x8(%rsp)
testl %r15d, %r15d
je 0x1eda8
movq 0x3f2f8(%rip), %r12     # 0x5dfc0
movq 0x418c9(%rip), %rdi     # 0x60598
movl %ebp, %esi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x2181f
cmpl $0x0, 0x41799(%rip)     # 0x6047c
je 0x1ed00
movl %r13d, %edi
callq 0x1db6c
testl %eax, %eax
jne 0x1ee00
movq (%r12), %rdi
callq 0x11480
jmp 0x1ecdc
cmpl $0x0, 0x41779(%rip)     # 0x60480
jne 0x1eddf
cmpl $0x0, 0x41794(%rip)     # 0x604a8
jne 0x1edd5
movl %r13d, %edi
callq 0x1db6c
testl %eax, %eax
jne 0x1edb5
movq 0x8(%rsp), %rdi
leaq 0x2ab1e(%rip), %rsi     # 0x49854
callq 0x11080
cmpl $0x2, %ebp
jne 0x1ed63
testl %eax, %eax
jne 0x1ed63
cmpl $0x6, 0x41845(%rip)     # 0x60590
je 0x1ed63
movq 0x8(%rbx), %rdi
callq 0x11610
movl %eax, 0x41714(%rip)     # 0x60470
callq 0x1de0e
jmp 0x1ed82
movq 0x8(%rsp), %rdi
leaq 0x2aaec(%rip), %rsi     # 0x4985b
callq 0x11080
cmpl $0x2, %ebp
jne 0x1ed82
testl %eax, %eax
jne 0x1ed82
callq 0x1d9a6
movq 0x416df(%rip), %rdi     # 0x60468
testq %rdi, %rdi
je 0x1ed93
callq 0x11730
decl %r15d
movq (%r12), %rdi
callq 0x11480
testl %r15d, %r15d
jne 0x1ecc8
movq %r14, %rdi
callq 0x1efdf
xorl %r14d, %r14d
jmp 0x1edc3
movq %r14, %rdi
callq 0x1efdf
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x11f23
jmp 0x1edbd
cmpl $0x1, 0x41702(%rip)     # 0x604e8
je 0x1edf4
leaq 0x2b0d2(%rip), %rdi     # 0x49ec1
callq 0x110e0
movl %r13d, %edi
callq 0x1db6c
testl %eax, %eax
je 0x1edf4
movl $0x1, %edi
callq 0x11640
leaq 0x2aa4f(%rip), %rdi     # 0x49860
leaq 0x29f8f(%rip), %rsi     # 0x48da7
leaq 0x2aa4a(%rip), %rcx     # 0x49869
movl $0x174, %edx            # imm = 0x174
callq 0x11260