// File: halfflat[P]tinyopt/ex/ex6-run.cc
// Function: main
int main(int argc, char** argv) {
    try {
        std::pair<const char*, const char*> kw_tbl[] = {
            { "fish", "FISH" }, { "cake", "CAKE" }
        };

        auto help = [argv0 = argv[0]] { to::usage(argv0, usage_str); };

        to::option opts[] = {
            { to::action(help), "-h", "--help" },
            { to::action(print_kw, to::keywords(kw_tbl)), "-n", to::lax },
            { to::action(print_int, to::default_parser<int>{}), "-n", to::lax },
            { to::action(print_flag), "-n", to::flag },
        };

        to::run(opts, argc, argv+1);
        if (argv[1]) throw to::option_error("unrecognized argument", 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 $0x4c0, %rsp            # imm = 0x4C0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0xdbc4(%rip), %rax      # 0x111b4
movq %rax, -0x38(%rbp)
leaq 0xdbbe(%rip), %rax      # 0x111b9
movq %rax, -0x40(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x4380
jmp 0x3612
leaq -0x20(%rbp), %rdi
leaq 0xdba1(%rip), %rax      # 0x111be
movq %rax, -0x58(%rbp)
leaq 0xdb9b(%rip), %rax      # 0x111c3
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x4380
jmp 0x363b
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movb $0x1, -0x2ed(%rbp)
leaq -0x230(%rbp), %rax
movq %rax, -0x238(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x260(%rbp)
movq -0x260(%rbp), %rsi
leaq -0x258(%rbp), %rdi
callq 0x3d80
jmp 0x367b
leaq 0xdb46(%rip), %rdx      # 0x111c8
leaq 0xdb42(%rip), %rcx      # 0x111cb
leaq -0x230(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x43b0
jmp 0x369e
leaq -0x1c0(%rbp), %rax
movq %rax, -0x408(%rbp)
movq %rax, -0x238(%rbp)
leaq -0x298(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x4540
jmp 0x36c5
leaq -0x19c(%rip), %rsi      # 0x3530
leaq -0x280(%rbp), %rdi
leaq -0x298(%rbp), %rdx
callq 0x44c0
jmp 0x36e1
movq -0x408(%rbp), %rdi
movl $0x40, -0x29c(%rbp)
leaq 0xdad9(%rip), %rdx      # 0x111d2
leaq -0x280(%rbp), %rsi
leaq -0x29c(%rbp), %rcx
callq 0x4570
jmp 0x370e
leaq -0x150(%rbp), %rax
movq %rax, -0x410(%rbp)
movq %rax, -0x238(%rbp)
leaq -0x1ba(%rip), %rsi      # 0x3570
leaq -0x2c0(%rbp), %rdi
callq 0x4680
jmp 0x3738
movq -0x410(%rbp), %rdi
movl $0x40, -0x2c8(%rbp)
leaq 0xda82(%rip), %rdx      # 0x111d2
leaq -0x2c0(%rbp), %rsi
leaq -0x2c8(%rbp), %rcx
callq 0x4570
jmp 0x3765
leaq -0xe0(%rbp), %rax
movq %rax, -0x418(%rbp)
movq %rax, -0x238(%rbp)
leaq -0x1d1(%rip), %rsi      # 0x35b0
leaq -0x2e8(%rbp), %rdi
callq 0x46c0
jmp 0x378f
movq -0x418(%rbp), %rdi
movl $0x1, -0x2ec(%rbp)
leaq 0xda2b(%rip), %rdx      # 0x111d2
leaq -0x2e8(%rbp), %rsi
leaq -0x2ec(%rbp), %rcx
callq 0x4570
jmp 0x37bc
movb $0x0, -0x2ed(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x4700
leaq -0x2c0(%rbp), %rdi
callq 0x4700
leaq -0x280(%rbp), %rdi
callq 0x4700
leaq -0x298(%rbp), %rdi
callq 0x4720
leaq -0x258(%rbp), %rdi
callq 0x4700
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x428(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x330(%rbp)
movq $0x0, -0x320(%rbp)
leaq -0x330(%rbp), %rdi
movq %rdi, -0x420(%rbp)
callq 0x4c00
movq -0x428(%rbp), %rcx
movq -0x420(%rbp), %r8
leaq -0x310(%rbp), %rdi
leaq -0x230(%rbp), %rsi
leaq -0x8(%rbp), %rdx
callq 0x4790
jmp 0x385d
leaq -0x310(%rbp), %rdi
callq 0x4c20
leaq -0x330(%rbp), %rdi
callq 0x4c50
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x3ad8
movb $0x1, -0x37a(%rbp)
movl $0x30, %edi
callq 0x3110
movq %rax, -0x438(%rbp)
leaq -0x351(%rbp), %rdi
movq %rdi, -0x430(%rbp)
callq 0x3380
movq -0x430(%rbp), %rdx
leaq 0xd918(%rip), %rsi      # 0x111d5
leaq -0x350(%rbp), %rdi
callq 0x4c70
jmp 0x38cb
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x448(%rbp)
leaq -0x379(%rbp), %rdi
movq %rdi, -0x440(%rbp)
callq 0x3380
movq -0x448(%rbp), %rsi
movq -0x440(%rbp), %rdx
leaq -0x378(%rbp), %rdi
callq 0x4c70
jmp 0x3909
movq -0x438(%rbp), %rdi
leaq -0x350(%rbp), %rsi
leaq -0x378(%rbp), %rdx
callq 0x4d20
jmp 0x3925
movq -0x438(%rbp), %rdi
movb $0x0, -0x37a(%rbp)
leaq 0x1732e(%rip), %rsi     # 0x1ac68
leaq 0x14af(%rip), %rdx      # 0x4df0
callq 0x3350
jmp 0x3d77
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3b77
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x39ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x39e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x39d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x39c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x39bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x4700
leaq -0x2c0(%rbp), %rdi
callq 0x4700
leaq -0x280(%rbp), %rdi
callq 0x4700
leaq -0x298(%rbp), %rdi
callq 0x4720
leaq -0x258(%rbp), %rdi
callq 0x4700
testb $0x1, -0x2ed(%rbp)
jne 0x39f8
jmp 0x3a45
movq -0x238(%rbp), %rax
leaq -0x230(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x450(%rbp)
je 0x3a43
movq -0x450(%rbp), %rdi
addq $-0x70, %rdi
movq %rdi, -0x458(%rbp)
callq 0x4740
movq -0x458(%rbp), %rax
leaq -0x230(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x450(%rbp)
jne 0x3a12
jmp 0x3a45
jmp 0x3b77
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x330(%rbp), %rdi
callq 0x4c50
jmp 0x3b29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3ab3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3a9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x378(%rbp), %rdi
callq 0x3160
leaq -0x379(%rbp), %rdi
callq 0x3240
leaq -0x350(%rbp), %rdi
callq 0x3160
leaq -0x351(%rbp), %rdi
callq 0x3240
testb $0x1, -0x37a(%rbp)
jne 0x3aca
jmp 0x3ad6
movq -0x438(%rbp), %rdi
callq 0x31a0
jmp 0x3b29
leaq -0x230(%rbp), %rax
movq %rax, -0x468(%rbp)
addq $0x1c0, %rax            # imm = 0x1C0
movq %rax, -0x460(%rbp)
movq -0x460(%rbp), %rdi
addq $-0x70, %rdi
movq %rdi, -0x470(%rbp)
callq 0x4740
movq -0x468(%rbp), %rcx
movq -0x470(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x460(%rbp)
jne 0x3af3
jmp 0x3d5a
leaq -0x230(%rbp), %rax
movq %rax, -0x480(%rbp)
addq $0x1c0, %rax            # imm = 0x1C0
movq %rax, -0x478(%rbp)
movq -0x478(%rbp), %rdi
addq $-0x70, %rdi
movq %rdi, -0x488(%rbp)
callq 0x4740
movq -0x480(%rbp), %rcx
movq -0x488(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x478(%rbp)
jne 0x3b44
jmp 0x3b77
movl -0x4c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3d66
movq -0x48(%rbp), %rdi
callq 0x30a0
movq %rax, -0x388(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x4a0(%rbp)
movq 0x1765c(%rip), %rax     # 0x1b208
movq %rax, -0x498(%rbp)
leaq -0x3a9(%rbp), %rdi
movq %rdi, -0x490(%rbp)
callq 0x3380
movq -0x498(%rbp), %rsi
movq -0x490(%rbp), %rdx
leaq -0x3a8(%rbp), %rdi
callq 0x4c70
jmp 0x3be2
movq -0x388(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, -0x4b0(%rbp)
leaq -0x3d1(%rbp), %rdi
movq %rdi, -0x4a8(%rbp)
callq 0x3380
movq -0x4b0(%rbp), %rsi
movq -0x4a8(%rbp), %rdx
leaq -0x3d0(%rbp), %rdi
callq 0x4c70
jmp 0x3c28
leaq -0x3f9(%rbp), %rdi
movq %rdi, -0x4b8(%rbp)
callq 0x3380
movq -0x4b8(%rbp), %rdx
leaq 0xd5a2(%rip), %rsi      # 0x111eb
leaq -0x3f8(%rbp), %rdi
callq 0x4c70
jmp 0x3c57
movq -0x4a0(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
leaq -0x3d0(%rbp), %rdx
leaq -0x3f8(%rbp), %rcx
callq 0x4e30
jmp 0x3c7a
leaq -0x3f8(%rbp), %rdi
callq 0x3160
leaq -0x3f9(%rbp), %rdi
callq 0x3240
leaq -0x3d0(%rbp), %rdi
callq 0x3160
leaq -0x3d1(%rbp), %rdi
callq 0x3240
leaq -0x3a8(%rbp), %rdi
callq 0x3160
leaq -0x3a9(%rbp), %rdi
callq 0x3240
movl $0x1, -0x4(%rbp)
callq 0x3330
jmp 0x3d5a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3d45
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3d2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3d15
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x3f8(%rbp), %rdi
callq 0x3160
leaq -0x3f9(%rbp), %rdi
callq 0x3240
leaq -0x3d0(%rbp), %rdi
callq 0x3160
leaq -0x3d1(%rbp), %rdi
callq 0x3240
leaq -0x3a8(%rbp), %rdi
callq 0x3160
leaq -0x3a9(%rbp), %rdi
callq 0x3240
callq 0x3330
jmp 0x3d58
jmp 0x3d66
movl -0x4(%rbp), %eax
addq $0x4c0, %rsp            # imm = 0x4C0
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x3370
movq %rax, %rdi
callq 0x4f10
nopw (%rax,%rax)