// File: shaovie[P]reactor/src/reactor.cpp
// Function: reactor::run(bool)
void reactor::run(const bool join) {
    if (!join) {
        for (int i = 0; i < this->poller_num; ++i) {
            std::thread thr(&poller::run, &(this->pollers[i]));
            thr.detach();
        }
        return ;
    }
    std::thread **threads = new std::thread*[this->poller_num]();
    for (int i = 0; i < this->poller_num; ++i) {
        threads[i] = new std::thread(&poller::run, &(this->pollers[i]));
    }
    for (int i = 0; i < this->poller_num; ++i) {
        threads[i]->join();
        delete threads[i];
    }
    delete[] threads;
}

// Assembly:
subq $0xa8, %rsp
movb %sil, %al
movq %rdi, 0xa0(%rsp)
andb $0x1, %al
movb %al, 0x9f(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x30(%rsp)
testb $0x1, 0x9f(%rsp)
jne 0x215d7
movl $0x0, 0x98(%rsp)
movq 0x30(%rsp), %rcx
movl 0x98(%rsp), %eax
cmpl (%rcx), %eax
jge 0x215d2
movq 0x30(%rsp), %rax
movq 0x8a97(%rip), %rcx      # 0x29fc8
movq %rcx, 0x80(%rsp)
movq $0x0, 0x88(%rsp)
movq 0x8(%rax), %rax
movslq 0x98(%rsp), %rdx
movq %rdx, %rcx
shlq $0x7, %rcx
leaq (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movq %rax, 0x78(%rsp)
leaq 0x90(%rsp), %rdi
movq %rdi, 0x28(%rsp)
leaq 0x80(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x142a0
movq 0x28(%rsp), %rdi
callq 0x15cc0
jmp 0x2158f
leaq 0x90(%rsp), %rdi
callq 0x15a30
movl 0x98(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x98(%rsp)
jmp 0x21511
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x15a30
jmp 0x2175c
jmp 0x21754
movq 0x30(%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, 0x18(%rsp)
callq 0x14050
movq 0x18(%rsp), %rdx
movq %rax, %rdi
movq %rdi, 0x20(%rsp)
xorl %esi, %esi
callq 0x14900
movq 0x20(%rsp), %rax
movq %rax, 0x60(%rsp)
movl $0x0, 0x5c(%rsp)
movq 0x30(%rsp), %rcx
movl 0x5c(%rsp), %eax
cmpl (%rcx), %eax
jge 0x216d8
movl $0x8, %edi
callq 0x15120
movq %rax, %rdi
movq 0x30(%rsp), %rax
movq %rdi, %rcx
movq %rcx, 0x10(%rsp)
movq 0x896b(%rip), %rcx      # 0x29fc8
movq %rcx, 0x48(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x8(%rax), %rax
movslq 0x5c(%rsp), %rdx
movq %rdx, %rcx
shlq $0x7, %rcx
leaq (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movq %rax, 0x40(%rsp)
leaq 0x48(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x142a0
jmp 0x21698
movq 0x10(%rsp), %rdx
movq 0x60(%rsp), %rax
movslq 0x5c(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x2162b
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
callq 0x15060
jmp 0x2175c
movl $0x0, 0x3c(%rsp)
movq 0x30(%rsp), %rcx
movl 0x3c(%rsp), %eax
cmpl (%rcx), %eax
jge 0x2173c
movq 0x60(%rsp), %rax
movslq 0x3c(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x15c20
movq 0x60(%rsp), %rax
movslq 0x3c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x2172d
movq 0x8(%rsp), %rdi
callq 0x15a30
movq 0x8(%rsp), %rdi
callq 0x15060
jmp 0x2172f
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x216e0
movq 0x60(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x21754
movq (%rsp), %rdi
callq 0x155c0
addq $0xa8, %rsp
retq
movq 0x70(%rsp), %rdi
callq 0x15ce0
nopw %cs:(%rax,%rax)