// File: /workspace/github_cpp_makefile_star2_O3/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 0x777a
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %r14
leaq 0xa4(%rdi), %r12
leaq 0x128(%rdi), %r15
leaq 0xa8(%rdi), %rbx
movl %edx, %eax
movq %rax, 0x20(%rsp)
xorl %ebp, %ebp
leaq 0x28(%rsp), %r13
movq %rsi, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
leaq (,%rbp,2), %rax
addq %rbp, %rax
movq 0x4(%rsi,%rax,4), %rbx
cmpq %r12, %rbx
je 0x76d8
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
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x7886
movl 0xc(%rsp), %eax
testl %eax, %eax
je 0x7756
movl 0x8(%rsp), %edx
movq %rbx, 0x2c(%rsp)
movl %eax, %ecx
andl $0x8, %ecx
shll $0x1b, %ecx
movl %eax, %esi
andl $0x1, %esi
orl %ecx, %esi
andl $0x2, %eax
leal (%rsi,%rax,2), %eax
movl %eax, 0x28(%rsp)
movl 0xa0(%r14), %edi
movl $0x3, %esi
movq %r13, %rcx
callq 0x3360
jmp 0x7756
movl (%r12), %edi
movl $0x80, %edx
movq %r13, %rsi
callq 0x33a0
cmpl $-0x1, %eax
movq 0x18(%rsp), %rbx
je 0x7745
movl 0x28(%rsp), %eax
movl %eax, 0x8(%rsp)
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
callq 0x78fe
testq %rax, %rax
je 0x772f
movq 0x10(%rax), %rcx
movq %r14, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x777c
testb %al, %al
je 0x772f
movl 0x28(%rsp), %esi
movq %rbx, %rdi
callq 0x3320
movl (%r12), %edi
movl $0x80, %edx
movq %r13, %rsi
callq 0x33a0
cmpl $-0x1, %eax
jne 0x76f3
movl (%r12), %edi
movq %rbx, %rsi
movl $0x80800, %edx          # imm = 0x80800
callq 0x3150
movq 0x10(%rsp), %rsi
incq %rbp
cmpq 0x20(%rsp), %rbp
jne 0x763b
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop