// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %r15
leaq 0xa4(%rdi), %r13
leaq 0x128(%rdi), %r12
xorl %eax, %eax
testl %edx, %edx
cmovlel %eax, %edx
movq %rdx, 0x18(%rsp)
leaq 0xa8(%rdi), %r14
leaq 0x28(%rsp), %rbp
leaq 0x4(%rsp), %rbx
movq %rsi, 0x8(%rsp)
movq %r14, 0x10(%rsp)
cmpq 0x18(%rsp), %rax
je 0x7505
movq %rax, 0x20(%rsp)
imulq $0xc, %rax, %rax
movq 0x4(%rsi,%rax), %r14
cmpq %r13, %r14
je 0x748b
addq %rsi, %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
pushq $0x4
popq %rax
cmovnel %eax, %r8d
orl %edx, %r8d
movq %rbp, %rdi
movq %r15, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x75c4
movl 0x2c(%rsp), %ecx
testl %ecx, %ecx
je 0x74f3
movl 0x28(%rsp), %esi
movq %r15, %rdi
movq %r14, %rdx
callq 0x4a14
jmp 0x74f3
movq 0x10(%rsp), %r14
movl (%r13), %edi
movl $0x80, %edx
movq %rbp, %rsi
callq 0x3370
cmpl $-0x1, %eax
je 0x74e2
movl 0x28(%rsp), %eax
movl %eax, 0x4(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x7638
testq %rax, %rax
je 0x7490
movq 0x10(%rax), %rcx
movq %r15, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x7518
testb %al, %al
je 0x7490
movl 0x28(%rsp), %esi
movq %r14, %rdi
callq 0x32f0
jmp 0x7490
movl (%r13), %edi
movq %r14, %rsi
movl $0x80800, %edx          # imm = 0x80800
callq 0x3150
movq 0x8(%rsp), %rsi
movq 0x20(%rsp), %rax
incq %rax
jmp 0x7419
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop