// File: sweeterthancandy[P]linux_event_debugger/linux_events.cpp
// Function: (anonymous namespace)::driver::run(int, char**)
int run(int argc, char** argv){
                try{
                        bool do_create_existing = true;

                        for(int arg_iter=1; arg_iter < argc;){
                                int d = argc - arg_iter;
                                std::string arg = argv[arg_iter];
                                switch(d){
                                default:
                                case 1:
                                        if( arg == "--dont-create-existing"){
                                                do_create_existing = false;
                                                ++arg_iter;
                                                continue;
                                        }
                                        if( arg == "--help" ){
                                                std::cout 
                                                        << argv[0] << " <options>\n"
                                                        << "             --dont-create-existing\n";
                                                ++arg_iter;
                                                return EXIT_SUCCESS;
                                        }
                                }
                                std::cerr << "unknown arg \"" << arg << "\"\n";
                                return EXIT_FAILURE;
                        }


                        start_monitor_();
                        if( do_create_existing ){
                                create_existing_();
                        }
                        start_signal_monitor_();

                        io_.run();


                } catch( const std::exception& e){
                        std::cerr 
                                << "Caught exception: "
                                << boost::diagnostic_information(e)
                                ;
                        return EXIT_FAILURE;
                }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movb $0x1, -0x21(%rbp)
movl $0x1, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x11935
movl -0x14(%rbp), %eax
movl -0x28(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xa8(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0xdbb0
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0x1e790
jmp 0x117af
leaq -0x51(%rbp), %rdi
callq 0xd6f0
movl -0x2c(%rbp), %eax
subl $0x1, %eax
je 0x117de
jmp 0x117dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x51(%rbp), %rdi
callq 0xd6f0
jmp 0x1196c
jmp 0x117de
leaq 0x4f357(%rip), %rsi     # 0x60b3c
leaq -0x50(%rbp), %rdi
callq 0x2fe90
movb %al, -0xa9(%rbp)
jmp 0x117f6
movb -0xa9(%rbp), %al
testb $0x1, %al
jne 0x11802
jmp 0x11835
movb $0x0, -0x21(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl $0x3, -0x68(%rbp)
jmp 0x11919
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xd3b0
jmp 0x1196c
leaq 0x4f317(%rip), %rsi     # 0x60b53
leaq -0x50(%rbp), %rdi
callq 0x2fe90
movb %al, -0xaa(%rbp)
jmp 0x1184d
movb -0xaa(%rbp), %al
testb $0x1, %al
jne 0x11859
jmp 0x118bf
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movq 0x87741(%rip), %rdi     # 0x98fa8
callq 0xd650
movq %rax, -0xb8(%rbp)
jmp 0x11875
movq -0xb8(%rbp), %rdi
leaq 0x4f2d7(%rip), %rsi     # 0x60b5a
callq 0xd650
movq %rax, -0xc0(%rbp)
jmp 0x11891
movq -0xc0(%rbp), %rdi
leaq 0x4f2c7(%rip), %rsi     # 0x60b66
callq 0xd650
jmp 0x118a6
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl $0x0, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x11919
jmp 0x118c1
movq 0x87718(%rip), %rdi     # 0x98fe0
leaq 0x4f2bc(%rip), %rsi     # 0x60b8b
callq 0xd650
movq %rax, -0xc8(%rbp)
jmp 0x118dd
movq -0xc8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xd5b0
movq %rax, -0xd0(%rbp)
jmp 0x118f6
movq -0xd0(%rbp), %rdi
leaq 0x4f295(%rip), %rsi     # 0x60b99
callq 0xd650
jmp 0x1190b
movl $0x1, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xd3b0
movl -0x68(%rbp), %eax
subl $0x1, %eax
je 0x11a41
jmp 0x11930
jmp 0x1175c
movq -0x98(%rbp), %rdi
callq 0x11b60
jmp 0x11943
testb $0x1, -0x21(%rbp)
je 0x119f2
movq -0x98(%rbp), %rdi
callq 0x11c60
jmp 0x1195b
jmp 0x119f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x11a4d
movq -0x60(%rbp), %rdi
callq 0xd240
movq %rax, -0x70(%rbp)
movq 0x87650(%rip), %rdi     # 0x98fe0
leaq 0x4f205(%rip), %rsi     # 0x60b9c
callq 0xd650
movq %rax, -0xd8(%rbp)
jmp 0x119a5
movq -0x70(%rbp), %rsi
leaq -0x90(%rbp), %rdi
movl $0x1, %edx
callq 0x2ff10
jmp 0x119bc
movq -0xd8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xd5b0
jmp 0x119d1
leaq -0x90(%rbp), %rdi
callq 0xd3b0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
callq 0xdb00
jmp 0x11a41
movq -0x98(%rbp), %rdi
callq 0x11eb0
jmp 0x11a00
movq -0x98(%rbp), %rdi
callq 0x2fec0
jmp 0x11a0e
jmp 0x11a3f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x11a36
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xd3b0
callq 0xdb00
jmp 0x11a3d
jmp 0x11a4d
ud2
movl -0x4(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0xdb80
movq %rax, %rdi
callq 0x1e540
nop