#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 main1(short *, int, int, int);
int main(void) {
  int i;
  int sum;
  short X[64];
  check_vect();
  for (i = 0; i < 64; i++) {
    X[i] = 16 - i;
  }
  sum = main1(X, 1, 16, 64 - 1);
  if (sum != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <check_vect@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
jge    117f <main+0x4f>
mov    $0x10,%eax
sub    -0x8(%rbp),%eax
mov    %ax,%cx
movslq -0x8(%rbp),%rax
mov    %cx,-0x90(%rbp,%rax,2)
ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <main+0x20>
lea    -0x90(%rbp),%rdi
mov    $0x1,%esi
mov    $0x10,%edx
mov    $0x3f,%ecx
call   1050 <main1@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     11ae <main+0x7e>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x88,%rsp
xor    %eax,%eax
call   1040 <check_vect@plt>
movaps 0xebb(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xec0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xed0(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
mov    $0x10,%edx
mov    $0x3f,%ecx
call   1050 <main1@plt>
test   %eax,%eax
jne    11c2 <main+0x92>
xor    %eax,%eax
add    $0x88,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [64 x i16]
store i32 0, i32* %1
%5 = call i32 (...) @check_vect()
store i32 0, i32* %2
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 64
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %2
%11 = sub nsw i32 16, %10
%12 = trunc i32 %11 to i16
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [64 x i16], [64 x i16]* %4, i64 0, i64 %14
store i16 %12, i16* %15
br label %16
16: ; preds = %9
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %6
19: ; preds = %6
%20 = getelementptr inbounds [64 x i16], [64 x i16]* %4, i64 0, i64 0
%21 = call i32 @main1(i16* %20, i32 1, i32 16, i32 63)
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %19
%25 = call i32 (...) @abort()
unreachable
26: ; preds = %19
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [64 x i16]
%2 = bitcast [64 x i16]* %1 to i8*
%3 = tail call i32 (...) @check_vect()
%4 = bitcast [64 x i16]* %1 to <8 x i16>*
store <8 x i16> <i16 16, i16 15, i16 14, i16 13, i16 12, i16 11, i16 10, i16 9>, <8 x i16>* %4
%5 = getelementptr inbounds [64 x i16], [64 x i16]* %1, i64 0, i64 8
%6 = bitcast i16* %5 to <8 x i16>*
store <8 x i16> <i16 8, i16 7, i16 6, i16 5, i16 4, i16 3, i16 2, i16 1>, <8 x i16>* %6
%7 = getelementptr inbounds [64 x i16], [64 x i16]* %1, i64 0, i64 16
%8 = bitcast i16* %7 to <8 x i16>*
store <8 x i16> <i16 0, i16 -1, i16 -2, i16 -3, i16 -4, i16 -5, i16 -6, i16 -7>, <8 x i16>* %8
%9 = getelementptr inbounds [64 x i16], [64 x i16]* %1, i64 0, i64 24
%10 = bitcast i16* %9 to <8 x i16>*
store <8 x i16> <i16 -8, i16 -9, i16 -10, i16 -11, i16 -12, i16 -13, i16 -14, i16 -15>, <8 x i16>* %10
%11 = getelementptr inbounds [64 x i16], [64 x i16]* %1, i64 0, i64 32
%12 = bitcast i16* %11 to <8 x i16>*
store <8 x i16> <i16 -16, i16 -17, i16 -18, i16 -19, i16 -20, i16 -21, i16 -22, i16 -23>, <8 x i16>* %12
%13 = getelementptr inbounds [64 x i16], [64 x i16]* %1, i64 0, i64 40
%14 = bitcast i16* %13 to <8 x i16>*
store <8 x i16> <i16 -24, i16 -25, i16 -26, i16 -27, i16 -28, i16 -29, i16 -30, i16 -31>, <8 x i16>* %14
%15 = getelementptr inbounds [64 x i16], [64 x i16]* %1, i64 0, i64 48
%16 = bitcast i16* %15 to <8 x i16>*
store <8 x i16> <i16 -32, i16 -33, i16 -34, i16 -35, i16 -36, i16 -37, i16 -38, i16 -39>, <8 x i16>* %16
%17 = getelementptr inbounds [64 x i16], [64 x i16]* %1, i64 0, i64 56
%18 = bitcast i16* %17 to <8 x i16>*
store <8 x i16> <i16 -40, i16 -41, i16 -42, i16 -43, i16 -44, i16 -45, i16 -46, i16 -47>, <8 x i16>* %18
%19 = getelementptr inbounds [64 x i16], [64 x i16]* %1, i64 0, i64 0
%20 = call i32 @main1(i16* %19, i32 1, i32 16, i32 63)
%21 = icmp eq i32 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %0
%23 = call i32 (...) @abort()
unreachable
24: ; preds = %0
ret i32 0
}