int main(int argc, const char *argv[]) {
  unsigned int input[20], output[20], i;
  check_vect();
  for (i = 0; i < 20; i++) {
    input[i] = i % 256;
    output[i] = 0;
    asm volatile("" ::: "memory");
  }
  unsigned int check_results[20] = {
      3208,  1334, 28764,  35679,  2789,  13028, 4754,  168364, 91254,  12399,
      22848, 8174, 307964, 146829, 22009, 32668, 11594, 447564, 202404, 31619};
  foo(input, output);
  for (i = 0; i < 20; i++)
    if (output[i] != check_results[i])
      abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <check_vect@plt>
movl   $0x0,-0xb4(%rbp)
cmpl   $0x14,-0xb4(%rbp)
jae    11b2 <main+0x72>
mov    -0xb4(%rbp),%ecx
and    $0xff,%ecx
mov    -0xb4(%rbp),%eax
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0xb4(%rbp),%eax
movl   $0x0,-0xb0(%rbp,%rax,4)
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    116a <main+0x2a>
lea    -0x110(%rbp),%rdi
lea    0xe40(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
mov    $0x0,%al
call   1060 <foo@plt>
movl   $0x0,-0xb4(%rbp)
cmpl   $0x14,-0xb4(%rbp)
jae    1231 <main+0xf1>
mov    -0xb4(%rbp),%eax
mov    -0xb0(%rbp,%rax,4),%eax
mov    -0xb4(%rbp),%ecx
cmp    -0x110(%rbp,%rcx,4),%eax
je     1218 <main+0xd8>
call   1030 <abort@plt>
jmp    121d <main+0xdd>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    11e6 <main+0xa6>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xa8,%rsp
xor    %eax,%eax
call   1040 <check_vect@plt>
movaps 0xebb(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps 0xeb8(%rip),%xmm1
movaps %xmm1,0x60(%rsp)
movaps %xmm0,0x10(%rsp)
movaps 0xeb7(%rip),%xmm1
movaps %xmm1,0x70(%rsp)
movaps %xmm0,0x20(%rsp)
movaps 0xeb6(%rip),%xmm1
movaps %xmm1,0x80(%rsp)
movaps %xmm0,0x30(%rsp)
movaps 0xeb2(%rip),%xmm1
movaps %xmm1,0x90(%rsp)
movaps %xmm0,0x40(%rsp)
lea    0x50(%rsp),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <foo@plt>
movdqa (%rsp),%xmm0
movdqa 0x10(%rsp),%xmm1
movdqa 0x20(%rsp),%xmm2
movdqa 0x30(%rsp),%xmm3
pcmpeqd 0xe87(%rip),%xmm3
pcmpeqd %xmm4,%xmm4
pxor   %xmm4,%xmm3
pcmpeqd 0xe87(%rip),%xmm2
pxor   %xmm4,%xmm2
packssdw %xmm3,%xmm2
pcmpeqd 0xe87(%rip),%xmm1
pxor   %xmm4,%xmm1
pcmpeqd 0xe8b(%rip),%xmm0
pxor   %xmm4,%xmm0
packssdw %xmm1,%xmm0
packsswb %xmm2,%xmm0
pmovmskb %xmm0,%eax
test   %eax,%eax
jne    123b <main+0x10b>
cmpl   $0x2d4a,0x40(%rsp)
jne    123b <main+0x10b>
cmpl   $0x6d44c,0x44(%rsp)
jne    123b <main+0x10b>
cmpl   $0x316a4,0x48(%rsp)
jne    123b <main+0x10b>
cmpl   $0x7b83,0x4c(%rsp)
jne    123b <main+0x10b>
xor    %eax,%eax
add    $0xa8,%rsp
ret
call   1030 <abort@plt>

LLVM IR (-O0):
@__const.main.check_results = [20 x i32] [i32 3208, i32 1334, i32 28764, i32 35679, i32 2789, i32 13028, i32 4754, i32 168364, i32 91254, i32 12399, i32 22848, i32 8174, i32 307964, i32 146829, i32 22009, i32 32668, i32 11594, i32 447564, i32 202404, i32 31619]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [20 x i32]
%7 = alloca [20 x i32]
%8 = alloca i32
%9 = alloca [20 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 (...) @check_vect()
store i32 0, i32* %8
br label %11
11: ; preds = %23, %2
%12 = load i32, i32* %8
%13 = icmp ult i32 %12, 20
br i1 %13, label %14, label %26
14: ; preds = %11
%15 = load i32, i32* %8
%16 = urem i32 %15, 256
%17 = load i32, i32* %8
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds [20 x i32], [20 x i32]* %6, i64 0, i64 %18
store i32 %16, i32* %19
%20 = load i32, i32* %8
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds [20 x i32], [20 x i32]* %7, i64 0, i64 %21
store i32 0, i32* %22
br label %23
23: ; preds = %14
%24 = load i32, i32* %8
%25 = add i32 %24, 1
store i32 %25, i32* %8
br label %11
26: ; preds = %11
%27 = bitcast [20 x i32]* %9 to i8*
%28 = getelementptr inbounds [20 x i32], [20 x i32]* %6, i64 0, i64 0
%29 = getelementptr inbounds [20 x i32], [20 x i32]* %7, i64 0, i64 0
%30 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @foo to i32 (i32*, i32*, ...)*)(i32* %28, i32* %29)
store i32 0, i32* %8
br label %31
31: ; preds = %46, %26
%32 = load i32, i32* %8
%33 = icmp ult i32 %32, 20
br i1 %33, label %34, label %49
34: ; preds = %31
%35 = load i32, i32* %8
%36 = zext i32 %35 to i64
%37 = getelementptr inbounds [20 x i32], [20 x i32]* %7, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = load i32, i32* %8
%40 = zext i32 %39 to i64
%41 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 %40
%42 = load i32, i32* %41
%43 = icmp ne i32 %38, %42
br i1 %43, label %44, label %45
44: ; preds = %34
unreachable
45: ; preds = %34
br label %46
46: ; preds = %45
%47 = load i32, i32* %8
%48 = add i32 %47, 1
store i32 %48, i32* %8
br label %31
49: ; preds = %31
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [20 x i32]
%4 = alloca [20 x i32]
%5 = bitcast [20 x i32]* %3 to i8*
%6 = bitcast [20 x i32]* %4 to i8*
%7 = tail call i32 (...) @check_vect()
%8 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%9 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 0
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%10 = bitcast [20 x i32]* %3 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %10
%11 = bitcast [20 x i32]* %4 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %11
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%12 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 4
%13 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 4
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%14 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %14
%15 = bitcast i32* %13 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %15
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%16 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 8
%17 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 8
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%18 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, <4 x i32>* %18
%19 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %19
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%20 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 12
%21 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 12
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%22 = bitcast i32* %20 to <4 x i32>*
store <4 x i32> <i32 12, i32 13, i32 14, i32 15>, <4 x i32>* %22
%23 = bitcast i32* %21 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %23
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%24 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 16
%25 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 16
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%26 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 17
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%27 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 18
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%28 = bitcast i32* %24 to <4 x i32>*
store <4 x i32> <i32 16, i32 17, i32 18, i32 19>, <4 x i32>* %28
%29 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 19
%30 = bitcast i32* %25 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %30
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%31 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @foo to i32 (i32*, i32*, ...)*)(i32* %8, i32* %9)
%32 = bitcast [20 x i32]* %4 to <16 x i32>*
%33 = load <16 x i32>, <16 x i32>* %32
%34 = freeze <16 x i32> %33
%35 = icmp ne <16 x i32> %34, <i32 3208, i32 1334, i32 28764, i32 35679, i32 2789, i32 13028, i32 4754, i32 168364, i32 91254, i32 12399, i32 22848, i32 8174, i32 307964, i32 146829, i32 22009, i32 32668>
%36 = bitcast <16 x i1> %35 to i16
%37 = icmp eq i16 %36, 0
%38 = load i32, i32* %25
%39 = icmp eq i32 %38, 11594
%40 = select i1 %37, i1 %39, i1 false
%41 = load i32, i32* %26
%42 = icmp eq i32 %41, 447564
%43 = select i1 %40, i1 %42, i1 false
%44 = load i32, i32* %27
%45 = icmp eq i32 %44, 202404
%46 = select i1 %43, i1 %45, i1 false
%47 = load i32, i32* %29
%48 = icmp eq i32 %47, 31619
%49 = select i1 %46, i1 %48, i1 false
br i1 %49, label %50, label %51
50: ; preds = %2
ret i32 0
51: ; preds = %2
unreachable
}