LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp-test.c
// Function: bh_execute
static void bh_execute(struct loop_ctx *ctx)
{
	struct peer *peer, *tmp;

	list_for_each_entry_safe(peer, tmp, &ctx->peers_to_free, list) {
		zmtp_deinit(&peer->zmtp);
		io_queue_unbind(&peer->q);
		io_queue_deinit(&peer->q);
		close(peer->psock);
		list_del(&peer->list);
		free(peer);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x270(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
addq $0x270, %rcx            # imm = 0x270
cmpq %rcx, %rax
je 0x190a
movq -0x10(%rbp), %rdi
addq $0x190, %rdi            # imm = 0x190
callq 0x2370
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
callq 0x44f0
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
callq 0x41a0
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x1100
movq -0x10(%rbp), %rdi
callq 0x2220
movq -0x10(%rbp), %rdi
callq 0x1040
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x1886
addq $0x50, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp-test.c
// Function: on_signal
static int on_signal(void *poller, struct poller_item *item)
{
	ssize_t rd;
	struct signalfd_siginfo fdsi;

	while (1) {
		rd = read(item->fd, &fdsi, sizeof(fdsi));
		if (rd < 0 && errno == EAGAIN) {
			return 0;
		}
		else if (rd != sizeof(fdsi)) {
			/* Consider as fatal error */
			assert(0);
			return -1;
		}

		switch (fdsi.ssi_signo) {
		case SIGINT:
		case SIGTERM:
			/* Stop further processing, termination requested */
			return 1;
		default:
			assert(0);
			return -1;
		}
	}

	/* Unreachable line */
	assert(0);
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %edi
leaq -0xa0(%rbp), %rsi
movl $0x80, %edx
callq 0x1130
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jge 0x19c8
callq 0x1050
cmpl $0xb, (%rax)
jne 0x19c8
movl $0x0, -0x4(%rbp)
jmp 0x1a3b
cmpq $0x80, -0x20(%rbp)
je 0x19f1
leaq 0x5cb0(%rip), %rdi      # 0x7689
leaq 0x5709(%rip), %rsi      # 0x70e9
movl $0xbb, %edx
leaq 0x57a8(%rip), %rcx      # 0x7194
callq 0x10d0
jmp 0x19f3
movl -0xa0(%rbp), %eax
movl %eax, -0xa4(%rbp)
subl $0x2, %eax
je 0x1a13
jmp 0x1a06
movl -0xa4(%rbp), %eax
subl $0xf, %eax
jne 0x1a1c
jmp 0x1a13
movl $0x1, -0x4(%rbp)
jmp 0x1a3b
leaq 0x5c66(%rip), %rdi      # 0x7689
leaq 0x56bf(%rip), %rsi      # 0x70e9
movl $0xc5, %edx
leaq 0x575e(%rip), %rcx      # 0x7194
callq 0x10d0
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp.c
// Function: zmtp_init_REP
static int zmtp_init_REP(struct zmtp *zmtp, struct io_queue *q)
{
	*zmtp = (struct zmtp){
		.inner_state = ZMTP_UNKNOWN,
		.io_proto = {
			.on_submit = on_proto_submit_REP,
		},
	};

	return io_queue_set_proto(q, &zmtp->io_proto);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x10e0
movq -0x48(%rbp), %rdi
leaq 0x5d(%rip), %rax        # 0x23a0
movq %rax, -0x30(%rbp)
movl $0x0, -0x18(%rbp)
leaq -0x40(%rbp), %rsi
movl $0x30, %edx
callq 0x1170
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x4860
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp.c
// Function: on_proto_submit_REP
static int on_proto_submit_REP(struct io_proto *p, struct io_req *req)
{
	struct io_req *hdr_req;
	struct zmtp *zmtp;
	int rc;

	zmtp = container_of(p, struct zmtp, io_proto);
	if (zmtp->inner_state == ZMTP_REP_CLOSED)
		/* That's all folks */
		return -ENOTCONN;

	if (req->flags & REQ_WR)
		hdr_req = zmtp_create_wr_hdr_req(zmtp, req);
	else
		hdr_req = zmtp_create_rd_hdr_req(zmtp);

	if (hdr_req == NULL)
		return -ENOMEM;

	rc = zmtp->io_proto.submit(hdr_req, TO_TAIL);
	if (rc)
		return rc;

	if (zmtp->inner_state == ZMTP_UNKNOWN)
		/* Start greeting */
		return zmtp_start_greeting_REP(zmtp);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x2, 0x28(%rax)
jne 0x23de
movl $0xffffff95, -0x4(%rbp) # imm = 0xFFFFFF95
jmp 0x2460
movq -0x18(%rbp), %rax
movl 0x20(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2400
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2470
movq %rax, -0x20(%rbp)
jmp 0x240d
movq -0x28(%rbp), %rdi
callq 0x24e0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x241d
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x2460
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq *%rax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x2441
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2460
movq -0x28(%rbp), %rax
cmpl $0x0, 0x28(%rax)
jne 0x2459
movq -0x28(%rbp), %rdi
callq 0x2540
movl %eax, -0x4(%rbp)
jmp 0x2460
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp.c
// Function: zmtp_create_wr_hdr_req
static struct io_req *zmtp_create_wr_hdr_req(struct zmtp *zmtp,
					     struct io_req *wr_req)
{
	struct io_req *req;

	req = io_req_create(zmtp->io_proto.q, REQ_WR, zmtp, on_send__REP);
	if (req == NULL)
		return NULL;
	zmtp_init_wr_hdr_req(zmtp, req, wr_req);

	return req;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
movl $0x1, %esi
leaq 0x1b9(%rip), %rcx       # 0x2650
callq 0x4b00
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x24b1
movq $0x0, -0x8(%rbp)
jmp 0x24ca
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x2680
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp.c
// Function: zmtp_create_rd_hdr_req
static struct io_req *zmtp_create_rd_hdr_req(struct zmtp *zmtp)
{
	struct io_req *req;

	req = io_req_create(zmtp->io_proto.q, REQ_RD, zmtp, on_recv__REP);
	if (req == NULL)
		return NULL;
	zmtp_init_rd_hdr_req(zmtp, req);

	return req;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
xorl %esi, %esi
leaq 0x3c0(%rip), %rcx       # 0x28c0
callq 0x4b00
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x251a
movq $0x0, -0x8(%rbp)
jmp 0x252f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2a70
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp.c
// Function: zmtp_start_greeting_REP
static int zmtp_start_greeting_REP(struct zmtp *zmtp)
{
	struct io_req *wr_req;
	int rc;

	/*
	 * Start greeting for ZMTP_REP, send only the signature.
	 */

	assert(zmtp->inner_state == ZMTP_UNKNOWN);
	wr_req = io_req_create(zmtp->io_proto.q, REQ_WR, zmtp,
			       on_greet_1_sign_send__REP);
	if (wr_req == NULL)
		return -ENOMEM;
	wr_req->buf = (struct io_buf){
		.iov[0] = {
			.iov_base = &sign_and_maj,
			.iov_len  = sizeof(sign_and_maj)
		},
		.iov_num  = 1,
	};
	rc = zmtp->io_proto.submit(wr_req, TO_HEAD);
	if (rc) {
		io_req_put(wr_req);

		return rc;
	}
	zmtp->inner_state = ZMTP_REP_CONNECTED;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x28(%rax)
jne 0x255b
jmp 0x257a
leaq 0x4df9(%rip), %rdi      # 0x735b
leaq 0x4d0f(%rip), %rsi      # 0x7278
movl $0x2cc, %edx            # imm = 0x2CC
leaq 0x4e08(%rip), %rcx      # 0x737d
callq 0x10d0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
movl $0x1, %esi
leaq 0x86f(%rip), %rcx       # 0x2e00
callq 0x4b00
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x25ad
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x2644
movq -0x18(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x170(%rbp)
leaq -0x168(%rbp), %rdi
xorl %esi, %esi
movl $0x148, %edx            # imm = 0x148
callq 0x10e0
movq -0x170(%rbp), %rdi
leaq 0x8b7f(%rip), %rax      # 0xb15c
movq %rax, -0x168(%rbp)
movq $0xb, -0x160(%rbp)
movq $0x1, -0x48(%rbp)
leaq -0x168(%rbp), %rsi
movl $0x148, %edx            # imm = 0x148
callq 0x1170
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq *%rax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x2632
movq -0x18(%rbp), %rdi
callq 0x4bb0
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2644
movq -0x10(%rbp), %rax
movl $0x1, 0x28(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp.c
// Function: zmtp_init_rd_hdr_req
static void zmtp_init_rd_hdr_req(struct zmtp *zmtp, struct io_req *req)
{
	buf_free(&req->buf);
	req->buf = (struct io_buf){
		.iov[0] = {
			.iov_base = &zmtp->hdr.flags,
			.iov_len  = 1
		},
		.iov_num  = 1,
	};
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
callq 0x3830
movq -0x10(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x160(%rbp)
leaq -0x158(%rbp), %rdi
xorl %esi, %esi
movl $0x148, %edx            # imm = 0x148
callq 0x10e0
movq -0x160(%rbp), %rdi
movq -0x8(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x158(%rbp)
movq $0x1, -0x150(%rbp)
movq $0x1, -0x38(%rbp)
leaq -0x158(%rbp), %rsi
movl $0x148, %edx            # imm = 0x148
callq 0x1170
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp.c
// Function: on_greet_1_sign_send__REP
static int on_greet_1_sign_send__REP(struct io_req *req, int len)
{
	struct zmtp *zmtp = req->data;
	struct io_req *rd_req;
	int rc;

	/*
	 * Signature is sent, recv a peer signature
	 */

	if (len < 0)
		goto out;
	rd_req = io_req_create(zmtp->io_proto.q, REQ_RD, zmtp,
			       on_greet_1_sign_recv__REP);
	if (rd_req == NULL) {
		len = -ENOMEM;
		goto out;
	}
	rd_req->buf = (struct io_buf){
		.iov[0] = {
			.iov_len  = sizeof(sign_and_maj)
		},
		.iov_num  = 1,
	};
	rc = zmtp->io_proto.submit(rd_req, TO_HEAD);
	if (rc) {
		io_req_put(rd_req);
		len = rc;
		goto out;
	}

out:
	io_req_put(req);
	if (len < 0)
		zmtp->inner_state = ZMTP_REP_CLOSED;

	return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x2e29
jmp 0x2ecf
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
xorl %esi, %esi
leaq 0xc3(%rip), %rcx        # 0x2f00
callq 0x4b00
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x2e56
movl $0xfffffff4, -0xc(%rbp) # imm = 0xFFFFFFF4
jmp 0x2ecf
movq -0x20(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x178(%rbp)
leaq -0x170(%rbp), %rdi
xorl %esi, %esi
movl $0x148, %edx            # imm = 0x148
callq 0x10e0
movq -0x178(%rbp), %rdi
movq $0xb, -0x168(%rbp)
movq $0x1, -0x50(%rbp)
leaq -0x170(%rbp), %rsi
movl $0x148, %edx            # imm = 0x148
callq 0x1170
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq *%rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x2ecd
movq -0x20(%rbp), %rdi
callq 0x4bb0
movl -0x24(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x2ecf
jmp 0x2ecf
movq -0x8(%rbp), %rdi
callq 0x4bb0
cmpl $0x0, -0xc(%rbp)
jge 0x2ee9
movq -0x18(%rbp), %rax
movl $0x2, 0x28(%rax)
movl -0xc(%rbp), %eax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp.c
// Function: on_greet_1_sign_recv__REP
static int on_greet_1_sign_recv__REP(struct io_req *req, int len)
{
	struct zmtp *zmtp = req->data;
	struct zmtp_header *hdr;
	int rc;

	/*
	 * Peer signature is received, validate and send the rest
	 */

	if (len < 0)
		goto out;

	/* Validate the signature */
	assert(len == sizeof(*hdr));
	hdr = req->buf.iov[0].iov_base;
	if (zmtp_signature_check(&hdr->sign, len)) {
		len = -EMSGSIZE;
		goto out;
	}

	switch (hdr->majv) {
	case 0x01:
		rc = zmtp_greet_v2_rest_send(zmtp);
		break;
	case 0x03:
		rc = zmtp_greet_v3_rest_send(zmtp);
		break;
	default:
		/* TODO: probably reply with some kind of ERROR? */
		len = -EMSGSIZE;
		goto out;
	}
	if (rc < 0)
		len = rc;

out:
	io_req_put(req);
	if (len < 0)
		zmtp->inner_state = ZMTP_REP_CLOSED;

	return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x2f26
jmp 0x2fc7
movslq -0xc(%rbp), %rax
cmpq $0xb, %rax
jne 0x2f32
jmp 0x2f51
leaq 0x446f(%rip), %rdi      # 0x73a8
leaq 0x4338(%rip), %rsi      # 0x7278
movl $0x27e, %edx            # imm = 0x27E
leaq 0x4470(%rip), %rcx      # 0x73bc
callq 0x10d0
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x2280
cmpl $0x0, %eax
je 0x2f78
movl $0xffffffa6, -0xc(%rbp) # imm = 0xFFFFFFA6
jmp 0x2fc7
movq -0x20(%rbp), %rax
movzbl 0xa(%rax), %eax
movl %eax, -0x28(%rbp)
subl $0x1, %eax
je 0x2f94
jmp 0x2f8a
movl -0x28(%rbp), %eax
subl $0x3, %eax
je 0x2fa2
jmp 0x2fb0
movq -0x18(%rbp), %rdi
callq 0x2ff0
movl %eax, -0x24(%rbp)
jmp 0x2fb9
movq -0x18(%rbp), %rdi
callq 0x30d0
movl %eax, -0x24(%rbp)
jmp 0x2fb9
movl $0xffffffa6, -0xc(%rbp) # imm = 0xFFFFFFA6
jmp 0x2fc7
cmpl $0x0, -0x24(%rbp)
jge 0x2fc5
movl -0x24(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x2fc7
movq -0x8(%rbp), %rdi
callq 0x4bb0
cmpl $0x0, -0xc(%rbp)
jge 0x2fe1
movq -0x18(%rbp), %rax
movl $0x2, 0x28(%rax)
movl -0xc(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp.c
// Function: zmtp_greet_v2_rest_send
static int zmtp_greet_v2_rest_send(struct zmtp *zmtp)
{
	struct io_req *wr_req;
	int rc;

	wr_req = io_req_create(zmtp->io_proto.q, REQ_WR, zmtp,
			       on_greet_v2_2_rest_send__REP);
	if (wr_req == NULL)
		return -ENOMEM;

	wr_req->buf = (struct io_buf){
		.iov[0] = {
			.iov_base = ZMTP_V2_REP_HS,
			.iov_len  = sizeof(ZMTP_V2_REP_HS)
		},
		.iov_num  = 1,
	};
	rc = zmtp->io_proto.submit(wr_req, TO_HEAD);
	if (rc) {
		io_req_put(wr_req);

		return rc;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
movl $0x1, %esi
leaq 0x19a(%rip), %rcx       # 0x31b0
callq 0x4b00
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3032
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x30be
movq -0x18(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x170(%rbp)
leaq -0x168(%rbp), %rdi
xorl %esi, %esi
movl $0x148, %edx            # imm = 0x148
callq 0x10e0
movq -0x170(%rbp), %rdi
leaq 0x8105(%rip), %rax      # 0xb167
movq %rax, -0x168(%rbp)
movq $0x3, -0x160(%rbp)
movq $0x1, -0x48(%rbp)
leaq -0x168(%rbp), %rsi
movl $0x148, %edx            # imm = 0x148
callq 0x1170
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq *%rax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x30b7
movq -0x18(%rbp), %rdi
callq 0x4bb0
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x30be
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp.c
// Function: zmtp_greet_v3_rest_send
static int zmtp_greet_v3_rest_send(struct zmtp *zmtp)
{
	struct io_req *wr_req;
	int rc;

	wr_req = io_req_create(zmtp->io_proto.q, REQ_WR, zmtp,
			       on_greet_v3_2_rest_send__REP);
	if (wr_req == NULL)
		return -ENOMEM;

	wr_req->buf = (struct io_buf){
		.iov[0] = {
			.iov_base = &v3_greet,
			.iov_len  = sizeof(v3_greet)
		},
		.iov_num  = 1,
	};
	rc = zmtp->io_proto.submit(wr_req, TO_HEAD);
	if (rc) {
		io_req_put(wr_req);

		return rc;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
movl $0x1, %esi
leaq 0x26a(%rip), %rcx       # 0x3360
callq 0x4b00
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3112
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x319e
movq -0x18(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x170(%rbp)
leaq -0x168(%rbp), %rdi
xorl %esi, %esi
movl $0x148, %edx            # imm = 0x148
callq 0x10e0
movq -0x170(%rbp), %rdi
leaq 0x802b(%rip), %rax      # 0xb16d
movq %rax, -0x168(%rbp)
movq $0x35, -0x160(%rbp)
movq $0x1, -0x48(%rbp)
leaq -0x168(%rbp), %rsi
movl $0x148, %edx            # imm = 0x148
callq 0x1170
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq *%rax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x3197
movq -0x18(%rbp), %rdi
callq 0x4bb0
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x319e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp.c
// Function: on_greet_v2_2_rest_send__REP
static int on_greet_v2_2_rest_send__REP(struct io_req *req, int len)
{
	struct zmtp *zmtp = req->data;
	struct io_req *rd_req;
	int rc;

	/*
	 * The rest is send, read the rest from the peer
	 */

	if (len < 0)
		goto out;
	rd_req = io_req_create(zmtp->io_proto.q, REQ_RD, zmtp,
			       on_greet_v2_2_rest_recv__REP);
	if (rd_req == NULL) {
		len = -ENOMEM;
		goto out;
	}
	rd_req->buf = (struct io_buf){
		.iov[0] = {
			.iov_len = sizeof(ZMTP_V2_REQ_HS)
		},
		.iov_num = 1,
	};
	rc = zmtp->io_proto.submit(rd_req, TO_HEAD);
	if (rc) {
		io_req_put(rd_req);
		len = rc;
		goto out;
	}

out:
	io_req_put(req);
	if (len < 0)
		zmtp->inner_state = ZMTP_REP_CLOSED;

	return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x31d9
jmp 0x327f
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
xorl %esi, %esi
leaq 0xc3(%rip), %rcx        # 0x32b0
callq 0x4b00
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x3206
movl $0xfffffff4, -0xc(%rbp) # imm = 0xFFFFFFF4
jmp 0x327f
movq -0x20(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x178(%rbp)
leaq -0x170(%rbp), %rdi
xorl %esi, %esi
movl $0x148, %edx            # imm = 0x148
callq 0x10e0
movq -0x178(%rbp), %rdi
movq $0x3, -0x168(%rbp)
movq $0x1, -0x50(%rbp)
leaq -0x170(%rbp), %rsi
movl $0x148, %edx            # imm = 0x148
callq 0x1170
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq *%rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x327d
movq -0x20(%rbp), %rdi
callq 0x4bb0
movl -0x24(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x327f
jmp 0x327f
movq -0x8(%rbp), %rdi
callq 0x4bb0
cmpl $0x0, -0xc(%rbp)
jge 0x3299
movq -0x18(%rbp), %rax
movl $0x2, 0x28(%rax)
movl -0xc(%rbp), %eax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp.c
// Function: on_greet_v2_2_rest_recv__REP
static int on_greet_v2_2_rest_recv__REP(struct io_req *req, int len)
{
	struct zmtp *zmtp = req->data;
	void *greet;

	/*
	 * The rest is received, validate version and recv the REQ hshake
	 */

	if (len < 0)
		goto out;

	/* Validate the rest greeting */
	assert(len == sizeof(ZMTP_V2_REQ_HS));
	greet = req->buf.iov[0].iov_base;
	if (memcmp(ZMTP_V2_REQ_HS, greet,  sizeof(ZMTP_V2_REQ_HS))) {
		len = -EMSGSIZE;
		goto out;
	}
out:
	io_req_put(req);
	if (len < 0)
		zmtp->inner_state = ZMTP_REP_CLOSED;

	return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x32d3
jmp 0x332f
movslq -0xc(%rbp), %rax
cmpq $0x3, %rax
jne 0x32df
jmp 0x32fe
leaq 0x410a(%rip), %rdi      # 0x73f0
leaq 0x3f8b(%rip), %rsi      # 0x7278
movl $0x220, %edx            # imm = 0x220
leaq 0x4115(%rip), %rcx      # 0x740e
callq 0x10d0
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rsi
leaq 0x7e55(%rip), %rdi      # 0xb16a
movl $0x3, %edx
callq 0x1140
cmpl $0x0, %eax
je 0x332d
movl $0xffffffa6, -0xc(%rbp) # imm = 0xFFFFFFA6
jmp 0x332f
jmp 0x332f
movq -0x8(%rbp), %rdi
callq 0x4bb0
cmpl $0x0, -0xc(%rbp)
jge 0x3349
movq -0x18(%rbp), %rax
movl $0x2, 0x28(%rax)
movl -0xc(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp.c
// Function: on_greet_v3_2_rest_send__REP
static int on_greet_v3_2_rest_send__REP(struct io_req *req, int len)
{
	struct zmtp *zmtp = req->data;
	struct io_req *rd_req;
	int rc;

	/*
	 * The rest is send, read the rest from the peer
	 */

	if (len < 0)
		goto out;
	rd_req = io_req_create(zmtp->io_proto.q, REQ_RD, zmtp,
			       on_greet_v3_2_rest_recv__REP);
	if (rd_req == NULL) {
		len = -ENOMEM;
		goto out;
	}
	rd_req->buf = (struct io_buf){
		.iov[0] = {
			.iov_len = sizeof(v3_greet)
		},
		.iov_num = 1,
	};
	rc = zmtp->io_proto.submit(rd_req, TO_HEAD);
	if (rc) {
		io_req_put(rd_req);
		len = rc;
		goto out;
	}

out:
	io_req_put(req);
	if (len < 0)
		zmtp->inner_state = ZMTP_REP_CLOSED;

	return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x3389
jmp 0x342f
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
xorl %esi, %esi
leaq 0xc3(%rip), %rcx        # 0x3460
callq 0x4b00
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x33b6
movl $0xfffffff4, -0xc(%rbp) # imm = 0xFFFFFFF4
jmp 0x342f
movq -0x20(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x178(%rbp)
leaq -0x170(%rbp), %rdi
xorl %esi, %esi
movl $0x148, %edx            # imm = 0x148
callq 0x10e0
movq -0x178(%rbp), %rdi
movq $0x35, -0x168(%rbp)
movq $0x1, -0x50(%rbp)
leaq -0x170(%rbp), %rsi
movl $0x148, %edx            # imm = 0x148
callq 0x1170
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq *%rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x342d
movq -0x20(%rbp), %rdi
callq 0x4bb0
movl -0x24(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x342f
jmp 0x342f
movq -0x8(%rbp), %rdi
callq 0x4bb0
cmpl $0x0, -0xc(%rbp)
jge 0x3449
movq -0x18(%rbp), %rax
movl $0x2, 0x28(%rax)
movl -0xc(%rbp), %eax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp.c
// Function: on_greet_v3_2_rest_recv__REP
static int on_greet_v3_2_rest_recv__REP(struct io_req *req, int len)
{
	struct zmtp *zmtp = req->data;
	struct io_req *rd_req;
	struct zmtp_greeting_v3 *greet;
	int rc;

	/*
	 * The rest is received, validate version and recv the REQ hshake
	 */

	if (len < 0)
		goto out;

	/* Validate the rest greeting */
	assert(len == sizeof(*greet));
	greet = req->buf.iov[0].iov_base;
	if (memcmp(&v3_greet, greet,  sizeof(*greet))) {
		len = -EMSGSIZE;
		goto out;
	}

	rd_req = io_req_create(zmtp->io_proto.q, REQ_RD, zmtp,
			       on_greet_v3_3_hshake_recv__REP);
	if (rd_req == NULL) {
		len = -ENOMEM;
		goto out;
	}
	/*
	 * TODO: probably we need generic function for that,
	 * TODO: like zmtp_init_rd_hdr_req() already does.
	 */
	rd_req->buf = (struct io_buf){
		.iov[0] = {
			.iov_len  = 1 /* Flag field to determin the size */
		},
		.iov_num  = 1,
	};
	rc = zmtp->io_proto.submit(rd_req, TO_HEAD);
	if (rc) {
		io_req_put(rd_req);
		len = rc;
		goto out;
	}

out:
	io_req_put(req);
	if (len < 0)
		zmtp->inner_state = ZMTP_REP_CLOSED;

	return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x3489
jmp 0x358c
movslq -0xc(%rbp), %rax
cmpq $0x35, %rax
jne 0x3495
jmp 0x34b4
leaq 0x3fa9(%rip), %rdi      # 0x7445
leaq 0x3dd5(%rip), %rsi      # 0x7278
movl $0x1ab, %edx            # imm = 0x1AB
leaq 0x3fac(%rip), %rcx      # 0x745b
callq 0x10d0
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rsi
leaq 0x7ca2(%rip), %rdi      # 0xb16d
movl $0x35, %edx
callq 0x1140
cmpl $0x0, %eax
je 0x34e6
movl $0xffffffa6, -0xc(%rbp) # imm = 0xFFFFFFA6
jmp 0x358c
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
xorl %esi, %esi
leaq 0xc6(%rip), %rcx        # 0x35c0
callq 0x4b00
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x3513
movl $0xfffffff4, -0xc(%rbp) # imm = 0xFFFFFFF4
jmp 0x358c
movq -0x20(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x180(%rbp)
leaq -0x178(%rbp), %rdi
xorl %esi, %esi
movl $0x148, %edx            # imm = 0x148
callq 0x10e0
movq -0x180(%rbp), %rdi
movq $0x1, -0x170(%rbp)
movq $0x1, -0x58(%rbp)
leaq -0x178(%rbp), %rsi
movl $0x148, %edx            # imm = 0x148
callq 0x1170
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq *%rax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x358a
movq -0x20(%rbp), %rdi
callq 0x4bb0
movl -0x2c(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x358c
jmp 0x358c
movq -0x8(%rbp), %rdi
callq 0x4bb0
cmpl $0x0, -0xc(%rbp)
jge 0x35a6
movq -0x18(%rbp), %rax
movl $0x2, 0x28(%rax)
movl -0xc(%rbp), %eax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp.c
// Function: on_greet_v3_3_hshake_recv__REP
static int on_greet_v3_3_hshake_recv__REP(struct io_req *req, int len)
{
	struct zmtp *zmtp = req->data;
	struct io_req *wr_req;
	int rc;

	/*
	 * Receive full hshake, validate and send our hshake
	 */

	if (len < 0)
		goto out;

	rc = zmtp_expect_msg(zmtp, req, true, NULL);
	if (rc < 0) {
		len = rc;
		goto out;
	}
	if (rc == 0)
		/* Package is not fully received, continue */
		return 0;

	rc = zmtp_parse_hshake(req, ZMTP_REP);
	if (rc < 0) {
		/* TODO: probably respond with ERROR? */
		len = rc;
		goto out;
	}

	/*
	 * Send hshake
	 */
	wr_req = io_req_create(zmtp->io_proto.q, REQ_WR, zmtp,
			       on_greet_v3_3_hshake_send__REP);
	if (wr_req == NULL) {
		len = -ENOMEM;
		goto out;
	}
	wr_req->buf = (struct io_buf){
		.iov[0] = {
			.iov_base = ZMTP_V3_REP_HS,
			.iov_len  = sizeof(ZMTP_V3_REP_HS)
		},
		.iov_num  = 1,
	};
	rc = zmtp->io_proto.submit(wr_req, TO_HEAD);
	if (rc) {
		io_req_put(wr_req);
		len = rc;
		goto out;
	}

out:
	io_req_put(req);
	if (len < 0)
		zmtp->inner_state = ZMTP_REP_CLOSED;

	return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0x35e9
jmp 0x36fe
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x2b00
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jge 0x3613
movl -0x2c(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x36fe
cmpl $0x0, -0x2c(%rbp)
jne 0x3625
movl $0x0, -0x4(%rbp)
jmp 0x371e
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x3730
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jge 0x3644
movl -0x2c(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x36fe
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rdx
movl $0x1, %esi
leaq 0x175(%rip), %rcx       # 0x37d0
callq 0x4b00
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x3677
movl $0xfffffff4, -0x14(%rbp) # imm = 0xFFFFFFF4
jmp 0x36fe
movq -0x28(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x180(%rbp)
leaq -0x178(%rbp), %rdi
xorl %esi, %esi
movl $0x148, %edx            # imm = 0x148
callq 0x10e0
movq -0x180(%rbp), %rdi
leaq 0x7b09(%rip), %rax      # 0xb1b0
movq %rax, -0x178(%rbp)
movq $0x1b, -0x170(%rbp)
movq $0x1, -0x58(%rbp)
leaq -0x178(%rbp), %rsi
movl $0x148, %edx            # imm = 0x148
callq 0x1170
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rdi
xorl %esi, %esi
callq *%rax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x36fc
movq -0x28(%rbp), %rdi
callq 0x4bb0
movl -0x2c(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x36fe
jmp 0x36fe
movq -0x10(%rbp), %rdi
callq 0x4bb0
cmpl $0x0, -0x14(%rbp)
jge 0x3718
movq -0x20(%rbp), %rax
movl $0x2, 0x28(%rax)
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp.c
// Function: zmtp_parse_hshake
static int zmtp_parse_hshake(struct io_req *req, int proto)
{
	if (req->buf.iov_num != 3)
		return -EINVAL;
	switch (proto) {
	case ZMTP_REP:
		if (req->buf.iov[2].iov_len < sizeof(ZMTP_V3_REQ_HS))
			return -EINVAL;
		if (memcmp(req->buf.iov[2].iov_base, ZMTP_V3_REQ_HS,
			   sizeof(ZMTP_V3_REQ_HS)))
			return -EINVAL;

		return 0;
	default:
		assert(0);
		/* TODO: currently support only REP<-REQ */
		return -ENOTSUP;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x3, 0x148(%rax)
je 0x3756
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x37c2
movl -0x14(%rbp), %eax
testl %eax, %eax
jne 0x37a3
jmp 0x375f
movq -0x10(%rbp), %rax
cmpq $0x19, 0x50(%rax)
jae 0x3773
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x37c2
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
leaq 0x7a4e(%rip), %rsi      # 0xb1d0
movl $0x19, %edx
callq 0x1140
cmpl $0x0, %eax
je 0x379a
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x37c2
movl $0x0, -0x4(%rbp)
jmp 0x37c2
leaq 0x3edf(%rip), %rdi      # 0x7689
leaq 0x3ac7(%rip), %rsi      # 0x7278
movl $0x7e, %edx
leaq 0x3cd5(%rip), %rcx      # 0x7492
callq 0x10d0
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/zmtp.c
// Function: on_greet_v3_3_hshake_send__REP
static int on_greet_v3_3_hshake_send__REP(struct io_req *req, int len)
{
	struct zmtp *zmtp = req->data;

	/*
	 * Our hshake is sent, ready for incoming data.
	 */
	io_req_put(req);

	if (len < 0)
		zmtp->inner_state = ZMTP_REP_CLOSED;

	return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4bb0
cmpl $0x0, -0xc(%rbp)
jge 0x3805
movq -0x18(%rbp), %rax
movl $0x2, 0x28(%rax)
movl -0xc(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: buf_free
void buf_free(struct io_buf *buf)
{
	int i;

	for (i = 0; i < ARRAY_SIZE(buf->iov); i++)
		if (buf->iov_free[i])
			free(buf->iov[i].iov_base);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movslq -0xc(%rbp), %rax
cmpq $0x10, %rax
jae 0x3883
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
testb $0x1, 0x110(%rax,%rcx)
je 0x3876
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x1040
jmp 0x3878
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x3843
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: buf_it_len
static int buf_it_len(struct io_buf *buf, struct iovec_iter *beg,
		      struct iovec_iter *end)
{
	size_t sz, nb;

	sz = 0;
	while (buf_it_cmp(beg, end) < 0) {
		nb = buf_it_iovlen(buf, beg, end);
		buf_it_advance(buf, beg, nb);
		sz += nb;
	}

	return sz;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4c20
cmpl $0x0, %eax
jge 0x3932
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x4ca0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x4d30
movq -0x28(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x38ec
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: buf_memcpy_to
int buf_memcpy_to(struct io_buf *src, size_t off, void *ptr, size_t len)
{
	int rc;
	struct iovec_iter it_s;
	struct io_buf dst = {
		.iov[0] = {
			.iov_base = ptr,
			.iov_len = len,
		},
		.iov_num = 1,
	};
	struct iovec_iter beg_d = BEG_IT(&dst);

	rc = buf_check(src);
	if (rc)
		return rc;

	it_s = buf_it(src, off);

	return buf_it_append(src, &it_s, &dst, &beg_d, len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
leaq -0x188(%rbp), %rdi
xorl %esi, %esi
movl $0x148, %edx            # imm = 0x148
callq 0x10e0
movq -0x20(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x180(%rbp)
movq $0x1, -0x68(%rbp)
leaq -0x198(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x10e0
movq -0x10(%rbp), %rdi
callq 0x3ab0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x3a49
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x3a9c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x3c80
movq %rax, -0x1a8(%rbp)
movq %rdx, -0x1a0(%rbp)
movq -0x1a8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x1a0(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %r8
leaq -0x40(%rbp), %rsi
leaq -0x188(%rbp), %rdx
leaq -0x198(%rbp), %rcx
callq 0x3db0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: buf_it
static struct iovec_iter buf_it(struct io_buf *buf, size_t off)
{
	size_t sz;
	struct iovec_iter beg = BEG_IT(buf);
	struct iovec_iter end = END_IT(buf);

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

	return beg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
leaq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x10e0
movq -0x18(%rbp), %rdi
callq 0x3810
testb $0x1, %al
jne 0x3caf
jmp 0x3cc8
movq -0x18(%rbp), %rax
movq 0x120(%rax), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
jmp 0x3cfd
movq -0x18(%rbp), %rax
movq 0x120(%rax), %rax
subq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x120(%rcx), %rcx
subq $0x1, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x3cff
leaq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4c20
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x39(%rbp)
jge 0x3d23
cmpq $0x0, -0x20(%rbp)
setne %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0x3d2c
jmp 0x3d9d
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x10(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x4ca0
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpq %rcx, %rax
jae 0x3d5b
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x3d70
movq -0x18(%rbp), %rdi
leaq -0x10(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x4ca0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq -0x10(%rbp), %rsi
callq 0x4d30
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x20(%rbp)
jmp 0x3cff
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: io_queue_deinit
void io_queue_deinit(struct io_queue *q)
{
	stash_free(q);
	assert(q->poller == NULL);
	assert(list_empty(&q->queue));
	assert(q->reqs_num[REQ_RD] == 0);
	assert(q->reqs_num[REQ_WR] == 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4280
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x41c1
jmp 0x41e0
leaq 0x32f6(%rip), %rdi      # 0x74be
leaq 0x3301(%rip), %rsi      # 0x74d0
movl $0x313, %edx            # imm = 0x313
leaq 0x32fa(%rip), %rcx      # 0x74d5
callq 0x10d0
movq -0x8(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
callq 0x42d0
cmpl $0x0, %eax
je 0x41f7
jmp 0x4216
leaq 0x32ff(%rip), %rdi      # 0x74fd
leaq 0x32cb(%rip), %rsi      # 0x74d0
movl $0x314, %edx            # imm = 0x314
leaq 0x32c4(%rip), %rcx      # 0x74d5
callq 0x10d0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x148(%rax)
jne 0x4225
jmp 0x4244
leaq 0x32e7(%rip), %rdi      # 0x7513
leaq 0x329d(%rip), %rsi      # 0x74d0
movl $0x315, %edx            # imm = 0x315
leaq 0x3296(%rip), %rcx      # 0x74d5
callq 0x10d0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x14c(%rax)
jne 0x4253
jmp 0x4272
leaq 0x32d2(%rip), %rdi      # 0x752c
leaq 0x326f(%rip), %rsi      # 0x74d0
movl $0x316, %edx            # imm = 0x316
leaq 0x3268(%rip), %rcx      # 0x74d5
callq 0x10d0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: stash_free
static void stash_free(struct io_queue *q)
{
	free(q->stash.iov_base);
	q->stash.iov_base = NULL;
	q->stash.iov_len  = 0;
	q->stash_pos      = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x158(%rax), %rdi
callq 0x1040
movq -0x8(%rbp), %rax
movq $0x0, 0x158(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x160(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x168(%rax)
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: io_queue_bind
int io_queue_bind(struct io_queue *q, void *poller, int fd)
{
	int err, flags;

	if (q->poller)
		return -EINVAL;
	q->refs = 1;
	q->poller = poller;
	q->item = (struct poller_item){
		.fd     = fd,
		.events = 0,
		.data   = NULL,
		.action = on_io,
	};

	flags = fcntl(fd, F_GETFL, 0);
	if  (flags < 0)
		return -errno;
	err = fcntl(fd, F_SETFL, flags | O_NONBLOCK);
	if (err < 0)
		return -errno;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x431c
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x43e7
movq -0x10(%rbp), %rax
movl $0x1, 0x174(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x160(%rbp)
leaq -0x158(%rbp), %rdi
xorl %esi, %esi
movl $0x130, %edx            # imm = 0x130
callq 0x10e0
movq -0x160(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl %eax, -0x158(%rbp)
leaq 0x92(%rip), %rax        # 0x4400
movq %rax, -0x30(%rbp)
leaq -0x158(%rbp), %rsi
movl $0x130, %edx            # imm = 0x130
callq 0x1170
movl -0x1c(%rbp), %edi
movl $0x3, %esi
xorl %edx, %edx
movb $0x0, %al
callq 0x1080
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jge 0x43ae
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x4(%rbp)
jmp 0x43e7
movl -0x1c(%rbp), %edi
movl -0x24(%rbp), %edx
orl $0x800, %edx            # imm = 0x800
movl $0x4, %esi
movb $0x0, %al
callq 0x1080
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jge 0x43e0
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x4(%rbp)
jmp 0x43e7
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: on_io
static int on_io(void *poller, struct poller_item *item)
{
	struct io_queue *q;
	int rc = 0;

	q = container_of(item, struct io_queue, item);
	__queue_get(q);
	if (item->revents & P_ERR) {
		rc = -EIO;
		goto complete_w_error;
	}
	do {
		rc = on_io_write(q);
		if (rc < 0)
			goto complete_w_error;
		rc = on_io_read(q);
		if (rc < 0)
			goto complete_w_error;
	} while (item->revents || req_exists_to_read_from_stash(q));

	/* Clear prewait */
	__poller_clr_prewait(q->poller, &q->item);
	/* Update poller with new events */
	__poller_update(q);
out:
	__queue_put(q);

	return rc;

complete_w_error:
	rc = __io_queue_cancel(q, rc);
	goto out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4f90
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4454
movl $0xfffffffb, -0x1c(%rbp) # imm = 0xFFFFFFFB
jmp 0x44d1
jmp 0x4456
movq -0x18(%rbp), %rdi
callq 0x4ff0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x446a
jmp 0x44d1
movq -0x18(%rbp), %rdi
callq 0x5170
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x447e
jmp 0x44d1
jmp 0x4480
movq -0x10(%rbp), %rcx
movb $0x1, %al
cmpl $0x0, 0x8(%rcx)
movb %al, -0x31(%rbp)
jne 0x449b
movq -0x18(%rbp), %rdi
callq 0x52f0
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x4456
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
callq 0x5380
movq -0x18(%rbp), %rdi
callq 0x53c0
movq -0x18(%rbp), %rdi
callq 0x5470
movl -0x1c(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x4580
movl %eax, -0x1c(%rbp)
jmp 0x44bf
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: io_queue_unbind
int io_queue_unbind(struct io_queue *q)
{
	int err;

	if (q->poller == NULL)
		return -EINVAL;
	if (q->refs == 0)
		return -EINVAL;
	if (q->refs > 1)
		return -EBUSY;

	err = __io_queue_cancel(q, -EIO);
	q->poller = NULL;
	q->refs = 0;

	return err;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x450f
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x456b
movq -0x10(%rbp), %rax
cmpl $0x0, 0x174(%rax)
jne 0x4525
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x456b
movq -0x10(%rbp), %rax
cmpl $0x1, 0x174(%rax)
jle 0x453b
movl $0xfffffff0, -0x4(%rbp) # imm = 0xFFFFFFF0
jmp 0x456b
movq -0x10(%rbp), %rdi
movl $0xfffffffb, %esi       # imm = 0xFFFFFFFB
callq 0x4580
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x174(%rax)
movl -0x14(%rbp), %eax
movl %eax, -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: io_queue_set_proto
int io_queue_set_proto(struct io_queue *q, struct io_proto *proto)
{
	if (proto) {
		if (q->proto)
			return -EINVAL;
		proto->q = q;
		proto->submit = __io_queue_submit_from_proto;
		q->proto = proto;
	} else {
		if (q->proto == NULL)
			return -EINVAL;
		q->proto->q = NULL;
		q->proto->submit = NULL;
		q->proto = NULL;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x48b5
movq -0x10(%rbp), %rax
cmpq $0x0, 0x150(%rax)
je 0x488a
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x4907
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
leaq 0x70(%rip), %rcx        # 0x4910
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x150(%rax)
jmp 0x4900
movq -0x10(%rbp), %rax
cmpq $0x0, 0x150(%rax)
jne 0x48cc
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x4907
movq -0x10(%rbp), %rax
movq 0x150(%rax), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movq 0x150(%rax), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x150(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: _io_queue_submit_from_proto
static int __io_queue_submit_from_proto(struct io_req *req, bool tail)
{
	struct io_queue *q = req->q;
	int rc;

	q->in_proto = true;
	rc = __io_queue_submit(req, tail);
	q->in_proto = false;

	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movb $0x1, 0x170(%rax)
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x46a0
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movb $0x0, 0x170(%rax)
movl -0x1c(%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: io_req_init
void io_req_init(struct io_req *req, struct io_queue *q, int flags,
		 void *data, int (*io_fn)(struct io_req *req, int len))
{
	*req = (struct io_req){
		.list  = LIST_HEAD_INIT(req->list),
		.q     = q,
		.data  = data,
		.flags = flags,
		.refs  = 1,
		.io_fn = io_fn
	};
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1b0(%rbp)
leaq -0x1a8(%rbp), %rdi
xorl %esi, %esi
movl $0x180, %edx            # imm = 0x180
callq 0x10e0
movq -0x1b0(%rbp), %rdi
movq -0x8(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x190(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x188(%rbp)
movl $0x1, -0x184(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq -0x1a8(%rbp), %rsi
movl $0x180, %edx            # imm = 0x180
callq 0x1170
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: io_req_create
struct io_req *io_req_create(struct io_queue *q, int flags, void *data,
			     int (*io_fn)(struct io_req *req, int len))
{
	struct io_req *req;

	req = malloc(sizeof(*req));
	if (req == NULL)
		return NULL;
	io_req_init(req, q, flags, data, io_fn);

	return req;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x180, %edi            # imm = 0x180
callq 0x1190
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x4b36
movq $0x0, -0x8(%rbp)
jmp 0x4b56
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x4970
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: io_req_put
bool io_req_put(struct io_req *req)
{
	int refs;

	assert(req->refs > 0);
	refs = --req->refs;
	if (!refs) {
		__io_req_deinit(req);
		free(req);
	}

	return !refs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x24(%rax)
jle 0x4bc8
jmp 0x4be7
leaq 0x29e0(%rip), %rdi      # 0x75af
leaq 0x28fa(%rip), %rsi      # 0x74d0
movl $0x3f3, %edx            # imm = 0x3F3
leaq 0x29fc(%rip), %rcx      # 0x75de
callq 0x10d0
movq -0x8(%rbp), %rcx
movl 0x24(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x24(%rcx)
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x4c0f
movq -0x8(%rbp), %rdi
callq 0x4a80
movq -0x8(%rbp), %rdi
callq 0x1040
cmpl $0x0, -0xc(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq