// File: /workspace/github_c_makefile_star2_O0/erikdubbelboer[P]discnt/src/discnt-cli.c
// Function: parseOptions
static int parseOptions(int argc, char **argv) {
    int i;

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

        if (!strcmp(argv[i],"-h") && !lastarg) {
            sdsfree(config.hostip);
            config.hostip = sdsnew(argv[++i]);
        } else if (!strcmp(argv[i],"-h") && lastarg) {
            usage();
        } else if (!strcmp(argv[i],"--help")) {
            usage();
        } else if (!strcmp(argv[i],"-x")) {
            config.stdinarg = 1;
        } else if (!strcmp(argv[i],"-p") && !lastarg) {
            config.hostport = atoi(argv[++i]);
        } else if (!strcmp(argv[i],"-s") && !lastarg) {
            config.hostsocket = argv[++i];
        } else if (!strcmp(argv[i],"-r") && !lastarg) {
            config.repeat = strtoll(argv[++i],NULL,10);
        } else if (!strcmp(argv[i],"-i") && !lastarg) {
            double seconds = atof(argv[++i]);
            config.interval = seconds*1000000;
        } else if (!strcmp(argv[i],"-a") && !lastarg) {
            config.auth = argv[++i];
        } else if (!strcmp(argv[i],"--raw")) {
            config.output = OUTPUT_RAW;
        } else if (!strcmp(argv[i],"--no-raw")) {
            config.output = OUTPUT_STANDARD;
        } else if (!strcmp(argv[i],"--csv")) {
            config.output = OUTPUT_CSV;
        } else if (!strcmp(argv[i],"--latency")) {
            config.latency_mode = 1;
        } else if (!strcmp(argv[i],"--latency-history")) {
            config.latency_mode = 1;
            config.latency_history = 1;
        } else if (!strcmp(argv[i],"--stat")) {
            config.stat_mode = 1;
        } else if (!strcmp(argv[i],"--intrinsic-latency") && !lastarg) {
            config.intrinsic_latency_mode = 1;
            config.intrinsic_latency_duration = atoi(argv[++i]);
        } else if (!strcmp(argv[i],"--pipe")) {
            config.pipe_mode = 1;
        } else if (!strcmp(argv[i],"--pipe-timeout") && !lastarg) {
            config.pipe_timeout = atoi(argv[++i]);
        } else if (!strcmp(argv[i],"--eval") && !lastarg) {
            config.eval = argv[++i];
        } else if (!strcmp(argv[i],"-d") && !lastarg) {
            sdsfree(config.mb_delim);
            config.mb_delim = sdsnew(argv[++i]);
        } else if (!strcmp(argv[i],"-v") || !strcmp(argv[i], "--version")) {
            sds version = cliVersion();
            printf("discnt %s\n", version);
            sdsfree(version);
            exit(0);
        } else {
            if (argv[i][0] == '-') {
                fprintf(stderr,
                    "Unrecognized option or bad number of args for: '%s'\n",
                    argv[i]);
                exit(1);
            } else {
                /* Likely the command name, stop here. */
                break;
            }
        }
    }
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x120a5
movl -0x14(%rbp), %eax
movl -0x4(%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 0x714e0(%rip), %rsi     # 0x82ffb
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11b5c
cmpl $0x0, -0x18(%rbp)
jne 0x11b5c
movq 0x85086(%rip), %rdi     # 0x96bb8
callq 0xe540
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xe430
movq %rax, 0x85061(%rip)     # 0x96bb8
jmp 0x12095
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7148c(%rip), %rsi     # 0x82ffb
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11b89
cmpl $0x0, -0x18(%rbp)
je 0x11b89
callq 0x13460
jmp 0x12093
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x71462(%rip), %rsi     # 0x82ffe
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11bb0
callq 0x13460
jmp 0x12091
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x71442(%rip), %rsi     # 0x83005
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11bdc
movl $0x1, 0x85035(%rip)     # 0x96c0c
jmp 0x1208f
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x71419(%rip), %rsi     # 0x83008
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11c23
cmpl $0x0, -0x18(%rbp)
jne 0x11c23
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xc550
movl %eax, 0x84fa2(%rip)     # 0x96bc0
jmp 0x1208d
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x713d5(%rip), %rsi     # 0x8300b
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11c66
cmpl $0x0, -0x18(%rbp)
jne 0x11c66
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x84f67(%rip)     # 0x96bc8
jmp 0x1208b
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x71395(%rip), %rsi     # 0x8300e
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11cb7
cmpl $0x0, -0x18(%rbp)
jne 0x11cb7
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0xc310
movq %rax, 0x84f1e(%rip)     # 0x96bd0
jmp 0x12089
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x71347(%rip), %rsi     # 0x83011
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11d16
cmpl $0x0, -0x18(%rbp)
jne 0x11d16
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xc110
movsd %xmm0, -0x20(%rbp)
movsd 0x70840(%rip), %xmm0    # 0x82540
mulsd -0x20(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, 0x84ec7(%rip)     # 0x96bd8
jmp 0x12087
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x712eb(%rip), %rsi     # 0x83014
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11d59
cmpl $0x0, -0x18(%rbp)
jne 0x11d59
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x84ebc(%rip)     # 0x96c10
jmp 0x12085
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x712ab(%rip), %rsi     # 0x83017
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11d85
movl $0x1, 0x84e98(%rip)     # 0x96c18
jmp 0x12083
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x71285(%rip), %rsi     # 0x8301d
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11db1
movl $0x0, 0x84e6c(%rip)     # 0x96c18
jmp 0x12081
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x71262(%rip), %rsi     # 0x83026
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11ddd
movl $0x2, 0x84e40(%rip)     # 0x96c18
jmp 0x1207f
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7123c(%rip), %rsi     # 0x8302c
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11e09
movl $0x1, 0x84dec(%rip)     # 0x96bf0
jmp 0x1207d
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7121a(%rip), %rsi     # 0x83036
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11e3f
movl $0x1, 0x84dc0(%rip)     # 0x96bf0
movl $0x1, 0x84dba(%rip)     # 0x96bf4
jmp 0x1207b
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x711f6(%rip), %rsi     # 0x83048
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11e6b
movl $0x1, 0x84d9a(%rip)     # 0x96c00
jmp 0x12079
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x711d1(%rip), %rsi     # 0x8304f
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11ebc
cmpl $0x0, -0x18(%rbp)
jne 0x11ebc
movl $0x1, 0x84d6c(%rip)     # 0x96c04
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xc550
movl %eax, 0x84d51(%rip)     # 0x96c08
jmp 0x12077
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x71194(%rip), %rsi     # 0x83063
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11ee8
movl $0x1, 0x84d15(%rip)     # 0x96bf8
jmp 0x12075
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7116f(%rip), %rsi     # 0x8306a
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11f2f
cmpl $0x0, -0x18(%rbp)
jne 0x11f2f
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xc550
movl %eax, 0x84cd2(%rip)     # 0x96bfc
jmp 0x12073
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x71137(%rip), %rsi     # 0x83079
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11f72
cmpl $0x0, -0x18(%rbp)
jne 0x11f72
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x84d3b(%rip)     # 0x96ca8
jmp 0x12071
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x710fb(%rip), %rsi     # 0x83080
callq 0xc2f0
cmpl $0x0, %eax
jne 0x11fc6
cmpl $0x0, -0x18(%rbp)
jne 0x11fc6
movq 0x84c84(%rip), %rdi     # 0x96c20
callq 0xe540
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0xe430
movq %rax, 0x84c5f(%rip)     # 0x96c20
jmp 0x1206f
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x710aa(%rip), %rsi     # 0x83083
callq 0xc2f0
cmpl $0x0, %eax
je 0x12000
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x71090(%rip), %rsi     # 0x83086
callq 0xc2f0
cmpl $0x0, %eax
jne 0x1202b
callq 0x134b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rsi
leaq 0x7107c(%rip), %rdi     # 0x83090
movb $0x0, %al
callq 0xc1c0
movq -0x28(%rbp), %rdi
callq 0xe540
xorl %edi, %edi
callq 0xc590
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x1206d
movq 0x83faa(%rip), %rax     # 0x95ff0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x7103f(%rip), %rsi     # 0x8309b
movb $0x0, %al
callq 0xc320
movl $0x1, %edi
callq 0xc590
jmp 0x120a5
jmp 0x12071
jmp 0x12073
jmp 0x12075
jmp 0x12077
jmp 0x12079
jmp 0x1207b
jmp 0x1207d
jmp 0x1207f
jmp 0x12081
jmp 0x12083
jmp 0x12085
jmp 0x12087
jmp 0x12089
jmp 0x1208b
jmp 0x1208d
jmp 0x1208f
jmp 0x12091
jmp 0x12093
jmp 0x12095
jmp 0x12097
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x11ae6
movl -0x14(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop