// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/src/redis-benchmark.c
// Function: parseOptions
int parseOptions(int argc, const char **argv) {
    int i;
    int lastarg;
    int exit_status = 1;

    for (i = 1; i < argc; i++) {
        lastarg = (i == (argc-1));

        if (!strcmp(argv[i],"-c")) {
            if (lastarg) goto invalid;
            config.numclients = atoi(argv[++i]);
        } else if (!strcmp(argv[i],"-n")) {
            if (lastarg) goto invalid;
            config.requests = atoi(argv[++i]);
        } else if (!strcmp(argv[i],"-k")) {
            if (lastarg) goto invalid;
            config.keepalive = atoi(argv[++i]);
        } else if (!strcmp(argv[i],"-h")) {
            if (lastarg) goto invalid;
            config.hostip = strdup(argv[++i]);
        } else if (!strcmp(argv[i],"-p")) {
            if (lastarg) goto invalid;
            config.hostport = atoi(argv[++i]);
        } else if (!strcmp(argv[i],"-s")) {
            if (lastarg) goto invalid;
            config.hostsocket = strdup(argv[++i]);
        } else if (!strcmp(argv[i],"-a") ) {
            if (lastarg) goto invalid;
            config.auth = strdup(argv[++i]);
        } else if (!strcmp(argv[i],"-d")) {
            if (lastarg) goto invalid;
            config.datasize = atoi(argv[++i]);
            if (config.datasize < 1) config.datasize=1;
            if (config.datasize > 1024*1024*1024) config.datasize = 1024*1024*1024;
        } else if (!strcmp(argv[i],"-P")) {
            if (lastarg) goto invalid;
            config.pipeline = atoi(argv[++i]);
            if (config.pipeline <= 0) config.pipeline=1;
        } else if (!strcmp(argv[i],"-r")) {
            if (lastarg) goto invalid;
            config.randomkeys = 1;
            config.randomkeys_keyspacelen = atoi(argv[++i]);
            if (config.randomkeys_keyspacelen < 0)
                config.randomkeys_keyspacelen = 0;
        } else if (!strcmp(argv[i],"-q")) {
            config.quiet = 1;
        } else if (!strcmp(argv[i],"--csv")) {
            config.csv = 1;
        } else if (!strcmp(argv[i],"-l")) {
            config.loop = 1;
        } else if (!strcmp(argv[i],"-I")) {
            config.idlemode = 1;
        } else if (!strcmp(argv[i],"-e")) {
            config.showerrors = 1;
        } else if (!strcmp(argv[i],"-t")) {
            if (lastarg) goto invalid;
            /* We get the list of tests to run as a string in the form
             * get,set,lrange,...,test_N. Then we add a comma before and
             * after the string in order to make sure that searching
             * for ",testname," will always get a match if the test is
             * enabled. */
            config.tests = sdsnew(",");
            config.tests = sdscat(config.tests,(char*)argv[++i]);
            config.tests = sdscat(config.tests,",");
            sdstolower(config.tests);
        } else if (!strcmp(argv[i],"--dbnum")) {
            if (lastarg) goto invalid;
            config.dbnum = atoi(argv[++i]);
            config.dbnumstr = sdsfromlonglong(config.dbnum);
        } else if (!strcmp(argv[i],"--help")) {
            exit_status = 0;
            goto usage;
        } else {
            /* Assume the user meant to provide an option when the arg starts
             * with a dash. We're done otherwise and should use the remainder
             * as the command and arguments for running the benchmark. */
            if (argv[i][0] == '-') goto invalid;
            return i;
        }
    }

    return i;

invalid:
    printf("Invalid option \"%s\" or option argument missing\n\n",argv[i]);

usage:
    printf(
"Usage: redis-benchmark [-h <host>] [-p <port>] [-c <clients>] [-n <requests]> [-k <boolean>]\n\n"
" -h <hostname>      Server hostname (default 127.0.0.1)\n"
" -p <port>          Server port (default 6379)\n"
" -s <socket>        Server socket (overrides host and port)\n"
" -a <password>      Password for Redis Auth\n"
" -c <clients>       Number of parallel connections (default 50)\n"
" -n <requests>      Total number of requests (default 100000)\n"
" -d <size>          Data size of SET/GET value in bytes (default 2)\n"
" -dbnum <db>        SELECT the specified db number (default 0)\n"
" -k <boolean>       1=keep alive 0=reconnect (default 1)\n"
" -r <keyspacelen>   Use random keys for SET/GET/INCR, random values for SADD\n"
"  Using this option the benchmark will expand the string __rand_int__\n"
"  inside an argument with a 12 digits number in the specified range\n"
"  from 0 to keyspacelen-1. The substitution changes every time a command\n"
"  is executed. Default tests use this to hit random keys in the\n"
"  specified range.\n"
" -P <numreq>        Pipeline <numreq> requests. Default 1 (no pipeline).\n"
" -e                 If server replies with errors, show them on stdout.\n"
"                    (no more than 1 error per second is displayed)\n"
" -q                 Quiet. Just show query/sec values\n"
" --csv              Output in CSV format\n"
" -l                 Loop. Run the tests forever\n"
" -t <tests>         Only run the comma separated list of tests. The test\n"
"                    names are the same as the ones produced as output.\n"
" -I                 Idle mode. Just open N idle connections and wait.\n\n"
"Examples:\n\n"
" Run the benchmark with the default configuration against 127.0.0.1:6379:\n"
"   $ redis-benchmark\n\n"
" Use 20 parallel clients, for a total of 100k requests, against 192.168.1.1:\n"
"   $ redis-benchmark -h 192.168.1.1 -p 6379 -n 100000 -c 20\n\n"
" Fill 127.0.0.1:6379 with about 1 million keys only using the SET test:\n"
"   $ redis-benchmark -t set -n 1000000 -r 100000000\n\n"
" Benchmark 127.0.0.1:6379 for a few commands producing CSV output:\n"
"   $ redis-benchmark -t ping,set,get -n 100000 --csv\n\n"
" Benchmark a specific command line:\n"
"   $ redis-benchmark -r 10000 -n 10000 eval 'return redis.call(\"ping\")' 0\n\n"
" Fill a list with 10000 random elements:\n"
"   $ redis-benchmark -r 10000 -n 10000 lpush mylist __rand_int__\n\n"
" On user specified command lines __rand_int__ is replaced with a random integer\n"
" with a range of values selected by the -r option.\n"
    );
    exit(exit_status);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x1c(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0xe8ec
movl -0x14(%rbp), %eax
movl -0x8(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7fe5a(%rip), %rsi     # 0x8e1cc
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe3ab
cmpl $0x0, -0x18(%rbp)
je 0xe387
jmp 0xe8f4
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xb4b0
movl %eax, 0x95092(%rip)     # 0xa3438
jmp 0xe8dc
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7fe11(%rip), %rsi     # 0x8e1cf
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe3f7
cmpl $0x0, -0x18(%rbp)
je 0xe3d3
jmp 0xe8f4
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xb4b0
movl %eax, 0x9504e(%rip)     # 0xa3440
jmp 0xe8da
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7fdc8(%rip), %rsi     # 0x8e1d2
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe443
cmpl $0x0, -0x18(%rbp)
je 0xe41f
jmp 0xe8f4
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xb4b0
movl %eax, 0x9501e(%rip)     # 0xa345c
jmp 0xe8d8
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7fd7f(%rip), %rsi     # 0x8e1d5
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe490
cmpl $0x0, -0x18(%rbp)
je 0xe46b
jmp 0xe8f4
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xb530
movq %rax, 0x94f95(%rip)     # 0xa3420
jmp 0xe8d6
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7fd35(%rip), %rsi     # 0x8e1d8
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe4dc
cmpl $0x0, -0x18(%rbp)
je 0xe4b8
jmp 0xe8f4
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xb4b0
movl %eax, 0x94f51(%rip)     # 0xa3428
jmp 0xe8d4
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7fcec(%rip), %rsi     # 0x8e1db
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe529
cmpl $0x0, -0x18(%rbp)
je 0xe504
jmp 0xe8f4
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xb530
movq %rax, 0x94f0c(%rip)     # 0xa3430
jmp 0xe8d2
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7fca2(%rip), %rsi     # 0x8e1de
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe576
cmpl $0x0, -0x18(%rbp)
je 0xe551
jmp 0xe8f4
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xb530
movq %rax, 0x94f47(%rip)     # 0xa34b8
jmp 0xe8d0
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7fc58(%rip), %rsi     # 0x8e1e1
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe5eb
cmpl $0x0, -0x18(%rbp)
je 0xe59e
jmp 0xe8f4
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xb4b0
movl %eax, 0x94e93(%rip)     # 0xa3450
cmpl $0x1, 0x94e8c(%rip)     # 0xa3450
jge 0xe5d0
movl $0x1, 0x94e80(%rip)     # 0xa3450
cmpl $0x40000000, 0x94e76(%rip) # imm = 0x40000000
jle 0xe5e6
movl $0x40000000, 0x94e6a(%rip) # imm = 0x40000000
jmp 0xe8ce
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7fbe6(%rip), %rsi     # 0x8e1e4
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe64a
cmpl $0x0, -0x18(%rbp)
je 0xe613
jmp 0xe8f4
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xb4b0
movl %eax, 0x94e2e(%rip)     # 0xa3460
cmpl $0x0, 0x94e27(%rip)     # 0xa3460
jg 0xe645
movl $0x1, 0x94e1b(%rip)     # 0xa3460
jmp 0xe8cc
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7fb8a(%rip), %rsi     # 0x8e1e7
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe6b3
cmpl $0x0, -0x18(%rbp)
je 0xe672
jmp 0xe8f4
movl $0x1, 0x94dd8(%rip)     # 0xa3454
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xb4b0
movl %eax, 0x94dbd(%rip)     # 0xa3458
cmpl $0x0, 0x94db6(%rip)     # 0xa3458
jge 0xe6ae
movl $0x0, 0x94daa(%rip)     # 0xa3458
jmp 0xe8ca
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7fb24(%rip), %rsi     # 0x8e1ea
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe6df
movl $0x1, 0x94db6(%rip)     # 0xa3490
jmp 0xe8c8
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7fafb(%rip), %rsi     # 0x8e1ed
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe70b
movl $0x1, 0x94d8e(%rip)     # 0xa3494
jmp 0xe8c6
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7fad5(%rip), %rsi     # 0x8e1f3
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe737
movl $0x1, 0x94d66(%rip)     # 0xa3498
jmp 0xe8c4
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7faac(%rip), %rsi     # 0x8e1f6
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe763
movl $0x1, 0x94d3e(%rip)     # 0xa349c
jmp 0xe8c2
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7fa83(%rip), %rsi     # 0x8e1f9
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe78f
movl $0x1, 0x94cda(%rip)     # 0xa3464
jmp 0xe8c0
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7fa5a(%rip), %rsi     # 0x8e1fc
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe81c
cmpl $0x0, -0x18(%rbp)
je 0xe7b7
jmp 0xe8f4
leaq 0x7fa41(%rip), %rdi     # 0x8e1ff
callq 0x15010
movq %rax, 0x94ce6(%rip)     # 0xa34b0
movq 0x94cdf(%rip), %rdi     # 0xa34b0
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x15bd0
movq %rax, 0x94cbf(%rip)     # 0xa34b0
movq 0x94cb8(%rip), %rdi     # 0xa34b0
leaq 0x7fa00(%rip), %rsi     # 0x8e1ff
callq 0x15bd0
movq %rax, 0x94ca5(%rip)     # 0xa34b0
movq 0x94c9e(%rip), %rdi     # 0xa34b0
callq 0x169f0
jmp 0xe8be
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7f9d2(%rip), %rsi     # 0x8e201
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe878
cmpl $0x0, -0x18(%rbp)
je 0xe844
jmp 0xe8f4
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xb4b0
movl %eax, 0x94c3d(%rip)     # 0xa34a0
movslq 0x94c36(%rip), %rdi     # 0xa34a0
callq 0x15ef0
movq %rax, 0x94c32(%rip)     # 0xa34a8
jmp 0xe8bc
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7f97e(%rip), %rsi     # 0x8e209
callq 0xb2b0
cmpl $0x0, %eax
jne 0xe89e
movl $0x0, -0x1c(%rbp)
jmp 0xe90e
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0xe8b4
jmp 0xe8f4
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xe924
jmp 0xe8be
jmp 0xe8c0
jmp 0xe8c2
jmp 0xe8c4
jmp 0xe8c6
jmp 0xe8c8
jmp 0xe8ca
jmp 0xe8cc
jmp 0xe8ce
jmp 0xe8d0
jmp 0xe8d2
jmp 0xe8d4
jmp 0xe8d6
jmp 0xe8d8
jmp 0xe8da
jmp 0xe8dc
jmp 0xe8de
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xe33d
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xe924
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x7f909(%rip), %rdi     # 0x8e210
movb $0x0, %al
callq 0xb1a0
leaq 0x7f92c(%rip), %rdi     # 0x8e241
movb $0x0, %al
callq 0xb1a0
movl -0x1c(%rbp), %edi
callq 0xb4f0
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)