// File: /workspace/github_cpp_makefile_star2_O2/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 0x8(%rsp), %r12
movq $0xc350, (%r12)         # imm = 0xC350
movq %r12, %rsi
callq 0x208d0
leaq 0x20(%rsp), %rbp
movq %rbx, (%rbp)
movq 0x40(%rbx), %r15
leaq 0x48(%rbx), %rax
movq %rax, (%rsp)
leaq 0x80(%rbx), %r14
movq %rbp, (%r12)
pushq $0x60
popq %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x195e0
movq %rax, %r13
movq %rax, 0x8(%r12)
andq $0x0, (%rax)
leaq 0xa2(%rip), %rax        # 0xec90
movq %rax, 0x8(%r13)
andl $0x0, 0x10(%r13)
andl $0x0, 0x18(%r13)
movb $0x0, 0x1c(%r13)
leaq 0x31c88(%rip), %rax     # 0x40890
movq %rax, 0x20(%r13)
movq (%rbp), %rax
movq %rax, 0x28(%r13)
leaq 0x30(%r13), %rdi
movq %r14, %rsi
callq 0x19d02
movq %r13, 0x10(%r12)
movb $0x1, 0x50(%rbx)
movq 0x68(%r15), %rdi
addq $0x28, %r15
addq $0x58, %rbx
movq %r15, %rsi
movq (%rsp), %rdx
movq %rbx, %rcx
movq %r13, %r8
callq 0x20a76
leaq 0x10(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
leaq 0x8(%rsp), %rdi
callq 0xec80
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xec80
movq %rbx, %rdi
callq 0xb900