// File: sweeterthancandy[P]linux_event_debugger/linux_events.cpp
// Function: (anonymous namespace)::driver::process_event_((anonymous namespace)::tag, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void process_event_(tag t, std::string const& dir){
                switch(t){
                        case tag_existing:
                        case tag_created:{
                                std::cerr << dir << " created\n";
                                auto sptr = std::make_shared<event_monitor>(io_, dir);
                                sptr->start();
                                sptr->connect( [this](std::string const& dev, const struct input_event& ev){
                                       pretty_print_(dev, ev);
                                });
                                monitors_.emplace(dir, sptr);
                                break;
                        }
                        case tag_deleted:{
                                std::cerr << dir << " deleted\n";
                                auto iter = monitors_.find(dir);
                                if( iter == monitors_.end()){
                                        std::cerr << "can't find it\n";
                                        break;
                                }
                                iter->second->stop();
                                monitors_.erase(iter);
                                break;
                        }
                }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0xbc(%rbp)
testl %eax, %eax
je 0x193f2
jmp 0x193d0
movl -0xbc(%rbp), %eax
subl $0x1, %eax
je 0x1951d
jmp 0x193e1
movl -0xbc(%rbp), %eax
subl $0x2, %eax
jne 0x195e8
jmp 0x193f2
movq -0x18(%rbp), %rsi
movq 0x7fbe3(%rip), %rdi     # 0x98fe0
callq 0xd5b0
movq %rax, %rdi
leaq 0x4ac52(%rip), %rsi     # 0x6405e
callq 0xd650
movq -0xc8(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x28(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x3b4f0
movq -0xd0(%rbp), %rdi
callq 0x3b570
movq %rax, %rdi
callq 0x3b590
jmp 0x19442
leaq -0x28(%rbp), %rdi
callq 0x3b570
movq %rax, %rcx
movq -0xc8(%rbp), %rax
movq %rcx, -0xd8(%rbp)
movq %rax, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x19600
jmp 0x19475
movq -0xd8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x3b5b0
jmp 0x1948b
leaq -0x48(%rbp), %rdi
callq 0x2ff80
leaq -0x80(%rbp), %rdi
callq 0x3b5f0
movq -0xc8(%rbp), %rdi
addq $0x70, %rdi
movq -0x18(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x3b620
movb %dl, -0xe1(%rbp)
movq %rax, -0xe0(%rbp)
jmp 0x194c4
movb -0xe1(%rbp), %al
movq -0xe0(%rbp), %rcx
movq %rcx, -0x98(%rbp)
movb %al, -0x90(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x3b670
jmp 0x195e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x1950f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x3b5f0
leaq -0x28(%rbp), %rdi
callq 0x3b670
jmp 0x195f1
movq -0x18(%rbp), %rsi
movq 0x7fab8(%rip), %rdi     # 0x98fe0
callq 0xd5b0
movq %rax, %rdi
leaq 0x4ab31(%rip), %rsi     # 0x64068
callq 0xd650
movq -0xc8(%rbp), %rdi
addq $0x70, %rdi
movq -0x18(%rbp), %rsi
callq 0x3b690
movq -0xc8(%rbp), %rdi
movq %rax, -0xa0(%rbp)
addq $0x70, %rdi
callq 0x3b6f0
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3b6c0
testb $0x1, %al
jne 0x19587
jmp 0x1959c
movq 0x7fa52(%rip), %rdi     # 0x98fe0
leaq 0x4aadd(%rip), %rsi     # 0x64072
callq 0xd650
jmp 0x195e8
leaq -0xa0(%rbp), %rdi
callq 0x3b720
movq %rax, %rdi
addq $0x20, %rdi
callq 0x3b570
movq %rax, %rdi
callq 0x3b740
movq -0xc8(%rbp), %rdi
addq $0x70, %rdi
movq -0xa0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rsi
callq 0x3b760
movq %rax, -0xb8(%rbp)
addq $0xf0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0xdb80
nopw (%rax,%rax)