LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: shaovie[P]reactor/src/ringq.h
// Function: ringq<poll_sync_opt::opt_arg>::pop_front()
inline void pop_front() {
        if (this->empty())
            return;

        this->rq[this->head] = item_t(); // clear
        this->head = (this->head + 1) % this->size;
        --(this->len);
    }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x14d00
testb $0x1, %al
jne 0x1c76e
jmp 0x1c770
jmp 0x1c7c8
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x14900
leaq 0x10(%rsp), %rdi
callq 0x15850
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
movslq 0x4(%rax), %rax
shlq $0x4, %rax
addq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x15d80
movq 0x8(%rsp), %rcx
movl 0x4(%rcx), %eax
addl $0x1, %eax
cltd
idivl (%rcx)
movq 0x8(%rsp), %rax
movl %edx, 0x4(%rax)
movl 0xc(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xc(%rax)
addq $0x28, %rsp
retq
nopl (%rax)
// File: shaovie[P]reactor/src/ringq.h
// Function: ringq<poll_sync_opt::opt_arg>::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:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x30(%rsp)
movl (%rax), %eax
shll %eax
movl %eax, 0x4c(%rsp)
cmpl $0x0, 0x4c(%rsp)
jne 0x1da8a
movl $0x2, 0x4c(%rsp)
movslq 0x4c(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0x10, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x14050
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x28(%rsp)
cmpq $0x0, %rax
je 0x1db1e
movq 0x28(%rsp), %rax
movq 0x20(%rsp), %rdx
shlq $0x4, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq %rdi, 0x8(%rsp)
xorl %esi, %esi
movl $0x10, %edx
callq 0x14900
movq 0x8(%rsp), %rdi
callq 0x15850
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
addq $0x10, %rax
cmpq %rcx, %rax
movq %rax, 0x18(%rsp)
jne 0x1dae6
movq 0x28(%rsp), %rax
movq %rax, 0x40(%rsp)
movl $0x0, 0x3c(%rsp)
movq 0x30(%rsp), %rcx
movl 0x3c(%rsp), %eax
cmpl 0xc(%rcx), %eax
jge 0x1db7e
movq 0x30(%rsp), %rcx
movq 0x10(%rcx), %rsi
movl 0x4(%rcx), %eax
addl 0x3c(%rsp), %eax
cltd
idivl (%rcx)
movslq %edx, %rax
shlq $0x4, %rax
addq %rax, %rsi
movq 0x40(%rsp), %rdi
movslq 0x3c(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x15d80
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x1db30
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x1db9a
movq (%rsp), %rdi
callq 0x155c0
movq 0x30(%rsp), %rax
movq 0x40(%rsp), %rcx
movq %rcx, 0x10(%rax)
movl 0x4c(%rsp), %ecx
movl %ecx, (%rax)
movl $0x0, 0x4(%rax)
movl 0xc(%rax), %ecx
movl %ecx, 0x8(%rax)
addq $0x58, %rsp
retq
// File: 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:
subq $0xb8, %rsp
movq %rdi, 0xa8(%rsp)
movq %rsi, 0xa0(%rsp)
movq %rdx, 0x98(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x14630
movq %rax, %rdi
callq 0x15d60
movl $0x1, %esi
xorl %edx, %edx
movl %esi, %edi
callq 0x14340
movl %eax, 0x94(%rsp)
cmpl $-0x1, 0x94(%rsp)
jne 0x1deae
movq 0xc159(%rip), %rax      # 0x29fd0
movq (%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x140c0
movl (%rax), %edi
callq 0x144d0
movq 0x10(%rsp), %rdi
movq %rax, %rdx
leaq 0x5454(%rip), %rsi      # 0x232ee
movb $0x0, %al
callq 0x15860
movl $0xffffffff, 0xb4(%rsp) # imm = 0xFFFFFFFF
jmp 0x1df0b
movw $0x1, 0x26(%rsp)
leaq 0x26(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x8(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x14630
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x15000
movq 0x18(%rsp), %rdi
movl 0x94(%rsp), %esi
movq 0x98(%rsp), %rax
movl 0x20(%rax), %r8d
leaq 0x26(%rsp), %rdx
movl $0x6e, %ecx
callq 0x15f90
movl %eax, 0xb4(%rsp)
movl 0xb4(%rsp), %eax
addq $0xb8, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, (%rsp)
movq (%rdi), %rax
callq *0x40(%rax)
movl %eax, 0x1c(%rsp)
movl $0xffffffff, 0x18(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x14(%rsp)
cmpl $0x80, 0x14(%rsp)
jge 0x1e544
movl 0x1c(%rsp), %edi
xorl %eax, %eax
movl %eax, %edx
movl $0x80800, %ecx          # imm = 0x80800
movq %rdx, %rsi
callq 0x147e0
movl %eax, 0x18(%rsp)
cmpl $-0x1, 0x18(%rsp)
jne 0x1e4e4
callq 0x140c0
cmpl $0x4, (%rax)
jne 0x1e499
jmp 0x1e534
callq 0x140c0
cmpl $0x18, (%rax)
jne 0x1e4e0
movq (%rsp), %rdi
callq 0x15eb0
movq (%rsp), %rsi
movq %rax, %rdi
movl $0xc8, %edx
xorl %ecx, %ecx
callq 0x15460
cmpl $0x0, %eax
jne 0x1e4de
movq (%rsp), %rdi
callq 0x15eb0
movq %rax, %rdi
movl 0x1c(%rsp), %esi
movl $0x2005, %edx           # imm = 0x2005
callq 0x15d50
jmp 0x1e4e0
jmp 0x1e4e2
jmp 0x1e544
movq (%rsp), %rax
callq *0x30(%rax)
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x1e503
movl 0x18(%rsp), %edi
callq 0x155b0
jmp 0x1e544
movq 0x8(%rsp), %rdi
movl 0x18(%rsp), %esi
movq (%rdi), %rax
callq *0x48(%rax)
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1e532
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
jmp 0x1e534
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x1e45c
movb $0x1, %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movl %esi, 0x34(%rsp)
movq %rdx, 0x28(%rsp)
movl %ecx, 0x24(%rsp)
movl %r8d, 0x20(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x34(%rsp), %edi
movq 0x28(%rsp), %rsi
movl 0x24(%rsp), %edx
callq 0x141c0
cmpl $-0x1, %eax
jne 0x1e633
movl 0x34(%rsp), %edi
callq 0x155b0
movq 0xb9d4(%rip), %rax      # 0x29fd0
movq (%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x140c0
movl (%rax), %edi
callq 0x144d0
movq 0x10(%rsp), %rdi
movq %rax, %rdx
leaq 0x4cf5(%rip), %rsi      # 0x23314
movb $0x0, %al
callq 0x15860
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e707
movl 0x34(%rsp), %edi
movl 0x20(%rsp), %esi
callq 0x15310
cmpl $-0x1, %eax
jne 0x1e689
movl 0x34(%rsp), %edi
callq 0x155b0
movq 0xb97b(%rip), %rax      # 0x29fd0
movq (%rax), %rax
movq %rax, 0x8(%rsp)
callq 0x140c0
movl (%rax), %edi
callq 0x144d0
movq 0x8(%rsp), %rdi
movq %rax, %rdx
leaq 0x4cb4(%rip), %rsi      # 0x2332c
movb $0x0, %al
callq 0x15860
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e707
movq 0x18(%rsp), %rdi
callq 0x15750
movq 0x18(%rsp), %rsi
movq %rax, %rdi
movl 0x34(%rsp), %edx
movl $0x2001, %ecx           # imm = 0x2001
callq 0x15740
cmpl $0x0, %eax
je 0x1e6f0
movl 0x34(%rsp), %edi
callq 0x155b0
movq 0xb912(%rip), %rax      # 0x29fd0
movq (%rax), %rax
movq %rax, (%rsp)
callq 0x140c0
movl (%rax), %edi
callq 0x144d0
movq (%rsp), %rdi
movq %rax, %rdx
leaq 0x4c67(%rip), %rsi      # 0x23346
movb $0x0, %al
callq 0x15860
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e707
movq 0x18(%rsp), %rdi
movl 0x34(%rsp), %esi
movq (%rdi), %rax
callq *0x48(%rax)
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
// File: 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:
subq $0x28, %rsp
movw %si, %ax
movq %rdi, 0x20(%rsp)
movw %ax, 0x1e(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movw $0x2, (%rax)
movzwl 0x1e(%rsp), %edi
callq 0x14110
movw %ax, %cx
movq 0x8(%rsp), %rax
movw %cx, 0x2(%rax)
movl $0x0, 0x4(%rax)
movq 0x10(%rsp), %rdi
callq 0x14700
cmpq $0x0, %rax
jbe 0x1eb66
movq 0x10(%rsp), %rdi
callq 0x15130
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x4(%rax)
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x14900
addq $0x28, %rsp
retq
// File: 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:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movl %ecx, 0x34(%rsp)
movq %r8, 0x28(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x18(%rsp)
movl $0x2, %edi
movl $0x80801, %esi          # imm = 0x80801
xorl %edx, %edx
callq 0x14340
movl %eax, 0x24(%rsp)
cmpl $-0x1, 0x24(%rsp)
jne 0x1ebcf
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x1ecd3
cmpq $0x0, 0x28(%rsp)
jbe 0x1ec00
movl 0x24(%rsp), %edi
movq 0x28(%rsp), %rsi
callq 0x15670
cmpl $-0x1, %eax
jne 0x1ec00
movl 0x24(%rsp), %edi
callq 0x155b0
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x1ecd3
movl 0x24(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x38(%rsp), %rdi
callq 0x15580
movq %rax, 0x10(%rsp)
movq 0x38(%rsp), %rdi
callq 0x15f60
movl 0xc(%rsp), %edi
movq 0x10(%rsp), %rsi
movl %eax, %edx
callq 0x14e80
movl %eax, 0x20(%rsp)
cmpl $0x0, 0x20(%rsp)
jne 0x1ec7f
movq 0x40(%rsp), %rdi
movl 0x24(%rsp), %esi
movq (%rdi), %rax
callq *0x48(%rax)
movq 0x40(%rsp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1ec75
movq 0x40(%rsp), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x1ecd3
movl $0x0, 0x54(%rsp)
jmp 0x1ecd3
callq 0x140c0
cmpl $0x73, (%rax)
jne 0x1ecc0
cmpl $0x1, 0x34(%rsp)
jge 0x1eca3
movl 0x24(%rsp), %edi
callq 0x155b0
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x1ecd3
movq 0x18(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl 0x24(%rsp), %edx
movl 0x34(%rsp), %ecx
callq 0x14680
movl %eax, 0x54(%rsp)
jmp 0x1ecd3
jmp 0x1ecc2
movl 0x24(%rsp), %edi
callq 0x155b0
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movl %edx, 0x3c(%rsp)
movl %ecx, 0x38(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movl $0x48, %edi
callq 0x15120
movq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rdx
callq 0x156b0
jmp 0x1ed26
movq 0x18(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
movl 0x3c(%rsp), %esi
movq (%rdi), %rax
callq *0x48(%rax)
movq 0x10(%rsp), %rdi
callq 0x15750
movq %rax, %rdi
movq 0x30(%rsp), %rsi
movl 0x3c(%rsp), %edx
movl $0x2005, %ecx           # imm = 0x2005
callq 0x15740
cmpl $-0x1, %eax
jne 0x1edac
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x1ed7f
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movl 0x3c(%rsp), %edi
callq 0x155b0
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x1edd1
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
callq 0x15060
jmp 0x1edda
movq 0x30(%rsp), %rdi
callq 0x15eb0
movq %rax, %rdi
movq 0x30(%rsp), %rsi
movl 0x38(%rsp), %edx
xorl %ecx, %ecx
callq 0x15460
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
movq 0x28(%rsp), %rdi
callq 0x15ce0
nopw %cs:(%rax,%rax)
nop
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
testb $0x1, 0x31(%rax)
je 0x1eebf
movb $0x1, 0x17(%rsp)
jmp 0x1eef4
movq (%rsp), %rax
movq 0x40(%rax), %rdi
movq (%rdi), %rax
movl $0x2, %esi
callq *0x28(%rax)
movq (%rsp), %rdi
callq 0x15eb0
movq (%rsp), %rsi
movq %rax, %rdi
callq 0x143c0
movq (%rsp), %rax
movb $0x1, 0x31(%rax)
movb $0x0, 0x17(%rsp)
movb 0x17(%rsp), %al
andb $0x1, %al
addq $0x18, %rsp
retq
nop
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
testb $0x1, 0x31(%rax)
je 0x1ef20
movb $0x1, 0x27(%rsp)
jmp 0x1ef76
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movq 0x8(%rsp), %rdi
movl %eax, 0x14(%rsp)
movq (%rdi), %rax
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq *0x48(%rax)
movq 0x8(%rsp), %rdi
callq 0x15eb0
movq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x143c0
movq 0x8(%rsp), %rax
movb $0x1, 0x31(%rax)
movb $0x1, 0x30(%rax)
movq 0x40(%rax), %rdi
movl 0x14(%rsp), %esi
movq (%rdi), %rax
callq *0x48(%rax)
movb $0x1, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
testb $0x1, 0x31(%rax)
je 0x1efb5
movb $0x0, 0x27(%rsp)
jmp 0x1f006
movq 0x8(%rsp), %rdi
movb $0x1, 0x32(%rdi)
callq 0x15eb0
movq 0x8(%rsp), %rdi
movq %rax, (%rsp)
movq (%rdi), %rax
callq *0x40(%rax)
movq (%rsp), %rdi
movl %eax, %esi
movl $0x2005, %edx           # imm = 0x2005
callq 0x15d50
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rdi
movq (%rdi), %rax
movl $0x1, %esi
callq *0x28(%rax)
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movb $0x0, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
movb 0x32(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x1f052
movq 0x8(%rsp), %rax
movb 0x31(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1f07d
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rdi
movq (%rdi), %rax
movl $0x2, %esi
callq *0x28(%rax)
movq 0x8(%rsp), %rdi
callq 0x15eb0
movq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x143c0
movq 0x8(%rsp), %rdi
callq 0x15220
movq 0x8(%rsp), %rax
movb 0x30(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x1f0c1
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1f0c1
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq 0x8(%rsp), %rax
cmpq $0x0, %rax
je 0x1f0d7
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
addq $0x18, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpl $-0x1, 0x8(%rax)
je 0x1f142
movq 0x8(%rsp), %rax
movl 0x8(%rax), %edi
callq 0x155b0
movq 0x8(%rsp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq 0x8(%rsp), %rax
movq $0x0, 0x18(%rax)
movq $0x0, 0x20(%rax)
addq $0x18, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpl $-0x1, 0x8(%rax)
jne 0x1f1d8
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x1f24f
movl $0x0, 0x1c(%rsp)
movq 0x10(%rsp), %rax
movl 0x8(%rax), %edi
movq 0x18(%rax), %rcx
movq 0x10(%rcx), %rsi
movq 0x18(%rax), %rax
movslq 0xc(%rax), %rdx
xorl %ecx, %ecx
callq 0x144b0
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
jle 0x1f221
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
jmp 0x1f247
jmp 0x1f223
xorl %eax, %eax
cmpl $-0x1, 0x1c(%rsp)
movb %al, 0xf(%rsp)
jne 0x1f23f
callq 0x140c0
cmpl $0x4, (%rax)
sete %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x1f1e0
movl 0x1c(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movl %edx, 0x64(%rsp)
movq 0x70(%rsp), %rax
movq %rax, (%rsp)
movslq 0x64(%rsp), %rdi
movq $-0x1, %rax
cmpq $0x0, %rdi
cmovlq %rax, %rdi
callq 0x14050
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rdi
movq 0x68(%rsp), %rsi
movslq 0x64(%rsp), %rdx
callq 0x14e70
movq (%rsp), %rax
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rsp)
movl 0x8(%rax), %ecx
movl %ecx, 0xc(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x58(%rsp), %rsi
movl 0x64(%rsp), %edx
leaq 0x20(%rsp), %rdi
callq 0x15430
movl 0xc(%rsp), %esi
movq 0x10(%rsp), %rdx
leaq 0x30(%rsp), %rdi
leaq 0x20(%rsp), %rcx
callq 0x14d80
movq 0x18(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x15dc0
movl 0x64(%rsp), %eax
addq $0x78, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpl $-0x1, 0x8(%rax)
jne 0x1f613
movb $0x0, 0x37(%rsp)
jmp 0x1f763
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rdi
callq 0x15ba0
movl %eax, 0x24(%rsp)
movl $0x0, 0x20(%rsp)
movl 0x20(%rsp), %eax
cmpl 0x24(%rsp), %eax
jge 0x1f713
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rdi
callq 0x151e0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rsp)
movl 0x8(%rax), %edi
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x18(%rsp), %rax
movslq (%rax), %rax
addq %rax, %rsi
movq 0x18(%rsp), %rax
movl 0x4(%rax), %eax
movq 0x18(%rsp), %rcx
subl (%rcx), %eax
movslq %eax, %rdx
xorl %ecx, %ecx
callq 0x14820
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jle 0x1f701
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rdx
movslq 0x34(%rax), %rcx
subq %rdx, %rcx
movl %ecx, 0x34(%rax)
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movl 0x4(%rcx), %ecx
movq 0x18(%rsp), %rdx
subl (%rdx), %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jne 0x1f6ef
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x1f6df
movq (%rsp), %rdi
callq 0x155c0
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rdi
callq 0x149c0
jmp 0x1f703
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rax
movslq (%rax), %rcx
addq %rdx, %rcx
movl %ecx, (%rax)
jmp 0x1f713
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x1f62d
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rdi
callq 0x141f0
testb $0x1, %al
jne 0x1f727
jmp 0x1f75e
movq 0x8(%rsp), %rax
movb 0x30(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x1f75e
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
movl 0x8(%rax), %esi
movl $0x4, %edx
callq 0x15d50
movq 0x8(%rsp), %rdi
movb $0x0, 0x30(%rdi)
movq (%rdi), %rax
callq *0x58(%rax)
movb $0x1, 0x37(%rsp)
movb 0x37(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nop
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x15220
movq 0x18(%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0x1fa44
movq 0x18(%rsp), %rax
movq 0x38(%rax), %rdi
callq 0x15ba0
movl %eax, 0x2c(%rsp)
movl $0x0, 0x28(%rsp)
movl 0x28(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jge 0x1fa08
movq 0x18(%rsp), %rax
movq 0x38(%rax), %rdi
callq 0x151e0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x1f9ed
movq 0x10(%rsp), %rdi
callq 0x155c0
movq 0x18(%rsp), %rax
movq 0x38(%rax), %rdi
callq 0x149c0
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x1f9b2
movq 0x18(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x1fa30
movq 0x8(%rsp), %rdi
callq 0x14a10
movq 0x8(%rsp), %rdi
callq 0x15060
movq 0x18(%rsp), %rax
movl $0x0, 0x34(%rax)
movq $0x0, 0x38(%rax)
addq $0x38, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
addq $0x50, %rdi
leaq 0x24(%rsp), %rsi
callq 0x14a80
movq 0x8(%rsp), %rdi
movq %rax, 0x18(%rsp)
addq $0x50, %rdi
callq 0x15840
movq %rax, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x155a0
testb $0x1, %al
jne 0x1faa2
jmp 0x1fab7
leaq 0x18(%rsp), %rdi
callq 0x15190
movq 0x8(%rax), %rax
movq %rax, 0x30(%rsp)
jmp 0x1fac0
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: shaovie[P]reactor/src/io_handle.h
// Function: async_send_buf::operator=(async_send_buf const&)
async_send_buf& operator=(const async_send_buf &v) {
        this->buf = v.buf;
        this->len = v.len;
        this->sendn = v.sendn;
        return *this;
    }

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq -0x10(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rsp), %rcx
movl 0x4(%rcx), %ecx
movl %ecx, 0x4(%rax)
movq -0x10(%rsp), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x9f4e(%rip), %rcx      # 0x29fa8
addq $0x10, %rcx
movq %rcx, (%rax)
cmpl $-0x1, 0x30(%rax)
je 0x20078
movq 0x18(%rsp), %rax
movl 0x30(%rax), %edi
callq 0x16000
jmp 0x20076
jmp 0x20078
movq 0x18(%rsp), %rax
cmpq $0x0, 0x68(%rax)
je 0x200ae
movq 0x18(%rsp), %rax
movq 0x68(%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x200ac
movq 0x10(%rsp), %rdi
callq 0x14580
movq 0x10(%rsp), %rdi
callq 0x15060
jmp 0x200ae
movq 0x18(%rsp), %rax
cmpq $0x0, 0x70(%rax)
je 0x200e4
movq 0x18(%rsp), %rax
movq 0x70(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x200e2
movq 0x8(%rsp), %rdi
callq 0x14580
movq 0x8(%rsp), %rdi
callq 0x15060
jmp 0x200e4
movq 0x18(%rsp), %rdi
callq 0x15760
addq $0x28, %rsp
retq
movq %rax, %rdi
callq 0x16de0
nopl (%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
movq 0x8(%rsp), %rax
movl (%rax), %eax
movl %eax, (%rdi)
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x10(%rdi)
movq 0x8(%rsp), %rsi
addq $0x18, %rsi
addq $0x18, %rdi
callq 0x149e0
movq (%rsp), %rax
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movl %edx, 0x1c(%rsp)
movl %ecx, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x1c(%rsp)
jl 0x212c6
cmpq $0x0, 0x20(%rsp)
je 0x212c6
cmpl $0x0, 0x18(%rsp)
jne 0x212d0
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x2132f
movq 0x8(%rsp), %rax
movl $0x0, 0x14(%rsp)
cmpl $0x1, (%rax)
jle 0x212f2
movq 0x8(%rsp), %rcx
movl 0x1c(%rsp), %eax
cltd
idivl (%rcx)
movl %edx, 0x14(%rsp)
movq 0x8(%rsp), %rsi
movq 0x20(%rsp), %rdi
callq 0x153d0
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movslq 0x14(%rsp), %rax
imulq $0x88, %rax, %rax
addq %rax, %rdi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %edx
movl 0x18(%rsp), %ecx
callq 0x15f80
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl %esi, 0x14(%rsp)
movl %edx, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
cmpl $0x0, 0x14(%rsp)
jl 0x213d8
cmpl $0x0, 0x10(%rsp)
jne 0x213e2
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
jmp 0x2142a
movq (%rsp), %rax
movl $0x0, 0xc(%rsp)
cmpl $0x1, (%rax)
jle 0x21402
movq (%rsp), %rcx
movl 0x14(%rsp), %eax
cltd
idivl (%rcx)
movl %edx, 0xc(%rsp)
movq (%rsp), %rax
movq 0x8(%rax), %rdi
movslq 0xc(%rsp), %rax
imulq $0x88, %rax, %rax
addq %rax, %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
callq 0x14750
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl %esi, 0x14(%rsp)
movl %edx, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
cmpl $0x0, 0x14(%rsp)
jl 0x21468
cmpl $0x0, 0x10(%rsp)
jne 0x21472
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
jmp 0x214ba
movq (%rsp), %rax
movl $0x0, 0xc(%rsp)
cmpl $0x1, (%rax)
jle 0x21492
movq (%rsp), %rcx
movl 0x14(%rsp), %eax
cltd
idivl (%rcx)
movl %edx, 0xc(%rsp)
movq (%rsp), %rax
movq 0x8(%rax), %rdi
movslq 0xc(%rsp), %rax
imulq $0x88, %rax, %rax
addq %rax, %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
callq 0x15d50
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl $0x0, -0x4(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x12c0
leaq 0x1de3(%rip), %rdi      # 0x3028
leaq -0x90(%rbp), %rsi
callq 0x13b0
leaq 0x1dda(%rip), %rdi      # 0x3032
movb $0x0, %al
callq 0x1070
movl $0x0, -0x8(%rbp)
movslq -0x8(%rbp), %rax
cmpq -0x78(%rbp), %rax
jae 0x1295
movq -0x70(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x1db7(%rip), %rdi      # 0x303a
movb $0x0, %al
callq 0x1070
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x1266
leaq 0x1da3(%rip), %rdi      # 0x303f
movb $0x0, %al
callq 0x1070
leaq -0x90(%rbp), %rdi
callq 0x13e0
xorl %eax, %eax
addq $0x90, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movss %xmm0, 0x9c(%rsp)
movss %xmm1, 0x98(%rsp)
movl %esi, 0x94(%rsp)
movq 0xa0(%rsp), %rsi
movss 0x9c(%rsp), %xmm0
movss 0x98(%rsp), %xmm1
movl 0x94(%rsp), %edx
leaq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x2b65b0
movq 0x10(%rsp), %rdi
movq 0xa0(%rsp), %rax
movq %rax, 0x18(%rsp)
callq 0x2a1bf0
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x2ad3b0
jmp 0x2bbe9e
movq 0xa0(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x29c3b0
movq 0x8(%rsp), %rdi
callq 0x29bed0
leaq 0x30(%rsp), %rdi
callq 0x2b39e0
addq $0xa8, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x2b39e0
movq 0x28(%rsp), %rdi
callq 0x2b6590
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x278, %rsp            # imm = 0x278
movq %rdi, 0x270(%rsp)
movq 0x270(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rax), %rdi
callq 0x2b9410
movq 0x10(%rsp), %rdi
movl %eax, 0x26c(%rsp)
addq $0x10, %rdi
movq %rdi, 0x18(%rsp)
movslq 0x26c(%rsp), %rsi
movl $0x3, %edx
callq 0x2ba670
movq 0x10(%rsp), %rdi
addq $0x20, %rdi
movslq 0x26c(%rsp), %rsi
movl $0x1, %edx
movq %rdx, 0x20(%rsp)
callq 0x2b8a80
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rsi
movq 0x8(%rax), %rdx
leaq 0x248(%rsp), %rdi
callq 0x29c620
movq 0x20(%rsp), %rdx
movslq 0x26c(%rsp), %rsi
movl $0xbf000000, 0x234(%rsp) # imm = 0xBF000000
leaq 0x238(%rsp), %rdi
leaq 0x234(%rsp), %rcx
callq 0x2b6510
jmp 0x2bc4e6
leaq 0x248(%rsp), %rdi
leaq 0x238(%rsp), %rsi
callq 0x2985b0
jmp 0x2bc4fd
leaq 0x248(%rsp), %rdi
callq 0x2ae5e0
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, 0x8(%rsp)
movsd 0xc9ae5(%rip), %xmm0    # 0x386008
movsd %xmm0, 0x178(%rsp)
movq 0x8(%rax), %rdi
callq 0x2acc30
movq %rax, 0x80(%rsp)
movsd 0xc9abb(%rip), %xmm0    # 0x386000
movsd %xmm0, 0x78(%rsp)
leaq 0x88(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x2ae320
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x2b4960
leaq 0xc8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x2b1640
leaq 0xe8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x2a3280
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
addq $0x10, %rdi
callq 0x2ad130
movq %rax, 0x30(%rsp)
movsd 0xc9a3d(%rip), %xmm0    # 0x386000
movsd %xmm0, 0x28(%rsp)
leaq 0x38(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x29e450
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x2a0600
leaq 0x118(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x2aac60
leaq 0x180(%rsp), %rdi
leaq 0x178(%rsp), %rsi
leaq 0x118(%rsp), %rdx
callq 0x297b60
movq 0x8(%rsp), %rsi
leaq 0x200(%rsp), %rdi
leaq 0x180(%rsp), %rdx
callq 0x2a0520
leaq 0x200(%rsp), %rdi
callq 0x2b0550
addq $0x278, %rsp            # imm = 0x278
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
leaq 0x248(%rsp), %rdi
callq 0x2ae5e0
movq 0x228(%rsp), %rdi
callq 0x2b6590
// File: 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:
subq $0xe8, %rsp
movq %rdi, 0xe0(%rsp)
movq %rsi, 0xd8(%rsp)
movq %rdx, 0xd0(%rsp)
movq 0xe0(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xd8(%rsp), %rdi
callq 0x298a90
movq %rax, 0x88(%rsp)
leaq 0x90(%rsp), %rdi
movq %rdi, (%rsp)
leaq 0x88(%rsp), %rsi
movl $0x2, %edx
callq 0x298200
movq (%rsp), %rsi
leaq 0xc8(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x2b38f0
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rsi
leaq 0x70(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x2a82b0
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
movq 0xd0(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movq 0x8(%rax), %rsi
addq $0x10, %rsi
leaq 0x38(%rsp), %rdi
callq 0x29f690
jmp 0x2bd10d
movq 0x20(%rsp), %rsi
leaq 0x50(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x2b0800
jmp 0x2bd123
leaq 0x50(%rsp), %rdi
callq 0x2b0550
leaq 0x70(%rsp), %rdi
callq 0x2b19b0
xorl %eax, %eax
addq $0xe8, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x2b19b0
movq 0x30(%rsp), %rdi
callq 0x2b6590
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: 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:
subq $0x148, %rsp            # imm = 0x148
movq %rdi, 0x140(%rsp)
movq %rsi, 0x138(%rsp)
movq %rdx, 0x130(%rsp)
movq 0x140(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x138(%rsp), %rdi
callq 0x298a90
movq %rax, 0xe8(%rsp)
leaq 0xf0(%rsp), %rdi
movq %rdi, 0x10(%rsp)
leaq 0xe8(%rsp), %rsi
movl $0x2, %edx
callq 0x298200
movq 0x10(%rsp), %rsi
leaq 0x128(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x2b38f0
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
addq $0x10, %rdi
leaq 0xe0(%rsp), %rsi
leaq 0xdc(%rsp), %rdx
callq 0x2a8de0
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rdx
movq 0x8(%rax), %rsi
leaq 0xc8(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x2a82b0
movq 0x28(%rsp), %rdi
callq 0x292380
movq %rax, 0x30(%rsp)
jmp 0x2be50a
movq 0x30(%rsp), %rax
movq %rax, 0x80(%rsp)
movslq 0xe0(%rsp), %rsi
leaq 0xc8(%rsp), %rdi
callq 0x293680
movq %rax, 0x8(%rsp)
jmp 0x2be533
movq 0x8(%rsp), %rdx
leaq 0x88(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x293bf0
jmp 0x2be54f
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x294e20
jmp 0x2be566
leaq 0xc8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x293e00
jmp 0x2be57d
movq 0x18(%rsp), %rax
movq 0x130(%rsp), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rsi
addq $0x10, %rsi
leaq 0x38(%rsp), %rdi
leaq 0xc8(%rsp), %rdx
callq 0x29f690
jmp 0x2be5aa
movq (%rsp), %rsi
leaq 0x50(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x2b0800
jmp 0x2be5bf
leaq 0x50(%rsp), %rdi
callq 0x2b0550
leaq 0xc8(%rsp), %rdi
callq 0x2b19b0
xorl %eax, %eax
addq $0x148, %rsp            # imm = 0x148
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x2b19b0
movq 0x78(%rsp), %rdi
callq 0x2b6590
nopw %cs:(%rax,%rax)
nop
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movslq 0x1c(%rsp), %rax
movq %rax, 0x10(%rsp)
callq 0x2b9410
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
jl 0x2be84b
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
xorl %edx, %edx
callq 0x2a50b0
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x2a2770
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
movslq 0x1c(%rsp), %rsi
callq 0x294650
xorps %xmm0, %xmm0
movss %xmm0, (%rax)
addq $0x28, %rsp
retq
// File: 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:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x10(%rsp)
movl $0x0, 0x84(%rsp)
movq 0x10(%rsp), %rdi
movslq 0x84(%rsp), %rax
movq %rax, 0x8(%rsp)
callq 0x2b9410
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jge 0x2be9b3
movq 0x10(%rsp), %rsi
movslq 0x84(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x2b2550
leaq 0x50(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x29f870
movq 0x88(%rsp), %rax
movq %rax, (%rsp)
callq 0x2b4750
movq (%rsp), %rsi
movss %xmm0, 0x1c(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x1c(%rsp), %rdx
callq 0x29f820
testb $0x1, %al
jne 0x2be999
jmp 0x2be99b
jmp 0x2be9b3
jmp 0x2be99d
movl 0x84(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x84(%rsp)
jmp 0x2be91f
movl 0x84(%rsp), %eax
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: schuyler[P]quickfix/include/quickfix/fix.h
// Function: Beacon<float, 2>::estimateError()
void Beacon<F, D>::estimateError() {
    Ranges R_hat;
    int i, j;

    // FIXME FIXME: this no longer works for RangeSolver
    //
    //std::cout << "\n\nR: " << R << "\n";
    R_hat = calculateRanges(A, X);
    //std::cout << "R_hat pre: " << R_hat << "\n";
    R.minCoeff(&i, &j);
    R_hat = (R_hat.array() - R_hat[i]).matrix(); 
    //std::cout << "R_hat post: " << R_hat << "\n";
    Err = meanSquaredError(R_hat);
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x2b8bb0
movq 0x28(%rsp), %rsi
movq %rsi, %rdx
addq $0x20, %rdx
leaq 0x88(%rsp), %rdi
callq 0x2a82b0
jmp 0x2bed44
leaq 0xa0(%rsp), %rdi
leaq 0x88(%rsp), %rsi
movq %rsi, 0x20(%rsp)
callq 0x2b9dd0
movq 0x20(%rsp), %rdi
callq 0x2b19b0
movq 0x28(%rsp), %rdi
addq $0x10, %rdi
leaq 0x9c(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0x2a8de0
jmp 0x2bed88
leaq 0xa0(%rsp), %rdi
callq 0x292380
movq %rax, 0x18(%rsp)
jmp 0x2bed9c
movq 0x18(%rsp), %rax
movq %rax, 0x30(%rsp)
movslq 0x9c(%rsp), %rsi
leaq 0xa0(%rsp), %rdi
callq 0x293680
movq %rax, 0x10(%rsp)
jmp 0x2bedc2
movq 0x10(%rsp), %rdx
leaq 0x38(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x293bf0
jmp 0x2bedd8
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x294e20
jmp 0x2bede9
leaq 0xa0(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x293e00
jmp 0x2bedfd
movq 0x28(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x2b0200
movss %xmm0, 0xc(%rsp)
jmp 0x2bee17
movq 0x28(%rsp), %rax
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x40(%rax)
leaq 0xa0(%rsp), %rdi
callq 0x2b19b0
addq $0xb8, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x2b19b0
movq 0x80(%rsp), %rdi
callq 0x2b6590
nopw (%rax,%rax)
// File: schuyler[P]quickfix/include/quickfix/beacon.h
// Function: Beacon<float, 2>::Reading(Eigen::Array<float, 1, 2, 1, 1, 2> const&, float)
int Beacon<F, D>::Reading(const Point &anchor, F range) {
    int i = findRow(anchor);
    Anchor(i, anchor);
    Range(i, range);
    return i;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movss %xmm0, 0x14(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movq 0x18(%rsp), %rsi
callq 0x291a80
movq 0x8(%rsp), %rdi
movl %eax, 0x10(%rsp)
movl 0x10(%rsp), %esi
movq 0x18(%rsp), %rdx
callq 0x298420
movq 0x8(%rsp), %rdi
movl 0x10(%rsp), %esi
movss 0x14(%rsp), %xmm0
callq 0x295cf0
movl 0x10(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax)