// File: /workspace/github_cpp_makefile_star2_O3/sweeterthancandy[P]linux_event_debugger/linux_events.cpp
// Function: (anonymous namespace)::directory_monitor::start_read()
void start_read(){
                timer_.expires_from_now(boost::posix_time::milliseconds(50));
                timer_.async_wait( [this](boost::system::error_code ec){
                        FD_ZERO ( &descriptors );
                        FD_SET ( fd, &descriptors );
                         
                                 
                        int return_value = select ( fd + 1, &descriptors, NULL, NULL, &time_to_wait);
                         
                        if ( return_value < 0 ) {
                                perror("select");
                        }
                        else if ( ! return_value ) {
                        }
                        else if ( FD_ISSET ( fd, &descriptors ) ) {
                                char buffer[BUF_LEN];
                                int length = read( fd, buffer, BUF_LEN );  

                                if ( length < 0 ) {
                                        perror( "read" );
                                }  

                                for(int i=0;  i < length ; ) {
                                        struct inotify_event *event = ( struct inotify_event * ) &buffer[ i ];
                                        if ( event->len ) {
                                                if ( event->mask & IN_CREATE ) {
                                                        if ( ! (event->mask & IN_ISDIR ) ) {
                                                                sig_(tag_created, dir_ + "/" + event->name); 
                                                        }
                                                }
                                                else if ( event->mask & IN_DELETE ) {
                                                        if ( ! ( event->mask & IN_ISDIR ) ) {
                                                                sig_(tag_deleted, dir_+ "/" + event->name); 
                                                        }
                                                }
                                        }
                                        i += EVENT_SIZE + event->len;
                                }
                        }

                        if( running_ ){
                                start_read();
                        }
                });
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
addq $0x40, %rdi
leaq 0x10(%rsp), %r13
movq $0xc350, (%r13)         # imm = 0xC350
movq %r13, %rsi
callq 0x251ec
leaq 0x8(%rsp), %rax
movq %rbx, (%rax)
movq 0x40(%rbx), %r15
leaq 0x48(%rbx), %r14
leaq 0x80(%rbx), %r12
movq %rax, (%r13)
movq %fs:-0x8, %rax
xorl %ebp, %ebp
testq %rax, %rax
je 0x1064b
movq 0x8(%rax), %rdi
jmp 0x1064d
xorl %edi, %edi
movl $0x60, %esi
callq 0x16e64
movq %rax, %r13
movq %rax, 0x18(%rsp)
movq $0x0, (%rax)
leaq 0x9b(%rip), %rax        # 0x10708
movq %rax, 0x8(%r13)
movl %ebp, 0x10(%r13)
movl %ebp, 0x18(%r13)
movb $0x0, 0x1c(%r13)
leaq 0x3035b(%rip), %rax     # 0x409e0
movq %rax, 0x20(%r13)
movq 0x8(%rsp), %rax
movq %rax, 0x28(%r13)
leaq 0x30(%r13), %rdi
movq %r12, %rsi
callq 0x1d4fc
movq %r13, 0x20(%rsp)
movb $0x1, 0x50(%rbx)
movq 0x68(%r15), %rdi
addq $0x28, %r15
addq $0x58, %rbx
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r13, %r8
callq 0x2541c
leaq 0x18(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
leaq 0x10(%rsp), %rdi
callq 0x10906
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x106ff
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x10906
movq %rbx, %rdi
callq 0xb860
movq %rax, %rdi
callq 0x11b57
nop