void __attribute__((no, noclone))
foo_char_3(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 < 3; ++j)
      out[j] = in[j];
    in += 3;
    out += s * 3;
  }
}


x86 assembly (clang, -O0):
<foo_char_3>:
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_3+0x91>
movl   $0x0,-0x30(%rbp)
cmpl   $0x3,-0x30(%rbp)
jge    1165 <foo_char_3+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_3+0x37>
mov    -0x20(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x20(%rbp)
imul   $0x3,-0x14(%rbp),%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1126 <foo_char_3+0x26>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_char_3>:
lea    (%rdx,%rdx,2),%eax
cltq
mov    0x2(%rdi),%cl
mov    %cl,0x2(%rsi)
movzwl (%rdi),%ecx
mov    %cx,(%rsi)
lea    (%rsi,%rax,1),%r8
mov    0x5(%rdi),%dl
mov    %dl,0x2(%rsi,%rax,1)
movzwl 0x3(%rdi),%edx
mov    %dx,(%rsi,%rax,1)
lea    (%r8,%rax,1),%rdx
mov    0x8(%rdi),%cl
mov    %cl,0x2(%rax,%r8,1)
movzwl 0x6(%rdi),%ecx
mov    %cx,(%rax,%r8,1)
lea    (%rdx,%rax,1),%rsi
mov    0xb(%rdi),%cl
mov    %cl,0x2(%rax,%rdx,1)
movzwl 0x9(%rdi),%ecx
mov    %cx,(%rax,%rdx,1)
lea    (%rsi,%rax,1),%r8
mov    0xe(%rdi),%dl
mov    %dl,0x2(%rax,%rsi,1)
movzwl 0xc(%rdi),%edx
mov    %dx,(%rax,%rsi,1)
lea    (%r8,%rax,1),%rdx
mov    0x11(%rdi),%cl
mov    %cl,0x2(%rax,%r8,1)
movzwl 0xf(%rdi),%ecx
mov    %cx,(%rax,%r8,1)
lea    (%rdx,%rax,1),%rsi
mov    0x14(%rdi),%cl
mov    %cl,0x2(%rax,%rdx,1)
movzwl 0x12(%rdi),%ecx
mov    %cx,(%rax,%rdx,1)
lea    (%rsi,%rax,1),%r8
mov    0x17(%rdi),%dl
mov    %dl,0x2(%rax,%rsi,1)
movzwl 0x15(%rdi),%edx
mov    %dx,(%rax,%rsi,1)
lea    (%r8,%rax,1),%rdx
mov    0x1a(%rdi),%cl
mov    %cl,0x2(%rax,%r8,1)
movzwl 0x18(%rdi),%ecx
mov    %cx,(%rax,%r8,1)
lea    (%rdx,%rax,1),%rsi
mov    0x1d(%rdi),%cl
mov    %cl,0x2(%rax,%rdx,1)
movzwl 0x1b(%rdi),%ecx
mov    %cx,(%rax,%rdx,1)
lea    (%rsi,%rax,1),%r8
mov    0x20(%rdi),%dl
mov    %dl,0x2(%rax,%rsi,1)
movzwl 0x1e(%rdi),%edx
mov    %dx,(%rax,%rsi,1)
lea    (%r8,%rax,1),%rdx
mov    0x23(%rdi),%cl
mov    %cl,0x2(%rax,%r8,1)
movzwl 0x21(%rdi),%ecx
mov    %cx,(%rax,%r8,1)
lea    (%rdx,%rax,1),%rsi
mov    0x26(%rdi),%cl
mov    %cl,0x2(%rax,%rdx,1)
movzwl 0x24(%rdi),%ecx
mov    %cx,(%rax,%rdx,1)
lea    (%rsi,%rax,1),%rcx
mov    0x29(%rdi),%dl
mov    %dl,0x2(%rax,%rsi,1)
movzwl 0x27(%rdi),%edx
mov    %dx,(%rax,%rsi,1)
lea    (%rcx,%rax,1),%rsi
mov    0x2c(%rdi),%dl
mov    %dl,0x2(%rax,%rcx,1)
movzwl 0x2a(%rdi),%edx
mov    %dx,(%rax,%rcx,1)
mov    0x2f(%rdi),%cl
mov    %cl,0x2(%rax,%rsi,1)
movzwl 0x2d(%rdi),%ecx
mov    %cx,(%rax,%rsi,1)
ret

LLVM IR (-O0):
define void @foo_char_3(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, 3
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 i8*, i8** %7
%35 = getelementptr inbounds i8, i8* %34, i64 3
store i8* %35, i8** %7
%36 = load i32, i32* %6
%37 = mul nsw i32 %36, 3
%38 = load i8*, i8** %8
%39 = sext i32 %37 to i64
%40 = getelementptr inbounds i8, i8* %38, i64 %39
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_3(i8* noalias %0, i8* noalias %1, i32 %2) {
%4 = mul nsw i32 %2, 3
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 3
%7 = getelementptr inbounds i8, i8* %1, i64 %5
%8 = getelementptr inbounds i8, i8* %0, i64 6
%9 = getelementptr inbounds i8, i8* %7, i64 %5
%10 = getelementptr inbounds i8, i8* %0, i64 9
%11 = getelementptr inbounds i8, i8* %9, i64 %5
%12 = getelementptr inbounds i8, i8* %0, i64 12
%13 = getelementptr inbounds i8, i8* %11, i64 %5
%14 = getelementptr inbounds i8, i8* %0, i64 15
%15 = getelementptr inbounds i8, i8* %13, i64 %5
%16 = getelementptr inbounds i8, i8* %0, i64 18
%17 = getelementptr inbounds i8, i8* %15, i64 %5
%18 = getelementptr inbounds i8, i8* %0, i64 21
%19 = getelementptr inbounds i8, i8* %17, i64 %5
%20 = getelementptr inbounds i8, i8* %0, i64 24
%21 = getelementptr inbounds i8, i8* %19, i64 %5
%22 = getelementptr inbounds i8, i8* %0, i64 27
%23 = getelementptr inbounds i8, i8* %21, i64 %5
%24 = getelementptr inbounds i8, i8* %0, i64 30
%25 = getelementptr inbounds i8, i8* %23, i64 %5
%26 = getelementptr inbounds i8, i8* %0, i64 33
%27 = getelementptr inbounds i8, i8* %25, i64 %5
%28 = getelementptr inbounds i8, i8* %0, i64 36
%29 = getelementptr inbounds i8, i8* %27, i64 %5
%30 = getelementptr inbounds i8, i8* %0, i64 39
%31 = getelementptr inbounds i8, i8* %29, i64 %5
%32 = getelementptr inbounds i8, i8* %0, i64 42
%33 = getelementptr inbounds i8, i8* %31, i64 %5
%34 = getelementptr inbounds i8, i8* %0, i64 45
%35 = getelementptr inbounds i8, i8* %33, i64 %5
ret void
}