LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/poll_sync_opt.cpp
// Function: poll_sync_opt::push(poll_sync_opt::opt_arg const&)
void poll_sync_opt::push(const poll_sync_opt::opt_arg &arg) {
    this->mtx.lock();
    this->writeq->push_back(arg);
    this->mtx.unlock();

    int expected = 0;
    if (!this->notified.compare_exchange_strong(expected, 1))
        return ;
    int64_t v = 1;
    int ret = 0;
    do {
        ret = ::write(this->efd, (void *)&v, sizeof(v));
    } while (ret == -1 && errno == EINTR);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x38(%rdi), %r15
movq %r15, %rdi
callq 0x9b60
movq 0x70(%rbx), %rdi
movq %r14, %rsi
callq 0x9050
movq %r15, %rdi
callq 0x9510
pushq $0x1
popq %rcx
xorl %eax, %eax
lock
cmpxchgl %ecx, 0x60(%rbx)
jne 0xb5c4
leaq 0x8(%rsp), %r14
movq $0x1, (%r14)
pushq $0x8
popq %r15
movl 0x30(%rbx), %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x91e0
cmpl $-0x1, %eax
jne 0xb5c4
callq 0x9060
cmpl $0x4, (%rax)
je 0xb5a7
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/poll_sync_opt.cpp
// Function: poll_sync_opt::on_read()
bool poll_sync_opt::on_read() {
    if (this->readq->empty()) {
        this->mtx.lock();
        std::swap(this->readq, this->writeq);
        this->mtx.unlock();
    }
    for (auto i = 0; i < 8 && !this->readq->empty(); ++i) {
        poll_sync_opt::opt_arg &arg = this->readq->front();
        this->do_sync(arg);
        this->readq->pop_front();
    }
    if (!this->readq->empty()) // Ignore readable eventfd, continue
        return true;

    int64_t v = 0;
    int ret = 0;
    do {
        ret = ::read(this->efd, (void *)&v, sizeof(v));
    } while (ret == -1 && errno == EINTR);

    this->notified.store(0);
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x68(%rdi), %rax
cmpl $0x0, 0xc(%rax)
jne 0xb605
leaq 0x38(%rbx), %r14
movq %r14, %rdi
callq 0x9b60
movdqu 0x68(%rbx), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x68(%rbx)
movq %r14, %rdi
callq 0x9510
pushq $0x8
popq %rbp
movq 0x68(%rbx), %rax
movl 0xc(%rax), %ecx
subl $0x1, %ebp
jb 0xb637
testl %ecx, %ecx
je 0xb63b
movslq 0x4(%rax), %rsi
shlq $0x4, %rsi
addq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0x90d0
movq 0x68(%rbx), %rdi
callq 0x9260
jmp 0xb608
testl %ecx, %ecx
jne 0xb668
movq %rsp, %r14
andq $0x0, (%r14)
pushq $0x8
popq %r15
movl 0x30(%rbx), %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x9960
cmpl $-0x1, %eax
jne 0xb663
callq 0x9060
cmpl $0x4, (%rax)
je 0xb646
xorl %eax, %eax
xchgl %eax, 0x60(%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/ringq.h
// Function: ringq<poll_sync_opt::opt_arg>::push_back(poll_sync_opt::opt_arg const&)
inline void push_back(const item_t &v) {
        if (this->full())
            this->grow();
        this->rq[this->tail] = v;
        this->tail = (this->tail + 1) % this->size;
        ++(this->len);
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl (%rdi), %esi
movl 0xc(%rdi), %ecx
cmpl %esi, %ecx
jne 0xb6a4
movq %rbx, %rdi
callq 0x92c0
movl (%rbx), %esi
movl 0xc(%rbx), %ecx
movq 0x10(%rbx), %rdx
movslq 0x8(%rbx), %rdi
leal 0x1(%rdi), %eax
shlq $0x4, %rdi
movl (%r14), %r8d
movl %r8d, (%rdx,%rdi)
movq 0x8(%r14), %r8
movq %r8, 0x8(%rdx,%rdi)
cltd
idivl %esi
movl %edx, 0x8(%rbx)
incl %ecx
movl %ecx, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/poller.h
// Function: poller::poll_cache_set(int, void*, void (*)(void*))
void poll_cache_set(const int id, void *val, void (*free_func)(void *)) {
        auto itor = this->pcache.find(id);
        if (itor != this->pcache.end())
            free_func(itor->second);
        this->pcache[id] = val;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r15
movq %rdx, %rbx
movq %rdi, %r14
leaq 0xc(%rsp), %rax
movl %esi, (%rax)
addq $0x50, %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x9540
testq %rax, %rax
je 0xb70a
movq 0x10(%rax), %rdi
callq *%r15
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0x9350
movq %rbx, (%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/ringq.h
// Function: ringq<async_send::item>::grow()
void grow() {
        int new_size = this->size * 2;
        if (new_size == 0)
            new_size = 2;
        item_t *newrq = new item_t[new_size]();

        for (int i = 0; i < this->len; ++i)
            newrq[i] = this->rq[(this->head + i) % this->size];
        delete[] this->rq;
        this->rq = newrq;
        this->size = new_size;
        this->head = 0;
        this->tail = this->len;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %eax
leal (%rax,%rax), %ecx
testl %eax, %eax
pushq $0x2
popq %rbp
cmovnel %ecx, %ebp
movslq %ebp, %r15
pushq $0x28
popq %rcx
movq %r15, %rax
mulq %rcx
pushq $-0x1
popq %rdi
cmovnoq %rax, %rdi
callq 0x9030
movq %rax, %r14
imulq $0x28, %r15, %rax
addq %r14, %rax
xorps %xmm0, %xmm0
movq %r14, %rcx
andq $0x0, (%rcx)
orl $-0x1, (%rcx)
orq $-0x1, 0x8(%rcx)
andq $0x0, 0x20(%rcx)
movups %xmm0, 0x10(%rcx)
addq $0x28, %rcx
cmpq %rax, %rcx
jne 0xcee6
xorl %r12d, %r12d
movq %r14, %r15
movslq 0xc(%rbx), %rax
movq 0x10(%rbx), %rsi
cmpq %rax, %r12
jge 0xcf3b
movl 0x4(%rbx), %eax
addl %r12d, %eax
cltd
idivl (%rbx)
movslq %edx, %rax
imulq $0x28, %rax, %rax
addq %rax, %rsi
movq %r15, %rdi
callq 0x9c00
incq %r12
addq $0x28, %r15
jmp 0xcf0a
testq %rsi, %rsi
je 0xcf4b
movq %rsi, %rdi
callq 0x9830
movl 0xc(%rbx), %eax
movq %r14, 0x10(%rbx)
movl %ebp, (%rbx)
andl $0x0, 0x4(%rbx)
movl %eax, 0x8(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/acceptor.cpp
// Function: acceptor::uds_open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, options const&)
int acceptor::uds_open(const std::string &addr, const options &opt) {
    ::remove(addr.c_str());
    int fd = ::socket(AF_UNIX, SOCK_STREAM, 0);
    if (fd == -1) {
        fprintf(stderr, "reactor: create unix socket fail! %s\n", strerror(errno));
        return -1;
    }
    struct sockaddr_un laddr;
    laddr.sun_family = AF_UNIX;
    ::strcpy(laddr.sun_path, addr.c_str());
    return this->listen(fd,
        reinterpret_cast<sockaddr *>(&laddr), sizeof(laddr),
        opt.backlog);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rsi), %rdi
callq 0x9af0
pushq $0x1
popq %rdi
movl %edi, %esi
xorl %edx, %edx
callq 0x9150
cmpl $-0x1, %eax
je 0xbc8e
movl %eax, %ebp
leaq 0xc(%rsp), %rdi
movw $0x1, -0x2(%rdi)
movq (%r15), %rsi
callq 0x9660
movl 0x20(%r14), %r8d
leaq 0xa(%rsp), %rdx
pushq $0x6e
popq %rcx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x9b80
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x633b(%rip), %rax      # 0x11fd0
movq (%rax), %rbx
callq 0x9060
movl (%rax), %edi
callq 0x91d0
leaq 0x2611(%rip), %rsi      # 0xe2bc
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x9940
pushq $-0x1
popq %rax
jmp 0xbc83
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/acceptor.cpp
// Function: acceptor::on_read()
bool acceptor::on_read() {
    int fd = this->get_fd();
    int conn = -1;
    for (int i = 0; i < 128; ++i) {
        conn = ::accept4(fd, nullptr, nullptr, SOCK_NONBLOCK|SOCK_CLOEXEC);
        if (conn == -1) {
            if (errno == EINTR) {
                continue;
            } else if (errno == EMFILE) {
                // 句柄不足，暂停200毫秒，不然会一直触发事件
                if (this->get_poller()->schedule_timer(this, 200, 0) == 0) {
                    this->get_poller()->remove(fd, ev_handler::ev_all);
                }
            }
            break;
        }
        auto eh = this->new_conn_func();
        if (eh == nullptr) {
            socket::close(conn);
            break;
        }
        eh->set_fd(conn);
        if (eh->on_open() == false)
            eh->on_close();
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x40(%rax)
movl %eax, %ebp
movl $0x80, %r12d
subl $0x1, %r12d
jb 0xbfe8
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
movl $0x80800, %ecx          # imm = 0x80800
callq 0x9340
cmpl $-0x1, %eax
je 0xbfa6
movl %eax, %r15d
callq *0x30(%rbx)
testq %rax, %rax
je 0xbfe0
movq %rax, %r14
movq (%rax), %rax
movq %r14, %rdi
movl %r15d, %esi
callq *0x48(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
testb %al, %al
jne 0xbf55
movq (%r14), %rax
movq %r14, %rdi
callq *0x38(%rax)
jmp 0xbf55
callq 0x9060
movl (%rax), %eax
cmpl $0x4, %eax
je 0xbf55
cmpl $0x18, %eax
jne 0xbfe8
movq 0x18(%rbx), %rdi
movq %rbx, %rsi
movl $0xc8, %edx
xorl %ecx, %ecx
callq 0x97f0
testl %eax, %eax
jne 0xbfe8
movq 0x18(%rbx), %rdi
movl %ebp, %esi
movl $0x2005, %edx           # imm = 0x2005
callq 0x9ae0
jmp 0xbfe8
movl %r15d, %edi
callq 0x9bc0
movb $0x1, %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/acceptor.cpp
// Function: acceptor::listen(int, sockaddr const*, unsigned int, int)
int acceptor::listen(const int fd,
    const struct sockaddr *addr, socklen_t addrlen,
    const int backlog) {
    if (::bind(fd, addr, addrlen) == -1) {
        socket::close(fd);
        fprintf(stderr, "reactor: bind fail! %s\n", strerror(errno));
        return -1;
    }

    if (::listen(fd, backlog) == -1) {
        socket::close(fd);
        fprintf(stderr, "reactor: listen fail! %s\n", strerror(errno));
        return -1;
    }

    if (this->get_reactor()->add_ev_handler(this, fd, ev_handler::ev_accept) != 0) {
        socket::close(fd);
        fprintf(stderr, "reactor: add accept ev handler fail! %s\n", strerror(errno));
        return -1;
    }
    this->set_fd(fd);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %r8d, %ebp
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %edi
movq %rdx, %rsi
movl %ecx, %edx
callq 0x90c0
cmpl $-0x1, %eax
je 0xc084
movl %ebx, %edi
movl %ebp, %esi
callq 0x9790
cmpl $-0x1, %eax
je 0xc0aa
movq 0x20(%r14), %rdi
movq %r14, %rsi
movl %ebx, %edx
movl $0x2001, %ecx           # imm = 0x2001
callq 0x98f0
testl %eax, %eax
jne 0xc0d0
movq (%r14), %rax
movq %r14, %rdi
movl %ebx, %esi
callq *0x48(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl %ebx, %edi
callq 0x9bc0
movq 0x5f3e(%rip), %rax      # 0x11fd0
movq (%rax), %rbx
callq 0x9060
movl (%rax), %edi
callq 0x91d0
leaq 0x223a(%rip), %rsi      # 0xe2e2
jmp 0xc0f4
movl %ebx, %edi
callq 0x9bc0
movq 0x5f18(%rip), %rax      # 0x11fd0
movq (%rax), %rbx
callq 0x9060
movl (%rax), %edi
callq 0x91d0
leaq 0x222c(%rip), %rsi      # 0xe2fa
jmp 0xc0f4
movl %ebx, %edi
callq 0x9bc0
movq 0x5ef2(%rip), %rax      # 0x11fd0
movq (%rax), %rbx
callq 0x9060
movl (%rax), %edi
callq 0x91d0
leaq 0x2220(%rip), %rsi      # 0xe314
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x9940
pushq $-0x1
popq %rax
jmp 0xc07f
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/inet_address.h
// Function: inet_address::set(unsigned short, char const*)
void set(const unsigned short port_number, const char *ip) {
        this->inet_addr.sin_family = AF_INET;
        this->inet_addr.sin_port = ::htons(port_number);
            this->inet_addr.sin_addr.s_addr = INADDR_ANY;
        if (::strlen(ip) > 0)
            this->inet_addr.sin_addr.s_addr = ::inet_addr(ip);
        ::memset(this->inet_addr.sin_zero, 0, sizeof(this->inet_addr.sin_zero));
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movw $0x2, (%rdi)
rolw $0x8, %si
movw %si, 0x2(%rdi)
andl $0x0, 0x4(%rdi)
cmpb $0x0, (%rdx)
je 0xc281
movq %rdx, %rdi
callq 0x96d0
movl %eax, 0x4(%rbx)
andq $0x0, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/connector.cpp
// Function: connector::connect(ev_handler*, inet_address const&, int, unsigned long)
int connector::connect(ev_handler *eh,
    const inet_address &remote_addr, 
    const int timeout /*milliseconds*/,
    const size_t rcvbuf_size) {

    int fd = ::socket(AF_INET, SOCK_STREAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0);
    if (fd == -1)
        return -1;

    // `sysctl -a | grep net.ipv4.tcp_rmem` 返回 min default max
    // 默认内核会在min,max之间动态调整, default是初始值, 如果设置了SO_RCVBUF, 
    // 缓冲区大小不变成固定值, 内核也不会进行动态调整了.
    //
    // 必须在listen/connect之前调用
    // must < `sysctl -a | grep net.core.rmem_max`
    
    if (rcvbuf_size > 0 && socket::set_rcvbuf(fd, rcvbuf_size) == -1) {
        socket::close(fd);
        return -1;
    }
    int ret = ::connect(fd,
        reinterpret_cast<sockaddr *>(remote_addr.get_addr()),
        remote_addr.get_addr_size());

    if (ret == 0) {
        eh->set_fd(fd); // fd 所有权转移, 从此后eh管理fd
        if (eh->on_open() == false) {
            eh->on_close(); 
            return -1;
        }
        return 0;
    } else if (errno == EINPROGRESS) {
        if (timeout < 1) {
            socket::close(fd);
            return -1;
        }
        return this->nblock_connect(eh, fd, timeout);
    }
    socket::close(fd);
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r13
movl %ecx, %ebp
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
pushq $0x2
popq %rdi
movl $0x80801, %esi          # imm = 0x80801
xorl %edx, %edx
callq 0x9150
movl %eax, %r14d
pushq $-0x1
popq %rax
cmpl $-0x1, %r14d
je 0xc346
testq %r13, %r13
je 0xc2d5
movl %r14d, %edi
movq %r13, %rsi
callq 0x98a0
cmpl $-0x1, %eax
je 0xc313
pushq $0x10
popq %rdx
movl %r14d, %edi
movq %r12, %rsi
callq 0x95b0
testl %eax, %eax
je 0xc31d
callq 0x9060
cmpl $0x73, (%rax)
jne 0xc313
testl %ebp, %ebp
jle 0xc313
movq %r15, %rdi
movq %rbx, %rsi
movl %r14d, %edx
movl %ebp, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9290
movl %r14d, %edi
callq 0x9bc0
jmp 0xc343
movq (%rbx), %rax
movq %rbx, %rdi
movl %r14d, %esi
callq *0x48(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movl %eax, %ecx
xorl %eax, %eax
testb %cl, %cl
jne 0xc346
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x38(%rax)
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/connector.cpp
// Function: connector::nblock_connect(ev_handler*, int, int)
int connector::nblock_connect(ev_handler *eh, const int fd, const int timeout) {
    in_progress_connect *ipc = new in_progress_connect(this, eh);

    ipc->set_fd(fd);
    if (this->get_reactor()->add_ev_handler(ipc, fd, ev_handler::ev_connect) == -1) {
        delete ipc;
        socket::close(fd);
        return -1;
    }
    // 要在同一个poller中注册定时器
    //
    // add_ev_handler 和 schedule_timer 不保证原子性,
    // 有可能schedule_timer的时候 ipc已经触发了I/O事件
    ipc->get_poller()->schedule_timer(ipc, timeout, 0);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r12
pushq $0x48
popq %rdi
callq 0x96c0
movq %rax, %r14
orq $-0x1, 0x10(%rax)
xorps %xmm0, %xmm0
andq $0x0, 0x28(%rax)
movups %xmm0, 0x18(%rax)
movq 0x5c4d(%rip), %rax      # 0x11fd8
addq $0x10, %rax
movq %rax, (%r14)
andw $0x0, 0x30(%r14)
movb $0x0, 0x32(%r14)
movq %r12, 0x38(%r14)
movq %r15, 0x40(%r14)
movl %ebx, 0x8(%r14)
movq 0x20(%r12), %rdi
movq %r14, %rsi
movl %ebx, %edx
movl $0x2005, %ecx           # imm = 0x2005
callq 0x98f0
cmpl $-0x1, %eax
je 0xc3d6
movq 0x18(%r14), %rdi
xorl %ebx, %ebx
movq %r14, %rsi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x97f0
jmp 0xc3e9
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movl %ebx, %edi
callq 0x9bc0
pushq $-0x1
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/connector.cpp
// Function: in_progress_connect::on_read()
virtual bool on_read() {
        if (this->io_ev_trigger)
            return true;
        this->eh->on_connect_fail(err_connect_fail);
        this->get_poller()->cancel_timer(this);
        this->io_ev_trigger = true;
        return false;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movb 0x31(%rdi), %bl
testb %bl, %bl
jne 0xc426
movq %rdi, %r14
movq 0x40(%rdi), %rdi
movq (%rdi), %rax
pushq $0x2
popq %rsi
callq *0x28(%rax)
movq 0x18(%r14), %rdi
movq %r14, %rsi
callq 0x9190
movb $0x1, 0x31(%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/connector.cpp
// Function: in_progress_connect::on_write()
virtual bool on_write() {
        if (this->io_ev_trigger)
            return true;
        int fd = this->get_fd();
        this->set_fd(-1); // From here on, the `fd` resources will be managed by eh.
        this->get_poller()->cancel_timer(this);
        this->io_ev_trigger = true;

        this->ok = true;
        this->eh->set_fd(fd);
        return true;
    }

// Assembly:
cmpb $0x0, 0x31(%rdi)
jne 0xc474
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x40(%rax)
movl %eax, %ebp
movq (%rbx), %rax
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq *0x48(%rax)
movq 0x18(%rbx), %rdi
movq %rbx, %rsi
callq 0x9190
movw $0x101, 0x30(%rbx)      # imm = 0x101
movq 0x40(%rbx), %rdi
movq (%rdi), %rax
movl %ebp, %esi
callq *0x48(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
movb $0x1, %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/connector.cpp
// Function: in_progress_connect::on_timeout(long)
virtual bool on_timeout(const int64_t) {
        if (this->io_ev_trigger)
            return false;
        
        this->timeout_trigger = true;
        this->get_poller()->remove(this->get_fd(), ev_handler::ev_all);
        this->eh->on_connect_fail(err_connect_timeout);
        this->on_close();
        return false;
    }

// Assembly:
cmpb $0x0, 0x31(%rdi)
jne 0xc4bf
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb $0x1, 0x32(%rdi)
movq (%rdi), %rax
movq 0x18(%rdi), %r14
callq *0x40(%rax)
movq %r14, %rdi
movl %eax, %esi
movl $0x2005, %edx           # imm = 0x2005
callq 0x9ae0
movq 0x40(%rbx), %rdi
movq (%rdi), %rax
pushq $0x1
popq %rsi
callq *0x28(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x38(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/connector.cpp
// Function: in_progress_connect::on_close()
virtual void on_close() {
        // maybe trigger EPOLLHUP | EPOLLERR
        if (this->timeout_trigger == false || this->io_ev_trigger == false) {
            this->eh->on_connect_fail(err_connect_fail);
            this->get_poller()->cancel_timer(this);
        }
        this->destroy();

        // eh部分不能在on_write里边调用, 因为fd对应的eh变化了，在poller中fd对应的eh
        // 没有及时更新, 产生混乱
        if (this->ok == true && this->eh->on_open() == false)
            this->eh->on_close();
        delete this;
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpb $0x0, 0x32(%rdi)
je 0xc4d2
cmpb $0x0, 0x31(%rbx)
jne 0xc4eb
movq 0x40(%rbx), %rdi
movq (%rdi), %rax
pushq $0x2
popq %rsi
callq *0x28(%rax)
movq 0x18(%rbx), %rdi
movq %rbx, %rsi
callq 0x9190
movq %rbx, %rdi
callq 0x9720
cmpb $0x1, 0x30(%rbx)
jne 0xc511
movq 0x40(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
testb %al, %al
jne 0xc511
movq 0x40(%rbx), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
popq %rbx
jmpq *0x8(%rax)
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/ev_handler.h
// Function: ev_handler::destroy()
void destroy() {
      if (this->fd != -1) {
          socket::close(this->fd);
          this->fd = -1;
      }
      this->poll = nullptr;
      this->rct  = nullptr;
  }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x8(%rdi), %edi
cmpl $-0x1, %edi
je 0xc53b
callq 0x9bc0
orl $-0x1, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/io_handle.cpp
// Function: io_handle::recv(char*&)
int io_handle::recv(char* &buff) {
    if (this->fd == -1)
        return -1;
    
    int ret = 0;
    do {
        ret = ::recv(this->fd, this->poll->io_buf, this->poll->io_buf_size, 0);
        if (ret > 0) {
            buff = this->poll->io_buf;
            break;
        }
    } while (ret == -1 && errno == EINTR);
    return ret;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
pushq $-0x1
popq %rbp
cmpl $-0x1, 0x8(%rdi)
je 0xc595
movq %rsi, %rbx
movq %rdi, %r14
movl 0x8(%r14), %edi
movq 0x18(%r14), %rax
movq 0x10(%rax), %rsi
movslq 0xc(%rax), %rdx
xorl %ecx, %ecx
callq 0x91c0
testl %eax, %eax
jg 0xc599
cmpl $-0x1, %eax
jne 0xc5a4
callq 0x9060
cmpl $0x4, (%rax)
je 0xc56b
movl %ebp, %eax
jmp 0xc5a4
movq 0x18(%r14), %rcx
movq 0x10(%rcx), %rcx
movq %rcx, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/io_handle.cpp
// Function: io_handle::async_send(char const*, int)
int io_handle::async_send(const char *buff, const int len) {
    char *bf = new char[len];
    ::memcpy(bf, buff, len);
    this->poll->push(async_send::item(this->fd, this->seq, async_send_buf(bf, len)));
    return len;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %r15
movslq %edx, %rbx
testl %ebx, %ebx
pushq $-0x1
popq %rdi
cmovnsq %rbx, %rdi
callq 0x9030
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x95a0
movq 0x18(%r15), %rdi
movl 0x8(%r15), %eax
movq 0x10(%r15), %rcx
movq %rsp, %rsi
movl %eax, (%rsi)
movq %rcx, 0x8(%rsi)
andq $0x0, 0x10(%rsi)
andl $0x0, 0x18(%rsi)
movl %ebx, 0x1c(%rsi)
movq %r12, 0x20(%rsi)
callq 0x9b00
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/io_handle.cpp
// Function: io_handle::on_write()
bool io_handle::on_write() {
    if (this->fd == -1)
        return false; // goto on_close
                      
    int n = this->async_send_buf_q->length();
    for (auto i = 0; i < n; ++i) {
        async_send_buf &asb = this->async_send_buf_q->front();
        auto ret = ::send(this->fd, asb.buf + asb.sendn, asb.len - asb.sendn, 0);
        if (ret > 0) {
            this->async_send_buf_size -= ret;
            if (ret == (asb.len - asb.sendn)) {
                delete[] asb.buf;
                this->async_send_buf_q->pop_front();
                continue;
            }
            asb.sendn += ret;
        }
        break;
    }
    if (this->async_send_buf_q->empty() && this->async_send_polling == true) {
        this->poll->remove(this->fd, ev_handler::ev_write);
        this->async_send_polling = false;
        this->on_send_buffer_drained();
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0x8(%rdi), %ebp
cmpl $-0x1, %ebp
je 0xc864
movq %rdi, %rbx
movq 0x38(%rdi), %rax
movl 0xc(%rax), %r14d
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
subl $0x1, %r14d
jb 0xc838
movq 0x38(%rbx), %rax
movq 0x10(%rax), %r15
movslq 0x4(%rax), %r12
shlq $0x4, %r12
movl 0x8(%rbx), %edi
movslq (%r15,%r12), %rax
movq 0x8(%r15,%r12), %rsi
addq %rax, %rsi
movslq 0x4(%r15,%r12), %rdx
subq %rax, %rdx
xorl %ecx, %ecx
callq 0x9370
testq %rax, %rax
jle 0xc838
addq %r12, %r15
subl %eax, 0x34(%rbx)
movslq 0x4(%r15), %rdx
movslq (%r15), %rcx
subq %rcx, %rdx
cmpq %rdx, %rax
jne 0xc833
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0xc828
callq 0x9830
movq 0x38(%rbx), %rdi
callq 0x9420
jmp 0xc7cc
addl %eax, %ecx
movl %ecx, (%r15)
movq 0x38(%rbx), %rax
cmpl $0x0, 0xc(%rax)
jne 0xc864
cmpb $0x1, 0x30(%rbx)
jne 0xc864
movq 0x18(%rbx), %rdi
movl 0x8(%rbx), %esi
pushq $0x4
popq %rdx
callq 0x9ae0
movb $0x0, 0x30(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x58(%rax)
cmpl $-0x1, %ebp
setne %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/io_handle.cpp
// Function: io_handle::sync_ordered_send(async_send_buf&)
void io_handle::sync_ordered_send(async_send_buf &asb) {
    if (this->fd == -1) {
        delete[] asb.buf;
        return;
    }
    this->async_send_buf_size += (asb.len - asb.sendn);
    if (this->async_send_buf_q != nullptr && !this->async_send_buf_q->empty()) {
        this->async_send_buf_q->push_back(asb);
        return ;
    }

    int ret = 0;
    do {
        ret = ::send(this->fd, asb.buf + asb.sendn, asb.len - asb.sendn, 0);
    } while (ret == -1 && errno == EINTR);

    if (ret > 0) { // partial
        this->async_send_buf_size -= ret;
        if (ret == (asb.len - asb.sendn)) {
            delete[] asb.buf;
            return ;
        }
        asb.sendn += ret;
    }
    if (this->async_send_buf_q == nullptr)
        this->async_send_buf_q = new ringq<async_send_buf>(2);
    this->async_send_buf_q->push_back(asb);
    if (this->async_send_polling == false) {
        this->poll->append(this->fd, ev_handler::ev_write);
        this->async_send_polling = true;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
cmpl $-0x1, 0x8(%rdi)
je 0xc8e9
movq %rdi, %rbx
movl 0x4(%r14), %eax
subl (%r14), %eax
addl %eax, 0x34(%rdi)
movq 0x38(%rdi), %rdi
testq %rdi, %rdi
je 0xc8b5
cmpl $0x0, 0xc(%rdi)
je 0xc8b5
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x97c0
callq 0x9060
cmpl $0x4, (%rax)
jne 0xc901
movl 0x8(%rbx), %edi
movslq (%r14), %rax
movq 0x8(%r14), %rsi
addq %rax, %rsi
movslq 0x4(%r14), %rdx
subq %rax, %rdx
xorl %ecx, %ecx
callq 0x9370
cmpl $-0x1, %eax
je 0xc8ab
testl %eax, %eax
jle 0xc901
subl %eax, 0x34(%rbx)
movl (%r14), %ecx
movl 0x4(%r14), %edx
subl %ecx, %edx
cmpl %eax, %edx
jne 0xc8fc
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0xc948
popq %rbx
popq %r14
popq %r15
jmp 0x9830
addl %eax, %ecx
movl %ecx, (%r14)
movq 0x38(%rbx), %r15
testq %r15, %r15
jne 0xc924
pushq $0x18
popq %rdi
callq 0x96c0
movq %rax, %r15
pushq $0x2
popq %rsi
movq %rax, %rdi
callq 0x96a0
movq %r15, 0x38(%rbx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x97c0
cmpb $0x0, 0x30(%rbx)
jne 0xc948
movq 0x18(%rbx), %rdi
movl 0x8(%rbx), %esi
pushq $0x4
popq %rdx
callq 0x9300
movb $0x1, 0x30(%rbx)
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r15, %rdi
callq 0x9690
movq %rbx, %rdi
callq 0x9aa0
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/io_handle.cpp
// Function: io_handle::destroy()
void io_handle::destroy() {
    ev_handler::destroy();

    if (this->async_send_buf_q != nullptr) {
        int n = this->async_send_buf_q->length();
        for (auto i = 0; i < n; ++i) {
            async_send_buf &asb = this->async_send_buf_q->front();
            delete[] asb.buf;
            this->async_send_buf_q->pop_front();
        }
        delete this->async_send_buf_q;
        this->async_send_buf_size = 0;
        this->async_send_buf_q = nullptr;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x9720
movq 0x38(%rbx), %rax
testq %rax, %rax
je 0xc9d1
movl 0xc(%rax), %eax
xorl %ebp, %ebp
testl %eax, %eax
cmovgl %eax, %ebp
movq 0x38(%rbx), %r14
subl $0x1, %ebp
jb 0xc9b3
movq 0x10(%r14), %rax
movslq 0x4(%r14), %rcx
shlq $0x4, %rcx
movq 0x8(%rax,%rcx), %rdi
testq %rdi, %rdi
je 0xc9a9
callq 0x9830
movq 0x38(%rbx), %r14
movq %r14, %rdi
callq 0x9420
jmp 0xc981
testq %r14, %r14
je 0xc9c0
movq %r14, %rdi
callq 0x9430
movq %r14, %rdi
callq 0x9690
andl $0x0, 0x34(%rbx)
andq $0x0, 0x38(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/poller.h
// Function: poller::poll_cache_get(int)
void *poll_cache_get(const int id) {
        auto itor = this->pcache.find(id);
        if (itor != this->pcache.end())
            return itor->second;
        return nullptr;
    }

// Assembly:
pushq %rax
leaq 0x4(%rsp), %rax
movl %esi, (%rax)
addq $0x50, %rdi
movq %rax, %rsi
callq 0x9540
testq %rax, %rax
je 0xc9f5
movq 0x10(%rax), %rax
jmp 0xc9f7
xorl %eax, %eax
popq %rcx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/async_send.cpp
// Function: async_send::~async_send()
async_send::~async_send() {
   if (this->efd != -1)
        ::close(this->efd);
    
   if (this->readq != nullptr)
       delete this->readq;
   if (this->writeq != nullptr)
       delete this->writeq;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x53fa(%rip), %rax      # 0x11fa8
addq $0x10, %rax
movq %rax, (%rdi)
movl 0x30(%rdi), %edi
cmpl $-0x1, %edi
je 0xcbc2
callq 0x9bc0
movq 0x68(%rbx), %r14
testq %r14, %r14
je 0xcbdb
movq %r14, %rdi
callq 0x9220
movq %r14, %rdi
callq 0x9690
movq 0x70(%rbx), %rbx
testq %rbx, %rbx
je 0xcbfb
movq %rbx, %rdi
callq 0x9220
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x9690
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0xa1e5
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/async_send.cpp
// Function: async_send::push(async_send::item const&)
void async_send::push(const async_send::item &asi) {
    this->mtx.lock();
    this->writeq->push_back(asi);
    this->mtx.unlock();

    int expected = 0;
    if (!this->notified.compare_exchange_strong(expected, 1))
        return ;
    int64_t v = 1;
    int ret = 0;
    do {
        ret = ::write(this->efd, (void *)&v, sizeof(v));
    } while (ret == -1 && errno == EINTR);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x38(%rdi), %r15
movq %r15, %rdi
callq 0x9b60
movq 0x70(%rbx), %rdi
movq %r14, %rsi
callq 0x9410
movq %r15, %rdi
callq 0x9510
pushq $0x1
popq %rcx
xorl %eax, %eax
lock
cmpxchgl %ecx, 0x60(%rbx)
jne 0xcd2a
leaq 0x8(%rsp), %r14
movq $0x1, (%r14)
pushq $0x8
popq %r15
movl 0x30(%rbx), %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x91e0
cmpl $-0x1, %eax
jne 0xcd2a
callq 0x9060
cmpl $0x4, (%rax)
je 0xcd0d
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/async_send.cpp
// Function: async_send::on_read()
bool async_send::on_read() {
    if (this->readq->empty()) {
        this->mtx.lock();
        std::swap(this->readq, this->writeq);
        this->mtx.unlock();
    }
    for (auto i = 0; i < 256 && !this->readq->empty(); ++i) { // 1次最多处理256个
        async_send::item &asi = this->readq->front();
        poll_desc *pd = this->poll->get_poll_desc(asi.fd);
        if (pd != nullptr && asi.seq == pd->seq) // 保证对象没有释放呢
            pd->eh->sync_ordered_send(asi.asb);
        else
            delete[] asi.asb.buf;
        
        this->readq->pop_front();
    }
    if (!this->readq->empty()) // Ignore readable eventfd, continue
        return true;

    int64_t v = 0;
    int ret = 0;
    do {
        ret = ::read(this->efd, (void *)&v, sizeof(v));
    } while (ret == -1 && errno == EINTR);

    this->notified.store(0);
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x68(%rdi), %rax
cmpl $0x0, 0xc(%rax)
jne 0xcd6b
leaq 0x38(%rbx), %r14
movq %r14, %rdi
callq 0x9b60
movdqu 0x68(%rbx), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x68(%rbx)
movq %r14, %rdi
callq 0x9510
movl $0x100, %ebp            # imm = 0x100
movq 0x68(%rbx), %rax
movl 0xc(%rax), %ecx
subl $0x1, %ebp
jb 0xcdd7
testl %ecx, %ecx
je 0xcddb
movq 0x10(%rax), %rcx
movslq 0x4(%rax), %rax
imulq $0x28, %rax, %rax
leaq (%rcx,%rax), %r14
movq 0x18(%rbx), %rdi
movl (%rcx,%rax), %esi
callq 0x9500
testq %rax, %rax
je 0xcdbe
movq 0x8(%r14), %rcx
cmpq 0x8(%rax), %rcx
jne 0xcdbe
movq 0x10(%rax), %rdi
addq $0x18, %r14
movq (%rdi), %rax
movq %r14, %rsi
callq *0x50(%rax)
jmp 0xcdcc
movq 0x20(%r14), %rdi
testq %rdi, %rdi
je 0xcdcc
callq 0x9830
movq 0x68(%rbx), %rdi
callq 0x91a0
jmp 0xcd70
testl %ecx, %ecx
jne 0xce08
movq %rsp, %r14
andq $0x0, (%r14)
pushq $0x8
popq %r15
movl 0x30(%rbx), %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x9960
cmpl $-0x1, %eax
jne 0xce03
callq 0x9060
cmpl $0x4, (%rax)
je 0xcde6
xorl %eax, %eax
xchgl %eax, 0x60(%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/async_send.h
// Function: async_send::item::operator=(async_send::item const&)
item& operator=(const item &v) {
            this->fd = v.fd;
            this->eh = v.eh;
            this->asb = v.asb;
            return *this;
        }

// Assembly:
movq %rdi, %rax
movl (%rsi), %ecx
movl %ecx, (%rdi)
movq 0x10(%rsi), %rcx
movq %rcx, 0x10(%rdi)
movq 0x20(%rsi), %rcx
movq %rcx, 0x20(%rdi)
movq 0x18(%rsi), %rcx
movq %rcx, 0x18(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/reactor.cpp
// Function: reactor::open(options const&)
int reactor::open(const options &opt) {
    if (opt.poller_num < 1) {
        fprintf(stderr, "reactor: poller_num=%d < 1\n", opt.poller_num);
        return -1;
    }
    this->poller_num = opt.poller_num;
    this->pollers = new poller[this->poller_num]();

    int cpu_num = std::thread::hardware_concurrency();
    for (int i = 0; i < this->poller_num; ++i) {
        if (opt.set_cpu_affinity) {
            int cpu_id = i % cpu_num;
            this->pollers[i].set_cpu_id(cpu_id);
        }
        if (this->pollers[i].open(opt) != 0) {
            return -1; // destroy ?
        }
    }
    if (opt.with_timer_shared == true) {
        this->timer = new timer_shared(opt.timer_init_size);
        if (this->timer->open() != 0)
            return -1; // destroy ?
        if (this->add_ev_handler(this->timer, this->timer->get_fd(), ev_handler::ev_read) != 0)
            return -1; // destroy ?
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq 0x8(%rsi), %r12
testq %r12, %r12
jle 0xd09c
movq %rsi, %r14
movq %rdi, %rbx
movl %r12d, (%rdi)
imulq $0x88, %r12, %r13
leaq 0x8(%r13), %rdi
callq 0x9030
movq %rax, %r15
movq %r12, (%rax)
addq $0x8, %r15
movq %r15, %r12
movl $0x88, %edx
movq %r12, %rdi
xorl %esi, %esi
callq 0x93b0
movq %r12, %rdi
callq 0x9230
addq $0x88, %r12
addq $-0x88, %r13
jne 0xcfc2
movq %r15, 0x8(%rbx)
xorl %r13d, %r13d
callq 0x98c0
movl %eax, %r15d
pushq $-0x1
popq %rbp
xorl %r12d, %r12d
movslq (%rbx), %rax
cmpq %rax, %r12
jge 0xd036
movq 0x8(%rbx), %rdi
cmpb $0x1, (%r14)
jne 0xd01b
movl %r12d, %eax
cltd
idivl %r15d
movl %edx, (%rdi,%r13)
addq %r13, %rdi
movq %r14, %rsi
callq 0x9550
incq %r12
addq $0x88, %r13
testl %eax, %eax
je 0xcffe
jmp 0xd08b
cmpb $0x1, 0x1(%r14)
jne 0xd089
movl $0x80, %edi
callq 0x96c0
movq %rax, %r15
movl 0x14(%r14), %esi
movq %rax, %rdi
callq 0x95d0
movq %r15, 0x10(%rbx)
movq %r15, %rdi
callq 0x9140
testl %eax, %eax
jne 0xd08b
movq 0x10(%rbx), %r14
movq (%r14), %rax
movq %r14, %rdi
callq *0x40(%rax)
movq %rbx, %rdi
movq %r14, %rsi
movl %eax, %edx
movl $0x2001, %ecx           # imm = 0x2001
callq 0x98f0
testl %eax, %eax
jne 0xd08b
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4f2d(%rip), %rax      # 0x11fd0
movq (%rax), %rdi
leaq 0x12cd(%rip), %rsi      # 0xe37a
movl %r12d, %edx
xorl %eax, %eax
callq 0x9940
pushq $-0x1
popq %rbp
jmp 0xd08b
movq %rax, %rbx
movq %r15, %rdi
callq 0x9690
movq %rbx, %rdi
callq 0x9aa0
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/reactor.cpp
// Function: reactor::add_ev_handler(ev_handler*, int, unsigned int)
int reactor::add_ev_handler(ev_handler *eh, const int fd, const uint32_t events) {
    if (fd < 0 || eh == nullptr || events == 0)
        return -1;
    int i = 0;
    if (this->poller_num > 1)
        i = fd % this->poller_num;
    eh->set_reactor(this);
    return this->pollers[i].add(eh, fd, events);
}

// Assembly:
movl %edx, %r8d
testl %edx, %edx
sets %al
testq %rsi, %rsi
sete %dl
testl %ecx, %ecx
sete %r9b
orb %dl, %r9b
orb %al, %r9b
je 0xd0f0
pushq $-0x1
popq %rax
retq
movl (%rdi), %r9d
cmpl $0x2, %r9d
jl 0xd103
movl %r8d, %eax
xorl %edx, %edx
divl %r9d
jmp 0xd105
xorl %edx, %edx
movq %rdi, 0x20(%rsi)
imulq $0x88, %rdx, %rax
addq 0x8(%rdi), %rax
movq %rax, %rdi
movl %r8d, %edx
jmp 0x9b70
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/reactor.cpp
// Function: reactor::append_ev(int, unsigned int)
int reactor::append_ev(const int fd, const uint32_t events) {
    if (fd < 0 || events == 0)
        return -1;
    int i = 0;
    if (this->poller_num > 1)
        i = fd % this->poller_num;
    return this->pollers[i].append(fd, events);
}

// Assembly:
movl %edx, %ecx
testl %esi, %esi
sets %al
testl %edx, %edx
sete %dl
orb %al, %dl
je 0xd148
pushq $-0x1
popq %rax
retq
movl (%rdi), %r8d
cmpl $0x2, %r8d
jl 0xd15a
movl %esi, %eax
xorl %edx, %edx
divl %r8d
jmp 0xd15c
xorl %edx, %edx
imulq $0x88, %rdx, %rax
addq 0x8(%rdi), %rax
movq %rax, %rdi
movl %ecx, %edx
jmp 0x9300
nop
// File: /workspace/github_cpp_makefile_star2_O2/shaovie[P]reactor/src/reactor.cpp
// Function: reactor::remove_ev(int, unsigned int)
int reactor::remove_ev(const int fd, const uint32_t events) {
    if (fd < 0 || events == 0)
        return -1;
    int i = 0;
    if (this->poller_num > 1)
        i = fd % this->poller_num;
    return this->pollers[i].remove(fd, events);
}

// Assembly:
movl %edx, %ecx
testl %esi, %esi
sets %al
testl %edx, %edx
sete %dl
orb %al, %dl
je 0xd186
pushq $-0x1
popq %rax
retq
movl (%rdi), %r8d
cmpl $0x2, %r8d
jl 0xd198
movl %esi, %eax
xorl %edx, %edx
divl %r8d
jmp 0xd19a
xorl %edx, %edx
imulq $0x88, %rdx, %rax
addq 0x8(%rdi), %rax
movq %rax, %rdi
movl %ecx, %edx
jmp 0x9ae0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
testl %esi, %esi
je 0xd259
movslq (%rbx), %rbp
leaq (,%rbp,8), %rax
testq %rbp, %rbp
pushq $-0x1
popq %r12
cmovnsq %rax, %r12
movq %r12, %rdi
callq 0x9030
movq %rax, %r14
xorl %r15d, %r15d
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x93b0
leaq 0x8(%rsp), %r13
xorl %r12d, %r12d
movslq %ebp, %rax
cmpq %rax, %r12
jge 0xd2bd
pushq $0x8
popq %rdi
callq 0x96c0
movq 0x4dab(%rip), %rcx      # 0x11fc8
movq %rcx, 0x10(%rsp)
andq $0x0, 0x18(%rsp)
movq %rax, %rbp
movq 0x8(%rbx), %rax
addq %r15, %rax
movq %rax, 0x8(%rsp)
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
movq %r13, %rdx
callq 0x9110
movq %rbp, (%r14,%r12,8)
incq %r12
movl (%rbx), %ebp
addq $0x88, %r15
jmp 0xd202
xorl %r13d, %r13d
leaq 0x8(%rsp), %r14
leaq 0x10(%rsp), %r15
leaq 0x20(%rsp), %r12
xorl %ebp, %ebp
movslq (%rbx), %rax
cmpq %rax, %rbp
jge 0xd2f3
movq 0x4d4c(%rip), %rax      # 0x11fc8
movq %rax, 0x10(%rsp)
andq $0x0, 0x18(%rsp)
movq 0x8(%rbx), %rax
addq %r13, %rax
movq %rax, 0x20(%rsp)
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x9110
movq %r14, %rdi
callq 0x9a90
movq %r14, %rdi
callq 0x99e0
incq %rbp
addq $0x88, %r13
jmp 0xd26d
xorl %r12d, %r12d
movslq %ebp, %rax
cmpq %rax, %r12
jge 0xd2eb
movq (%r14,%r12,8), %r15
movq %r15, %rdi
callq 0x9a60
movq %r15, %rdi
callq 0x99e0
movq %r15, %rdi
callq 0x9690
incq %r12
movl (%rbx), %ebp
jmp 0xd2c0
movq %r14, %rdi
callq 0x9830
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x99e0
jmp 0xd31c
movq %rax, %rbx
movq %rbp, %rdi
callq 0x9690
movq %rbx, %rdi
callq 0x9aa0
// File: /workspace/github_cpp_makefile_star2_O2/onai[P]npio/example1.c
// Function: main
int main()
{
  int i;
  npio_Array array;

  npio_init_array(&array);
  npio_load("test1.npy", &array);

  printf("shape: ");
  for (i = 0; i < array.dim; ++i)
    printf("%ld ", array.shape[i]);
  printf("\n");

  npio_free_array(&array);
  return 0;
}

// Assembly:
pushq %rax
leaq 0xe90(%rip), %rdi       # 0x2004
xorl %esi, %esi
xorl %eax, %eax
callq 0x1060
leaq 0xe8a(%rip), %rdi       # 0x200e
xorl %eax, %eax
callq 0x1040
pushq $0xa
popq %rdi
callq 0x1030
xorl %edi, %edi
callq 0x1050
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O2/schuyler[P]quickfix/src/wrapper.cpp
// Function: beacon2d_fix
void beacon2d_fix(Beacon2D *b, float tick, float rmsError, int maxTries) {
        Beacon2D estimate = b->Fix<Beacon2D::DifferenceSolver>(tick, rmsError, maxTries);
        //Beacon2D estimate = b->Fix<Beacon2D::RangeSolver>(rmsError);
        // TODO: take these out and return the values
        b->Position(estimate.Position());
        b->Error(estimate.Error());
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movl %esi, %edx
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4f940
movsd 0x20(%r14), %xmm0
movsd %xmm0, 0x20(%rbx)
movss 0x40(%r14), %xmm0
movss %xmm0, 0x40(%rbx)
movq %r14, %rdi
callq 0x4f560
addq $0x68, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/schuyler[P]quickfix/include/quickfix/range.h
// Function: Beacon<float, 2>::RangeSolver::setCoefficients()
void Beacon<F, D>::RangeSolver::setCoefficients() {
    int n = B.A.rows();
    G.resize(n, D+1);
    h.resize(n, 1);
    G << B.A, Matrix<F, Dynamic, 1>::Constant(n, 1, -0.5);
    h << (1.0 / 2.0) * (
        B.A.array().pow(2.0).matrix().rowwise().sum() -
        B.R.array().pow(2.0).matrix()
    );
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x160, %rsp            # imm = 0x160
movq %rdi, %r14
movq 0x8(%rdi), %rax
movslq 0x8(%rax), %r15
leaq 0x10(%rdi), %r12
pushq $0x3
popq %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x4ff60
leaq 0x20(%r14), %rbx
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4fd90
movq 0x8(%r14), %rdx
leaq 0xe0(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x4e9c0
leaq 0x80(%rsp), %rsi
movq %r15, (%rsi)
movl $0xbf000000, 0xc(%rsi)  # imm = 0xBF000000
movq %r13, %rdi
callq 0x4cc90
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
movq 0x8(%r14), %rax
movq 0x8(%rax), %rcx
leaq 0x50(%rsp), %rsi
movq %rax, 0x8(%rsi)
movq %rcx, 0x10(%rsi)
movl $0x40000000, %ecx       # imm = 0x40000000
movl %ecx, 0x1c(%rsi)
movq 0x18(%rax), %rdi
addq $0x10, %rax
leaq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %rdi, 0x8(%rdx)
movl %ecx, 0x14(%rdx)
leaq 0x80(%rsp), %r14
movq %r14, %rdi
callq 0x4e870
leaq 0xe0(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4cb70
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x4e420
addq $0x160, %rsp            # imm = 0x160
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/schuyler[P]quickfix/include/quickfix/range.h
// Function: Beacon<float, 2>::RangeSolver::operator()(Eigen::Matrix<float, -1, 1, 0, -1, 1> const&, Eigen::Matrix<float, -1, 1, 0, -1, 1>&) const
int Beacon<F,D>::RangeSolver::operator()(const InputType &X_hat, Ranges &fvec) const {
    Point x = X_hat.transpose().leftCols(D);
    Ranges R_hat = Beacon::calculateRanges(B.A, x);
    fvec << (B.R - R_hat);
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movq (%rsi), %rax
movss (%rax), %xmm0
leaq 0x10(%rsp), %rdx
movss %xmm0, (%rdx)
movss 0x4(%rax), %xmm0
movss %xmm0, 0x4(%rdx)
movq 0x8(%rdi), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x4e460
movq 0x8(%r14), %rax
addq $0x10, %rax
leaq 0x18(%rsp), %rdx
movq %rax, (%rdx)
movq %r15, 0x8(%rdx)
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x4ec80
movq (%rsp), %rdi
callq 0x4e5b0
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
callq 0x4e5b0
movq %rbx, %rdi
callq 0x4f920
// File: /workspace/github_cpp_makefile_star2_O2/schuyler[P]quickfix/include/quickfix/difference.h
// Function: Beacon<float, 2>::DifferenceSolver::operator()(Eigen::Matrix<float, -1, 1, 0, -1, 1> const&, Eigen::Matrix<float, -1, 1, 0, -1, 1>&) const
int Beacon<F,D>::DifferenceSolver::operator()(const InputType &X_hat, Ranges &fvec) const {
    Point x = X_hat.transpose().leftCols(D);
    int i, j;

    B.R.minCoeff(&i, &j);

    Ranges R_hat = Beacon::calculateRanges(B.A, x);
    R_hat = (R_hat.array() - R_hat[i]).matrix(); 

    fvec << (B.R - R_hat);
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movq (%rsi), %rax
movss (%rax), %xmm0
leaq 0x18(%rsp), %r12
movss %xmm0, (%r12)
movss 0x4(%rax), %xmm0
movss %xmm0, 0x4(%r12)
movq 0x8(%rdi), %rdi
addq $0x10, %rdi
leaq 0x4(%rsp), %r13
movq %rsp, %rdx
movq %r13, %rsi
callq 0x4e100
movq 0x8(%r14), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r12, %rdx
callq 0x4e460
movslq (%r13), %rax
movq (%r15), %rcx
movq 0x8(%r15), %rdx
movss (%rcx,%rax,4), %xmm0
leaq 0x20(%rsp), %rsi
movq %r15, (%rsi)
movq %rdx, 0x8(%rsi)
movss %xmm0, 0x14(%rsi)
movq %r15, %rdi
callq 0x4c6e0
movq 0x8(%r14), %rax
addq $0x10, %rax
leaq 0x20(%rsp), %rdx
movq %rax, (%rdx)
movq %r15, 0x8(%rdx)
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x4ec80
movq 0x8(%rsp), %rdi
callq 0x4e5b0
xorl %eax, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x50c2d
movq %rax, %rbx
movq 0x8(%rsp), %rdi
callq 0x4e5b0
movq %rbx, %rdi
callq 0x4f920
// File: /workspace/github_cpp_makefile_star2_O2/schuyler[P]quickfix/include/quickfix/beacon.h
// Function: Beacon<float, 2>::checkSize(int)
void Beacon<F, D>::checkSize(int i) {
    if (i >= A.rows()) {
        A.conservativeResize(i + 1, Eigen::NoChange);
        R.conservativeResize(i + 1);
        R(i) = 0.0;
    } 
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movslq %esi, %r15
cmpq %r15, 0x8(%rdi)
jg 0x50c7a
movq %rdi, %rbx
leal 0x1(%r15), %eax
movslq %eax, %r14
pushq $0x2
popq %rdx
movq %r14, %rsi
callq 0x4fc70
leaq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x4fbb0
movq 0x10(%rbx), %rax
andl $0x0, (%rax,%r15,4)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/schuyler[P]quickfix/include/quickfix/beacon.h
// Function: Beacon<float, 2>::findRow(Eigen::Array<float, 1, 2, 1, 1, 2> const&) const
int Beacon<F, D>::findRow(const Point &a) const {
    int i;
    for (i = 0; i < A.rows(); i++) {
        if (A.row(i).array().isApprox(a)) {
            break;
        }
    }
    return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %ebp, %ebp
leaq 0x8(%rsp), %r15
leaq 0x4(%rsp), %r13
xorl %r12d, %r12d
cmpq %r12, 0x8(%r14)
jle 0x50cf0
movq (%r14), %rax
addq %rbp, %rax
movq %rax, 0x8(%rsp)
movq %r14, 0x18(%rsp)
movq %r12, 0x20(%rsp)
andq $0x0, 0x28(%rsp)
movq $0x1, 0x30(%rsp)
movl $0x3727c5ac, 0x4(%rsp)  # imm = 0x3727C5AC
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x4de70
testb %al, %al
jne 0x50cf0
incq %r12
addq $0x4, %rbp
jmp 0x50ca3
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq