// 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>>::add_signal_watch_nolock(int, void*)
void add_signal_watch_nolock(int signo, void *userdata)
    {
        sigdataMap[signo] = userdata;

        // Modify the signal fd to watch the new signal
        bool was_no_sigfd = (sigfd == -1);
        sigaddset(&sigmask, signo);
        sigfd = signalfd(sigfd, &sigmask, SFD_NONBLOCK | SFD_CLOEXEC);
        if (sigfd == -1) {
            throw std::system_error(errno, std::system_category());
        }
        
        if (was_no_sigfd) {
            // Add the signalfd to the epoll set.
            struct epoll_event epevent;
            epevent.data.ptr = &sigfd;
            epevent.events = EPOLLIN;
            // No need for EPOLLONESHOT - we can pull the signals out
            // as we see them.
            if (epoll_ctl(epfd, EPOLL_CTL_ADD, sigfd, &epevent) == -1) {
                close(sigfd);
                sigfd = -1;
                throw std::system_error(errno, std::system_category());
            }
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
addq $0x128, %rdi            # imm = 0x128
leaq -0xc(%rbp), %rsi
callq 0xbcd0
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %rdi
movq %rcx, (%rax)
cmpl $-0x1, 0xa4(%rdi)
sete %al
andb $0x1, %al
movb %al, -0x19(%rbp)
addq $0xa8, %rdi
movl -0xc(%rbp), %esi
callq 0x33a0
movq -0x40(%rbp), %rsi
movl 0xa4(%rsi), %edi
addq $0xa8, %rsi
movl $0x80800, %edx          # imm = 0x80800
callq 0x3130
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0xa4(%rax)
cmpl $-0x1, 0xa4(%rax)
jne 0xbbf2
movl $0x20, %edi
callq 0x3110
movq %rax, -0x58(%rbp)
movq %rax, -0x60(%rbp)
callq 0x3030
movl (%rax), %eax
movl %eax, -0x4c(%rbp)
callq 0x3140
movq -0x58(%rbp), %rdi
movl -0x4c(%rbp), %esi
movq %rax, %rdx
callq 0x77c0
jmp 0xbbc1
movq -0x60(%rbp), %rdi
movq 0xe3ac(%rip), %rsi      # 0x19f78
movq 0xe3d5(%rip), %rdx      # 0x19fa8
callq 0x3400
movq -0x60(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3190
jmp 0xbcbc
testb $0x1, -0x19(%rbp)
je 0xbcb3
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0xa4, %rcx
movq %rcx, -0x34(%rbp)
movl $0x1, -0x38(%rbp)
movl 0xa0(%rax), %edi
movl 0xa4(%rax), %edx
movl $0x1, %esi
leaq -0x38(%rbp), %rcx
callq 0x3340
cmpl $-0x1, %eax
jne 0xbcb1
movq -0x40(%rbp), %rax
movl 0xa4(%rax), %edi
callq 0x3440
movq -0x40(%rbp), %rax
movl $0xffffffff, 0xa4(%rax) # imm = 0xFFFFFFFF
movl $0x20, %edi
callq 0x3110
movq %rax, -0x70(%rbp)
movq %rax, -0x78(%rbp)
callq 0x3030
movl (%rax), %eax
movl %eax, -0x64(%rbp)
callq 0x3140
movq -0x70(%rbp), %rdi
movl -0x64(%rbp), %esi
movq %rax, %rdx
callq 0x77c0
jmp 0xbc83
movq -0x78(%rbp), %rdi
movq 0xe2ea(%rip), %rsi      # 0x19f78
movq 0xe313(%rip), %rdx      # 0x19fa8
callq 0x3400
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3190
jmp 0xbcbc
jmp 0xbcb3
addq $0x80, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x3410
nopw %cs:(%rax,%rax)
nop