// File: /workspace/github_c_makefile_star2_O1/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 $0x1c8, %rsp            # imm = 0x1C8
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x80(%rsp), %r13
movl $0x148, %edx            # imm = 0x148
movq %r13, %rdi
xorl %esi, %esi
callq 0x10e0
movq %r15, (%r13)
movq %r14, 0x18(%rsp)
movq %r14, 0x8(%r13)
movq $0x1, 0x120(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x3045
movl %eax, %r13d
testl %eax, %eax
je 0x2b6c
movl %r13d, %eax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x120(%rbx), %rax
cmpb $0x0, 0x128(%rbx)
je 0x2b80
xorl %ecx, %ecx
jmp 0x2b8f
decq %rax
movq %rax, %rcx
shlq $0x4, %rcx
movq 0x8(%rbx,%rcx), %rcx
movq 0x18(%rsp), %r9
movq $0x0, (%rsp)
xorl %r8d, %r8d
movb $0x1, %dl
cmpq %rax, (%rsp)
jb 0x2bb4
setbe %sil
cmpq %rcx, %r8
setb %dl
andb %sil, %dl
testb %dl, %dl
je 0x2c70
testq %r12, %r12
je 0x2c70
cmpq %rax, (%rsp)
jb 0x2bdb
ja 0x2c68
movl $0x0, %esi
cmpq %rcx, %r8
jae 0x2bf4
movq %rcx, %rsi
cmpq %rax, (%rsp)
je 0x2bf1
movq (%rsp), %rdx
shlq $0x4, %rdx
movq 0x8(%rbx,%rdx), %rsi
subq %r8, %rsi
movq %r12, %rdx
cmpq %rsi, %r12
jb 0x2c27
cmpq %rax, (%rsp)
jb 0x2c0e
ja 0x2c6c
movl $0x0, %edx
cmpq %rcx, %r8
jae 0x2c27
movq %rcx, %rdx
cmpq %rax, (%rsp)
je 0x2c24
movq (%rsp), %rdx
shlq $0x4, %rdx
movq 0x8(%rbx,%rdx), %rdx
subq %r8, %rdx
addq %rdx, %r8
movq 0x120(%rbx), %rsi
decq %rsi
cmpq %rsi, (%rsp)
je 0x2c60
movq (%rsp), %r10
movq %r10, %rsi
shlq $0x4, %rsi
xorl %edi, %edi
cmpq %r8, 0x8(%rbx,%rsi)
sete %dil
movl $0x0, %esi
cmoveq %rsi, %r8
addq %rdi, %r10
movq %r10, (%rsp)
subq %rdx, %r12
jmp 0x2b9f
xorl %esi, %esi
jmp 0x2bf4
xorl %edx, %edx
jmp 0x2c27
movzbl 0x1a8(%rsp), %r15d
xorl %r13d, %r13d
testq %r15, %r15
movq %r9, %rax
cmovneq %r13, %rax
movq %rax, 0x8(%rsp)
movq (%rsp), %rax
cmpq 0x100(%rbx), %rax
jae 0x2fc7
movq 0x180(%rsp), %rax
cmpq %rax, 0x20(%rsp)
jae 0x2fea
movq %r8, %r12
leaq 0x100(%rbx), %rdx
xorps %xmm0, %xmm0
leaq 0x70(%rsp), %rsi
movaps %xmm0, (%rsi)
movq %rbx, %rdi
movq %rdx, 0x48(%rsp)
callq 0x2a19
cltq
movq 0x18(%rsp), %rbp
cmpq %rbp, %rax
ja 0x2cf8
leaq 0x70(%rsp), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
movq %rbx, %rdi
movq 0x48(%rsp), %rdx
callq 0x2a19
movslq %eax, %rbp
movq %rbx, 0x38(%rsp)
leaq 0x108(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x20(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %r9
xorl %r13d, %r13d
movq %r12, %r8
movq %r15, 0x58(%rsp)
movq 0x48(%rsp), %rax
movq (%rax), %rax
cmpq %rax, (%rsp)
jb 0x2d42
ja 0x3008
movq 0x10(%rsp), %rcx
cmpq (%rcx), %r8
jae 0x3008
movb $0x1, %cl
cmpq %r15, %rsi
jb 0x2d56
setbe %dl
cmpq 0x8(%rsp), %r9
setb %cl
andb %dl, %cl
testb %cl, %cl
je 0x3008
testq %rbp, %rbp
je 0x3008
cmpq %rax, (%rsp)
jae 0x2d93
movq (%rsp), %rdx
movq %rdx, %rcx
shlq $0x4, %rcx
cmpq %rax, %rdx
movq 0x38(%rsp), %rdx
leaq 0x8(%rdx,%rcx), %rcx
cmoveq 0x10(%rsp), %rcx
movq (%rcx), %rcx
subq %r8, %rcx
jmp 0x2da1
ja 0x2d9f
movq 0x10(%rsp), %rcx
cmpq (%rcx), %r8
jb 0x2d6d
xorl %ecx, %ecx
movq %rbp, %rdx
cmpq %rcx, %rbp
jb 0x2de3
cmpq %rax, (%rsp)
jae 0x2dd5
movq (%rsp), %rdx
movq %rdx, %rcx
shlq $0x4, %rcx
cmpq %rax, %rdx
movq 0x38(%rsp), %rax
leaq 0x8(%rax,%rcx), %rax
cmoveq 0x10(%rsp), %rax
movq (%rax), %rdx
subq %r8, %rdx
jmp 0x2de3
ja 0x2de1
movq 0x10(%rsp), %rcx
cmpq (%rcx), %r8
jb 0x2daf
xorl %edx, %edx
movq %rsi, %rax
shlq $0x4, %rax
leaq (%rsp,%rax), %rcx
addq $0x88, %rcx
movq %rcx, 0x30(%rsp)
addq %rsp, %rax
addq $0x80, %rax
movq %rax, 0x50(%rsp)
movq %rsi, 0x40(%rsp)
movb $0x1, %al
cmpq %r15, %rsi
jb 0x2e21
setbe %cl
cmpq 0x8(%rsp), %r9
setb %al
andb %cl, %al
testb %al, %al
je 0x2d20
testq %rdx, %rdx
je 0x2d20
movq 0x1a0(%rsp), %rax
decq %rax
cmpq %rax, %rsi
jne 0x2e4c
movq 0x30(%rsp), %rax
cmpq (%rax), %r9
je 0x2e57
movq 0x50(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x2e8b
leaq 0x80(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %rdx, %r14
movq %rbp, %rdx
movq %r8, %rbx
movq %r9, %r12
callq 0x3e45
movq %r14, %rdx
movq %r12, %r9
movq 0x40(%rsp), %rsi
movq %rbx, %r8
testl %eax, %eax
js 0x2fdf
cmpq %r15, %rsi
setbe %al
cmpq 0x8(%rsp), %r9
setb %cl
cmpq %r15, %rsi
jb 0x2ea6
andb %cl, %al
jne 0x2ea6
xorl %eax, %eax
jmp 0x2ebb
movq 0x8(%rsp), %rax
cmpq %r15, %rsi
je 0x2eb8
movq 0x30(%rsp), %rax
movq (%rax), %rax
subq %r9, %rax
movq %rdx, %r12
cmpq %rax, %rdx
jb 0x2ef4
cmpq %r15, %rsi
setbe %al
cmpq 0x8(%rsp), %r9
setb %cl
cmpq %r15, %rsi
jb 0x2edf
andb %cl, %al
jne 0x2edf
xorl %r12d, %r12d
jmp 0x2ef4
movq 0x8(%rsp), %r12
cmpq %r15, %rsi
je 0x2ef1
movq 0x30(%rsp), %rax
movq (%rax), %r12
subq %r9, %r12
movq %rdx, %rbx
movq %r13, 0x68(%rsp)
movq %rbp, 0x18(%rsp)
movq 0x50(%rsp), %rax
movq (%rax), %rdi
movq %r9, 0x60(%rsp)
addq %r9, %rdi
movq (%rsp), %r13
movq %r13, %rbp
shlq $0x4, %rbp
movq 0x38(%rsp), %r14
movq (%r14,%rbp), %rsi
addq %r8, %rsi
movq %r12, %rdx
movq %r8, %r15
callq 0x1160
movq %r15, %r8
addq %r12, %r8
movq 0x120(%r14), %rax
decq %rax
cmpq %rax, %r13
je 0x2f5f
xorl %eax, %eax
cmpq %r8, 0x8(%r14,%rbp)
sete %al
movl $0x0, %ecx
cmoveq %rcx, %r8
addq %rax, (%rsp)
movq 0x40(%rsp), %rsi
movq %rbx, %rdx
subq %r12, %rdx
movq 0x18(%rsp), %rbp
subq %r12, %rbp
movq 0x68(%rsp), %r13
addq %r12, %r13
movq 0x60(%rsp), %r9
addq %r12, %r9
movq %r9, 0x28(%rsp)
movq 0x1a0(%rsp), %rax
decq %rax
cmpq %rax, %rsi
movq 0x58(%rsp), %r15
je 0x2e0d
movq 0x30(%rsp), %rax
cmpq %r9, (%rax)
jne 0x2e0d
movq $0x0, 0x28(%rsp)
incq %rsi
movq %rsi, 0x20(%rsp)
xorl %r9d, %r9d
jmp 0x2de3
ja 0x2b57
cmpq 0x108(%rbx), %r8
jae 0x2b57
jmp 0x2c9c
movl $0xfffffff4, %r13d      # imm = 0xFFFFFFF4
jmp 0x2b57
ja 0x2b57
movq 0x28(%rsp), %rax
cmpq 0x188(%rsp), %rax
ja 0x2b57
jmp 0x2caf
movq 0x180(%rsp), %rax
cmpq %rax, 0x20(%rsp)
jb 0x2b57
ja 0x3030
movq 0x28(%rsp), %rax
cmpq 0x188(%rsp), %rax
jbe 0x2b57
movaps 0x20(%rsp), %xmm0
leaq 0x180(%rsp), %rax
movups %xmm0, (%rax)
jmp 0x2b57