void __attribute__((no, noclone))
foo_char_6(char *__restrict__ in_, char *__restrict__ out_, int s) {
  char *in = __builtin_assume_aligned(in_, 16);
  char *out = __builtin_assume_aligned(out_, 16);
  for (int i = 0; i < 16; i++) {
    for (int j = 0; j < 6; ++j)
      out[j] = in[j];
    in += s * 6;
    out += 6;
  }
}


x86 assembly (clang, -O0):
<foo_char_6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x10,-0x2c(%rbp)
jge    1191 <foo_char_6+0x91>
movl   $0x0,-0x30(%rbp)
cmpl   $0x6,-0x30(%rbp)
jge    1165 <foo_char_6+0x65>
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1137 <foo_char_6+0x37>
imul   $0x6,-0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1126 <foo_char_6+0x26>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_char_6>:
add    %edx,%edx
lea    (%rdx,%rdx,2),%eax
cltq
movzwl 0x4(%rdi),%ecx
mov    %cx,0x4(%rsi)
mov    (%rdi),%ecx
mov    %ecx,(%rsi)
lea    (%rdi,%rax,1),%rcx
movzwl 0x4(%rdi,%rax,1),%edx
mov    %dx,0xa(%rsi)
mov    (%rdi,%rax,1),%edx
mov    %edx,0x6(%rsi)
lea    (%rcx,%rax,1),%rdx
movzwl 0x4(%rax,%rcx,1),%edi
mov    %di,0x10(%rsi)
mov    (%rax,%rcx,1),%ecx
mov    %ecx,0xc(%rsi)
lea    (%rdx,%rax,1),%rcx
movzwl 0x4(%rax,%rdx,1),%edi
mov    %di,0x16(%rsi)
mov    (%rax,%rdx,1),%edx
mov    %edx,0x12(%rsi)
lea    (%rcx,%rax,1),%rdx
movzwl 0x4(%rax,%rcx,1),%edi
mov    %di,0x1c(%rsi)
mov    (%rax,%rcx,1),%ecx
mov    %ecx,0x18(%rsi)
lea    (%rdx,%rax,1),%rcx
mov    (%rax,%rdx,1),%edi
mov    %edi,0x1e(%rsi)
movzwl 0x4(%rax,%rdx,1),%edx
mov    %dx,0x22(%rsi)
lea    (%rcx,%rax,1),%rdx
mov    (%rax,%rcx,1),%edi
mov    %edi,0x24(%rsi)
movzwl 0x4(%rax,%rcx,1),%ecx
mov    %cx,0x28(%rsi)
lea    (%rdx,%rax,1),%rcx
movzwl 0x4(%rax,%rdx,1),%edi
mov    %di,0x2e(%rsi)
mov    (%rax,%rdx,1),%edx
mov    %edx,0x2a(%rsi)
lea    (%rcx,%rax,1),%rdx
mov    (%rax,%rcx,1),%edi
mov    %edi,0x30(%rsi)
movzwl 0x4(%rax,%rcx,1),%ecx
mov    %cx,0x34(%rsi)
lea    (%rdx,%rax,1),%rcx
mov    (%rax,%rdx,1),%edi
mov    %edi,0x36(%rsi)
movzwl 0x4(%rax,%rdx,1),%edx
mov    %dx,0x3a(%rsi)
lea    (%rcx,%rax,1),%rdx
movzwl 0x4(%rax,%rcx,1),%edi
mov    %di,0x40(%rsi)
mov    (%rax,%rcx,1),%ecx
mov    %ecx,0x3c(%rsi)
lea    (%rdx,%rax,1),%rcx
movzwl 0x4(%rax,%rdx,1),%edi
mov    %di,0x46(%rsi)
mov    (%rax,%rdx,1),%edx
mov    %edx,0x42(%rsi)
lea    (%rcx,%rax,1),%rdx
mov    (%rax,%rcx,1),%edi
mov    %edi,0x48(%rsi)
movzwl 0x4(%rax,%rcx,1),%ecx
mov    %cx,0x4c(%rsi)
lea    (%rdx,%rax,1),%rcx
mov    (%rax,%rdx,1),%edi
mov    %edi,0x4e(%rsi)
movzwl 0x4(%rax,%rdx,1),%edx
mov    %dx,0x52(%rsi)
lea    (%rcx,%rax,1),%rdx
mov    (%rax,%rcx,1),%edi
mov    %edi,0x54(%rsi)
movzwl 0x4(%rax,%rcx,1),%ecx
mov    %cx,0x58(%rsi)
movzwl 0x4(%rax,%rdx,1),%ecx
mov    %cx,0x5e(%rsi)
mov    (%rax,%rdx,1),%eax
mov    %eax,0x5a(%rsi)
ret

