int main(void) {
  int i;
  int sum;
  short X[64];
  check_vect();
  for (i = 0; i < 64; i++) {
    X[i] = 16 - i;
    __asm__ volatile("");
  }
  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
mov    $0x0,%al
call   1050 <main1@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     11ae <main+0x7e>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <check_vect@plt>
mov    $0x10,%ax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ax,(%rsp,%rbx,2)
add    $0x1,%rbx
add    $0xffffffff,%eax
cmp    $0x40,%rbx
jne    1150 <main+0x20>
mov    %rsp,%rdi
mov    $0x1,%esi
mov    $0x10,%edx
mov    $0x3f,%ecx
xor    %eax,%eax
call   1050 <main1@plt>
test   %eax,%eax
jne    1189 <main+0x59>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret
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 (i16*, i32, i32, i32, ...) bitcast (i32 (...)* @main1 to i32 (i16*, i32, i32, i32, ...)*)(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 %25
24: ; preds = %19
unreachable
25: ; 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()
br label %4
4: ; preds = %0, %4
%5 = phi i64 [ 0, %0 ], [ %9, %4 ]
%6 = trunc i64 %5 to i16
%7 = sub nsw i16 16, %6
%8 = getelementptr inbounds [64 x i16], [64 x i16]* %1, i64 0, i64 %5
store i16 %7, i16* %8
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%9 = add nuw nsw i64 %5, 1
%10 = icmp eq i64 %9, 64
br i1 %10, label %11, label %4
11: ; preds = %4
%12 = getelementptr inbounds [64 x i16], [64 x i16]* %1, i64 0, i64 0
%13 = call i32 (i16*, i32, i32, i32, ...) bitcast (i32 (...)* @main1 to i32 (i16*, i32, i32, i32, ...)*)(i16* %12, i32 1, i32 16, i32 63)
%14 = icmp eq i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %11
unreachable
16: ; preds = %11
ret i32 0
}