// File: /workspace/github_c_makefile_star2_O2/jaroslov[P]docoptc/test.c
// Function: main
int main(int argc, char **argv)
{
    const char docstr[] =
    "Usage:\n"
    "  test self-test\n"
    "  test one N\n";

    docopt_t doc        = docopt(docstr, argc-1, argv+1, 0, DOCOPT_VERSION);
    unsigned long low   = 0;
    unsigned long high  = sizeof(tests)/sizeof(tests[0]);
    if (doc && !docopt_error(doc))
    {
        if (docopt_get(doc, "one", 0))
        {
            low         = strtoul(docopt_get(doc, "N", 0)->fst, 0, 0);
            high        = low + 1;
            fprintf(stdout, "ARGS\n");
            for (int j = 0; tests[low].args[j]; ++j)
                fprintf(stdout, "    %s\n", tests[low].args[j]);
        }
    }
    else
    {
        return 1;
    }
    docopt_free(doc);

    for (int i = low, e = high; i < e; ++i)
    {
        int argc        = 0;
        for (int j = 0; tests[i].args[j]; ++j, ++argc)
            ;
        docopt_t doc    = docopt(usages[tests[i].usage], argc, (char**)tests[i].args, DOCOPT_NO_HELP, DOCOPT_VERSION);
        if (!doc)
        {
            fprintf(stdout, "Failed to parse (%d):\n====\n%s\n====\n", i, usages[tests[i].usage]);
            return 1;
        }
        else if (docopt_error(doc))
        {
            assert(docopt_error(doc) == DOCOPT_PRINTED_HELP);
            if (check_test(doc, i)) return 1;
        }
        else
        {
            if (check_test(doc, i)) return 1;
        }
        docopt_free(doc);
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movaps 0x3e04(%rip), %xmm0     # 0xc3d0
leaq -0x60(%rbp), %rax
movaps %xmm0, 0x10(%rax)
movaps 0x3de5(%rip), %xmm0     # 0xc3c0
movaps %xmm0, (%rax)
movabsq $0xa4e20656e6f20, %rcx  # imm = 0xA4E20656E6F20
movq %rcx, 0x1e(%rax)
leal -0x1(%rdi), %ecx
leaq 0x8(%rsi), %rdx
movq %rax, %rdi
movl %ecx, %esi
xorl %ecx, %ecx
movl $0x100, %r8d            # imm = 0x100
callq 0x7311
pushq $0x1
popq %r14
testq %rax, %rax
je 0x8616
movq %rax, %r15
cmpl $0x0, (%rax)
je 0x8628
movl %r14d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x381c(%rip), %rsi      # 0xbe4b
xorl %ebx, %ebx
movq %r15, %rdi
xorl %edx, %edx
callq 0x83d3
testq %rax, %rax
je 0x86c5
leaq 0x3766(%rip), %rsi      # 0xbdb1
movq %r15, %rdi
xorl %edx, %edx
callq 0x83d3
movq (%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7110
movq %rax, %rbx
movq 0x2896d(%rip), %r12     # 0x30fd8
movq (%r12), %rcx
leaq 0x37d9(%rip), %rdi      # 0xbe4f
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
callq 0x7130
imulq $0x3c8, %rbx, %rax      # imm = 0x3C8
leaq 0x5b81(%rip), %rcx      # 0xe210
leaq (%rax,%rcx), %r13
addq $0x8, %r13
leaq 0x37b7(%rip), %r14      # 0xbe55
movq (%r13), %rdx
testq %rdx, %rdx
je 0x86bb
movq (%r12), %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x70e0
addq $0x8, %r13
jmp 0x869e
movslq %ebx, %rbx
leal 0x1(%rbx), %eax
cltq
jmp 0x86ca
movl $0x93, %eax
movq %rax, -0x30(%rbp)
movq %r15, %rdi
callq 0x8585
imulq $0x3c8, %rbx, %rax      # imm = 0x3C8
leaq 0x5b2c(%rip), %rcx      # 0xe210
leaq (%rax,%rcx), %r12
addq $0x8, %r12
pushq $0x1
popq %r14
cmpq -0x30(%rbp), %rbx
jge 0x877d
imulq $0x3c8, %rbx, %rcx      # imm = 0x3C8
leaq 0x5b08(%rip), %rdx      # 0xe210
leaq (%rdx,%rcx), %rax
addq %rcx, %rdx
addq $0x8, %rdx
movq %r12, %rcx
pushq $-0x1
popq %rsi
incl %esi
cmpq $0x0, (%rcx)
leaq 0x8(%rcx), %rcx
jne 0x8719
movslq (%rax), %r13
leaq 0x28991(%rip), %rax     # 0x310c0
movq (%rax,%r13,8), %rdi
movl %r14d, %ecx
movl $0x100, %r8d            # imm = 0x100
callq 0x7311
testq %rax, %rax
je 0x8785
movq %rax, %r15
movl (%rax), %eax
testl %eax, %eax
je 0x8754
cmpl $0x5, %eax
jne 0x87af
movq %r15, %rdi
movl %ebx, %esi
callq 0x87ce
testl %eax, %eax
jne 0x8616
movq %r15, %rdi
callq 0x8585
incq %rbx
addq $0x3c8, %r12            # imm = 0x3C8
jmp 0x86f0
xorl %r14d, %r14d
jmp 0x8616
movq 0x2884c(%rip), %rax     # 0x30fd8
movq (%rax), %rdi
leaq 0x2892a(%rip), %rax     # 0x310c0
movq (%rax,%r13,8), %rcx
leaq 0x36bc(%rip), %rsi      # 0xbe5d
movl %ebx, %edx
xorl %eax, %eax
callq 0x70e0
jmp 0x8616
leaq 0x36cb(%rip), %rdi      # 0xbe81
leaq 0x36ed(%rip), %rsi      # 0xbeaa
leaq 0x36ed(%rip), %rcx      # 0xbeb1
movl $0x255, %edx            # imm = 0x255
callq 0x7080