int main(int argc, const char *argv[]) {
  int input[16], output[16], i;
  int input2[16], output2[16];
  check_vect();
  check_vect();
  for (i = 0; i < 16; i++) {
    input[i] = i % 256;
    input2[i] = i % 256;
    output[i] = 0;
    output2[i] = 0;
    __asm__ volatile("");
  }
  int check_results[16] = {1470,  395,  28271,  5958,  1655, 111653,
                           10446, 2915, 195035, 14934, 4175, 278417,
                           19422, 5435, 361799, 0};
  int check_results2[16] = {4322,  135,  13776, 629, 23230, 1123, 32684, 1617,
                            42138, 2111, 0,     0,   0,     0,    0,     0};
  foo(input, output, input2, output2);
  for (i = 0; i < 16; i++)
    if (output[i] != check_results[i] || output2[i] != check_results2[i])
      abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <check_vect@plt>
mov    $0x0,%al
call   1040 <check_vect@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0x10,-0x94(%rbp)
jge    11eb <main+0xab>
mov    -0x94(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
movslq -0x94(%rbp),%rax
mov    %edx,-0x50(%rbp,%rax,4)
mov    -0x94(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
movslq -0x94(%rbp),%rax
mov    %edx,-0xe0(%rbp,%rax,4)
movslq -0x94(%rbp),%rax
movl   $0x0,-0x90(%rbp,%rax,4)
movslq -0x94(%rbp),%rax
movl   $0x0,-0x120(%rbp,%rax,4)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1171 <main+0x31>
lea    -0x160(%rbp),%rdi
lea    0xe07(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
lea    -0x1a0(%rbp),%rdi
lea    0xe2f(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
lea    -0x50(%rbp),%rdi
lea    -0x90(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    -0x120(%rbp),%rcx
mov    $0x0,%al
call   1060 <foo@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0x10,-0x94(%rbp)
jge    12b4 <main+0x174>
movslq -0x94(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%eax
movslq -0x94(%rbp),%rcx
cmp    -0x160(%rbp,%rcx,4),%eax
jne    1296 <main+0x156>
movslq -0x94(%rbp),%rax
mov    -0x120(%rbp,%rax,4),%eax
movslq -0x94(%rbp),%rcx
cmp    -0x1a0(%rbp,%rcx,4),%eax
je     129b <main+0x15b>
call   1030 <abort@plt>
jmp    12a0 <main+0x160>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1245 <main+0x105>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <check_vect@plt>
xor    %eax,%eax
call   1040 <check_vect@plt>
nopl   0x0(%rax,%rax,1)
mov    %ebx,0xc0(%rsp,%rbx,4)
mov    %ebx,0x80(%rsp,%rbx,4)
movl   $0x0,0x40(%rsp,%rbx,4)
movl   $0x0,(%rsp,%rbx,4)
add    $0x1,%rbx
cmp    $0x10,%rbx
jne    1150 <main+0x20>
xor    %ebx,%ebx
lea    0xc0(%rsp),%rdi
lea    0x40(%rsp),%rsi
lea    0x80(%rsp),%rdx
mov    %rsp,%rcx
xor    %eax,%eax
call   1050 <foo@plt>
lea    0xe61(%rip),%rax
lea    0xe9a(%rip),%rcx
cs nopw 0x0(%rax,%rax,1)
mov    0x40(%rsp,%rbx,4),%edx
cmp    (%rax,%rbx,4),%edx
jne    11ea <main+0xba>
mov    (%rsp,%rbx,4),%edx
cmp    (%rcx,%rbx,4),%edx
jne    11ea <main+0xba>
mov    0x44(%rsp,%rbx,4),%edx
cmp    0x4(%rax,%rbx,4),%edx
jne    11ea <main+0xba>
mov    0x4(%rsp,%rbx,4),%edx
cmp    0x4(%rcx,%rbx,4),%edx
jne    11ea <main+0xba>
add    $0x2,%rbx
cmp    $0x10,%rbx
jne    11b0 <main+0x80>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret
call   1030 <abort@plt>

LLVM IR (-O0):
@__const.main.check_results = [16 x i32] [i32 1470, i32 395, i32 28271, i32 5958, i32 1655, i32 111653, i32 10446, i32 2915, i32 195035, i32 14934, i32 4175, i32 278417, i32 19422, i32 5435, i32 361799, i32 0]
@__const.main.check_results2 = [16 x i32] [i32 4322, i32 135, i32 13776, i32 629, i32 23230, i32 1123, i32 32684, i32 1617, i32 42138, i32 2111, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i32]
%7 = alloca [16 x i32]
%8 = alloca i32
%9 = alloca [16 x i32]
%10 = alloca [16 x i32]
%11 = alloca [16 x i32]
%12 = alloca [16 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = call i32 (...) @check_vect()
%14 = call i32 (...) @check_vect()
store i32 0, i32* %8
br label %15
15: ; preds = %35, %2
%16 = load i32, i32* %8
%17 = icmp slt i32 %16, 16
br i1 %17, label %18, label %38
18: ; preds = %15
%19 = load i32, i32* %8
%20 = srem i32 %19, 256
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 %22
store i32 %20, i32* %23
%24 = load i32, i32* %8
%25 = srem i32 %24, 256
%26 = load i32, i32* %8
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [16 x i32], [16 x i32]* %9, i64 0, i64 %27
store i32 %25, i32* %28
%29 = load i32, i32* %8
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 %30
store i32 0, i32* %31
%32 = load i32, i32* %8
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 %33
store i32 0, i32* %34
br label %35
35: ; preds = %18
%36 = load i32, i32* %8
%37 = add nsw i32 %36, 1
store i32 %37, i32* %8
br label %15
38: ; preds = %15
%39 = bitcast [16 x i32]* %11 to i8*
%40 = bitcast [16 x i32]* %12 to i8*
%41 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 0
%42 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 0
%43 = getelementptr inbounds [16 x i32], [16 x i32]* %9, i64 0, i64 0
%44 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 0
%45 = call i32 (i32*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @foo to i32 (i32*, i32*, i32*, i32*, ...)*)(i32* %41, i32* %42, i32* %43, i32* %44)
store i32 0, i32* %8
br label %46
46: ; preds = %71, %38
%47 = load i32, i32* %8
%48 = icmp slt i32 %47, 16
br i1 %48, label %49, label %74
49: ; preds = %46
%50 = load i32, i32* %8
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 %51
%53 = load i32, i32* %52
%54 = load i32, i32* %8
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [16 x i32], [16 x i32]* %11, i64 0, i64 %55
%57 = load i32, i32* %56
%58 = icmp ne i32 %53, %57
br i1 %58, label %69, label %59
59: ; preds = %49
%60 = load i32, i32* %8
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 %61
%63 = load i32, i32* %62
%64 = load i32, i32* %8
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [16 x i32], [16 x i32]* %12, i64 0, i64 %65
%67 = load i32, i32* %66
%68 = icmp ne i32 %63, %67
br i1 %68, label %69, label %70
69: ; preds = %59, %49
unreachable
70: ; preds = %59
br label %71
71: ; preds = %70
%72 = load i32, i32* %8
%73 = add nsw i32 %72, 1
store i32 %73, i32* %8
br label %46
74: ; preds = %46
ret i32 0
}

LLVM IR (-O2):
@__const.main.check_results = [16 x i32] [i32 1470, i32 395, i32 28271, i32 5958, i32 1655, i32 111653, i32 10446, i32 2915, i32 195035, i32 14934, i32 4175, i32 278417, i32 19422, i32 5435, i32 361799, i32 0]
@__const.main.check_results2 = [16 x i32] [i32 4322, i32 135, i32 13776, i32 629, i32 23230, i32 1123, i32 32684, i32 1617, i32 42138, i32 2111, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i32]
%4 = alloca [16 x i32]
%5 = alloca [16 x i32]
%6 = alloca [16 x i32]
%7 = bitcast [16 x i32]* %3 to i8*
%8 = bitcast [16 x i32]* %4 to i8*
%9 = bitcast [16 x i32]* %5 to i8*
%10 = bitcast [16 x i32]* %6 to i8*
%11 = tail call i32 (...) @check_vect()
%12 = tail call i32 (...) @check_vect()
br label %13
13: ; preds = %2, %13
%14 = phi i64 [ 0, %2 ], [ %20, %13 ]
%15 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 %14
%16 = trunc i64 %14 to i32
store i32 %16, i32* %15
%17 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 %14
store i32 %16, i32* %17
%18 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 %14
store i32 0, i32* %18
%19 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 %14
store i32 0, i32* %19
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%20 = add nuw nsw i64 %14, 1
%21 = icmp eq i64 %20, 16
br i1 %21, label %22, label %13
22: ; preds = %13
%23 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%24 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 0
%25 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 0
%26 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 0
%27 = call i32 (i32*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @foo to i32 (i32*, i32*, i32*, i32*, ...)*)(i32* %23, i32* %24, i32* %25, i32* %26)
br label %44
28: ; preds = %51
%29 = or i64 %45, 1
%30 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = getelementptr inbounds [16 x i32], [16 x i32]* @__const.main.check_results, i64 0, i64 %29
%33 = load i32, i32* %32
%34 = icmp eq i32 %31, %33
br i1 %34, label %35, label %57
35: ; preds = %28
%36 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 %29
%37 = load i32, i32* %36
%38 = getelementptr inbounds [16 x i32], [16 x i32]* @__const.main.check_results2, i64 0, i64 %29
%39 = load i32, i32* %38
%40 = icmp eq i32 %37, %39
br i1 %40, label %41, label %57
41: ; preds = %35
%42 = add nuw nsw i64 %45, 2
%43 = icmp eq i64 %42, 16
br i1 %43, label %58, label %44
44: ; preds = %41, %22
%45 = phi i64 [ 0, %22 ], [ %42, %41 ]
%46 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 %45
%47 = load i32, i32* %46
%48 = getelementptr inbounds [16 x i32], [16 x i32]* @__const.main.check_results, i64 0, i64 %45
%49 = load i32, i32* %48
%50 = icmp eq i32 %47, %49
br i1 %50, label %51, label %57
51: ; preds = %44
%52 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 %45
%53 = load i32, i32* %52
%54 = getelementptr inbounds [16 x i32], [16 x i32]* @__const.main.check_results2, i64 0, i64 %45
%55 = load i32, i32* %54
%56 = icmp eq i32 %53, %55
br i1 %56, label %28, label %57
57: ; preds = %35, %28, %51, %44
unreachable
58: ; preds = %41
ret i32 0
}