void test1(short *__restrict__ x, short *__restrict__ y,
           short *__restrict__ z) {
  int i;
  for (i = 127; i >= 0; i--) {
    x[i] = y[127 - i] + z[127 - i];
  }
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x7f,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1166 <test1+0x66>
mov    -0x10(%rbp),%rax
mov    $0x7f,%ecx
sub    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
movswl (%rax,%rcx,2),%eax
mov    -0x18(%rbp),%rcx
mov    $0x7f,%edx
sub    -0x1c(%rbp),%edx
movslq %edx,%rdx
movswl (%rcx,%rdx,2),%ecx
add    %ecx,%eax
mov    %ax,%dx
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <test1+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
movdqu (%rsi),%xmm0
movdqu 0x10(%rsi),%xmm1
movdqu (%rdx),%xmm2
paddw  %xmm0,%xmm2
movdqu 0x10(%rdx),%xmm0
paddw  %xmm1,%xmm0
pshufd $0x4e,%xmm2,%xmm1
pshuflw $0x1b,%xmm1,%xmm1
pshufhw $0x1b,%xmm1,%xmm1
movdqu %xmm1,0xf0(%rdi)
pshufd $0x4e,%xmm0,%xmm0
pshuflw $0x1b,%xmm0,%xmm0
pshufhw $0x1b,%xmm0,%xmm0
movdqu %xmm0,0xe0(%rdi)
movdqu 0x20(%rsi),%xmm0
movdqu 0x30(%rsi),%xmm1
movdqu 0x20(%rdx),%xmm2
paddw  %xmm0,%xmm2
movdqu 0x30(%rdx),%xmm0
paddw  %xmm1,%xmm0
pshufd $0x4e,%xmm2,%xmm1
pshuflw $0x1b,%xmm1,%xmm1
pshufhw $0x1b,%xmm1,%xmm1
movdqu %xmm1,0xd0(%rdi)
pshufd $0x4e,%xmm0,%xmm0
pshuflw $0x1b,%xmm0,%xmm0
pshufhw $0x1b,%xmm0,%xmm0
movdqu %xmm0,0xc0(%rdi)
movdqu 0x40(%rsi),%xmm0
movdqu 0x50(%rsi),%xmm1
movdqu 0x40(%rdx),%xmm2
paddw  %xmm0,%xmm2
movdqu 0x50(%rdx),%xmm0
paddw  %xmm1,%xmm0
pshufd $0x4e,%xmm2,%xmm1
pshuflw $0x1b,%xmm1,%xmm1
pshufhw $0x1b,%xmm1,%xmm1
movdqu %xmm1,0xb0(%rdi)
pshufd $0x4e,%xmm0,%xmm0
pshuflw $0x1b,%xmm0,%xmm0
pshufhw $0x1b,%xmm0,%xmm0
movdqu %xmm0,0xa0(%rdi)
movdqu 0x60(%rsi),%xmm0
movdqu 0x70(%rsi),%xmm1
movdqu 0x60(%rdx),%xmm2
paddw  %xmm0,%xmm2
movdqu 0x70(%rdx),%xmm0
paddw  %xmm1,%xmm0
pshufd $0x4e,%xmm2,%xmm1
pshuflw $0x1b,%xmm1,%xmm1
pshufhw $0x1b,%xmm1,%xmm1
movdqu %xmm1,0x90(%rdi)
pshufd $0x4e,%xmm0,%xmm0
pshuflw $0x1b,%xmm0,%xmm0
pshufhw $0x1b,%xmm0,%xmm0
movdqu %xmm0,0x80(%rdi)
movdqu 0x80(%rsi),%xmm0
movdqu 0x90(%rsi),%xmm1
movdqu 0x80(%rdx),%xmm2
paddw  %xmm0,%xmm2
movdqu 0x90(%rdx),%xmm0
paddw  %xmm1,%xmm0
pshufd $0x4e,%xmm2,%xmm1
pshuflw $0x1b,%xmm1,%xmm1
pshufhw $0x1b,%xmm1,%xmm1
movdqu %xmm1,0x70(%rdi)
pshufd $0x4e,%xmm0,%xmm0
pshuflw $0x1b,%xmm0,%xmm0
pshufhw $0x1b,%xmm0,%xmm0
movdqu %xmm0,0x60(%rdi)
movdqu 0xa0(%rsi),%xmm0
movdqu 0xb0(%rsi),%xmm1
movdqu 0xa0(%rdx),%xmm2
paddw  %xmm0,%xmm2
movdqu 0xb0(%rdx),%xmm0
paddw  %xmm1,%xmm0
pshufd $0x4e,%xmm2,%xmm1
pshuflw $0x1b,%xmm1,%xmm1
pshufhw $0x1b,%xmm1,%xmm1
movdqu %xmm1,0x50(%rdi)
pshufd $0x4e,%xmm0,%xmm0
pshuflw $0x1b,%xmm0,%xmm0
pshufhw $0x1b,%xmm0,%xmm0
movdqu %xmm0,0x40(%rdi)
movdqu 0xc0(%rsi),%xmm0
movdqu 0xd0(%rsi),%xmm1
movdqu 0xc0(%rdx),%xmm2
paddw  %xmm0,%xmm2
movdqu 0xd0(%rdx),%xmm0
paddw  %xmm1,%xmm0
pshufd $0x4e,%xmm2,%xmm1
pshuflw $0x1b,%xmm1,%xmm1
pshufhw $0x1b,%xmm1,%xmm1
movdqu %xmm1,0x30(%rdi)
pshufd $0x4e,%xmm0,%xmm0
pshuflw $0x1b,%xmm0,%xmm0
pshufhw $0x1b,%xmm0,%xmm0
movdqu %xmm0,0x20(%rdi)
movdqu 0xe0(%rsi),%xmm0
movdqu 0xf0(%rsi),%xmm1
movdqu 0xe0(%rdx),%xmm2
paddw  %xmm0,%xmm2
movdqu 0xf0(%rdx),%xmm0
paddw  %xmm1,%xmm0
pshufd $0x4e,%xmm2,%xmm1
pshuflw $0x1b,%xmm1,%xmm1
pshufhw $0x1b,%xmm1,%xmm1
movdqu %xmm1,0x10(%rdi)
pshufd $0x4e,%xmm0,%xmm0
pshuflw $0x1b,%xmm0,%xmm0
pshufhw $0x1b,%xmm0,%xmm0
movdqu %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @test1(i16* noalias %0, i16* noalias %1, i16* noalias %2) {
%4 = alloca i16*
%5 = alloca i16*
%6 = alloca i16*
%7 = alloca i32
store i16* %0, i16** %4
store i16* %1, i16** %5
store i16* %2, i16** %6
store i32 127, i32* %7
br label %8
8: ; preds = %32, %3
%9 = load i32, i32* %7
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %35
11: ; preds = %8
%12 = load i16*, i16** %5
%13 = load i32, i32* %7
%14 = sub nsw i32 127, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i16, i16* %12, i64 %15
%17 = load i16, i16* %16
%18 = sext i16 %17 to i32
%19 = load i16*, i16** %6
%20 = load i32, i32* %7
%21 = sub nsw i32 127, %20
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i16, i16* %19, i64 %22
%24 = load i16, i16* %23
%25 = sext i16 %24 to i32
%26 = add nsw i32 %18, %25
%27 = trunc i32 %26 to i16
%28 = load i16*, i16** %4
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i16, i16* %28, i64 %30
store i16 %27, i16* %31
br label %32
32: ; preds = %11
%33 = load i32, i32* %7
%34 = add nsw i32 %33, -1
store i32 %34, i32* %7
br label %8
35: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @test1(i16* noalias nocapture writeonly %0, i16* noalias nocapture %1, i16* noalias nocapture %2) {
%4 = bitcast i16* %1 to <8 x i16>*
%5 = load <8 x i16>, <8 x i16>* %4
%6 = getelementptr inbounds i16, i16* %1, i64 8
%7 = bitcast i16* %6 to <8 x i16>*
%8 = load <8 x i16>, <8 x i16>* %7
%9 = bitcast i16* %2 to <8 x i16>*
%10 = load <8 x i16>, <8 x i16>* %9
%11 = getelementptr inbounds i16, i16* %2, i64 8
%12 = bitcast i16* %11 to <8 x i16>*
%13 = load <8 x i16>, <8 x i16>* %12
%14 = add <8 x i16> %10, %5
%15 = add <8 x i16> %13, %8
%16 = shufflevector <8 x i16> %14, <8 x i16> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%17 = getelementptr inbounds i16, i16* %0, i64 120
%18 = bitcast i16* %17 to <8 x i16>*
store <8 x i16> %16, <8 x i16>* %18
%19 = shufflevector <8 x i16> %15, <8 x i16> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%20 = getelementptr inbounds i16, i16* %0, i64 112
%21 = bitcast i16* %20 to <8 x i16>*
store <8 x i16> %19, <8 x i16>* %21
%22 = getelementptr inbounds i16, i16* %1, i64 16
%23 = bitcast i16* %22 to <8 x i16>*
%24 = load <8 x i16>, <8 x i16>* %23
%25 = getelementptr inbounds i16, i16* %1, i64 24
%26 = bitcast i16* %25 to <8 x i16>*
%27 = load <8 x i16>, <8 x i16>* %26
%28 = getelementptr inbounds i16, i16* %2, i64 16
%29 = bitcast i16* %28 to <8 x i16>*
%30 = load <8 x i16>, <8 x i16>* %29
%31 = getelementptr inbounds i16, i16* %2, i64 24
%32 = bitcast i16* %31 to <8 x i16>*
%33 = load <8 x i16>, <8 x i16>* %32
%34 = add <8 x i16> %30, %24
%35 = add <8 x i16> %33, %27
%36 = shufflevector <8 x i16> %34, <8 x i16> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%37 = getelementptr inbounds i16, i16* %0, i64 104
%38 = bitcast i16* %37 to <8 x i16>*
store <8 x i16> %36, <8 x i16>* %38
%39 = shufflevector <8 x i16> %35, <8 x i16> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%40 = getelementptr inbounds i16, i16* %0, i64 96
%41 = bitcast i16* %40 to <8 x i16>*
store <8 x i16> %39, <8 x i16>* %41
%42 = getelementptr inbounds i16, i16* %1, i64 32
%43 = bitcast i16* %42 to <8 x i16>*
%44 = load <8 x i16>, <8 x i16>* %43
%45 = getelementptr inbounds i16, i16* %1, i64 40
%46 = bitcast i16* %45 to <8 x i16>*
%47 = load <8 x i16>, <8 x i16>* %46
%48 = getelementptr inbounds i16, i16* %2, i64 32
%49 = bitcast i16* %48 to <8 x i16>*
%50 = load <8 x i16>, <8 x i16>* %49
%51 = getelementptr inbounds i16, i16* %2, i64 40
%52 = bitcast i16* %51 to <8 x i16>*
%53 = load <8 x i16>, <8 x i16>* %52
%54 = add <8 x i16> %50, %44
%55 = add <8 x i16> %53, %47
%56 = shufflevector <8 x i16> %54, <8 x i16> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%57 = getelementptr inbounds i16, i16* %0, i64 88
%58 = bitcast i16* %57 to <8 x i16>*
store <8 x i16> %56, <8 x i16>* %58
%59 = shufflevector <8 x i16> %55, <8 x i16> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%60 = getelementptr inbounds i16, i16* %0, i64 80
%61 = bitcast i16* %60 to <8 x i16>*
store <8 x i16> %59, <8 x i16>* %61
%62 = getelementptr inbounds i16, i16* %1, i64 48
%63 = bitcast i16* %62 to <8 x i16>*
%64 = load <8 x i16>, <8 x i16>* %63
%65 = getelementptr inbounds i16, i16* %1, i64 56
%66 = bitcast i16* %65 to <8 x i16>*
%67 = load <8 x i16>, <8 x i16>* %66
%68 = getelementptr inbounds i16, i16* %2, i64 48
%69 = bitcast i16* %68 to <8 x i16>*
%70 = load <8 x i16>, <8 x i16>* %69
%71 = getelementptr inbounds i16, i16* %2, i64 56
%72 = bitcast i16* %71 to <8 x i16>*
%73 = load <8 x i16>, <8 x i16>* %72
%74 = add <8 x i16> %70, %64
%75 = add <8 x i16> %73, %67
%76 = shufflevector <8 x i16> %74, <8 x i16> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%77 = getelementptr inbounds i16, i16* %0, i64 72
%78 = bitcast i16* %77 to <8 x i16>*
store <8 x i16> %76, <8 x i16>* %78
%79 = shufflevector <8 x i16> %75, <8 x i16> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%80 = getelementptr inbounds i16, i16* %0, i64 64
%81 = bitcast i16* %80 to <8 x i16>*
store <8 x i16> %79, <8 x i16>* %81
%82 = getelementptr inbounds i16, i16* %1, i64 64
%83 = bitcast i16* %82 to <8 x i16>*
%84 = load <8 x i16>, <8 x i16>* %83
%85 = getelementptr inbounds i16, i16* %1, i64 72
%86 = bitcast i16* %85 to <8 x i16>*
%87 = load <8 x i16>, <8 x i16>* %86
%88 = getelementptr inbounds i16, i16* %2, i64 64
%89 = bitcast i16* %88 to <8 x i16>*
%90 = load <8 x i16>, <8 x i16>* %89
%91 = getelementptr inbounds i16, i16* %2, i64 72
%92 = bitcast i16* %91 to <8 x i16>*
%93 = load <8 x i16>, <8 x i16>* %92
%94 = add <8 x i16> %90, %84
%95 = add <8 x i16> %93, %87
%96 = shufflevector <8 x i16> %94, <8 x i16> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%97 = getelementptr inbounds i16, i16* %0, i64 56
%98 = bitcast i16* %97 to <8 x i16>*
store <8 x i16> %96, <8 x i16>* %98
%99 = shufflevector <8 x i16> %95, <8 x i16> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%100 = getelementptr inbounds i16, i16* %0, i64 48
%101 = bitcast i16* %100 to <8 x i16>*
store <8 x i16> %99, <8 x i16>* %101
%102 = getelementptr inbounds i16, i16* %1, i64 80
%103 = bitcast i16* %102 to <8 x i16>*
%104 = load <8 x i16>, <8 x i16>* %103
%105 = getelementptr inbounds i16, i16* %1, i64 88
%106 = bitcast i16* %105 to <8 x i16>*
%107 = load <8 x i16>, <8 x i16>* %106
%108 = getelementptr inbounds i16, i16* %2, i64 80
%109 = bitcast i16* %108 to <8 x i16>*
%110 = load <8 x i16>, <8 x i16>* %109
%111 = getelementptr inbounds i16, i16* %2, i64 88
%112 = bitcast i16* %111 to <8 x i16>*
%113 = load <8 x i16>, <8 x i16>* %112
%114 = add <8 x i16> %110, %104
%115 = add <8 x i16> %113, %107
%116 = shufflevector <8 x i16> %114, <8 x i16> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%117 = getelementptr inbounds i16, i16* %0, i64 40
%118 = bitcast i16* %117 to <8 x i16>*
store <8 x i16> %116, <8 x i16>* %118
%119 = shufflevector <8 x i16> %115, <8 x i16> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%120 = getelementptr inbounds i16, i16* %0, i64 32
%121 = bitcast i16* %120 to <8 x i16>*
store <8 x i16> %119, <8 x i16>* %121
%122 = getelementptr inbounds i16, i16* %1, i64 96
%123 = bitcast i16* %122 to <8 x i16>*
%124 = load <8 x i16>, <8 x i16>* %123
%125 = getelementptr inbounds i16, i16* %1, i64 104
%126 = bitcast i16* %125 to <8 x i16>*
%127 = load <8 x i16>, <8 x i16>* %126
%128 = getelementptr inbounds i16, i16* %2, i64 96
%129 = bitcast i16* %128 to <8 x i16>*
%130 = load <8 x i16>, <8 x i16>* %129
%131 = getelementptr inbounds i16, i16* %2, i64 104
%132 = bitcast i16* %131 to <8 x i16>*
%133 = load <8 x i16>, <8 x i16>* %132
%134 = add <8 x i16> %130, %124
%135 = add <8 x i16> %133, %127
%136 = shufflevector <8 x i16> %134, <8 x i16> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%137 = getelementptr inbounds i16, i16* %0, i64 24
%138 = bitcast i16* %137 to <8 x i16>*
store <8 x i16> %136, <8 x i16>* %138
%139 = shufflevector <8 x i16> %135, <8 x i16> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%140 = getelementptr inbounds i16, i16* %0, i64 16
%141 = bitcast i16* %140 to <8 x i16>*
store <8 x i16> %139, <8 x i16>* %141
%142 = getelementptr inbounds i16, i16* %1, i64 112
%143 = bitcast i16* %142 to <8 x i16>*
%144 = load <8 x i16>, <8 x i16>* %143
%145 = getelementptr inbounds i16, i16* %1, i64 120
%146 = bitcast i16* %145 to <8 x i16>*
%147 = load <8 x i16>, <8 x i16>* %146
%148 = getelementptr inbounds i16, i16* %2, i64 112
%149 = bitcast i16* %148 to <8 x i16>*
%150 = load <8 x i16>, <8 x i16>* %149
%151 = getelementptr inbounds i16, i16* %2, i64 120
%152 = bitcast i16* %151 to <8 x i16>*
%153 = load <8 x i16>, <8 x i16>* %152
%154 = add <8 x i16> %150, %144
%155 = add <8 x i16> %153, %147
%156 = shufflevector <8 x i16> %154, <8 x i16> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%157 = getelementptr inbounds i16, i16* %0, i64 8
%158 = bitcast i16* %157 to <8 x i16>*
store <8 x i16> %156, <8 x i16>* %158
%159 = shufflevector <8 x i16> %155, <8 x i16> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%160 = bitcast i16* %0 to <8 x i16>*
store <8 x i16> %159, <8 x i16>* %160
ret void
}