// File: /workspace/github_c_makefile_star2_O0/rouming[P]io/io.c
// Function: buf_it_append
static int buf_it_append(struct io_buf *src, struct iovec_iter *it_s,
			 struct io_buf *dst, struct iovec_iter *it_d,
			 size_t len)
{
	int rc;
	size_t len_s, nb, sz;
	struct iovec_iter end_d = END_IT(dst);

	if (buf_it_cmp(it_s, &src->pos) >= 0)
		return 0;
	if (buf_it_cmp(it_d, &dst->pos) > 0)
		return 0;

	len = min(len, buf_pos(src));
	sz = 0;
	while (buf_it_cmp(it_s, &src->pos) < 0 &&
	       buf_it_cmp(it_d, &end_d) < 0 && len) {
		len_s = min(len, buf_it_iovlen(src, it_s, &src->pos));
		while (buf_it_cmp(it_d, &end_d) < 0 && len_s) {
			if (buf_it_end(dst, it_d) ||
			    buf_it_iovbase(dst, it_d) == NULL) {
				rc = buf_it_realloc(dst, it_d, len);
				if (rc < 0)
					return -ENOMEM;
			}
			nb = min(len_s, buf_it_iovlen(dst, it_d, &end_d));
			memcpy(buf_it_iovbase(dst, it_d),
			       buf_it_iovbase(src, it_s), nb);
			len_s -= nb;
			len -= nb;
			sz += nb;
			buf_it_advance(src, it_s, nb);
			buf_it_advance(dst, it_d, nb);
		}
	}
	if (buf_it_cmp(it_d, &dst->pos) > 0)
		dst->pos = *it_d;

	return sz;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3810
testb $0x1, %al
jne 0x3dde
jmp 0x3df7
movq -0x20(%rbp), %rax
movq 0x120(%rax), %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
jmp 0x3e2c
movq -0x20(%rbp), %rax
movq 0x120(%rax), %rax
subq $0x1, %rax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x120(%rcx), %rcx
subq $0x1, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
callq 0x4c20
cmpl $0x0, %eax
jl 0x3e51
movl $0x0, -0x4(%rbp)
jmp 0x4118
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
callq 0x4c20
cmpl $0x0, %eax
jle 0x3e76
movl $0x0, -0x4(%rbp)
jmp 0x4118
movq -0x30(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3890
movl %eax, %ecx
movq -0x68(%rbp), %rax
movslq %ecx, %rcx
cmpq %rcx, %rax
jae 0x3e9f
movq -0x30(%rbp), %rax
movq %rax, -0x70(%rbp)
jmp 0x3eae
movq -0x10(%rbp), %rdi
callq 0x3890
cltq
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
callq 0x4c20
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x71(%rbp)
jge 0x3f02
movq -0x28(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4c20
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x71(%rbp)
jge 0x3f02
cmpq $0x0, -0x30(%rbp)
setne %al
movb %al, -0x71(%rbp)
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0x3f0e
jmp 0x40db
movq -0x30(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0x100, %rdx            # imm = 0x100
callq 0x4ca0
movq %rax, %rcx
movq -0x80(%rbp), %rax
cmpq %rcx, %rax
jae 0x3f47
movq -0x30(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x3f66
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0x100, %rdx            # imm = 0x100
callq 0x4ca0
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4c20
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x89(%rbp)
jge 0x3f9b
cmpq $0x0, -0x40(%rbp)
setne %al
movb %al, -0x89(%rbp)
movb -0x89(%rbp), %al
testb $0x1, %al
jne 0x3faa
jmp 0x40d6
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x4df0
testb $0x1, %al
jne 0x3fce
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x4e50
cmpq $0x0, %rax
jne 0x3ff6
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x4e80
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x3ff4
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x4118
jmp 0x3ff6
movq -0x40(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x4ca0
movq %rax, %rcx
movq -0x98(%rbp), %rax
cmpq %rcx, %rax
jae 0x402e
movq -0x40(%rbp), %rax
movq %rax, -0xa0(%rbp)
jmp 0x4046
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x4ca0
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x4e50
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4e50
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
movq -0x48(%rbp), %rdx
callq 0x1170
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rcx
movq -0x30(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x48(%rbp), %rax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x4d30
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x4d30
jmp 0x3f71
jmp 0x3ebe
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
callq 0x4c20
cmpl $0x0, %eax
jle 0x4111
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, 0x100(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x108(%rax)
movq -0x50(%rbp), %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)