#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ check_vect();
int /*<<< orphan*/ foo(int *, int *, int *, int *);
int main(int argc, const char *argv[]) {
  int input[16], output[16], i;
  int check_results[16] = {1470,  395,  28271,  5958,  1655, 111653,
                           10446, 2915, 195035, 14934, 4175, 278417,
                           19422, 5435, 361799, 0};
  int input2[16], output2[16];
  int check_results2[16] = {4322,  135,  13776, 629, 23230, 1123, 32684, 1617,
                            42138, 2111, 0,     0,   0,     0,    0,     0};
  check_vect();
  check_vect();
  for (i = 0; i < 16; i++) {
    input[i] = i % 256;
    input2[i] = i % 256;
    output[i] = 0;
    output2[i] = 0;
    if (input[i] > 256)
      abort();
  }
  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)
lea    -0xe0(%rbp),%rdi
lea    0xe99(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
lea    -0x1a0(%rbp),%rdi
lea    0xec1(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
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    123c <main+0xfc>
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,-0x120(%rbp,%rax,4)
movslq -0x94(%rbp),%rax
movl   $0x0,-0x90(%rbp,%rax,4)
movslq -0x94(%rbp),%rax
movl   $0x0,-0x160(%rbp,%rax,4)
movslq -0x94(%rbp),%rax
cmpl   $0x100,-0x50(%rbp,%rax,4)
jle    1223 <main+0xe3>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1228 <main+0xe8>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    11a1 <main+0x61>
lea    -0x50(%rbp),%rdi
lea    -0x90(%rbp),%rsi
lea    -0x120(%rbp),%rdx
lea    -0x160(%rbp),%rcx
call   1060 <foo@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0x10,-0x94(%rbp)
jge    12d5 <main+0x195>
movslq -0x94(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%eax
movslq -0x94(%rbp),%rcx
cmp    -0xe0(%rbp,%rcx,4),%eax
jne    12b5 <main+0x175>
movslq -0x94(%rbp),%rax
mov    -0x160(%rbp,%rax,4),%eax
movslq -0x94(%rbp),%rcx
cmp    -0x1a0(%rbp,%rcx,4),%eax
je     12bc <main+0x17c>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    12c1 <main+0x181>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1264 <main+0x124>
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>
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps 0xe87(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0x80(%rsp)
movaps 0xe80(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps 0xe79(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps 0xe72(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xb0(%rsp)
lea    0xc0(%rsp),%rdi
lea    0x40(%rsp),%rsi
lea    0x80(%rsp),%rdx
mov    %rsp,%rcx
call   1050 <foo@plt>
lea    0xe4e(%rip),%rax
lea    0xe87(%rip),%rcx
nopl   0x0(%rax)
mov    0x40(%rsp,%rbx,4),%edx
cmp    (%rax,%rbx,4),%edx
jne    123a <main+0x10a>
mov    (%rsp,%rbx,4),%edx
cmp    (%rcx,%rbx,4),%edx
jne    123a <main+0x10a>
mov    0x44(%rsp,%rbx,4),%edx
cmp    0x4(%rax,%rbx,4),%edx
jne    123a <main+0x10a>
mov    0x4(%rsp,%rbx,4),%edx
cmp    0x4(%rcx,%rbx,4),%edx
jne    123a <main+0x10a>
add    $0x2,%rbx
cmp    $0x10,%rbx
jne    1200 <main+0xd0>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret
xor    %eax,%eax
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 = bitcast [16 x i32]* %9 to i8*
%14 = bitcast [16 x i32]* %12 to i8*
%15 = call i32 (...) @check_vect()
%16 = call i32 (...) @check_vect()
store i32 0, i32* %8
br label %17
17: ; preds = %45, %2
%18 = load i32, i32* %8
%19 = icmp slt i32 %18, 16
br i1 %19, label %20, label %48
20: ; preds = %17
%21 = load i32, i32* %8
%22 = srem i32 %21, 256
%23 = load i32, i32* %8
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 %24
store i32 %22, i32* %25
%26 = load i32, i32* %8
%27 = srem i32 %26, 256
%28 = load i32, i32* %8
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 %29
store i32 %27, i32* %30
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 %32
store i32 0, i32* %33
%34 = load i32, i32* %8
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [16 x i32], [16 x i32]* %11, i64 0, i64 %35
store i32 0, i32* %36
%37 = load i32, i32* %8
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 %38
%40 = load i32, i32* %39
%41 = icmp sgt i32 %40, 256
br i1 %41, label %42, label %44
42: ; preds = %20
%43 = call i32 (...) @abort()
unreachable
44: ; preds = %20
br label %45
45: ; preds = %44
%46 = load i32, i32* %8
%47 = add nsw i32 %46, 1
store i32 %47, i32* %8
br label %17
48: ; preds = %17
%49 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 0
%50 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 0
%51 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 0
%52 = getelementptr inbounds [16 x i32], [16 x i32]* %11, i64 0, i64 0
%53 = call i32 @foo(i32* %49, i32* %50, i32* %51, i32* %52)
store i32 0, i32* %8
br label %54
54: ; preds = %80, %48
%55 = load i32, i32* %8
%56 = icmp slt i32 %55, 16
br i1 %56, label %57, label %83
57: ; preds = %54
%58 = load i32, i32* %8
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 %59
%61 = load i32, i32* %60
%62 = load i32, i32* %8
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [16 x i32], [16 x i32]* %9, i64 0, i64 %63
%65 = load i32, i32* %64
%66 = icmp ne i32 %61, %65
br i1 %66, label %77, label %67
67: ; preds = %57
%68 = load i32, i32* %8
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [16 x i32], [16 x i32]* %11, i64 0, i64 %69
%71 = load i32, i32* %70
%72 = load i32, i32* %8
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [16 x i32], [16 x i32]* %12, i64 0, i64 %73
%75 = load i32, i32* %74
%76 = icmp ne i32 %71, %75
br i1 %76, label %77, label %79
77: ; preds = %67, %57
%78 = call i32 (...) @abort()
unreachable
79: ; preds = %67
br label %80
80: ; preds = %79
%81 = load i32, i32* %8
%82 = add nsw i32 %81, 1
store i32 %82, i32* %8
br label %54
83: ; preds = %54
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 = bitcast [16 x i32]* %4 to i8*
%6 = alloca [16 x i32]
%7 = alloca [16 x i32]
%8 = bitcast [16 x i32]* %7 to i8*
%9 = bitcast [16 x i32]* %3 to i8*
%10 = bitcast [16 x i32]* %6 to i8*
%11 = tail call i32 (...) @check_vect()
%12 = tail call i32 (...) @check_vect()
%13 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%14 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 0
%15 = bitcast [16 x i32]* %3 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %15
%16 = bitcast [16 x i32]* %6 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %16
%17 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 4
%18 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 4
%19 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %19
%20 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %20
%21 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 8
%22 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 8
%23 = bitcast i32* %21 to <4 x i32>*
store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, <4 x i32>* %23
%24 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, <4 x i32>* %24
%25 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 12
%26 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 12
%27 = bitcast i32* %25 to <4 x i32>*
store <4 x i32> <i32 12, i32 13, i32 14, i32 15>, <4 x i32>* %27
%28 = bitcast i32* %26 to <4 x i32>*
store <4 x i32> <i32 12, i32 13, i32 14, i32 15>, <4 x i32>* %28
%29 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 0
%30 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 0
%31 = call i32 @foo(i32* %13, i32* %29, i32* %14, i32* %30)
br label %48
32: ; preds = %55
%33 = or i64 %49, 1
%34 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = getelementptr inbounds [16 x i32], [16 x i32]* @__const.main.check_results, i64 0, i64 %33
%37 = load i32, i32* %36
%38 = icmp eq i32 %35, %37
br i1 %38, label %39, label %61
39: ; preds = %32
%40 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 %33
%41 = load i32, i32* %40
%42 = getelementptr inbounds [16 x i32], [16 x i32]* @__const.main.check_results2, i64 0, i64 %33
%43 = load i32, i32* %42
%44 = icmp eq i32 %41, %43
br i1 %44, label %45, label %61
45: ; preds = %39
%46 = add nuw nsw i64 %49, 2
%47 = icmp eq i64 %46, 16
br i1 %47, label %63, label %48
48: ; preds = %45, %2
%49 = phi i64 [ 0, %2 ], [ %46, %45 ]
%50 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 %49
%51 = load i32, i32* %50
%52 = getelementptr inbounds [16 x i32], [16 x i32]* @__const.main.check_results, i64 0, i64 %49
%53 = load i32, i32* %52
%54 = icmp eq i32 %51, %53
br i1 %54, label %55, label %61
55: ; preds = %48
%56 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 %49
%57 = load i32, i32* %56
%58 = getelementptr inbounds [16 x i32], [16 x i32]* @__const.main.check_results2, i64 0, i64 %49
%59 = load i32, i32* %58
%60 = icmp eq i32 %57, %59
br i1 %60, label %32, label %61
61: ; preds = %39, %32, %55, %48
%62 = call i32 (...) @abort()
unreachable
63: ; preds = %45
ret i32 0
}