// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/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_dist_mode = 0;
    config.latency_history = 0;
    config.lru_test_mode = 0;
    config.lru_test_sample_size = 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;
    config.eval_ldb = 0;
    config.eval_ldb_end = 0;
    config.eval_ldb_sync = 0;
    config.enable_ldb_on_eval = 0;
    config.last_cmd_type = -1;

    pref.hints = 1;

    spectrum_palette = spectrum_palette_color;
    spectrum_palette_size = spectrum_palette_color_size;

    if (!isatty(fileno(stdout)) && (getenv("FAKETTY") == NULL))
        config.output = OUTPUT_RAW;
    else
        config.output = OUTPUT_STANDARD;
    config.mb_delim = sdsnew("\n");

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

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

    /* Latency distribution mode */
    if (config.latency_dist_mode) {
        if (cliConnect(0) == REDIS_ERR) exit(1);
        latencyDistMode();
    }

    /* 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();
    }

    /* LRU test mode */
    if (config.lru_test_mode) {
        if (cliConnect(0) == REDIS_ERR) exit(1);
        LRUTestMode();
    }

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

    /* Start interactive mode when no command is provided */
    if (argc == 0 && !config.eval) {
        /* Ignore SIGPIPE in interactive mode to force a reconnect */
        signal(SIGPIPE, SIG_IGN);

        /* 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 0x77671(%rip), %rdi     # 0x8ae9e
callq 0x1ed70
movq %rax, 0x8dc4f(%rip)     # 0xa1488
movl $0x18eb, 0x8dc4d(%rip)  # imm = 0x18EB
movq $0x0, 0x8dc4a(%rip) # 0xa1498
movq $0x1, 0x8dc47(%rip) # 0xa14a0
movq $0x0, 0x8dc44(%rip) # 0xa14a8
movl $0x0, 0x8dc42(%rip)     # 0xa14b0
movl $0x0, 0x8dc3c(%rip)     # 0xa14b4
movl $0x0, 0x8dc36(%rip)     # 0xa14b8
movl $0x0, 0x8dc30(%rip)     # 0xa14bc
movl $0x0, 0x8dc2a(%rip)     # 0xa14c0
movl $0x0, 0x8dc24(%rip)     # 0xa14c4
movl $0x0, 0x8dc1e(%rip)     # 0xa14c8
movl $0x0, 0x8dc18(%rip)     # 0xa14cc
movl $0x0, 0x8dc12(%rip)     # 0xa14d0
movq $0x0, 0x8dc0f(%rip) # 0xa14d8
movl $0x0, 0x8dc0d(%rip)     # 0xa14e0
movl $0x0, 0x8dc0b(%rip)     # 0xa14e8
movl $0x0, 0x8dc0d(%rip)     # 0xa14f4
movl $0x0, 0x8dc07(%rip)     # 0xa14f8
movl $0x0, 0x8dc01(%rip)     # 0xa14fc
movl $0x0, 0x8dbfb(%rip)     # 0xa1500
movq $0x0, 0x8dbf8(%rip) # 0xa1508
movq $0x0, 0x8dbf5(%rip) # 0xa1510
movl $0x0, 0x8dbc7(%rip)     # 0xa14ec
movl $0x1e, 0x8dbc1(%rip)    # 0xa14f0
movl $0x0, 0x8dbdf(%rip)     # 0xa1518
movl $0x0, 0x8dbd9(%rip)     # 0xa151c
movq $0x0, 0x8dbd2(%rip) # 0xa1520
movq $0x0, 0x8dc5f(%rip) # 0xa15b8
movl $0x0, 0x8dc5d(%rip)     # 0xa15c0
movl $0x0, 0x8dc5b(%rip)     # 0xa15c8
movl $0x0, 0x8dc4d(%rip)     # 0xa15c4
movl $0x0, 0x8dc4b(%rip)     # 0xa15cc
movl $0xffffffff, 0x8dc45(%rip) # imm = 0xFFFFFFFF
movl $0x1, 0x8dae3(%rip)     # 0xa1478
leaq 0x8d8d4(%rip), %rax     # 0xa1270
movq %rax, 0x8dadd(%rip)     # 0xa1480
movl 0x8d8bf(%rip), %eax     # 0xa1268
movl %eax, 0x8dacd(%rip)     # 0xa147c
movq 0x8b60a(%rip), %rax     # 0x9efc0
movq (%rax), %rdi
callq 0x103d0
movl %eax, %edi
callq 0x100d0
cmpl $0x0, %eax
jne 0x139e8
leaq 0x774d7(%rip), %rdi     # 0x8aea8
callq 0x10040
cmpq $0x0, %rax
jne 0x139e8
movl $0x1, 0x8db42(%rip)     # 0xa1528
jmp 0x139f2
movl $0x0, 0x8db36(%rip)     # 0xa1528
leaq 0x789a2(%rip), %rdi     # 0x8c39b
callq 0x1ed70
movq %rax, 0x8db2b(%rip)     # 0xa1530
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x13c20
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, 0x8da89(%rip)     # 0xa14c4
je 0x13a58
xorl %edi, %edi
callq 0x14530
cmpl $-0x1, %eax
jne 0x13a53
movl $0x1, %edi
callq 0x10600
callq 0x146a0
cmpl $0x0, 0x8da69(%rip)     # 0xa14c8
je 0x13a7c
xorl %edi, %edi
callq 0x14530
cmpl $-0x1, %eax
jne 0x13a77
movl $0x1, %edi
callq 0x10600
callq 0x148a0
cmpl $0x0, 0x8da65(%rip)     # 0xa14e8
je 0x13aa0
xorl %edi, %edi
callq 0x14530
cmpl $-0x1, %eax
jne 0x13a9b
movl $0x1, %edi
callq 0x10600
callq 0x14a70
cmpl $0x0, 0x8da4d(%rip)     # 0xa14f4
je 0x13ac4
xorl %edi, %edi
callq 0x14530
cmpl $-0x1, %eax
jne 0x13abf
movl $0x1, %edi
callq 0x10600
callq 0x14bb0
cmpl $0x0, 0x8da21(%rip)     # 0xa14ec
je 0x13ae8
xorl %edi, %edi
callq 0x14530
cmpl $-0x1, %eax
jne 0x13ae3
movl $0x1, %edi
callq 0x10600
callq 0x14de0
cmpl $0x0, 0x8da29(%rip)     # 0xa1518
je 0x13b0c
xorl %edi, %edi
callq 0x14530
cmpl $-0x1, %eax
jne 0x13b07
movl $0x1, %edi
callq 0x10600
callq 0x153f0
cmpl $0x0, 0x8d9e5(%rip)     # 0xa14f8
je 0x13b45
xorl %edi, %edi
callq 0x14530
cmpl $-0x1, %eax
jne 0x13b2b
movl $0x1, %edi
callq 0x10600
cmpq $0x0, 0x8d975(%rip)     # 0xa14a8
jne 0x13b40
movq $0xf4240, 0x8d968(%rip) # imm = 0xF4240
callq 0x15c80
cmpl $0x0, 0x8d9b0(%rip)     # 0xa14fc
je 0x13b69
xorl %edi, %edi
callq 0x14530
cmpl $-0x1, %eax
jne 0x13b64
movl $0x1, %edi
callq 0x10600
callq 0x16020
cmpl $0x0, 0x8d960(%rip)     # 0xa14d0
je 0x13b8d
xorl %edi, %edi
callq 0x14530
cmpl $-0x1, %eax
jne 0x13b88
movl $0x1, %edi
callq 0x10600
callq 0x16160
cmpl $0x0, 0x8d96c(%rip)     # 0xa1500
je 0x13b9b
callq 0x16410
cmpl $0x0, -0x8(%rbp)
jne 0x13bc6
cmpq $0x0, 0x8da0f(%rip)     # 0xa15b8
jne 0x13bc6
movl $0xd, %edi
movl $0x1, %esi
callq 0x10340
xorl %edi, %edi
callq 0x14530
callq 0x16530
xorl %edi, %edi
callq 0x14530
cmpl $0x0, %eax
je 0x13bdc
movl $0x1, %edi
callq 0x10600
cmpq $0x0, 0x8d9d4(%rip)     # 0xa15b8
je 0x13bf7
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x168e0
movl %eax, -0x4(%rbp)
jmp 0x13c17
movl -0x8(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x16cb0
movl -0x18(%rbp), %edi
movq %rax, %rsi
callq 0x16c30
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq