#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*/ VecBug(short **);
int /*<<< orphan*/ VecBug2(short **);
int /*<<< orphan*/ check_vect();
int main(int argc, char **argv) {
  check_vect();
  short Kernel[8][24] __attribute__((__aligned__(16)));
  int k, i;
  for (k = 0; k < 8; k++)
    for (i = 0; i < 24; i++)
      Kernel[k][i] = 0;
  VecBug(Kernel);
  VecBug2(Kernel);
  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   1050 <check_vect@plt>
movl   $0x0,-0x194(%rbp)
cmpl   $0x8,-0x194(%rbp)
jge    11cd <main+0x9d>
movl   $0x0,-0x198(%rbp)
cmpl   $0x18,-0x198(%rbp)
jge    11b4 <main+0x84>
movslq -0x194(%rbp),%rcx
lea    -0x190(%rbp),%rax
imul   $0x30,%rcx,%rcx
add    %rcx,%rax
movslq -0x198(%rbp),%rcx
movw   $0x0,(%rax,%rcx,2)
mov    -0x198(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x198(%rbp)
jmp    1171 <main+0x41>
jmp    11b9 <main+0x89>
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    115a <main+0x2a>
lea    -0x190(%rbp),%rdi
call   1040 <VecBug@plt>
lea    -0x190(%rbp),%rdi
call   1030 <VecBug2@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x180,%rsp
xor    %eax,%eax
call   1050 <check_vect@plt>
mov    %rsp,%rbx
mov    $0x180,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
mov    %rbx,%rdi
call   1040 <VecBug@plt>
mov    %rbx,%rdi
call   1030 <VecBug2@plt>
xor    %eax,%eax
add    $0x180,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x [24 x i16]]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (...) @check_vect()
store i32 0, i32* %7
br label %10
10: ; preds = %28, %2
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 8
br i1 %12, label %13, label %31
13: ; preds = %10
store i32 0, i32* %8
br label %14
14: ; preds = %24, %13
%15 = load i32, i32* %8
%16 = icmp slt i32 %15, 24
br i1 %16, label %17, label %27
17: ; preds = %14
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [8 x [24 x i16]], [8 x [24 x i16]]* %6, i64 0, i64 %19
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [24 x i16], [24 x i16]* %20, i64 0, i64 %22
store i16 0, i16* %23
br label %24
24: ; preds = %17
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %14
27: ; preds = %14
br label %28
28: ; preds = %27
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %10
31: ; preds = %10
%32 = getelementptr inbounds [8 x [24 x i16]], [8 x [24 x i16]]* %6, i64 0, i64 0
%33 = bitcast [24 x i16]* %32 to i16**
%34 = call i32 @VecBug(i16** %33)
%35 = getelementptr inbounds [8 x [24 x i16]], [8 x [24 x i16]]* %6, i64 0, i64 0
%36 = bitcast [24 x i16]* %35 to i16**
%37 = call i32 @VecBug2(i16** %36)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x [24 x i16]]
%4 = bitcast [8 x [24 x i16]]* %3 to i8*
%5 = tail call i32 (...) @check_vect()
%6 = bitcast [8 x [24 x i16]]* %3 to i16**
%7 = call i32 @VecBug(i16** %6)
%8 = call i32 @VecBug2(i16** %6)
ret i32 0
}