// File: /workspace/github_cpp_makefile_star2_O2/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 $0x288, %rsp            # imm = 0x288
movl %edi, 0xc(%rsp)
movq %rsi, 0x58(%rsp)
movq (%rsi), %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
andq $0x0, 0x70(%rsp)
leaq 0x110(%rsp), %rsi
andq $0x0, 0x8(%rsi)
movq %rax, (%rsi)
leaq 0x512(%rip), %rax       # 0x2930
movq %rax, 0x18(%rsi)
leaq 0x58d(%rip), %rax       # 0x29b6
movq %rax, 0x10(%rsi)
leaq 0x8(%rsp), %r8
movl $0x1, (%r8)
leaq 0x8c(%rsp), %r9
movl $0x10, (%r9)
leaq 0x3cdd(%rip), %rdx      # 0x612c
leaq 0x3cd9(%rip), %rcx      # 0x612f
leaq 0x130(%rsp), %r12
movq %r12, %rdi
callq 0x2b0c
leaq 0xf0(%rsp), %rsi
andq $0x0, 0x8(%rsi)
leaq 0x1a0(%rsp), %r13
leaq 0x60(%rsp), %rbx
movq %rbx, (%rsi)
leaq 0x552(%rip), %rax       # 0x29dc
movq %rax, 0x18(%rsi)
leaq 0x585(%rip), %rax       # 0x2a1a
movq %rax, 0x10(%rsi)
leaq 0x10(%rsp), %rdx
xorps %xmm0, %xmm0
movaps %xmm0, (%rdx)
movl $0x3, (%rdx)
leaq 0xcf5(%rip), %rax       # 0x31a6
movq %rax, 0x18(%rdx)
leaq 0xcee(%rip), %rax       # 0x31aa
movq %rax, 0x10(%rdx)
leaq 0x88(%rsp), %r8
movl $0x1, (%r8)
leaq 0x3c60(%rip), %rcx      # 0x6136
movq %r13, %rdi
callq 0x2bc2
leaq 0xd0(%rsp), %rsi
andq $0x0, 0x8(%rsi)
leaq 0x210(%rsp), %r13
movq %rbx, (%rsi)
leaq 0x543(%rip), %rax       # 0x2a40
movq %rax, 0x18(%rsi)
leaq 0x584(%rip), %rax       # 0x2a8c
movq %rax, 0x10(%rsi)
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rdx
movaps %xmm0, (%rdx)
leaq 0x594(%rip), %rax       # 0x2ab2
movq %rax, 0x18(%rdx)
leaq 0x591(%rip), %rax       # 0x2aba
movq %rax, 0x10(%rdx)
leaq 0x90(%rsp), %rcx
movaps %xmm0, (%rcx)
leaq 0x5a1(%rip), %rax       # 0x2ae0
movq %rax, 0x18(%rcx)
leaq 0x59c(%rip), %rax       # 0x2ae6
movq %rax, 0x10(%rcx)
movq %r13, %rdi
callq 0x2c92
leaq 0x90(%rsp), %rdi
callq 0x31f8
leaq 0x30(%rsp), %r15
movq %r15, %rdi
callq 0x31f8
leaq 0xd0(%rsp), %rdi
callq 0x31f8
leaq 0x10(%rsp), %rdi
callq 0x31f8
leaq 0xf0(%rsp), %rdi
callq 0x31f8
leaq 0x110(%rsp), %rdi
callq 0x31f8
movq 0x58(%rsp), %rax
leaq 0x8(%rax), %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
andq $0x0, 0x10(%r15)
leaq 0x10(%rsp), %rdi
leaq 0x130(%rsp), %rsi
leaq 0xc(%rsp), %rdx
leaq 0x30(%rsp), %r8
movq %r14, %rcx
callq 0x2d58
leaq 0x10(%rsp), %rdi
movb (%rdi), %bl
callq 0x34ec
leaq 0x30(%rsp), %rdi
callq 0x2fba
testb %bl, %bl
je 0x2684
cmpq $0x0, (%r14)
jne 0x26c1
movq 0x60(%rsp), %rbx
movq 0x68(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x89ba(%rip), %r14      # 0xafd0
leaq 0x10(%rsp), %r13
leaq 0x30(%rsp), %rbp
cmpq 0x80(%rsp), %rbx
je 0x2684
movq %r14, %rdi
leaq 0x3b1b(%rip), %rsi      # 0x614f
callq 0x2170
movq %r14, 0x10(%rsp)
leaq 0x3b16(%rip), %rax      # 0x615b
movq %rax, 0x18(%rsp)
movq (%rbx), %r12
movq 0x8(%rbx), %r15
cmpq %r15, %r12
je 0x266f
movl (%r12), %eax
movl %eax, 0x30(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x30ac
addq $0x4, %r12
jmp 0x2651
movq %r14, %rdi
leaq 0x3ad9(%rip), %rsi      # 0x6152
callq 0x2170
addq $0x18, %rbx
jmp 0x2620
movl $0xe0, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x130, %rdi            # imm = 0x130
callq 0x4e86
addq $-0x70, %rbx
cmpq $-0x70, %rbx
jne 0x2689
leaq 0x60(%rsp), %rdi
callq 0x30d0
xorl %eax, %eax
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x30
popq %rdi
callq 0x20c0
movq %rax, %r12
leaq 0x3a66(%rip), %rsi      # 0x6139
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x2fdc
movq (%r14), %rsi
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x2fdc
movb $0x1, %bl
leaq 0x10(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
movq %r12, %rdi
callq 0x3018
xorl %ebx, %ebx
leaq 0x8536(%rip), %rsi      # 0xac50
leaq 0x2127(%rip), %rdx      # 0x4848
movq %r12, %rdi
callq 0x2250
movq %rdx, %r15
movq %rax, %r14
leaq 0xb0(%rsp), %rdi
callq 0x2090
jmp 0x2746
movq %rdx, %r15
movq %rax, %r14
movb $0x1, %bl
leaq 0x10(%rsp), %rdi
callq 0x2090
testb %bl, %bl
jne 0x275f
jmp 0x280c
movq %rdx, %r15
movq %rax, %r14
movq %r12, %rdi
callq 0x2110
jmp 0x280c
movq %rdx, %r15
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x2fba
jmp 0x280c
movq %rdx, %r15
movq %rax, %r14
leaq 0x90(%rsp), %rdi
callq 0x31f8
leaq 0x30(%rsp), %rdi
callq 0x31f8
leaq 0xd0(%rsp), %rdi
callq 0x31f8
jmp 0x27b3
movq %rdx, %r15
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x31f8
leaq 0xf0(%rsp), %rdi
callq 0x31f8
jmp 0x27d5
movq %rdx, %r15
movq %rax, %r14
movq %r12, %r13
leaq 0x110(%rsp), %rdi
callq 0x31f8
cmpq %r13, %r12
je 0x282b
leaq 0x130(%rsp), %rbx
addq $-0x70, %r13
movq %r13, %rdi
callq 0x4e86
cmpq %rbx, %r13
jne 0x27ef
jmp 0x282b
jmp 0x2806
jmp 0x2806
movq %rdx, %r15
movq %rax, %r14
movl $0xe0, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x130, %rdi            # imm = 0x130
callq 0x4e86
addq $-0x70, %rbx
cmpq $-0x70, %rbx
jne 0x2811
leaq 0x60(%rsp), %rdi
callq 0x30d0
cmpl $0x1, %r15d
jne 0x291f
movq %r14, %rdi
callq 0x2070
movq %rax, %r14
movq 0x58(%rsp), %rax
movq (%rax), %rbx
movq 0x890f(%rip), %rsi      # 0xb168
leaq 0x130(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x2fdc
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
leaq 0x10(%rsp), %rdi
leaq 0x60(%rsp), %rdx
movq %rax, %rsi
callq 0x2fdc
leaq 0x38c5(%rip), %rsi      # 0x6155
leaq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x2fdc
leaq 0x130(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x30(%rsp), %rcx
movq %rbx, %rdi
callq 0x30f1
leaq 0x30(%rsp), %rdi
callq 0x2090
leaq 0x10(%rsp), %rdi
callq 0x2090
leaq 0x130(%rsp), %rdi
callq 0x2090
callq 0x2230
pushq $0x1
popq %rax
jmp 0x26af
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x2090
jmp 0x28f9
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x2090
jmp 0x2908
movq %rax, %r14
leaq 0x130(%rsp), %rdi
callq 0x2090
jmp 0x291a
movq %rax, %r14
callq 0x2230
movq %r14, %rdi
callq 0x2270
movq %rax, %rdi
callq 0x319b
nop