#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] = {0,    112,  810, 336, 1620, 560, 2430, 784,
                            3240, 1008, 0,   0,   0,    0,   0,    0};
  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>
movl   $0x0,-0x94(%rbp)
cmpl   $0x10,-0x94(%rbp)
jge    1235 <main+0xf5>
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    121c <main+0xdc>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1221 <main+0xe1>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    119a <main+0x5a>
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    12ce <main+0x18e>
movslq -0x94(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%eax
movslq -0x94(%rbp),%rcx
cmp    -0xe0(%rbp,%rcx,4),%eax
jne    12ae <main+0x16e>
movslq -0x94(%rbp),%rax
mov    -0x160(%rbp,%rax,4),%eax
movslq -0x94(%rbp),%rcx
cmp    -0x1a0(%rbp,%rcx,4),%eax
je     12b5 <main+0x175>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    12ba <main+0x17a>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    125d <main+0x11d>
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>
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 0xe8e(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0x80(%rsp)
movaps 0xe87(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps 0xe80(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps 0xe79(%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    0xe55(%rip),%rax
lea    0xe8e(%rip),%rcx
cs nopw 0x0(%rax,%rax,1)
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 0, i32 112, i32 810, i32 336, i32 1620, i32 560, i32 2430, i32 784, i32 3240, i32 1008, 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()
store i32 0, i32* %8
br label %16
16: ; preds = %44, %2
%17 = load i32, i32* %8
%18 = icmp slt i32 %17, 16
br i1 %18, label %19, label %47
19: ; preds = %16
%20 = load i32, i32* %8
%21 = srem i32 %20, 256
%22 = load i32, i32* %8
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 %23
store i32 %21, i32* %24
%25 = load i32, i32* %8
%26 = srem i32 %25, 256
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 %28
store i32 %26, i32* %29
%30 = load i32, i32* %8
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 %31
store i32 0, i32* %32
%33 = load i32, i32* %8
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [16 x i32], [16 x i32]* %11, i64 0, i64 %34
store i32 0, i32* %35
%36 = load i32, i32* %8
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = icmp sgt i32 %39, 256
br i1 %40, label %41, label %43
41: ; preds = %19
%42 = call i32 (...) @abort()
unreachable
43: ; preds = %19
br label %44
44: ; preds = %43
%45 = load i32, i32* %8
%46 = add nsw i32 %45, 1
store i32 %46, i32* %8
br label %16
47: ; preds = %16
%48 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 0
%49 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 0
%50 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 0
%51 = getelementptr inbounds [16 x i32], [16 x i32]* %11, i64 0, i64 0
%52 = call i32 @foo(i32* %48, i32* %49, i32* %50, i32* %51)
store i32 0, i32* %8
br label %53
53: ; preds = %79, %47
%54 = load i32, i32* %8
%55 = icmp slt i32 %54, 16
br i1 %55, label %56, label %82
56: ; preds = %53
%57 = load i32, i32* %8
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = load i32, i32* %8
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [16 x i32], [16 x i32]* %9, i64 0, i64 %62
%64 = load i32, i32* %63
%65 = icmp ne i32 %60, %64
br i1 %65, label %76, label %66
66: ; preds = %56
%67 = load i32, i32* %8
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [16 x i32], [16 x i32]* %11, i64 0, i64 %68
%70 = load i32, i32* %69
%71 = load i32, i32* %8
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [16 x i32], [16 x i32]* %12, i64 0, i64 %72
%74 = load i32, i32* %73
%75 = icmp ne i32 %70, %74
br i1 %75, label %76, label %78
76: ; preds = %66, %56
%77 = call i32 (...) @abort()
unreachable
78: ; preds = %66
br label %79
79: ; preds = %78
%80 = load i32, i32* %8
%81 = add nsw i32 %80, 1
store i32 %81, i32* %8
br label %53
82: ; preds = %53
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 0, i32 112, i32 810, i32 336, i32 1620, i32 560, i32 2430, i32 784, i32 3240, i32 1008, 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 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%13 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 0
%14 = bitcast [16 x i32]* %3 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %14
%15 = bitcast [16 x i32]* %6 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %15
%16 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 4
%17 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 4
%18 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %18
%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 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 8
%21 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 8
%22 = bitcast i32* %20 to <4 x i32>*
store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, <4 x i32>* %22
%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 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 12
%25 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 12
%26 = bitcast i32* %24 to <4 x i32>*
store <4 x i32> <i32 12, i32 13, i32 14, i32 15>, <4 x i32>* %26
%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 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 0
%29 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 0
%30 = call i32 @foo(i32* %12, i32* %28, i32* %13, i32* %29)
br label %47
31: ; preds = %54
%32 = or i64 %48, 1
%33 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = getelementptr inbounds [16 x i32], [16 x i32]* @__const.main.check_results, i64 0, i64 %32
%36 = load i32, i32* %35
%37 = icmp eq i32 %34, %36
br i1 %37, label %38, label %60
38: ; preds = %31
%39 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 %32
%40 = load i32, i32* %39
%41 = getelementptr inbounds [16 x i32], [16 x i32]* @__const.main.check_results2, i64 0, i64 %32
%42 = load i32, i32* %41
%43 = icmp eq i32 %40, %42
br i1 %43, label %44, label %60
44: ; preds = %38
%45 = add nuw nsw i64 %48, 2
%46 = icmp eq i64 %45, 16
br i1 %46, label %62, label %47
47: ; preds = %44, %2
%48 = phi i64 [ 0, %2 ], [ %45, %44 ]
%49 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 %48
%50 = load i32, i32* %49
%51 = getelementptr inbounds [16 x i32], [16 x i32]* @__const.main.check_results, i64 0, i64 %48
%52 = load i32, i32* %51
%53 = icmp eq i32 %50, %52
br i1 %53, label %54, label %60
54: ; preds = %47
%55 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 %48
%56 = load i32, i32* %55
%57 = getelementptr inbounds [16 x i32], [16 x i32]* @__const.main.check_results2, i64 0, i64 %48
%58 = load i32, i32* %57
%59 = icmp eq i32 %56, %58
br i1 %59, label %31, label %60
60: ; preds = %38, %31, %54, %47
%61 = call i32 (...) @abort()
unreachable
62: ; preds = %44
ret i32 0
}