// File: /workspace/github_cpp_makefile_star2_O3/halfflat[P]tinyopt/ex/ex7-run.cc
// Function: main
int main(int argc, char** argv) {
    try {
        auto help = [argv0 = argv[0]] { to::usage(argv0, usage_str); };

        std::vector<std::vector<int>> nss;

        auto new_ns = [&]() { nss.push_back({}); return true; };
        auto push_ns = [&](int n) { nss.back().push_back(n); return true; };

        auto gt0 = [](int m) { return m>0; };
        auto decrement = [](int m) { return m-1; };

        to::option opts[] = {
            { to::action(help), "-h", "--help", to::flag, to::exit },
            { to::action(new_ns), to::then(3), "-n", to::flag },
            { to::action(push_ns), to::when(gt0), to::then(decrement)}
        };

        if (!to::run(opts, argc, argv+1)) return 0;
        if (argv[1]) throw to::option_error("unrecognized argument", argv[1]);

        for (auto& ns: nss) {
            std::cout << "{ ";
            std::ostream_iterator<int> os(std::cout, " ");
            for (int n: ns) *os = n;
            std::cout << "}\n";
        }
    }
    catch (to::option_error& e) {
        to::usage_error(argv[0], usage_str, e.what());
        return 1;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movl %edi, 0x44(%rsp)
movq %rsi, 0x48(%rsp)
movq (%rsi), %rax
xorl %ecx, %ecx
movq %rcx, 0x60(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
leaq 0xe0(%rsp), %rsi
movq %rcx, 0x8(%rsi)
movq %rax, (%rsi)
leaq 0x710(%rip), %rax       # 0x2c0e
movq %rax, 0x18(%rsi)
leaq 0x7cf(%rip), %rax       # 0x2cd8
movq %rax, 0x10(%rsi)
leaq 0x7c(%rsp), %r8
movl $0x1, (%r8)
leaq 0x78(%rsp), %r9
movl $0x10, (%r9)
leaq 0x4c00(%rip), %rdx      # 0x712c
leaq 0x4bfc(%rip), %rcx      # 0x712f
leaq 0x120(%rsp), %r12
movq %r12, %rdi
callq 0x2e66
leaq 0x190(%rsp), %r12
leaq 0xc0(%rsp), %rsi
movq $0x0, 0x8(%rsi)
leaq 0x50(%rsp), %rbx
movq %rbx, (%rsi)
leaq 0x794(%rip), %rax       # 0x2cfe
movq %rax, 0x18(%rsi)
leaq 0x7e7(%rip), %rax       # 0x2d5c
movq %rax, 0x10(%rsi)
movq %rsp, %rdx
xorps %xmm0, %xmm0
movaps %xmm0, (%rdx)
movl $0x3, (%rdx)
leaq 0x12eb(%rip), %rax      # 0x387a
movq %rax, 0x18(%rdx)
leaq 0x12e4(%rip), %rax      # 0x387e
movq %rax, 0x10(%rdx)
leaq 0x74(%rsp), %r8
movl $0x1, (%r8)
leaq 0x4b85(%rip), %rcx      # 0x7136
movq %r12, %rdi
callq 0x2f74
leaq 0x200(%rsp), %r12
leaq 0xa0(%rsp), %rsi
movq $0x0, 0x8(%rsi)
movq %rbx, (%rsi)
leaq 0x7a7(%rip), %rax       # 0x2d82
movq %rax, 0x18(%rsi)
leaq 0x800(%rip), %rax       # 0x2de6
movq %rax, 0x10(%rsi)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdx
movaps %xmm0, (%rdx)
leaq 0x810(%rip), %rax       # 0x2e0c
movq %rax, 0x18(%rdx)
leaq 0x80d(%rip), %rax       # 0x2e14
movq %rax, 0x10(%rdx)
leaq 0x80(%rsp), %rcx
movaps %xmm0, (%rcx)
leaq 0x81d(%rip), %rax       # 0x2e3a
movq %rax, 0x18(%rcx)
leaq 0x818(%rip), %rax       # 0x2e40
movq %rax, 0x10(%rcx)
movq %r12, %rdi
callq 0x309e
movq 0x90(%rsp), %rax
testq %rax, %rax
je 0x2653
leaq 0x80(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x266c
leaq 0x20(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xb0(%rsp), %rax
testq %rax, %rax
je 0x268b
leaq 0xa0(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x26a2
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xd0(%rsp), %rax
testq %rax, %rax
je 0x26c1
leaq 0xc0(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xf0(%rsp), %rax
testq %rax, %rax
je 0x26e0
leaq 0xe0(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x48(%rsp), %rax
leaq 0x8(%rax), %r14
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r8
movaps %xmm0, (%r8)
movq $0x0, 0x10(%r8)
movq %rsp, %rdi
leaq 0x120(%rsp), %rsi
leaq 0x44(%rsp), %rdx
movq %r14, %rcx
callq 0x31c4
cmpb $0x0, (%rsp)
je 0x27d6
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x34a6
movb $0x0, -0x8(%r15)
leaq 0x20(%rsp), %rdi
callq 0x34a6
cmpq $0x0, (%r14)
jne 0x285f
movq 0x50(%rsp), %rbx
movq 0x58(%rsp), %rax
movq %rax, 0x68(%rsp)
cmpq %rax, %rbx
je 0x27e4
movq 0x886c(%rip), %r14      # 0xafd0
movq %rsp, %r13
leaq 0x20(%rsp), %rbp
movl $0x2, %edx
movq %r14, %rdi
leaq 0x49d4(%rip), %rsi      # 0x714f
callq 0x21a0
movq %r14, (%rsp)
leaq 0x49d0(%rip), %rax      # 0x715b
movq %rax, 0x8(%rsp)
movq (%rbx), %r12
movq 0x8(%rbx), %r15
cmpq %r15, %r12
je 0x27b5
movl (%r12), %eax
movl %eax, 0x20(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x36ac
addq $0x4, %r12
jmp 0x2797
movl $0x2, %edx
movq %r14, %rdi
leaq 0x498e(%rip), %rsi      # 0x7152
callq 0x21a0
addq $0x18, %rbx
cmpq 0x68(%rsp), %rbx
jne 0x276c
jmp 0x27e4
movb $0x0, (%rsp)
leaq 0x20(%rsp), %rdi
callq 0x34a6
movl $0x150, %r14d           # imm = 0x150
leaq (%rsp,%r14), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x38a4
leaq (%rsp,%r14), %rdi
addq $0xe8, %rdi
callq 0x38d4
leaq (%rsp,%r14), %rbx
addq $0xd0, %rbx
movq %rbx, %rdi
callq 0x3904
movq -0x10(%rbx), %rax
testq %rax, %rax
je 0x283b
leaq (%rsp,%r14), %rdi
addq $0xb0, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
addq $-0x70, %r14
jne 0x27ea
leaq 0x50(%rsp), %rdi
callq 0x36ea
xorl %eax, %eax
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x30, %edi
callq 0x20c0
movq %rax, %r12
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x48bd(%rip), %rsi      # 0x7139
leaq 0x48cb(%rip), %rdx      # 0x714e
movq %rsp, %rdi
callq 0x3b2e
movq (%r14), %rsi
leaq 0x100(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x3504
movb $0x1, %bl
movq %rsp, %rsi
leaq 0x100(%rsp), %rdx
movq %r12, %rdi
callq 0x3542
xorl %ebx, %ebx
leaq 0x838a(%rip), %rsi      # 0xac48
leaq 0x288b(%rip), %rdx      # 0x5150
movq %r12, %rdi
callq 0x2240
movq %rdx, %r15
movq %rax, %r14
leaq 0x110(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x28f4
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x2170
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x290a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
testb %bl, %bl
jne 0x2937
jmp 0x2a80
movq %rdx, %r15
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x2937
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x2937
movq %rdx, %r15
movq %rax, %r14
movq %r12, %rdi
callq 0x2110
jmp 0x2a80
jmp 0x2a72
jmp 0x2a72
jmp 0x2a72
jmp 0x2a72
jmp 0x2a72
jmp 0x2a72
movq %rdx, %r15
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x34a6
jmp 0x2a80
movq %rdx, %r15
movq %rax, %r14
movq 0x90(%rsp), %rax
testq %rax, %rax
je 0x299c
leaq 0x80(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x29b5
leaq 0x20(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xb0(%rsp), %rax
testq %rax, %rax
je 0x29eb
leaq 0xa0(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x29eb
jmp 0x2a72
jmp 0x2a72
jmp 0x2a72
movq %rdx, %r15
movq %rax, %r14
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x2a02
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xd0(%rsp), %rax
testq %rax, %rax
je 0x2a2d
leaq 0xc0(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x2a2d
jmp 0x2a72
jmp 0x2a72
movq %rdx, %r15
movq %rax, %r14
movq 0xf0(%rsp), %rax
testq %rax, %rax
je 0x2a4c
leaq 0xe0(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x120(%rsp), %rbx
cmpq %r12, %rbx
je 0x2a9f
addq $-0x70, %r12
movq %r12, %rdi
callq 0x580e
cmpq %rbx, %r12
jne 0x2a59
jmp 0x2a9f
jmp 0x2a72
jmp 0x2a7a
jmp 0x2a7a
movq %rax, %rdi
callq 0x386f
movq %rdx, %r15
movq %rax, %r14
movl $0xe0, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x120, %rdi            # imm = 0x120
callq 0x580e
addq $-0x70, %rbx
cmpq $-0x70, %rbx
jne 0x2a85
leaq 0x50(%rsp), %rdi
callq 0x36ea
cmpl $0x1, %r15d
jne 0x2c00
movq %r14, %rdi
callq 0x2090
movq %rax, %r14
movq 0x48(%rsp), %rax
movq (%rax), %rbx
movq 0x868b(%rip), %rsi      # 0xb158
leaq 0x120(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0x3504
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movq %rsp, %rdi
leaq 0x50(%rsp), %rdx
movq %rax, %rsi
callq 0x3504
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x464a(%rip), %rsi      # 0x7155
leaq 0x464a(%rip), %rdx      # 0x715c
leaq 0x20(%rsp), %rdi
callq 0x3b2e
leaq 0x120(%rsp), %rsi
movq %rsp, %rdx
leaq 0x20(%rsp), %rcx
movq %rbx, %rdi
callq 0x373d
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x2b4b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2170
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b66
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
leaq 0x130(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b87
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x2170
callq 0x2210
movl $0x1, %eax
jmp 0x284d
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x2bb5
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x2bb5
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2bd5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x2bd5
movq %rax, %r14
leaq 0x130(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2bfb
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x2bfb
movq %rax, %r14
callq 0x2210
movq %r14, %rdi
callq 0x2260
jmp 0x2a72
nop