// File: /workspace/github_cpp_makefile_star2_O1/davmac314[P]dinit/src/../dasynq/include/dasynq/epoll.h
// Function: dasynq::v2::epoll_loop<dasynq::interrupt_channel<dasynq::timer_fd_events<dasynq::v2::child_proc_events<dasynq::v2::dprivate::event_dispatch<dasynq::v2::epoll_traits, dasynq::v2::default_traits<dasynq::null_mutex>>>>, dasynq::null_mutex>>::process_events(epoll_event*, int)
void process_events(epoll_event *events, int r)
    {
        std::lock_guard<decltype(Base::lock)> guard(Base::lock);
        
        for (int i = 0; i < r; i++) {
            void * ptr = events[i].data.ptr;
            
            if (ptr == &sigfd) {
                // Signal
                sigdata_t siginfo;
                while (true) {
                    int r = read(sigfd, &siginfo.info, sizeof(siginfo.info));
                    if (r == -1) break;
                    auto iter = sigdataMap.find(siginfo.get_signo());
                    if (iter != sigdataMap.end()) {
                        void *userdata = (*iter).second;
                        if (Base::receive_signal(*this, siginfo, userdata)) {
                            sigdelset(&sigmask, siginfo.get_signo());
                        }
                    }
                }
                signalfd(sigfd, &sigmask, SFD_NONBLOCK | SFD_CLOEXEC);
            }
            else {
                int flags = 0;
                (events[i].events & EPOLLIN) && (flags |= IN_EVENTS);
                (events[i].events & EPOLLOUT) && (flags |= OUT_EVENTS);
                // We mustn't introduce IN/OUT events for error conditions as we don't know which are being
                // watched! Just set ERR_EVENTS.
                (events[i].events & EPOLLHUP) && (flags |= ERR_EVENTS);
                (events[i].events & EPOLLERR) && (flags |= ERR_EVENTS);
                auto r = Base::receive_fd_event(*this, fd_r(), ptr, flags);
                if (std::get<0>(r) != 0) {
                    enable_fd_watch_nolock(fd_r().get_fd(std::get<1>(r)), ptr, std::get<0>(r));
                }
            }            
        }
    }

// Assembly:
testl %edx, %edx
jle 0x7a31
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %r14
leaq 0xa4(%rdi), %rbp
leaq 0xa8(%rdi), %rax
movq %rax, 0x8(%rsp)
movl %edx, %eax
movq %rax, 0x10(%rsp)
xorl %ebx, %ebx
leaq 0x18(%rsp), %r12
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movq %rsi, (%rsp)
leaq (%rbx,%rbx,2), %rax
movq 0x4(%rsi,%rax,4), %r13
cmpq %rbp, %r13
je 0x793d
leaq (%rsi,%rax,4), %rax
movl (%rax), %eax
movl %eax, %ecx
andl $0x1, %ecx
movl %eax, %edx
shrl %edx
andl $0x2, %edx
orl %ecx, %edx
movl %eax, %r8d
shrl $0x2, %r8d
andl $0x4, %r8d
testb $0x8, %al
movl $0x4, %eax
cmovnel %eax, %r8d
orl %edx, %r8d
movq %r12, %rdi
movq %r14, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x7b36
movl 0x1c(%rsp), %ecx
testl %ecx, %ecx
je 0x7a0e
movl 0x18(%rsp), %esi
movq %r14, %rdi
movq %r13, %rdx
callq 0x4f24
jmp 0x7a0e
movl (%rbp), %edi
movl $0x80, %edx
movq %r12, %rsi
callq 0x33a0
movl %eax, %r13d
cmpq %r15, %r13
je 0x79fc
movslq 0x18(%rsp), %rcx
movq 0x128(%r14), %rdi
movq 0x130(%r14), %r8
movq %rcx, %rax
xorl %edx, %edx
divq %r8
movq %rdx, %rsi
movq (%rdi,%rdx,8), %rdx
movl $0x0, %eax
testq %rdx, %rdx
je 0x79bd
movq (%rdx), %r9
movq %rdx, %rax
cmpl 0x8(%r9), %ecx
je 0x79bd
movq %r9, %r10
movq (%r9), %r9
testq %r9, %r9
je 0x79bb
movslq 0x8(%r9), %rdi
movq %rdi, %rax
xorl %edx, %edx
divq %r8
movl $0x0, %eax
cmpq %rsi, %rdx
jne 0x79bd
movq %r10, %rax
cmpl %edi, %ecx
jne 0x7991
jmp 0x79bd
xorl %eax, %eax
testq %rax, %rax
je 0x79c7
movq (%rax), %rax
jmp 0x79c9
xorl %eax, %eax
testq %rax, %rax
je 0x79f2
movq 0x10(%rax), %rcx
movq %r14, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x7a32
testb %al, %al
je 0x79f2
movl 0x18(%rsp), %esi
movq 0x8(%rsp), %rdi
callq 0x3320
cmpl $-0x1, %r13d
jne 0x793d
movl (%rbp), %edi
movq 0x8(%rsp), %rsi
movl $0x80800, %edx          # imm = 0x80800
callq 0x3150
movq (%rsp), %rsi
incq %rbx
cmpq 0x10(%rsp), %rbx
jne 0x78d1
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq