// File: halfflat[P]tinyopt/ex/ex5-run.cc
// Function: main
int main(int argc, char** argv) {
    try {
        to::option opts[] = {
            // 'echo' and 'ohce' are always recognized:
            { {}, to::flag, "echo", to::then(1) },
            { {}, to::flag, "ohce", to::then(2) },

            // If mode is zero and we see a word, it's an error.
            { to::error("unrecognized keyword"), to::when(0) },

            // If mode is one, echo argument.
            { to::action(echo), to::when(1) },

            // If mode is two, echo argument in reverse.
            { to::action(ohce), to::when(2) }
        };

        to::run(opts, argc, argv+1);
    }
    catch (to::option_error& e) {
        to::usage_error(argv[0], usage_str, e.what());
        return 1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x540, %rsp            # imm = 0x540
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x1, -0x3c9(%rbp)
leaq -0x240(%rbp), %rax
movq %rax, -0x248(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x3e70
jmp 0x35fc
movl $0x1, -0x278(%rbp)
leaq -0x298(%rbp), %rdi
movl $0x1, %esi
callq 0x3e90
jmp 0x3619
leaq 0xdab5(%rip), %rcx      # 0x110d5
leaq -0x240(%rbp), %rdi
leaq -0x268(%rbp), %rsi
leaq -0x278(%rbp), %rdx
leaq -0x298(%rbp), %r8
callq 0x3ec0
jmp 0x3643
leaq -0x1d0(%rbp), %rax
movq %rax, -0x498(%rbp)
movq %rax, -0x248(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0x3e70
jmp 0x3666
movl $0x1, -0x2bc(%rbp)
leaq -0x2e0(%rbp), %rdi
movl $0x2, %esi
callq 0x3e90
jmp 0x3683
movq -0x498(%rbp), %rdi
leaq 0xda49(%rip), %rcx      # 0x110da
leaq -0x2b8(%rbp), %rsi
leaq -0x2bc(%rbp), %rdx
leaq -0x2e0(%rbp), %r8
callq 0x3ec0
jmp 0x36ad
leaq -0x160(%rbp), %rax
movq %rax, -0x4a8(%rbp)
movq %rax, -0x248(%rbp)
leaq -0x321(%rbp), %rdi
movq %rdi, -0x4a0(%rbp)
callq 0x3330
movq -0x4a0(%rbp), %rdx
leaq 0xd9fc(%rip), %rsi      # 0x110df
leaq -0x320(%rbp), %rdi
callq 0x4000
jmp 0x36f1
leaq -0x300(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0x3f90
jmp 0x3706
leaq -0x348(%rbp), %rdi
xorl %esi, %esi
callq 0x40b0
jmp 0x3716
movq -0x4a8(%rbp), %rdi
leaq -0x300(%rbp), %rsi
leaq -0x348(%rbp), %rdx
callq 0x40e0
jmp 0x3732
leaq -0xf0(%rbp), %rax
movq %rax, -0x4b0(%rbp)
movq %rax, -0x248(%rbp)
leaq -0x27e(%rip), %rsi      # 0x34d0
leaq -0x368(%rbp), %rdi
callq 0x41d0
jmp 0x375c
leaq -0x388(%rbp), %rdi
movl $0x1, %esi
callq 0x40b0
jmp 0x376f
movq -0x4b0(%rbp), %rdi
leaq -0x368(%rbp), %rsi
leaq -0x388(%rbp), %rdx
callq 0x40e0
jmp 0x378b
leaq -0x80(%rbp), %rax
movq %rax, -0x4b8(%rbp)
movq %rax, -0x248(%rbp)
leaq -0x294(%rip), %rsi      # 0x3510
leaq -0x3a8(%rbp), %rdi
callq 0x41d0
jmp 0x37b2
leaq -0x3c8(%rbp), %rdi
movl $0x2, %esi
callq 0x40b0
jmp 0x37c5
movq -0x4b8(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
leaq -0x3c8(%rbp), %rdx
callq 0x40e0
jmp 0x37e1
movb $0x0, -0x3c9(%rbp)
leaq -0x3c8(%rbp), %rdi
callq 0x4210
leaq -0x3a8(%rbp), %rdi
callq 0x4230
leaq -0x388(%rbp), %rdi
callq 0x4210
leaq -0x368(%rbp), %rdi
callq 0x4230
leaq -0x348(%rbp), %rdi
callq 0x4210
leaq -0x300(%rbp), %rdi
callq 0x4230
leaq -0x320(%rbp), %rdi
callq 0x3130
leaq -0x321(%rbp), %rdi
callq 0x3210
leaq -0x2e0(%rbp), %rdi
callq 0x4250
leaq -0x2b8(%rbp), %rdi
callq 0x4230
leaq -0x298(%rbp), %rdi
callq 0x4250
leaq -0x268(%rbp), %rdi
callq 0x4230
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x4c8(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x410(%rbp)
movq $0x0, -0x400(%rbp)
leaq -0x410(%rbp), %rdi
movq %rdi, -0x4c0(%rbp)
callq 0x4730
movq -0x4c8(%rbp), %rcx
movq -0x4c0(%rbp), %r8
leaq -0x3f0(%rbp), %rdi
leaq -0x240(%rbp), %rsi
leaq -0x8(%rbp), %rdx
callq 0x42c0
jmp 0x38d6
leaq -0x3f0(%rbp), %rdi
callq 0x4750
leaq -0x410(%rbp), %rdi
callq 0x4780
leaq -0x240(%rbp), %rax
movq %rax, -0x4d8(%rbp)
addq $0x230, %rax            # imm = 0x230
movq %rax, -0x4d0(%rbp)
movq -0x4d0(%rbp), %rdi
addq $-0x70, %rdi
movq %rdi, -0x4e0(%rbp)
callq 0x4270
movq -0x4d8(%rbp), %rcx
movq -0x4e0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x4d0(%rbp)
jne 0x3909
jmp 0x3db0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x3ae9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x3add
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x3ad1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x3ac5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x3ab9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x3aad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x3aa1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x3a95
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x3a89
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x3a7d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x3a71
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x3a65
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
leaq -0x3c8(%rbp), %rdi
callq 0x4210
leaq -0x3a8(%rbp), %rdi
callq 0x4230
leaq -0x388(%rbp), %rdi
callq 0x4210
leaq -0x368(%rbp), %rdi
callq 0x4230
leaq -0x348(%rbp), %rdi
callq 0x4210
leaq -0x300(%rbp), %rdi
callq 0x4230
leaq -0x320(%rbp), %rdi
callq 0x3130
leaq -0x321(%rbp), %rdi
callq 0x3210
leaq -0x2e0(%rbp), %rdi
callq 0x4250
leaq -0x2b8(%rbp), %rdi
callq 0x4230
leaq -0x298(%rbp), %rdi
callq 0x4250
leaq -0x268(%rbp), %rdi
callq 0x4230
testb $0x1, -0x3c9(%rbp)
jne 0x3af4
jmp 0x3b41
movq -0x248(%rbp), %rax
leaq -0x240(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x4e8(%rbp)
je 0x3b3f
movq -0x4e8(%rbp), %rdi
addq $-0x70, %rdi
movq %rdi, -0x4f0(%rbp)
callq 0x4270
movq -0x4f0(%rbp), %rax
leaq -0x240(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x4e8(%rbp)
jne 0x3b0e
jmp 0x3b41
jmp 0x3baf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
leaq -0x410(%rbp), %rdi
callq 0x4780
leaq -0x240(%rbp), %rax
movq %rax, -0x500(%rbp)
addq $0x230, %rax            # imm = 0x230
movq %rax, -0x4f8(%rbp)
movq -0x4f8(%rbp), %rdi
addq $-0x70, %rdi
movq %rdi, -0x508(%rbp)
callq 0x4270
movq -0x500(%rbp), %rcx
movq -0x508(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x4f8(%rbp)
jne 0x3b7c
jmp 0x3baf
movl -0x274(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3dbc
movq -0x270(%rbp), %rdi
callq 0x30a0
movq %rax, -0x418(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x520(%rbp)
movq 0x175ee(%rip), %rax     # 0x1b1d8
movq %rax, -0x518(%rbp)
leaq -0x439(%rbp), %rdi
movq %rdi, -0x510(%rbp)
callq 0x3330
movq -0x518(%rbp), %rsi
movq -0x510(%rbp), %rdx
leaq -0x438(%rbp), %rdi
callq 0x4000
jmp 0x3c20
movq -0x418(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, -0x530(%rbp)
leaq -0x461(%rbp), %rdi
movq %rdi, -0x528(%rbp)
callq 0x3330
movq -0x530(%rbp), %rsi
movq -0x528(%rbp), %rdx
leaq -0x460(%rbp), %rdi
callq 0x4000
jmp 0x3c66
leaq -0x489(%rbp), %rdi
movq %rdi, -0x538(%rbp)
callq 0x3330
movq -0x538(%rbp), %rdx
leaq 0xd46d(%rip), %rsi      # 0x110f4
leaq -0x488(%rbp), %rdi
callq 0x4000
jmp 0x3c95
movq -0x520(%rbp), %rdi
leaq -0x438(%rbp), %rsi
leaq -0x460(%rbp), %rdx
leaq -0x488(%rbp), %rcx
callq 0x47a0
jmp 0x3cb8
leaq -0x488(%rbp), %rdi
callq 0x3130
leaq -0x489(%rbp), %rdi
callq 0x3210
leaq -0x460(%rbp), %rdi
callq 0x3130
leaq -0x461(%rbp), %rdi
callq 0x3210
leaq -0x438(%rbp), %rdi
callq 0x3130
leaq -0x439(%rbp), %rdi
callq 0x3210
movl $0x1, -0x4(%rbp)
callq 0x3300
jmp 0x3db0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x3d9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x3d83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x3d6b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
leaq -0x488(%rbp), %rdi
callq 0x3130
leaq -0x489(%rbp), %rdi
callq 0x3210
leaq -0x460(%rbp), %rdi
callq 0x3130
leaq -0x461(%rbp), %rdi
callq 0x3210
leaq -0x438(%rbp), %rdi
callq 0x3130
leaq -0x439(%rbp), %rdi
callq 0x3210
callq 0x3300
jmp 0x3dae
jmp 0x3dbc
movl -0x4(%rbp), %eax
addq $0x540, %rsp            # imm = 0x540
popq %rbp
retq
movq -0x270(%rbp), %rdi
callq 0x3320
movq %rax, %rdi
callq 0x4880