// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r13
leaq 0x80(%rsp), %r12
movl $0x138, %edx            # imm = 0x138
movq %r12, %rdi
xorl %esi, %esi
callq 0x10e0
movq %rbx, -0x10(%r12)
movq %r14, 0x18(%rsp)
movq %r14, -0x8(%r12)
movq $0x1, 0x110(%r12)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq %r13, %rdi
callq 0x2e8c
movl %eax, %ebp
testl %eax, %eax
jne 0x2e78
movq 0x120(%r13), %rcx
leaq -0x1(%rcx), %rax
cmpb $0x0, 0x128(%r13)
je 0x2b01
xorl %edx, %edx
jmp 0x2b10
movq %rax, %rcx
shlq $0x4, %rcx
movq 0x8(%r13,%rcx), %rdx
movq %rax, %rcx
xorl %r12d, %r12d
xorl %r9d, %r9d
cmpq %rcx, %r12
jb 0x2b2a
ja 0x2bae
cmpq %rdx, %r9
jae 0x2bae
testq %r15, %r15
je 0x2bae
movq %rdx, %rdi
cmpq %rcx, %r12
je 0x2b43
movq %r12, %rsi
shlq $0x4, %rsi
movq 0x8(%r13,%rsi), %rdi
subq %r9, %rdi
movq %r15, %rsi
cmpq %rdi, %r15
jb 0x2b76
cmpq %rcx, %r12
jb 0x2b5f
ja 0x2baa
movl $0x0, %esi
cmpq %rdx, %r9
jae 0x2b76
movq %rdx, %rsi
cmpq %rcx, %r12
je 0x2b73
movq %r12, %rsi
shlq $0x4, %rsi
movq 0x8(%r13,%rsi), %rsi
subq %r9, %rsi
addq %rsi, %r9
cmpq %r12, %rax
jne 0x2b83
movq %rax, %r12
jmp 0x2ba2
movq %r12, %rdi
shlq $0x4, %rdi
xorl %r8d, %r8d
cmpq %r9, 0x8(%r13,%rdi)
sete %r8b
movl $0x0, %edi
cmoveq %rdi, %r9
addq %r8, %r12
subq %rsi, %r15
jmp 0x2b16
xorl %esi, %esi
jmp 0x2b76
movq %r9, (%rsp)
movq 0x100(%r13), %rbx
cmpq %rbx, %r12
jae 0x2e59
leaq 0x100(%r13), %rdx
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %rsi
movaps %xmm0, (%rsi)
movq %r13, %rdi
movq %rdx, 0x28(%rsp)
callq 0x29cd
cltq
movq 0x18(%rsp), %rcx
movq %rcx, %r14
cmpq %rcx, %rax
ja 0x2c0b
leaq 0x60(%rsp), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
movq %r13, %rdi
movq 0x28(%rsp), %rdx
callq 0x29cd
movslq %eax, %r14
leaq 0x108(%r13), %rax
movq %rax, 0x8(%rsp)
movl $0x1, %eax
xorl %edi, %edi
xorl %r15d, %r15d
xorl %ecx, %ecx
xorl %ebp, %ebp
movq %r13, 0x10(%rsp)
cmpq %rbx, %r12
jb 0x2c47
ja 0x2e78
movq (%rsp), %rdx
movq 0x8(%rsp), %rsi
cmpq (%rsi), %rdx
jae 0x2e78
testq %rcx, %rcx
jne 0x2e78
cmpq 0x18(%rsp), %r15
jae 0x2e78
testq %r14, %r14
je 0x2e78
cmpq %rbx, %r12
jae 0x2c87
movq %r12, %rcx
shlq $0x4, %rcx
cmpq %rbx, %r12
leaq 0x8(%r13,%rcx), %rcx
cmoveq 0x8(%rsp), %rcx
movq (%rcx), %rcx
subq (%rsp), %rcx
jmp 0x2c99
ja 0x2c97
movq (%rsp), %rcx
movq 0x8(%rsp), %rdx
cmpq (%rdx), %rcx
jb 0x2c69
xorl %ecx, %ecx
movq %r14, %r13
cmpq %rcx, %r14
jb 0x2cdc
cmpq %rbx, %r12
movq 0x10(%rsp), %rdx
jae 0x2cc9
movq %r12, %rcx
shlq $0x4, %rcx
cmpq %rbx, %r12
leaq 0x8(%rdx,%rcx), %rcx
cmoveq 0x8(%rsp), %rcx
movq (%rcx), %r13
subq (%rsp), %r13
jmp 0x2cdc
ja 0x2cd9
movq (%rsp), %rcx
movq 0x8(%rsp), %rsi
cmpq (%rsi), %rcx
jb 0x2cab
xorl %r13d, %r13d
xorl %ecx, %ecx
movq %rdi, 0x30(%rsp)
movq 0x18(%rsp), %rbx
subq %r15, %rbx
jbe 0x2e3c
testq %r13, %r13
je 0x2e3c
cmpq $0x1, %rax
movq %rdi, 0x20(%rsp)
movq %rbp, 0x38(%rsp)
movq %r14, 0x58(%rsp)
jne 0x2d1d
movq %rcx, %rax
shlq $0x4, %rax
cmpq 0x78(%rsp,%rax), %r15
je 0x2d29
shlq $0x4, %rcx
cmpq $0x0, 0x70(%rsp,%rcx)
jne 0x2d51
leaq 0x70(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %r14, %rdx
callq 0x3cc9
testl %eax, %eax
js 0x2e73
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x2d51
xorl %ecx, %ecx
jmp 0x2d56
xorl %eax, %eax
movq %rbx, %rcx
testq %rax, %rax
movl $0x0, %edx
cmovneq %rdx, %rbx
cmpq %rcx, %r13
cmovbq %r13, %rbx
shlq $0x4, %rax
movq 0x70(%rsp,%rax), %rdi
movq %r15, 0x50(%rsp)
addq %r15, %rdi
movq %r12, %rbp
shlq $0x4, %rbp
movq 0x10(%rsp), %r15
movq (%r15,%rbp), %rsi
movq %r12, %r14
movq (%rsp), %r12
addq %r12, %rsi
movq %rbx, %rdx
callq 0x1160
addq %rbx, %r12
movq 0x120(%r15), %rax
decq %rax
cmpq %r14, %rax
jne 0x2db4
movq %r12, (%rsp)
jmp 0x2dce
xorl %eax, %eax
cmpq %r12, 0x8(%r15,%rbp)
sete %al
movl $0x0, %ecx
cmoveq %rcx, %r12
movq %r12, (%rsp)
addq %rax, %r14
movq 0x38(%rsp), %rbp
movq %r14, %r12
movq 0x20(%rsp), %rdi
movq 0x50(%rsp), %r15
addq %rbx, %r15
movq %r15, 0x48(%rsp)
movq 0x190(%rsp), %rax
leaq -0x1(%rax), %rcx
cmpq %rdi, %rcx
movq 0x58(%rsp), %r14
je 0x2e25
movq %rdi, %rcx
shlq $0x4, %rcx
cmpq %r15, 0x78(%rsp,%rcx)
jne 0x2e25
movq $0x0, 0x48(%rsp)
incq %rdi
movq %rdi, 0x40(%rsp)
movq %rdi, 0x30(%rsp)
xorl %r15d, %r15d
subq %rbx, %r13
subq %rbx, %r14
addq %rbx, %rbp
movq %rdi, %rcx
testq %rdi, %rdi
je 0x2ce3
jmp 0x2e3f
movq %rcx, %rdi
movq %rdi, %rcx
movq 0x28(%rsp), %rdx
movq (%rdx), %rbx
movq 0x30(%rsp), %rdi
movq 0x10(%rsp), %r13
jmp 0x2c2a
xorl %ebp, %ebp
cmpq %rbx, %r12
ja 0x2e78
movq (%rsp), %rax
cmpq 0x108(%r13), %rax
jb 0x2bc2
jmp 0x2e78
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
movl %ebp, %eax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq