// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/redis-cli.c
// Function: main
int main(int argc, char **argv) {
    int firstarg;

    config.hostip = sdsnew("127.0.0.1");
    config.hostport = 6379;
    config.hostsocket = NULL;
    config.repeat = 1;
    config.interval = 0;
    config.dbnum = 0;
    config.interactive = 0;
    config.shutdown = 0;
    config.monitor_mode = 0;
    config.pubsub_mode = 0;
    config.latency_mode = 0;
    config.latency_history = 0;
    config.cluster_mode = 0;
    config.slave_mode = 0;
    config.getrdb_mode = 0;
    config.stat_mode = 0;
    config.scan_mode = 0;
    config.intrinsic_latency_mode = 0;
    config.pattern = NULL;
    config.rdb_filename = NULL;
    config.pipe_mode = 0;
    config.pipe_timeout = REDIS_CLI_DEFAULT_PIPE_TIMEOUT;
    config.bigkeys = 0;
    config.stdinarg = 0;
    config.auth = NULL;
    config.eval = NULL;
    if (!isatty(fileno(stdout)) && (getenv("FAKETTY") == NULL))
        config.output = OUTPUT_RAW;
    else
        config.output = OUTPUT_STANDARD;
    config.mb_delim = sdsnew("\n");
    cliInitHelp();

    firstarg = parseOptions(argc,argv);
    argc -= firstarg;
    argv += firstarg;

    /* Latency mode */
    if (config.latency_mode) {
        if (cliConnect(0) == REDIS_ERR) exit(1);
        latencyMode();
    }

    /* Slave mode */
    if (config.slave_mode) {
        if (cliConnect(0) == REDIS_ERR) exit(1);
        slaveMode();
    }

    /* Get RDB mode. */
    if (config.getrdb_mode) {
        if (cliConnect(0) == REDIS_ERR) exit(1);
        getRDB();
    }

    /* Pipe mode */
    if (config.pipe_mode) {
        if (cliConnect(0) == REDIS_ERR) exit(1);
        pipeMode();
    }

    /* Find big keys */
    if (config.bigkeys) {
        if (cliConnect(0) == REDIS_ERR) exit(1);
        findBigKeys();
    }

    /* Stat mode */
    if (config.stat_mode) {
        if (cliConnect(0) == REDIS_ERR) exit(1);
        if (config.interval == 0) config.interval = 1000000;
        statMode();
    }

    /* Scan mode */
    if (config.scan_mode) {
        if (cliConnect(0) == REDIS_ERR) exit(1);
        scanMode();
    }

    /* Intrinsic latency mode */
    if (config.intrinsic_latency_mode) intrinsicLatencyMode();

    /* Start interactive mode when no command is provided */
    if (argc == 0 && !config.eval) {
        /* Note that in repl mode we don't abort on connection error.
         * A new attempt will be performed for every command send. */
        cliConnect(0);
        repl();
    }

    /* Otherwise, we have some arguments to execute */
    if (cliConnect(0) != REDIS_OK) exit(1);
    if (config.eval) {
        return evalMode(argc,argv);
    } else {
        return noninteractive(argc,convertToSds(argc,argv));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x3c00c(%rip), %rdi     # 0x4dcf9
callq 0xeff0
movq %rax, 0x4f0bf(%rip)     # 0x60db8
movl $0x18eb, 0x4f0bd(%rip)  # imm = 0x18EB
movq $0x0, 0x4f0ba(%rip) # 0x60dc8
movq $0x1, 0x4f0b7(%rip) # 0x60dd0
movq $0x0, 0x4f0b4(%rip) # 0x60dd8
movl $0x0, 0x4f0b2(%rip)     # 0x60de0
movl $0x0, 0x4f0ac(%rip)     # 0x60de4
movl $0x0, 0x4f0a6(%rip)     # 0x60de8
movl $0x0, 0x4f0a0(%rip)     # 0x60dec
movl $0x0, 0x4f09a(%rip)     # 0x60df0
movl $0x0, 0x4f094(%rip)     # 0x60df4
movl $0x0, 0x4f08e(%rip)     # 0x60df8
movl $0x0, 0x4f088(%rip)     # 0x60dfc
movl $0x0, 0x4f086(%rip)     # 0x60e04
movl $0x0, 0x4f088(%rip)     # 0x60e10
movl $0x0, 0x4f082(%rip)     # 0x60e14
movl $0x0, 0x4f07c(%rip)     # 0x60e18
movl $0x0, 0x4f076(%rip)     # 0x60e1c
movq $0x0, 0x4f077(%rip) # 0x60e28
movq $0x0, 0x4f074(%rip) # 0x60e30
movl $0x0, 0x4f042(%rip)     # 0x60e08
movl $0x1e, 0x4f03c(%rip)    # 0x60e0c
movl $0x0, 0x4f05e(%rip)     # 0x60e38
movl $0x0, 0x4f058(%rip)     # 0x60e3c
movq $0x0, 0x4f051(%rip) # 0x60e40
movq $0x0, 0x4f0de(%rip) # 0x60ed8
movq 0x4d1af(%rip), %rax     # 0x5efb0
movq (%rax), %rdi
callq 0xd390
movl %eax, %edi
callq 0xd0d0
cmpl $0x0, %eax
jne 0x11e33
leaq 0x3bee7(%rip), %rdi     # 0x4dd03
callq 0xd040
cmpq $0x0, %rax
jne 0x11e33
movl $0x1, 0x4f017(%rip)     # 0x60e48
jmp 0x11e3d
movl $0x0, 0x4f00b(%rip)     # 0x60e48
leaq 0x3d033(%rip), %rdi     # 0x4ee77
callq 0xeff0
movq %rax, 0x4f000(%rip)     # 0x60e50
callq 0x14130
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x12020
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %ecx
movl -0x8(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x8(%rbp)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
cmpl $0x0, 0x4ef69(%rip)     # 0x60df4
je 0x11ea8
xorl %edi, %edi
callq 0x12770
cmpl $-0x1, %eax
jne 0x11ea3
movl $0x1, %edi
callq 0xd5c0
callq 0x128e0
cmpl $0x0, 0x4ef55(%rip)     # 0x60e04
je 0x11ecc
xorl %edi, %edi
callq 0x12770
cmpl $-0x1, %eax
jne 0x11ec7
movl $0x1, %edi
callq 0xd5c0
callq 0x12ae0
cmpl $0x0, 0x4ef3d(%rip)     # 0x60e10
je 0x11ef0
xorl %edi, %edi
callq 0x12770
cmpl $-0x1, %eax
jne 0x11eeb
movl $0x1, %edi
callq 0xd5c0
callq 0x12c20
cmpl $0x0, 0x4ef11(%rip)     # 0x60e08
je 0x11f14
xorl %edi, %edi
callq 0x12770
cmpl $-0x1, %eax
jne 0x11f0f
movl $0x1, %edi
callq 0xd5c0
callq 0x12e50
cmpl $0x0, 0x4ef1d(%rip)     # 0x60e38
je 0x11f38
xorl %edi, %edi
callq 0x12770
cmpl $-0x1, %eax
jne 0x11f33
movl $0x1, %edi
callq 0xd5c0
callq 0x13440
cmpl $0x0, 0x4eed5(%rip)     # 0x60e14
je 0x11f71
xorl %edi, %edi
callq 0x12770
cmpl $-0x1, %eax
jne 0x11f57
movl $0x1, %edi
callq 0xd5c0
cmpq $0x0, 0x4ee79(%rip)     # 0x60dd8
jne 0x11f6c
movq $0xf4240, 0x4ee6c(%rip) # imm = 0xF4240
callq 0x155a0
cmpl $0x0, 0x4eea0(%rip)     # 0x60e18
je 0x11f95
xorl %edi, %edi
callq 0x12770
cmpl $-0x1, %eax
jne 0x11f90
movl $0x1, %edi
callq 0xd5c0
callq 0x15ba0
cmpl $0x0, 0x4ee80(%rip)     # 0x60e1c
je 0x11fa3
callq 0x13cf0
cmpl $0x0, -0x8(%rbp)
jne 0x11fbf
cmpq $0x0, 0x4ef27(%rip)     # 0x60ed8
jne 0x11fbf
xorl %edi, %edi
callq 0x12770
callq 0x15ce0
xorl %edi, %edi
callq 0x12770
cmpl $0x0, %eax
je 0x11fd5
movl $0x1, %edi
callq 0xd5c0
cmpq $0x0, 0x4eefb(%rip)     # 0x60ed8
je 0x11ff0
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x13de0
movl %eax, -0x4(%rbp)
jmp 0x12010
movl -0x8(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x140c0
movl -0x18(%rbp), %edi
movq %rax, %rsi
callq 0x14030
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)