LLVM IR (-O0):
define void @foo_char_6(i8* noalias %0, i8* noalias %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%11 = load i8*, i8** %4
store i8* %11, i8** %7
%12 = load i8*, i8** %5
store i8* %12, i8** %8
store i32 0, i32* %9
br label %13
13: ; preds = %41, %3
%14 = load i32, i32* %9
%15 = icmp slt i32 %14, 16
br i1 %15, label %16, label %44
16: ; preds = %13
store i32 0, i32* %10
br label %17
17: ; preds = %30, %16
%18 = load i32, i32* %10
%19 = icmp slt i32 %18, 6
br i1 %19, label %20, label %33
20: ; preds = %17
%21 = load i8*, i8** %7
%22 = load i32, i32* %10
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = load i8*, i8** %8
%27 = load i32, i32* %10
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
store i8 %25, i8* %29
br label %30
30: ; preds = %20
%31 = load i32, i32* %10
%32 = add nsw i32 %31, 1
store i32 %32, i32* %10
br label %17
33: ; preds = %17
%34 = load i32, i32* %6
%35 = mul nsw i32 %34, 6
%36 = load i8*, i8** %7
%37 = sext i32 %35 to i64
%38 = getelementptr inbounds i8, i8* %36, i64 %37
store i8* %38, i8** %7
%39 = load i8*, i8** %8
%40 = getelementptr inbounds i8, i8* %39, i64 6
store i8* %40, i8** %8
br label %41
41: ; preds = %33
%42 = load i32, i32* %9
%43 = add nsw i32 %42, 1
store i32 %43, i32* %9
br label %13
44: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @foo_char_6(i8* noalias %0, i8* noalias %1, i32 %2) {
%4 = mul nsw i32 %2, 6
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = getelementptr inbounds i8, i8* %1, i64 6
%8 = getelementptr inbounds i8, i8* %6, i64 %5
%9 = getelementptr inbounds i8, i8* %1, i64 12
%10 = getelementptr inbounds i8, i8* %8, i64 %5
%11 = getelementptr inbounds i8, i8* %1, i64 18
%12 = getelementptr inbounds i8, i8* %10, i64 %5
%13 = getelementptr inbounds i8, i8* %1, i64 24
%14 = getelementptr inbounds i8, i8* %12, i64 %5
%15 = getelementptr inbounds i8, i8* %1, i64 30
%16 = getelementptr inbounds i8, i8* %14, i64 %5
%17 = getelementptr inbounds i8, i8* %1, i64 36
%18 = getelementptr inbounds i8, i8* %16, i64 %5
%19 = getelementptr inbounds i8, i8* %1, i64 42
%20 = getelementptr inbounds i8, i8* %18, i64 %5
%21 = getelementptr inbounds i8, i8* %1, i64 48
%22 = getelementptr inbounds i8, i8* %20, i64 %5
%23 = getelementptr inbounds i8, i8* %1, i64 54
%24 = getelementptr inbounds i8, i8* %22, i64 %5
%25 = getelementptr inbounds i8, i8* %1, i64 60
%26 = getelementptr inbounds i8, i8* %24, i64 %5
%27 = getelementptr inbounds i8, i8* %1, i64 66
%28 = getelementptr inbounds i8, i8* %26, i64 %5
%29 = getelementptr inbounds i8, i8* %1, i64 72
%30 = getelementptr inbounds i8, i8* %28, i64 %5
%31 = getelementptr inbounds i8, i8* %1, i64 78
%32 = getelementptr inbounds i8, i8* %30, i64 %5
%33 = getelementptr inbounds i8, i8* %1, i64 84
%34 = getelementptr inbounds i8, i8* %32, i64 %5
%35 = getelementptr inbounds i8, i8* %1, i64 90
ret void
}