// File: halfflat[P]tinyopt/ex/ex2-parse.cc
// Function: main
int main(int, char** argv) {
    try {
        std::vector<int> x;
        bool help = false;

        for (auto arg = argv+1; *arg; ) {
            bool ok =
                help << to::parse(arg, "-h", "--help") ||
                x    << to::parse<std::vector<int>>(arg, to::delimited<int>(), "--sum");

            if (!ok) throw to::option_error("unrecognized argument", *arg);
        }

        if (help) {
            to::usage(argv[0], usage_str);
            return 0;
        }

        std::cout << std::accumulate(x.begin(), x.end(), 0) << "\n";
    }
    catch (to::option_error& e) {
        to::usage_error(argv[0], usage_str, e.what());
        return 1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2b0, %rsp            # imm = 0x2B0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x2c50
movb $0x0, -0x29(%rbp)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq $0x0, (%rax)
je 0x285a
movb $0x0, -0xe9(%rbp)
movb $0x0, -0xea(%rbp)
movb $0x0, -0xeb(%rbp)
leaq 0x4b4e(%rip), %rsi      # 0x707a
leaq -0x68(%rbp), %rdi
callq 0x2f60
jmp 0x2537
leaq 0x4b3f(%rip), %rcx      # 0x707d
leaq -0x3c(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x68(%rbp), %rdx
callq 0x2cd0
jmp 0x2551
leaq -0x3b(%rbp), %rdi
leaq -0x29(%rbp), %rsi
leaq -0x3c(%rbp), %rdx
callq 0x2c70
jmp 0x2564
leaq -0x3b(%rbp), %rdi
callq 0x3000
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x21a(%rbp)
jne 0x2613
movl $0x2c, %edi
callq 0x3540
movb %al, -0x21b(%rbp)
jmp 0x2592
movb -0x21b(%rbp), %al
movb %al, -0xba(%rbp)
leaq 0x4adf(%rip), %rsi      # 0x7084
leaq -0xe8(%rbp), %rdi
callq 0x2f60
jmp 0x25b3
movb $0x1, -0xe9(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0xba(%rbp), %rdx
leaq -0xe8(%rbp), %rcx
callq 0x3090
jmp 0x25da
movb $0x1, -0xea(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
callq 0x3020
jmp 0x25fa
movb $0x1, -0xeb(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x3570
movb %al, -0x21a(%rbp)
movb -0x21a(%rbp), %al
movb %al, -0x21c(%rbp)
testb $0x1, -0xeb(%rbp)
jne 0x262a
jmp 0x2636
leaq -0x98(%rbp), %rdi
callq 0x3590
testb $0x1, -0xea(%rbp)
jne 0x2641
jmp 0x264d
leaq -0xb8(%rbp), %rdi
callq 0x3590
testb $0x1, -0xe9(%rbp)
jne 0x2658
jmp 0x2664
leaq -0xe8(%rbp), %rdi
callq 0x35c0
leaq -0x3b(%rbp), %rdi
callq 0x35e0
leaq -0x68(%rbp), %rdi
callq 0x35c0
movb -0x21c(%rbp), %al
andb $0x1, %al
movb %al, -0x39(%rbp)
testb $0x1, -0x39(%rbp)
jne 0x2855
movb $0x1, -0x13a(%rbp)
movl $0x30, %edi
callq 0x20f0
movq %rax, -0x230(%rbp)
leaq -0x111(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0x2320
movq -0x228(%rbp), %rdx
leaq 0x49c6(%rip), %rsi      # 0x708a
leaq -0x110(%rbp), %rdi
callq 0x3610
jmp 0x26d2
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x240(%rbp)
leaq -0x139(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x2320
movq -0x240(%rbp), %rsi
movq -0x238(%rbp), %rdx
leaq -0x138(%rbp), %rdi
callq 0x3610
jmp 0x270f
movq -0x230(%rbp), %rdi
leaq -0x110(%rbp), %rsi
leaq -0x138(%rbp), %rdx
callq 0x36c0
jmp 0x272b
movq -0x230(%rbp), %rdi
movb $0x0, -0x13a(%rbp)
leaq 0x85a8(%rip), %rsi      # 0xace8
leaq 0x1049(%rip), %rdx      # 0x3790
callq 0x22f0
jmp 0x2c50
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x2a3d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x27d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x27ca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x27b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
testb $0x1, -0xea(%rbp)
jne 0x27a3
jmp 0x27af
leaq -0xb8(%rbp), %rdi
callq 0x3590
jmp 0x27b1
testb $0x1, -0xe9(%rbp)
jne 0x27bc
jmp 0x27c8
leaq -0xe8(%rbp), %rdi
callq 0x35c0
jmp 0x27ca
leaq -0x3b(%rbp), %rdi
callq 0x35e0
leaq -0x68(%rbp), %rdi
callq 0x35c0
jmp 0x2a3d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x282d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x2815
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x2150
leaq -0x139(%rbp), %rdi
callq 0x2220
leaq -0x110(%rbp), %rdi
callq 0x2150
leaq -0x111(%rbp), %rdi
callq 0x2220
testb $0x1, -0x13a(%rbp)
jne 0x2844
jmp 0x2850
movq -0x230(%rbp), %rdi
callq 0x2180
jmp 0x2a3d
jmp 0x2502
testb $0x1, -0x29(%rbp)
je 0x299d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x258(%rbp)
movq 0x895f(%rip), %rax      # 0xb1d8
movq %rax, -0x250(%rbp)
leaq -0x161(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x2320
movq -0x250(%rbp), %rsi
movq -0x248(%rbp), %rdx
leaq -0x160(%rbp), %rdi
callq 0x3610
jmp 0x28af
leaq -0x189(%rbp), %rdi
movq %rdi, -0x260(%rbp)
callq 0x2320
movq -0x260(%rbp), %rdx
leaq 0x47d0(%rip), %rsi      # 0x70a0
leaq -0x188(%rbp), %rdi
callq 0x3610
jmp 0x28de
movq -0x258(%rbp), %rdi
leaq -0x160(%rbp), %rsi
leaq -0x188(%rbp), %rdx
callq 0x37d0
jmp 0x28fa
leaq -0x188(%rbp), %rdi
callq 0x2150
leaq -0x189(%rbp), %rdi
callq 0x2220
leaq -0x160(%rbp), %rdi
callq 0x2150
leaq -0x161(%rbp), %rdi
callq 0x2220
movl $0x0, -0x4(%rbp)
movl $0x1, -0x190(%rbp)
jmp 0x2a1e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x298c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x2974
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x2150
leaq -0x189(%rbp), %rdi
callq 0x2220
leaq -0x160(%rbp), %rdi
callq 0x2150
leaq -0x161(%rbp), %rdi
callq 0x2220
jmp 0x2a3d
leaq -0x28(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0x38d0
movq -0x270(%rbp), %rdi
movq %rax, -0x198(%rbp)
callq 0x3900
movq %rax, -0x1a0(%rbp)
movq -0x198(%rbp), %rdi
movq -0x1a0(%rbp), %rsi
xorl %edx, %edx
callq 0x3870
movl %eax, -0x264(%rbp)
jmp 0x29e4
movl -0x264(%rbp), %esi
movq 0x85df(%rip), %rdi      # 0xafd0
callq 0x2300
movq %rax, -0x278(%rbp)
jmp 0x29ff
movq -0x278(%rbp), %rdi
leaq 0x466b(%rip), %rsi      # 0x7078
callq 0x21e0
jmp 0x2a14
movl $0x0, -0x190(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x3930
movl -0x190(%rbp), %eax
testl %eax, %eax
je 0x2a38
jmp 0x2a33
jmp 0x2c33
jmp 0x2c33
leaq -0x28(%rbp), %rdi
callq 0x3930
movl -0x74(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x2c3f
movq -0x70(%rbp), %rdi
callq 0x2080
movq %rax, -0x1a8(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x290(%rbp)
movq 0x875d(%rip), %rax      # 0xb1d8
movq %rax, -0x288(%rbp)
leaq -0x1c9(%rbp), %rdi
movq %rdi, -0x280(%rbp)
callq 0x2320
movq -0x288(%rbp), %rsi
movq -0x280(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x3610
jmp 0x2ab1
movq -0x1a8(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, -0x2a0(%rbp)
leaq -0x1f1(%rbp), %rdi
movq %rdi, -0x298(%rbp)
callq 0x2320
movq -0x2a0(%rbp), %rsi
movq -0x298(%rbp), %rdx
leaq -0x1f0(%rbp), %rdi
callq 0x3610
jmp 0x2af7
leaq -0x219(%rbp), %rdi
movq %rdi, -0x2a8(%rbp)
callq 0x2320
movq -0x2a8(%rbp), %rdx
leaq 0x4588(%rip), %rsi      # 0x70a0
leaq -0x218(%rbp), %rdi
callq 0x3610
jmp 0x2b26
movq -0x290(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
leaq -0x1f0(%rbp), %rdx
leaq -0x218(%rbp), %rcx
callq 0x3990
jmp 0x2b49
leaq -0x218(%rbp), %rdi
callq 0x2150
leaq -0x219(%rbp), %rdi
callq 0x2220
leaq -0x1f0(%rbp), %rdi
callq 0x2150
leaq -0x1f1(%rbp), %rdi
callq 0x2220
leaq -0x1c8(%rbp), %rdi
callq 0x2150
leaq -0x1c9(%rbp), %rdi
callq 0x2220
movl $0x1, -0x4(%rbp)
movl $0x1, -0x190(%rbp)
callq 0x22d0
jmp 0x2c33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x2c1e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x2c06
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x2bee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x2150
leaq -0x219(%rbp), %rdi
callq 0x2220
leaq -0x1f0(%rbp), %rdi
callq 0x2150
leaq -0x1f1(%rbp), %rdi
callq 0x2220
leaq -0x1c8(%rbp), %rdi
callq 0x2150
leaq -0x1c9(%rbp), %rdi
callq 0x2220
callq 0x22d0
jmp 0x2c31
jmp 0x2c3f
movl -0x4(%rbp), %eax
addq $0x2b0, %rsp            # imm = 0x2B0
popq %rbp
retq
movq -0x70(%rbp), %rdi
callq 0x2310
movq %rax, %rdi
callq 0x3a70