// File: 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
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x108(%rbp)
addq $0x28, %rsi
leaq -0x20(%rbp), %rdi
callq 0x73c0
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xee91
movq -0x108(%rbp), %rcx
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movq 0x4(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0xa4, %rcx
cmpq %rcx, %rax
jne 0xed29
jmp 0xeb85
jmp 0xeb87
movq -0x108(%rbp), %rax
movl 0xa4(%rax), %edi
leaq -0xb0(%rbp), %rsi
movl $0x80, %edx
callq 0x3380
movq %rax, -0x110(%rbp)
jmp 0xebae
movq -0x110(%rbp), %rax
movl %eax, -0xb4(%rbp)
cmpl $-0x1, -0xb4(%rbp)
jne 0xebe9
jmp 0xed06
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x7580
jmp 0xeea3
movq -0x108(%rbp), %rax
addq $0x128, %rax            # imm = 0x128
movq %rax, -0x120(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0xeee0
movl %eax, -0x114(%rbp)
jmp 0xec11
movq -0x120(%rbp), %rdi
movl -0x114(%rbp), %eax
movl %eax, -0xd4(%rbp)
leaq -0xd4(%rbp), %rsi
callq 0xeeb0
movq %rax, -0x128(%rbp)
jmp 0xec39
movq -0x108(%rbp), %rdi
movq -0x128(%rbp), %rax
movq %rax, -0xd0(%rbp)
addq $0x128, %rdi            # imm = 0x128
callq 0xef20
movq %rax, -0xe0(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0xeef0
testb $0x1, %al
jne 0xec7d
jmp 0xed01
leaq -0xd0(%rbp), %rdi
callq 0xef50
movq -0x108(%rbp), %rsi
movq 0x8(%rax), %rax
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rcx
leaq -0xb0(%rbp), %rdx
movq %rsi, %rdi
callq 0xef80
movb %al, -0x129(%rbp)
jmp 0xecb9
movb -0x129(%rbp), %al
testb $0x1, %al
jne 0xecc5
jmp 0xecff
movq -0x108(%rbp), %rax
addq $0xa8, %rax
movq %rax, -0x138(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0xeee0
movl %eax, -0x130(%rbp)
jmp 0xeced
movl -0x130(%rbp), %esi
movq -0x138(%rbp), %rdi
callq 0x3300
jmp 0xed01
jmp 0xeb85
movq -0x108(%rbp), %rsi
movl 0xa4(%rsi), %edi
addq $0xa8, %rsi
movl $0x80800, %edx          # imm = 0x80800
callq 0x3130
jmp 0xee81
movl $0x0, -0xec(%rbp)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xed61
movl -0xec(%rbp), %eax
orl $0x1, %eax
movl %eax, -0xec(%rbp)
cmpl $0x0, %eax
setne %al
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xed8f
movl -0xec(%rbp), %eax
orl $0x2, %eax
movl %eax, -0xec(%rbp)
cmpl $0x0, %eax
setne %al
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0xedbd
movl -0xec(%rbp), %eax
orl $0x4, %eax
movl %eax, -0xec(%rbp)
cmpl $0x0, %eax
setne %al
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0xedeb
movl -0xec(%rbp), %eax
orl $0x4, %eax
movl %eax, -0xec(%rbp)
cmpl $0x0, %eax
setne %al
movq -0x108(%rbp), %rdx
movq -0x30(%rbp), %rcx
movl -0xec(%rbp), %r8d
leaq -0xf4(%rbp), %rdi
movq %rdx, %rsi
callq 0xf0d0
jmp 0xee0e
leaq -0xf4(%rbp), %rdi
callq 0xf1e0
cmpl $0x0, (%rax)
je 0xee7f
leaq -0xf4(%rbp), %rdi
callq 0xf210
movl (%rax), %eax
movl %eax, -0xfc(%rbp)
movl -0xfc(%rbp), %esi
leaq -0xf6(%rbp), %rdi
callq 0xf200
movl %eax, -0x13c(%rbp)
jmp 0xee4d
movq -0x30(%rbp), %rax
movq %rax, -0x148(%rbp)
leaq -0xf4(%rbp), %rdi
callq 0xf1e0
movq -0x108(%rbp), %rdi
movl -0x13c(%rbp), %esi
movq -0x148(%rbp), %rdx
movl (%rax), %ecx
callq 0x6760
jmp 0xee81
jmp 0xee83
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xeb45
leaq -0x20(%rbp), %rdi
callq 0x7580
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0xc0(%rbp), %rdi
callq 0x3410
nop