LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: buf_it_cmp
static int buf_it_cmp(struct iovec_iter *it1, struct iovec_iter *it2)
{
	if (it1->iov_ind < it2->iov_ind)
		return -1;
	if (it1->iov_ind > it2->iov_ind)
		return 1;
	if (it1->iov_off < it2->iov_off)
		return -1;
	if (it1->iov_off > it2->iov_off)
		return 1;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x4c45
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4c9b
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jbe 0x4c5e
movl $0x1, -0x4(%rbp)
jmp 0x4c9b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x4c79
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4c9b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x4c94
movl $0x1, -0x4(%rbp)
jmp 0x4c9b
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: buf_it_iovlen
static size_t buf_it_iovlen(struct io_buf *buf, struct iovec_iter *beg,
			    struct iovec_iter *end)
{
	size_t len;

	if (buf_it_cmp(beg, end) >= 0)
		return 0;
	if (beg->iov_ind == end->iov_ind)
		len = end->iov_off;
	else
		len = buf->iov[beg->iov_ind].iov_len;

	return len - beg->iov_off;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x4c20
cmpl $0x0, %eax
jl 0x4cd0
movq $0x0, -0x8(%rbp)
jmp 0x4d18
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
cmpq (%rcx), %rax
jne 0x4cee
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x4d08
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
subq 0x8(%rcx), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: buf_it_advance
static void buf_it_advance(struct io_buf *buf, struct iovec_iter *it, size_t sz)
{
	it->iov_off += sz;
	if (!buf_it_tail(buf, it) &&
	    buf_it_iov(buf, it)->iov_len == it->iov_off) {
		/*
		 * We advance if this is the end of iov
		 * and iov is not a tail
		 */
		it->iov_off = 0;
		it->iov_ind++;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4da0
testb $0x1, %al
jne 0x4d9a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4dd0
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x4d9a
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: buf_it_realloc
static int buf_it_realloc(struct io_buf *buf, struct iovec_iter *it, size_t sz)
{
	struct iovec *iov;
	void *tmp;

	/*
	 * Here we come because of two reasons:
	 *   1. !iov_len, !iov_base,  is_vari_len
	 *   2.  iov_len, !iov_base, !is_vari_len
	 *
	 * For 1 we reallocate the iov_len + sz.
	 * For 2 we allocate what is set in iov_len.
	 */

	iov = buf_it_iov(buf, it);
	if (buf_it_vari_len_tail(buf, it))
		sz += iov->iov_len;
	else
		sz  = iov->iov_len;

	tmp = realloc(iov->iov_base, sz);
	if (tmp == NULL)
		return -ENOMEM;
	iov->iov_base = tmp;
	buf->iov_free[it->iov_ind] = true;
	iov->iov_len = sz;

	return sz;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4dd0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4f40
testb $0x1, %al
jne 0x4eb8
jmp 0x4eca
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x4ed6
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x11b0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x4efa
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x4f2b
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movb $0x1, 0x110(%rax,%rcx)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: on_io_write
static int on_io_write(struct io_queue *q)
{
	struct io_req *req;
	int sz;

	if (!(q->item.revents & P_OUT))
		return 0;

	req = list_first_entry_or_null(&q->queue, struct io_req, list);
	assert(req);
	assert(is_write_req(req));

	sz = do_write(q->item.fd, req);
	if (sz > 0) {
		buf_advance(&req->buf, &req->buf.pos, sz);
		if (buf_it_end(&req->buf, &req->buf.pos)) {
			sz = buf_pos(&req->buf);
			sz = complete_req(req, sz);
		}
	}
	q->item.revents &= ~P_OUT;

	return sz < 0 ? sz : 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x5017
movl $0x0, -0x4(%rbp)
jmp 0x5159
movq -0x10(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
callq 0x42d0
cmpl $0x0, %eax
jne 0x504d
movq -0x10(%rbp), %rax
movq 0x138(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x5055
xorl %eax, %eax
movq %rax, -0x38(%rbp)
jmp 0x5055
movq -0x38(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x5066
jmp 0x5085
leaq 0x2207(%rip), %rdi      # 0x7274
leaq 0x245c(%rip), %rsi      # 0x74d0
movl $0x2d8, %edx            # imm = 0x2D8
leaq 0x25c2(%rip), %rcx      # 0x7642
callq 0x10d0
movq -0x18(%rbp), %rdi
callq 0x54d0
testb $0x1, %al
jne 0x5094
jmp 0x5096
jmp 0x50b5
leaq 0x25c8(%rip), %rdi      # 0x7665
leaq 0x242c(%rip), %rsi      # 0x74d0
movl $0x2d9, %edx            # imm = 0x2D9
leaq 0x2592(%rip), %rcx      # 0x7642
callq 0x10d0
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x18(%rbp), %rsi
callq 0x54f0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jle 0x5131
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
movq -0x18(%rbp), %rsi
addq $0x28, %rsi
addq $0x100, %rsi            # imm = 0x100
movslq -0x1c(%rbp), %rdx
callq 0x5570
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
movq -0x18(%rbp), %rsi
addq $0x28, %rsi
addq $0x100, %rsi            # imm = 0x100
callq 0x4df0
testb $0x1, %al
jne 0x5110
jmp 0x512f
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
callq 0x3890
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x5690
movl %eax, -0x1c(%rbp)
jmp 0x5131
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
andl $-0x5, %ecx
movl %ecx, 0x10(%rax)
cmpl $0x0, -0x1c(%rbp)
jge 0x514c
movl -0x1c(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x5153
xorl %eax, %eax
movl %eax, -0x3c(%rbp)
jmp 0x5153
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: on_io_read
static int on_io_read(struct io_queue *q)
 {
	struct io_req *req;
	int sz;

	if (!(q->item.revents & P_IN) && !req_exists_to_read_from_stash(q))
		/* Both sources (socket and stash) are empty */
		return 0;

	req = list_first_entry_or_null(&q->queue, struct io_req, list);
	assert(req);
	assert(is_read_req(req));

	sz = do_read(q->item.fd, req);
	if (sz > 0) {
		buf_advance(&req->buf, &req->buf.pos, sz);
		if (can_complete_rd(&req->buf, sz)) {
			sz = buf_pos(&req->buf);
			sz = complete_req(req, sz);
		}
	}
	q->item.revents &= ~P_IN;

	return sz < 0 ? sz : 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x51a4
movq -0x10(%rbp), %rdi
callq 0x52f0
testb $0x1, %al
jne 0x51a4
movl $0x0, -0x4(%rbp)
jmp 0x52db
movq -0x10(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
callq 0x42d0
cmpl $0x0, %eax
jne 0x51da
movq -0x10(%rbp), %rax
movq 0x138(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x51e2
xorl %eax, %eax
movq %rax, -0x38(%rbp)
jmp 0x51e2
movq -0x38(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x51f3
jmp 0x5212
leaq 0x207a(%rip), %rdi      # 0x7274
leaq 0x22cf(%rip), %rsi      # 0x74d0
movl $0x2bf, %edx            # imm = 0x2BF
leaq 0x253a(%rip), %rcx      # 0x7747
callq 0x10d0
movq -0x18(%rbp), %rdi
callq 0x5d00
testb $0x1, %al
jne 0x5221
jmp 0x5223
jmp 0x5242
leaq 0x253f(%rip), %rdi      # 0x7769
leaq 0x229f(%rip), %rsi      # 0x74d0
movl $0x2c0, %edx            # imm = 0x2C0
leaq 0x250a(%rip), %rcx      # 0x7747
callq 0x10d0
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x18(%rbp), %rsi
callq 0x5d20
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jle 0x52b3
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
movq -0x18(%rbp), %rsi
addq $0x28, %rsi
addq $0x100, %rsi            # imm = 0x100
movslq -0x1c(%rbp), %rdx
callq 0x5570
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
movslq -0x1c(%rbp), %rsi
callq 0x5e60
testb $0x1, %al
jne 0x5292
jmp 0x52b1
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
callq 0x3890
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x5690
movl %eax, -0x1c(%rbp)
jmp 0x52b3
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
andl $-0x3, %ecx
movl %ecx, 0x10(%rax)
cmpl $0x0, -0x1c(%rbp)
jge 0x52ce
movl -0x1c(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x52d5
xorl %eax, %eax
movl %eax, -0x3c(%rbp)
jmp 0x52d5
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: _poller_update
static int __poller_update(struct io_queue *q)
{
	struct io_req *req;

	int wr, ev;

	/*
	 * Take first request from the queue and update events.
	 */

	req = list_first_entry_or_null(&q->queue, struct io_req, list);
	if (req) {
		wr = req->flags & REQ_RDWR_MASK;
		ev = wr ? P_OUT : P_IN;
	} else
		ev = 0;

	return __poller_set(q->poller, &q->item, ev);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
callq 0x42d0
cmpl $0x0, %eax
jne 0x5402
movq -0x8(%rbp), %rax
movq 0x138(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x540a
xorl %eax, %eax
movq %rax, -0x30(%rbp)
jmp 0x540a
movq -0x30(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x543e
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
andl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %edx
movl $0x2, %eax
movl $0x4, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x18(%rbp)
jmp 0x5445
movl $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
addq $0x8, %rsi
movl -0x18(%rbp), %edx
callq 0x61c0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: do_write
static int do_write(int fd, struct io_req *req)
{
	int sz;

	assert(req_check(req) == 0);
	sz = __write(fd, req);
	if (sz < 0) {
		if (sz == -EAGAIN || sz == -ENOMEM)
			/* Why EAGAIN? Yeah, that's weird. Check
			 * linux/net/ipv4/tcp.c:tcp_sendmsg():wait_for_memory,
			 * in case of memory preasure and nonblock
			 * send EAGAIN will be returned. So relax. */
			return 0;
	}

	return sz;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x57a0
cmpl $0x0, %eax
jne 0x550f
jmp 0x552e
leaq 0x2161(%rip), %rdi      # 0x7677
leaq 0x1fb3(%rip), %rsi      # 0x74d0
movl $0x1ff, %edx            # imm = 0x1FF
leaq 0x2162(%rip), %rcx      # 0x768b
callq 0x10d0
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x5810
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0x555a
cmpl $-0xb, -0x14(%rbp)
je 0x554f
cmpl $-0xc, -0x14(%rbp)
jne 0x5558
movl $0x0, -0x4(%rbp)
jmp 0x5560
jmp 0x555a
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: buf_advance
static size_t buf_advance(struct io_buf *buf, struct iovec_iter *it,
			  size_t sz)
{
	size_t nb;
	struct iovec_iter end = END_IT(buf);

	while (buf_it_cmp(it, &end) < 0 && sz) {
		nb = min(sz, buf_it_iovlen(buf, it, &end));
		buf_it_advance(buf, it, nb);
		sz -= nb;
	}

	return sz;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3810
testb $0x1, %al
jne 0x5593
jmp 0x55ac
movq -0x8(%rbp), %rax
movq 0x120(%rax), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
jmp 0x55e1
movq -0x8(%rbp), %rax
movq 0x120(%rax), %rax
subq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x120(%rcx), %rcx
subq $0x1, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x55e3
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x4c20
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x31(%rbp)
jge 0x5607
cmpq $0x0, -0x18(%rbp)
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x5610
jmp 0x5681
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x4ca0
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpq %rcx, %rax
jae 0x563f
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x5654
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x4ca0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x4d30
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x18(%rbp)
jmp 0x55e3
movq -0x18(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: complete_req
static int complete_req(struct io_req *req, int len)
{
	struct io_queue *q = req->q;

	bool keep_in_queue = false;
	int off, dir;

	dir = req->flags & REQ_RDWR_MASK;
	io_req_get(req);
	list_del_init(&req->list);
	off = req->io_fn(req, len);
	if (dir == REQ_RD) {
		/* Read path */
		if (off == 0) {
			/* Return to the request queue, continue filling in */
			list_add(&req->list, &q->queue);
			keep_in_queue = true;
		} else {
			if (off > 0 && off != len) {
				/* Stash the rest or everything. */
				off = stash_rest(req, off, len);
			}
		}
	}
	io_req_put(req);
	if (!keep_in_queue) {
		assert(q->reqs_num[dir] > 0);
		q->reqs_num[dir]--;
	}

	return off;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
andl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4b60
movq -0x8(%rbp), %rdi
callq 0x5a80
movq -0x8(%rbp), %rax
movq 0x178(%rax), %rax
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq *%rax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x5731
cmpl $0x0, -0x20(%rbp)
jne 0x570b
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x138, %rsi            # imm = 0x138
callq 0x5ab0
movb $0x1, -0x19(%rbp)
jmp 0x572f
cmpl $0x0, -0x20(%rbp)
jle 0x572d
movl -0x20(%rbp), %eax
cmpl -0xc(%rbp), %eax
je 0x572d
movq -0x8(%rbp), %rdi
movslq -0x20(%rbp), %rsi
movslq -0xc(%rbp), %rdx
callq 0x5ae0
movl %eax, -0x20(%rbp)
jmp 0x572f
jmp 0x5731
movq -0x8(%rbp), %rdi
callq 0x4bb0
testb $0x1, -0x19(%rbp)
jne 0x578c
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
cmpl $0x0, 0x148(%rax,%rcx,4)
jle 0x5754
jmp 0x5773
leaq 0x1f53(%rip), %rdi      # 0x76ae
leaq 0x1d6e(%rip), %rsi      # 0x74d0
movl $0x227, %edx            # imm = 0x227
leaq 0x1f55(%rip), %rcx      # 0x76c3
callq 0x10d0
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl 0x148(%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, 0x148(%rax,%rcx,4)
movl -0x20(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: req_check
static int req_check(struct io_req *req)
{
	int rc;

	rc = buf_check(&req->buf);
	if (rc)
		return rc;
	if ((req->flags & REQ_WR) && buf_vari_len(&req->buf))
		return -EINVAL;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
callq 0x3ab0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x57ca
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x57fc
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x57f5
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
callq 0x3810
testb $0x1, %al
jne 0x57ec
jmp 0x57f5
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x57fc
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: stash_rest
static int stash_rest(struct io_req *req, size_t off, size_t end)
{
	struct io_queue *q = req->q;
	struct iovec *st = &q->stash;
	size_t len, sz;
	void *tmp;

	if (off == INT_MAX) {
		/* Special case, stash everything */
		off = 0;
	}
	len = end - off;

	assert(st->iov_len == 0);
	assert(q->stash_pos == 0);
	if (st->iov_base == NULL || malloc_usable_size(st->iov_base) < len) {
		sz = round_up(len, _4K);
		tmp = realloc(st->iov_base, sz);
		if (tmp == NULL)
			return -ENOMEM;
		st->iov_base = tmp;
	}
	sz = buf_memcpy_to(&req->buf, off, st->iov_base, len);
	assert(sz == len);
	st->iov_len = len;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x158, %rax            # imm = 0x158
movq %rax, -0x30(%rbp)
cmpq $0x7fffffff, -0x18(%rbp) # imm = 0x7FFFFFFF
jne 0x5b20
movq $0x0, -0x18(%rbp)
movq -0x20(%rbp), %rax
subq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x5b39
jmp 0x5b58
leaq 0x1baa(%rip), %rdi      # 0x76ea
leaq 0x1989(%rip), %rsi      # 0x74d0
movl $0x171, %edx            # imm = 0x171
leaq 0x1ba8(%rip), %rcx      # 0x76fb
callq 0x10d0
movq -0x28(%rbp), %rax
cmpq $0x0, 0x168(%rax)
jne 0x5b68
jmp 0x5b87
leaq 0x1bbc(%rip), %rdi      # 0x772b
leaq 0x195a(%rip), %rsi      # 0x74d0
movl $0x172, %edx            # imm = 0x172
leaq 0x1b79(%rip), %rcx      # 0x76fb
callq 0x10d0
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
je 0x5ba3
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x1120
cmpq -0x38(%rbp), %rax
jae 0x5bea
movq -0x38(%rbp), %rax
addq $0x1000, %rax           # imm = 0x1000
subq $0x1, %rax
andq $-0x1000, %rax          # imm = 0xF000
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0x11b0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x5bdf
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x5c4a
movq -0x48(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rax
movq (%rax), %rdx
movq -0x38(%rbp), %rcx
callq 0x39d0
cltq
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
jne 0x5c18
jmp 0x5c37
leaq 0x1b1e(%rip), %rdi      # 0x773d
leaq 0x18aa(%rip), %rsi      # 0x74d0
movl $0x17b, %edx            # imm = 0x17B
leaq 0x1ac9(%rip), %rcx      # 0x76fb
callq 0x10d0
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: do_read
static int do_read(int fd, struct io_req *req)
{
	struct io_buf *buf = &req->buf;
	int sz, hint;

	hint = buf->__proto.read_hint;
	assert(req_check(req) == 0);
	if (buf_it_end(buf, &buf->pos) ||
	    buf_it_iovbase(buf, &buf->pos) == NULL) {
		sz = hint ? min(hint, _4K) : _4K;
		sz = buf_it_realloc(buf, &buf->pos, sz);
		if (sz < 0)
			return sz;
	}
	sz = __read(fd, req, hint);
	if (sz < 0) {
		if (sz == -EAGAIN)
			/* Yes, on Linux it is possible to observe
			 * spurious readiness notifications, when
			 * pollers see data available, but recv would
			 * block. See man 2 select, BUGS section.
			 */
			return 0;
	} else if (sz == 0) {
		/* Here we reuse ESHUTDOWN for indicating EOF since read()
		 * or write() never returns it and we can't mixed it up.
		 */
		return -ESHUTDOWN;
	}

	return sz;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x130(%rax), %rax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x57a0
cmpl $0x0, %eax
jne 0x5d59
jmp 0x5d78
leaq 0x1917(%rip), %rdi      # 0x7677
leaq 0x1769(%rip), %rsi      # 0x74d0
movl $0x1c3, %edx            # imm = 0x1C3
leaq 0x1a07(%rip), %rcx      # 0x777a
callq 0x10d0
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
callq 0x4df0
testb $0x1, %al
jne 0x5daa
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
callq 0x4e50
cmpq $0x0, %rax
jne 0x5e0e
cmpl $0x0, -0x20(%rbp)
je 0x5dd3
cmpl $0x1000, -0x20(%rbp)    # imm = 0x1000
jge 0x5dc1
movl -0x20(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x5dcb
movl $0x1000, %eax           # imm = 0x1000
movl %eax, -0x24(%rbp)
jmp 0x5dcb
movl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x5ddd
movl $0x1000, %eax           # imm = 0x1000
movl %eax, -0x28(%rbp)
jmp 0x5ddd
movl -0x28(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
movslq -0x1c(%rbp), %rdx
callq 0x4e80
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x5e0c
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x5e4f
jmp 0x5e0e
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
movslq -0x20(%rbp), %rdx
callq 0x5f20
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x5e38
cmpl $-0xb, -0x1c(%rbp)
jne 0x5e36
movl $0x0, -0x4(%rbp)
jmp 0x5e4f
jmp 0x5e49
cmpl $0x0, -0x1c(%rbp)
jne 0x5e47
movl $0xffffff94, -0x4(%rbp) # imm = 0xFFFFFF94
jmp 0x5e4f
jmp 0x5e49
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: can_complete_rd
static bool can_complete_rd(struct io_buf *buf, size_t sz)
{
	size_t hint = buf->__proto.read_hint;

	if (hint == 0)
		/*
		 * No hint from proto, so we care only about vari length tail,
		 * which should be completed immediately.  If this is not a
		 * vari length - just check have we reached the end or not.
		 */
		return buf_it_vari_len_tail(buf, &buf->pos) ||
		       buf_it_end(buf, &buf->pos);
	else if (buf_it_vari_len_tail(buf, &buf->pos))
		/*
		 * Proto hinted us, and we are on vari length tail, that means
		 * we must absorb what was told by the proto to have a package
		 * of exact size.
		 */
		return buf_pos(buf) == hint;
	else
		/*
		 * Even proto hinted us we have to follow restriction of the
		 * package and reach the end.
		 */
		return buf_it_end(buf, &buf->pos);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x130(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x5ec7
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
callq 0x4f40
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x21(%rbp)
jne 0x5ebd
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
callq 0x4df0
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x5f13
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
callq 0x4f40
testb $0x1, %al
jne 0x5ee1
jmp 0x5efa
movq -0x10(%rbp), %rdi
callq 0x3890
cltq
cmpq -0x20(%rbp), %rax
sete %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x5f13
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
callq 0x4df0
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: _read
static int __read(int fd, struct io_req *req, size_t len)
{
	int ret, iovlen;
	void *dst;
	struct io_buf *buf = &req->buf;
	struct iovec_iter end = END_IT(buf);

	if (SIMULATE_1_BYTE_RDWR)
		len = 1;

	iovlen = buf_it_iovlen(buf, &buf->pos, &end);
	len = len ? min(len, iovlen) : iovlen;
	dst = buf_it_iovbase(buf, &buf->pos);

	/* Firstly consume stash */
	ret = read_from_stash(req->q, dst, len);
	if (!ret)
		ret = SAFE_CALL(read(fd, dst, len));

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x3810
testb $0x1, %al
jne 0x5f4e
jmp 0x5f67
movq -0x30(%rbp), %rax
movq 0x120(%rax), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
jmp 0x5f9c
movq -0x30(%rbp), %rax
movq 0x120(%rax), %rax
subq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x120(%rcx), %rcx
subq $0x1, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
leaq -0x40(%rbp), %rdx
callq 0x4ca0
movl %eax, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x5fe7
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jae 0x5fd5
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x5fdd
movslq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x5fef
movslq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
callq 0x4e50
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x6090
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x6083
jmp 0x602f
movl -0x4(%rbp), %edi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x1130
movl %eax, -0x44(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x44(%rbp)
movb %al, -0x59(%rbp)
jge 0x605b
callq 0x1050
cmpl $0x4, (%rax)
sete %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0x602f
cmpl $0x0, -0x44(%rbp)
jge 0x6077
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: read_from_stash
static int read_from_stash(struct io_queue *q, void *dst, size_t len)
{
	if (q->stash.iov_len) {
		assert(q->stash_pos < q->stash.iov_len);
		len = min(q->stash.iov_len - q->stash_pos, len);
		memcpy(dst, q->stash.iov_base + q->stash_pos, len);
		q->stash_pos += len;
		if (q->stash.iov_len == q->stash_pos) {
			/* Stash fully consumed */
			q->stash.iov_len = 0;
			q->stash_pos = 0;
		}
	} else
		len = 0;

	return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x160(%rax)
je 0x61a8
movq -0x8(%rbp), %rax
movq 0x168(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x160(%rcx), %rax
jae 0x60d0
jmp 0x60ef
leaq 0x16c5(%rip), %rdi      # 0x779c
leaq 0x13f2(%rip), %rsi      # 0x74d0
movl $0x18c, %edx            # imm = 0x18C
leaq 0x16d2(%rip), %rcx      # 0x77bc
callq 0x10d0
movq -0x8(%rbp), %rax
movq 0x160(%rax), %rax
movq -0x8(%rbp), %rcx
subq 0x168(%rcx), %rax
cmpq -0x18(%rbp), %rax
jae 0x6127
movq -0x8(%rbp), %rax
movq 0x160(%rax), %rax
movq -0x8(%rbp), %rcx
subq 0x168(%rcx), %rax
movq %rax, -0x20(%rbp)
jmp 0x612f
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x158(%rax), %rsi
movq -0x8(%rbp), %rax
addq 0x168(%rax), %rsi
movq -0x18(%rbp), %rdx
callq 0x1170
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
addq 0x168(%rax), %rcx
movq %rcx, 0x168(%rax)
movq -0x8(%rbp), %rax
movq 0x160(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x168(%rcx), %rax
jne 0x61a6
movq -0x8(%rbp), %rax
movq $0x0, 0x160(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x168(%rax)
jmp 0x61b0
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: _poller_set
static int __poller_set(void *poller, struct poller_item *item, int new_events)
{
	int rc = 0, old_events = item->events;

	if (new_events ^ old_events) {
		item->events = new_events;
		if (old_events && new_events)
			rc = __poller_ctl(poller, P_CTL_MOD, item);
		else if (!old_events && new_events)
			rc = __poller_ctl(poller, P_CTL_ADD, item);
		else
			rc = __poller_ctl(poller, P_CTL_DEL, item);
	}

	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
xorl -0x1c(%rbp), %eax
cmpl $0x0, %eax
je 0x6255
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
cmpl $0x0, -0x1c(%rbp)
je 0x621c
cmpl $0x0, -0x14(%rbp)
je 0x621c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0x1, %esi
callq 0x6260
movl %eax, -0x18(%rbp)
jmp 0x6253
cmpl $0x0, -0x1c(%rbp)
jne 0x623c
cmpl $0x0, -0x14(%rbp)
je 0x623c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
xorl %esi, %esi
callq 0x6260
movl %eax, -0x18(%rbp)
jmp 0x6251
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0x2, %esi
callq 0x6260
movl %eax, -0x18(%rbp)
jmp 0x6253
jmp 0x6255
movl -0x18(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: _poller_set_prewait
static int __poller_set_prewait(void *poller, struct poller_item *item)
{
	struct io_queue *q;
	struct io_req *req;

	/*
	 * Take first request from the queue and update prewait callback.
	 */

	q = container_of(item, struct io_queue, item);
	req = list_first_entry_or_null(&q->queue, struct io_req, list);
	if (!req || (req->flags & REQ_WR))
		return 0;

	item->prewait = prewait_check_stash;

	return poller_set_prewait(poller, item);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
callq 0x42d0
cmpl $0x0, %eax
jne 0x63e2
movq -0x20(%rbp), %rax
movq 0x138(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x63ea
xorl %eax, %eax
movq %rax, -0x50(%rbp)
jmp 0x63ea
movq -0x50(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x6408
movq -0x28(%rbp), %rax
movl 0x20(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x6411
movl $0x0, -0x4(%rbp)
jmp 0x6433
movq -0x18(%rbp), %rax
leaq 0x24(%rip), %rcx        # 0x6440
movq %rcx, 0x120(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x6870
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: prewait_check_stash
static int prewait_check_stash(void *poller, struct poller_item *item)
{
	struct io_queue *q;

	q = container_of(item, struct io_queue, item);
	if ((item->events & P_IN) && is_stashed(q))
		item->revents |= P_IN;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x6497
movq -0x18(%rbp), %rdi
callq 0x4620
testb $0x1, %al
jne 0x648a
jmp 0x6497
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0x8(%rax)
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/poller.c
// Function: poller_create
int poller_create(void **p)
{
	int rc;
	struct poller *poller;

	poller = malloc(sizeof(*poller));
	if (poller == NULL)
		return -ENOMEM;
	INIT_LIST_HEAD(&poller->prew_list);
	poller->epollfd = epoll_create1(0);
	if (poller->epollfd < 0) {
		rc = -errno;
		free(poller);

		return rc;
	}
	*p = poller;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x18, %edi
callq 0x1190
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x64ca
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x6521
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x6530
xorl %edi, %edi
callq 0x11e0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
jge 0x650f
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x14(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1040
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6521
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/poller.c
// Function: poller_destroy
void poller_destroy(void *p)
{
	struct poller *poller = p;

	if (poller) {
		del_prewaits(poller);
		close(poller->epollfd);
		free(poller);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x6598
movq -0x10(%rbp), %rdi
callq 0x65a0
movq -0x10(%rbp), %rax
movl (%rax), %edi
callq 0x1100
movq -0x10(%rbp), %rdi
callq 0x1040
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/poller.c
// Function: poller_ctl
int poller_ctl(void *p, int op, struct poller_item *item)
{
	int rc, eop;
	struct poller *poller = p;
	struct epoll_event epollev;

	if (poller == NULL)
		return -EINVAL;
	eop = to_epoll_op(op);
	if (eop < 0)
		return eop;
	if (op == P_CTL_DEL || item->prewait == NULL)
		del_prewait(poller, item);

	epollev = (struct epoll_event){
		.events   = to_epoll_events(item->events),
		.data.ptr = item,
	};
	rc = epoll_ctl(poller->epollfd, eop, item->fd, &epollev);

	return (rc >= 0 ? rc : -errno);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x666e
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x670e
movl -0x14(%rbp), %edi
callq 0x6720
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jge 0x668a
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x670e
cmpl $0x2, -0x14(%rbp)
je 0x669e
movq -0x20(%rbp), %rax
cmpq $0x0, 0x120(%rax)
jne 0x66ab
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x6780
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x6820
movl %eax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x44(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x3c(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rax
movl (%rax), %edi
movl -0x28(%rbp), %esi
movq -0x20(%rbp), %rax
movl (%rax), %edx
leaq -0x3c(%rbp), %rcx
callq 0x1110
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x66f9
movl -0x24(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0x6708
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/poller.c
// Function: to_epoll_op
static int to_epoll_op(int op)
{
	int epollop = 0;

	if (op == P_CTL_ADD)
		epollop = EPOLL_CTL_ADD;
	else if (op == P_CTL_MOD)
		epollop = EPOLL_CTL_MOD;
	else if (op == P_CTL_DEL)
		epollop = EPOLL_CTL_DEL;
	else
		return -EINVAL;

	return epollop;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x0, -0x8(%rbp)
jne 0x673d
movl $0x1, -0xc(%rbp)
jmp 0x6768
cmpl $0x1, -0x8(%rbp)
jne 0x674c
movl $0x3, -0xc(%rbp)
jmp 0x6766
cmpl $0x2, -0x8(%rbp)
jne 0x675b
movl $0x2, -0xc(%rbp)
jmp 0x6764
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x676e
jmp 0x6766
jmp 0x6768
movl -0xc(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/poller.c
// Function: del_prewait
static void del_prewait(struct poller *poller, struct poller_item *item)
{
	int i, prews_num = item->prews_num;
	struct prewait *prew;

	for (i = 0; i < ARRAY_SIZE(item->prews) && prews_num; i++) {
		prew = &item->prews[i];
		if (prew->poller)
			prews_num--;
		if (poller == prew->poller) {
			__del_prewait(prew);
			break;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x14(%rbp)
movslq -0x14(%rbp), %rcx
xorl %eax, %eax
cmpq $0x8, %rcx
movb %al, -0x21(%rbp)
jae 0x67ba
cmpl $0x0, -0x18(%rbp)
setne %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x67c3
jmp 0x6812
movq -0x10(%rbp), %rax
addq $0x20, %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
je 0x67ed
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq (%rcx), %rax
jne 0x6805
movq -0x20(%rbp), %rdi
callq 0x6d90
jmp 0x6812
jmp 0x6807
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x67a1
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/poller.c
// Function: to_epoll_events
static int to_epoll_events(int ev)
{
	int epollev = 0;

	if (ev & P_IN)
		epollev |= EPOLLIN;
	if (ev & P_OUT)
		epollev |= EPOLLOUT;
	if (ev & P_ERR)
		epollev |= EPOLLERR;

	return epollev;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
movl -0x4(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x6842
movl -0x8(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x6856
movl -0x8(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x686a
movl -0x8(%rbp), %eax
orl $0x8, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/poller.c
// Function: poller_set_prewait
int poller_set_prewait(void *p, struct poller_item *item)
{
	int rc = 0;
	struct poller *poller = p;

	if (item->prewait == NULL)
		del_prewait(poller, item);
	else if (item->prewait) {
		/*
		 * Item with a prewait action is a special case:
		 * it can belong to a limit amount of pollers,
		 * thus we have to check and return an error if
		 * no buffers left.
		 */
		rc = add_prewait(poller, item);
	}

	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x120(%rax)
jne 0x68ac
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6780
jmp 0x68cc
movq -0x10(%rbp), %rax
cmpq $0x0, 0x120(%rax)
je 0x68ca
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x68e0
movl %eax, -0x14(%rbp)
jmp 0x68cc
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/poller.c
// Function: add_prewait
static int add_prewait(struct poller *poller, struct poller_item *item)
{
	int i, prews_num = item->prews_num;
	struct prewait *prew, *empty = NULL;

	if (prews_num >= ARRAY_SIZE(item->prews))
		return -ENOBUFS;
	for (i = 0; i < ARRAY_SIZE(item->prews); i++) {
		prew = &item->prews[i];
		if (poller == prew->poller)
			/* Already added */
			return 0;
		if (prew->poller) {
			assert(prews_num);
			prews_num -= 1;
		}
		else if (empty == NULL)
			empty = prew;
		if (!prews_num && empty)
			break;
	}
	assert(empty);
	empty->poller = poller;
	empty->item = item;
	list_add_tail(&empty->list, &poller->prew_list);
	item->prews_num += 1;
	assert(item->prews_num <= ARRAY_SIZE(item->prews));

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
movslq -0x20(%rbp), %rax
cmpq $0x8, %rax
jb 0x6918
movl $0xffffff97, -0x4(%rbp) # imm = 0xFFFFFF97
jmp 0x6a60
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
cmpq $0x8, %rax
jae 0x69c9
movq -0x18(%rbp), %rax
addq $0x20, %rax
movslq -0x1c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jne 0x695d
movl $0x0, -0x4(%rbp)
jmp 0x6a60
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
je 0x6999
cmpl $0x0, -0x20(%rbp)
je 0x696f
jmp 0x698e
leaq 0xef9(%rip), %rdi       # 0x786f
leaq 0xefc(%rip), %rsi       # 0x7879
movl $0x51, %edx
leaq 0xf1e(%rip), %rcx       # 0x78a7
callq 0x10d0
movl -0x20(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x69aa
cmpq $0x0, -0x30(%rbp)
jne 0x69a8
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x69aa
cmpl $0x0, -0x20(%rbp)
jne 0x69b9
cmpq $0x0, -0x30(%rbp)
je 0x69b9
jmp 0x69c9
jmp 0x69bb
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x691f
cmpq $0x0, -0x30(%rbp)
je 0x69d2
jmp 0x69f1
leaq 0xf05(%rip), %rdi       # 0x78de
leaq 0xe99(%rip), %rsi       # 0x7879
movl $0x59, %edx
leaq 0xebb(%rip), %rcx       # 0x78a7
callq 0x10d0
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x6e70
movq -0x18(%rbp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movq -0x18(%rbp), %rax
movslq 0x18(%rax), %rax
cmpq $0x8, %rax
ja 0x6a3a
jmp 0x6a59
leaq 0xea3(%rip), %rdi       # 0x78e4
leaq 0xe31(%rip), %rsi       # 0x7879
movl $0x5e, %edx
leaq 0xe53(%rip), %rcx       # 0x78a7
callq 0x10d0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/poller.c
// Function: poller_wait
int poller_wait(void *p, struct poller_item **pitems, int num, int timeout)
{
	int rc, i;
	struct poller *poller = p;
	struct epoll_event epollevs[num];
	struct poller_item *item;

	if (poller == NULL)
		return -EINVAL;

	rc = call_prewaits(poller, pitems, num);
	if (rc)
		return rc;
	rc = epoll_wait(poller->epollfd, epollevs, num, tv_to_poll(timeout));
	if (rc > 0) {
		for (i = 0; i < rc; i++) {
			item = (struct poller_item *)epollevs[i].data.ptr;
			item->revents = from_epoll_events(epollevs[i].events);
			pitems[i] = item;
		}
	}

	return (rc >= 0 ? rc : -errno);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x1c(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x38(%rbp)
leaq (%rax,%rax,2), %rcx
leaq 0xf(,%rcx,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x58(%rbp)
movq %rcx, %rsp
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x6ad3
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
movl $0x1, -0x4c(%rbp)
jmp 0x6bba
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x6bd0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x6afe
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x4c(%rbp)
jmp 0x6bba
movq -0x30(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x60(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x20(%rbp), %edi
callq 0x6ce0
movl -0x60(%rbp), %edi
movq -0x58(%rbp), %rsi
movl -0x5c(%rbp), %edx
movl %eax, %ecx
callq 0x11c0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jle 0x6b90
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x6b8e
movq -0x58(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0xc, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq 0x4(%rcx), %rcx
movq %rcx, -0x48(%rbp)
movslq -0x28(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edi
callq 0x6d10
movl %eax, %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x48(%rbp), %rdx
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x6b36
jmp 0x6b90
cmpl $0x0, -0x24(%rbp)
jl 0x6b9e
movl -0x24(%rbp), %eax
movl %eax, -0x64(%rbp)
jmp 0x6bad
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, %rsp
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/poller.c
// Function: call_prewaits
static int call_prewaits(struct poller *poller, struct poller_item **pitems,
			 int num)
{
	int i, rc;
	struct prewait *prew;

	if (num == 0)
		return 0;

	i = 0;
	list_for_each_entry(prew, &poller->prew_list, list) {
		prew->item->revents = 0;
		rc = prew->item->prewait(poller, prew->item);
		if (rc)
			return rc;
		if (prew->item->revents) {
			pitems[i++] = prew->item;
			if (i == num)
				break;
		}
	}

	return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x6bf5
movl $0x0, -0x4(%rbp)
jmp 0x6cd7
movl $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
addq $-0x10, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x10, %rax
movq -0x10(%rbp), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x6cd1
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x0, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x120(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rsi
callq *%rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x6c72
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6cd7
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x8(%rax)
je 0x6caa
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x6ca8
jmp 0x6cd1
jmp 0x6caa
jmp 0x6cac
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
addq $-0x10, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x6c1c
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/poller.c
// Function: from_epoll_events
static int from_epoll_events(int epollev)
{
	int ev = 0;

	if (epollev & EPOLLIN)
		ev |= P_IN;
	if (epollev & EPOLLOUT)
		ev |= P_OUT;
	if (epollev & EPOLLERR)
		ev |= P_ERR;

	return ev;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
movl -0x4(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x6d32
movl -0x8(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x6d46
movl -0x8(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x6d5a
movl -0x8(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
popq %rbp
retq
nop