// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io-test.c
// Function: on_read_vari_len_req1_1__slave_from_master
static int on_read_vari_len_req1_1__slave_from_master(struct io_req *req, int len)
{
	int nb, rc, stashed;
	char msg[len], *str;
	struct io_req *s_m_req;
	struct loop_ctx *ctx = req->data;

	nb = buf_memcpy_to(&req->buf, 0, msg, len);
	assert(nb == len);

	str = memmem(msg, nb, "</msg>", 6);
	if (str == NULL)
		return 0;

	nb = str - msg + strlen("</msg>");
	stashed = len - nb;
	len = nb;
	printf(" VARI LEN MSG 1: stashed=%2d, len=%2d, msg='%.*s'\n",
	       stashed, len, len, msg);
	io_req_put(req);

	/* Read slave<-master, part2 */
	s_m_req = io_req_create(&ctx->slave, REQ_RD, ctx,
				on_read_vari_len_req1_2__slave_from_master);
	s_m_req->buf = (struct io_buf){
		.iov[0] = {
			.iov_base = NULL,
			.iov_len  = 0
		},
		.iov_num  = 1,
		.is_vari_len = true
	};
	rc = io_queue_submit(s_m_req);
	assert(rc == 0);

	return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x28(%rbp)
movq %rax, %rcx
addq $0xf, %rcx
andq $-0x10, %rcx
movq %rsp, %rdx
subq %rcx, %rdx
movq %rdx, -0x1a0(%rbp)
movq %rdx, %rsp
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
movslq -0x14(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x3ce0
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0x2059
jmp 0x2078
leaq 0x6178(%rip), %rdi      # 0x81d8
leaq 0x5fcb(%rip), %rsi      # 0x8032
movl $0xf9, %edx
leaq 0x62db(%rip), %rcx      # 0x834e
callq 0x1090
movq -0x1a0(%rbp), %rdi
movslq -0x18(%rbp), %rsi
leaq 0x6279(%rip), %rdx      # 0x8303
movl $0x6, %ecx
callq 0x1120
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x20b2
movl $0x0, -0x4(%rbp)
movl $0x1, -0x4c(%rbp)
jmp 0x219d
movq -0x1a0(%rbp), %r8
movq -0x38(%rbp), %rax
subq %r8, %rax
addq $0x6, %rax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
subl -0x18(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x20(%rbp), %esi
movl -0x14(%rbp), %edx
movl -0x14(%rbp), %ecx
leaq 0x62ad(%rip), %rdi      # 0x8393
movb $0x0, %al
callq 0x1080
movq -0x10(%rbp), %rdi
callq 0x4ec0
movq -0x48(%rbp), %rdi
addq $0x178, %rdi            # imm = 0x178
movq -0x48(%rbp), %rdx
xorl %esi, %esi
leaq 0x222(%rip), %rcx       # 0x2330
callq 0x4e10
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x1a8(%rbp)
leaq -0x198(%rbp), %rdi
xorl %esi, %esi
movl $0x148, %edx            # imm = 0x148
callq 0x10a0
movq -0x1a8(%rbp), %rdi
movq $0x1, -0x78(%rbp)
movb $0x1, -0x70(%rbp)
leaq -0x198(%rbp), %rsi
movl $0x148, %edx            # imm = 0x148
callq 0x1140
movq -0x40(%rbp), %rdi
callq 0x4950
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x2171
jmp 0x2190
leaq 0x5f62(%rip), %rdi      # 0x80da
leaq 0x5eb3(%rip), %rsi      # 0x8032
movl $0x112, %edx            # imm = 0x112
leaq 0x61c3(%rip), %rcx      # 0x834e
callq 0x1090
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x4c(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rsp
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
nopl (%rax)