// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r15d
movq %rsi, %rbx
movl %edi, %r14d
movq (%rsi), %r12
cmpl $0x0, 0x40455(%rip)     # 0x5a540
je 0x1a1fe
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq $0x0, 0x4045a(%rip)     # 0x5a558
je 0x1a65c
leaq 0x2b747(%rip), %rsi     # 0x45852
movq %r12, %rdi
callq 0x10080
testl %eax, %eax
je 0x1a3ad
xorl %r13d, %r13d
cmpl $0x2, %r14d
jl 0x1a3b3
leaq 0x2e646(%rip), %rsi     # 0x48775
movq %r12, %rdi
callq 0x10080
testl %eax, %eax
jne 0x1a181
movq 0x8(%rbx), %rbp
leaq 0x2b711(%rip), %rsi     # 0x45857
movq %rbp, %rdi
callq 0x10080
testl %eax, %eax
jne 0x1a16a
movq 0x10(%rbx), %rdi
leaq 0x2b6f5(%rip), %rsi     # 0x45852
callq 0x10080
testl %eax, %eax
je 0x1a3ad
leaq 0x2b6ef(%rip), %rsi     # 0x45860
movq %rbp, %rdi
callq 0x10080
testl %eax, %eax
je 0x1a3ad
cmpl $0x3, %r14d
je 0x1a2a3
cmpl $0x2, %r14d
jne 0x1a3b3
leaq 0x2b667(%rip), %rsi     # 0x45803
movq %r12, %rdi
callq 0x10080
testl %eax, %eax
je 0x1a37f
leaq 0x2695c(%rip), %rsi     # 0x40b0f
movq %r12, %rdi
callq 0x10080
testl %eax, %eax
jne 0x1a1d7
movq 0x8(%rbx), %rdi
leaq 0x27ead(%rip), %rsi     # 0x42077
callq 0x10080
testl %eax, %eax
je 0x1a3ad
leaq 0x29d42(%rip), %rsi     # 0x43f20
movq %r12, %rdi
callq 0x10080
testl %eax, %eax
jne 0x1a3b3
movq 0x8(%rbx), %rdi
leaq 0x2b67b(%rip), %rsi     # 0x45874
jmp 0x1a2c5
leaq 0x29cff(%rip), %rsi     # 0x43f04
movq %r12, %rdi
callq 0x10080
testl %eax, %eax
je 0x1a228
leaq 0x2b638(%rip), %rsi     # 0x45850
movq %r12, %rdi
callq 0x10080
testl %eax, %eax
jne 0x1a0f1
movl %r14d, %eax
decl %eax
movl %eax, 0x14(%rsp)
je 0x1a27b
cmpl $0x2, %r14d
jl 0x1a6a2
movq 0x8(%rbx), %r14
cmpb $0x40, (%r14)
jne 0x1a271
incq %r14
leaq 0x3c15f(%rip), %r13     # 0x563b0
xorl %r12d, %r12d
movq (%r13), %rsi
movq %r14, %rdi
callq 0x10080
testl %eax, %eax
je 0x1a2d7
incq %r12
addq $0x8, %r13
cmpq $0xe, %r12
jne 0x1a254
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
jmp 0x1a2dc
callq 0x191d5
movq %rax, %rbx
leaq 0x2b649(%rip), %rdi     # 0x458d3
xorl %ebp, %ebp
movq %rax, %rsi
xorl %eax, %eax
callq 0x101f0
movq %rbx, %rdi
callq 0x1da09
jmp 0x1a65c
leaq 0x29c76(%rip), %rsi     # 0x43f20
movq %r12, %rdi
callq 0x10080
testl %eax, %eax
jne 0x1a3b3
movq 0x8(%rbx), %rdi
leaq 0x2b5a9(%rip), %rsi     # 0x4586e
callq 0x10080
testl %eax, %eax
jne 0x1a3b3
jmp 0x1a3ad
movl %r12d, 0x8(%rsp)
cmpl $0x0, 0x40281(%rip)     # 0x5a564
jle 0x1a36e
movl 0x14(%rsp), %r12d
xorl %r13d, %r13d
movq 0x40270(%rip), %rax     # 0x5a568
movq %r13, %rcx
shlq $0x5, %rcx
cmpl $0x1, (%rax,%rcx)
jne 0x1a35f
addq %rcx, %rax
movq 0x18(%rax), %r14
movl 0x8(%rsp), %ecx
cmpl $-0x1, %ecx
je 0x1a322
cmpl 0x18(%r14), %ecx
jne 0x1a35f
movq %r14, %rdi
xorl %esi, %esi
jmp 0x1a35a
movl 0x14(%rsp), %ecx
cmpl %ecx, 0x4(%rax)
jne 0x1a35f
movq 0x8(%rax), %r15
xorl %ebp, %ebp
movq 0x8(%rbx,%rbp,8), %rdi
movq (%r15,%rbp,8), %rsi
callq 0x10080
testl %eax, %eax
jne 0x1a34d
incq %rbp
cmpq %rbp, %r12
jne 0x1a331
jmp 0x1a352
cmpl %ebp, %r12d
jne 0x1a35f
movq %r14, %rdi
movl $0x1, %esi
callq 0x1a6c1
incq %r13
movslq 0x401fb(%rip), %rax     # 0x5a564
cmpq %rax, %r13
jl 0x1a2f1
leaq 0x2aace(%rip), %rdi     # 0x44e43
callq 0x100e0
jmp 0x1a64b
movq 0x8(%rbx), %rbp
leaq 0x2b4de(%rip), %rsi     # 0x45868
movq %rbp, %rdi
callq 0x10080
testl %eax, %eax
je 0x1a3ad
leaq 0x2b4b5(%rip), %rsi     # 0x45852
movq %rbp, %rdi
callq 0x10080
testl %eax, %eax
jne 0x1a1ac
movl $0x1, %r13d
leaq 0x2b4c1(%rip), %rsi     # 0x4587b
movq %r12, %rdi
callq 0x10080
testl %eax, %eax
jne 0x1a3d0
movl $0x1, 0x40068(%rip)     # 0x5a438
leaq 0x2b4ad(%rip), %rsi     # 0x45884
movq %r12, %rdi
callq 0x10080
testl %eax, %eax
jne 0x1a3ed
movl $0x1, 0x4004f(%rip)     # 0x5a43c
leaq 0x2b499(%rip), %rsi     # 0x4588d
movq %r12, %rdi
callq 0x10080
testl %eax, %eax
je 0x1a413
leaq 0x2b485(%rip), %rsi     # 0x4588c
movq %r12, %rdi
callq 0x10080
testl %eax, %eax
jne 0x1a41d
movl $0x1, 0x40023(%rip)     # 0x5a440
leaq 0x2b6bb(%rip), %rsi     # 0x45adf
movq %r12, %rdi
callq 0x10080
testl %eax, %eax
je 0x1a443
leaq 0x2b460(%rip), %rsi     # 0x45897
movq %r12, %rdi
callq 0x10080
testl %eax, %eax
jne 0x1a44d
movl $0x1, 0x4001b(%rip)     # 0x5a468
cmpl $0x3, %r14d
jne 0x1a4b4
leaq 0x28855(%rip), %rsi     # 0x42caf
movq %r12, %rdi
callq 0x10080
testl %eax, %eax
jne 0x1a4b4
movq 0x8(%rbx), %rdi
leaq 0x2e304(%rip), %rsi     # 0x48775
callq 0x10080
testl %eax, %eax
jne 0x1a4b4
movq 0x10(%rbx), %rbp
leaq 0x2b66c(%rip), %rsi     # 0x45af1
movq %rbp, %rdi
callq 0x10080
testl %eax, %eax
je 0x1a4a9
leaq 0x2b647(%rip), %rsi     # 0x45adf
movq %rbp, %rdi
callq 0x10080
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
jmp 0x1a4ae
movl $0x1, %ecx
movl %ecx, 0x40098(%rip)     # 0x5a54c
leaq 0x29afc(%rip), %rsi     # 0x43fb7
movq %r12, %rdi
callq 0x10080
testl %eax, %eax
jne 0x1a4e1
cmpl $0x0, 0x4007e(%rip)     # 0x5a54c
je 0x1a4e1
movl $0x1, %eax
movl %eax, 0x40065(%rip)     # 0x5a540
movl %eax, 0x3ffc7(%rip)     # 0x5a4a8
movslq %r14d, %rdi
shlq $0x3, %rdi
callq 0x1a735
movq %rax, %rbp
testl %r14d, %r14d
jle 0x1a54b
movl %r14d, %eax
xorl %ecx, %ecx
leaq 0x25e3b(%rip), %rdx     # 0x4033c
movq (%rbx,%rcx,8), %rdi
movzbl -0x1(%rdi), %esi
movl %esi, %r8d
andl $0x7, %r8d
cmpl $0x4, %r8d
ja 0x1a53c
movslq (%rdx,%r8,4), %r8
addq %rdx, %r8
jmpq *%r8
shrl $0x3, %esi
jmp 0x1a53e
movq -0x11(%rdi), %rsi
jmp 0x1a53e
movzwl -0x5(%rdi), %esi
jmp 0x1a53e
movl -0x9(%rdi), %esi
jmp 0x1a53e
movzbl -0x3(%rdi), %esi
jmp 0x1a53e
xorl %esi, %esi
movq %rsi, (%rbp,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x1a501
movq %r12, 0x8(%rsp)
testl %r15d, %r15d
je 0x1a643
movq 0x3da60(%rip), %r12     # 0x57fc0
movq 0x3fff1(%rip), %rdi     # 0x5a558
movl %r14d, %esi
movq %rbx, %rdx
movq %rbp, %rcx
callq 0x1d1f1
cmpl $0x0, 0x3fec0(%rip)     # 0x5a43c
je 0x1a599
movl %r13d, %edi
callq 0x19433
testl %eax, %eax
jne 0x1a698
movq (%r12), %rdi
callq 0x10470
jmp 0x1a575
cmpl $0x0, 0x3fea0(%rip)     # 0x5a440
jne 0x1a677
cmpl $0x0, 0x3febb(%rip)     # 0x5a468
jne 0x1a66d
movl %r13d, %edi
callq 0x19433
testl %eax, %eax
jne 0x1a64f
movq 0x8(%rsp), %rdi
leaq 0x2b2ce(%rip), %rsi     # 0x4589d
callq 0x10080
cmpl $0x2, %r14d
jne 0x1a5fd
testl %eax, %eax
jne 0x1a5fd
cmpl $0x6, 0x3ff6b(%rip)     # 0x5a550
je 0x1a5fd
movq 0x8(%rbx), %rdi
callq 0x10600
movl %eax, 0x3fe3a(%rip)     # 0x5a430
callq 0x196cc
jmp 0x1a61d
movq 0x8(%rsp), %rdi
leaq 0x2b29b(%rip), %rsi     # 0x458a4
callq 0x10080
cmpl $0x2, %r14d
jne 0x1a61d
testl %eax, %eax
jne 0x1a61d
callq 0x1926d
movq 0x3fe04(%rip), %rdi     # 0x5a428
testq %rdi, %rdi
je 0x1a62e
callq 0x10720
decl %r15d
movq (%r12), %rdi
callq 0x10470
testl %r15d, %r15d
jne 0x1a560
movq %rbp, %rdi
callq 0x1a877
xorl %ebp, %ebp
jmp 0x1a65c
movq %rbp, %rdi
callq 0x1a877
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbp, %rdi
callq 0x10ec1
jmp 0x1a657
cmpl $0x1, 0x3fe2a(%rip)     # 0x5a4a8
je 0x1a68c
leaq 0x2b883(%rip), %rdi     # 0x45f0a
callq 0x100e0
movl %r13d, %edi
callq 0x19433
testl %eax, %eax
je 0x1a68c
movl $0x1, %edi
callq 0x10630
leaq 0x2b200(%rip), %rdi     # 0x458a9
leaq 0x2a727(%rip), %rsi     # 0x44dd7
leaq 0x2b1fb(%rip), %rcx     # 0x458b2
movl $0x174, %edx            # imm = 0x174
callq 0x10250