#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*/ assert(int);
void test_short() {
  signed short b[100];
  signed short i, j, x = -1, y = -1;
#pragma acc parallel loop copyout(b)
  for (j = 0; j > -5; j--) {
    short c = x + y;
#pragma acc loop vector
    for (i = 0; i < 20; i++)
      b[-j * 20 + i] = c;
    b[5 - j] = c;
  }
  for (i = 0; i < 100; i++)
    assert(b[i] == -2);
}


x86 assembly (clang, -O0):
<test_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movw   $0xffff,-0xd6(%rbp)
ff ff
movw   $0xffff,-0xd8(%rbp)
ff ff
movw   $0x0,-0xd4(%rbp)
movswl -0xd4(%rbp),%eax
cmp    $0xfffffffb,%eax
jle    11eb <test_short+0xdb>
movswl -0xd6(%rbp),%eax
movswl -0xd8(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0xda(%rbp)
movw   $0x0,-0xd2(%rbp)
movswl -0xd2(%rbp),%eax
cmp    $0x14,%eax
jge    11b5 <test_short+0xa5>
mov    -0xda(%rbp),%cx
movswl -0xd4(%rbp),%edx
xor    %eax,%eax
sub    %edx,%eax
imul   $0x14,%eax,%eax
movswl -0xd2(%rbp),%edx
add    %edx,%eax
cltq
mov    %cx,-0xd0(%rbp,%rax,2)
ff
mov    -0xd2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xd2(%rbp)
jmp    1166 <test_short+0x56>
mov    -0xda(%rbp),%cx
movswl -0xd4(%rbp),%edx
mov    $0x5,%eax
sub    %edx,%eax
cltq
mov    %cx,-0xd0(%rbp,%rax,2)
ff
mov    -0xd4(%rbp),%ax
add    $0xffff,%ax
mov    %ax,-0xd4(%rbp)
jmp    1136 <test_short+0x26>
movw   $0x0,-0xd2(%rbp)
movswl -0xd2(%rbp),%eax
cmp    $0x64,%eax
jge    123b <test_short+0x12b>
movswq -0xd2(%rbp),%rax
ff
movswl -0xd0(%rbp,%rax,2),%eax
ff
cmp    $0xfffffffe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xd2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xd2(%rbp)
jmp    11f4 <test_short+0xe4>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_short>:
push   %rbx
sub    $0xd0,%rsp
movabs $0xfffefffefffefffe,%rax
ff fe ff
mov    %rax,(%rsp)
movw   $0xfffe,0x8(%rsp)
movaps 0xecc(%rip),%xmm0
movups %xmm0,0x12(%rsp)
movl   $0xfffefffe,0x22(%rsp)
ff
movw   $0xfffe,0x26(%rsp)
movl   $0xfffefffe,0xa(%rsp)
ff
movl   $0xfffefffe,0x28(%rsp)
ff
movw   $0xfffe,0x2c(%rsp)
movups %xmm0,0x2e(%rsp)
movups %xmm0,0x3e(%rsp)
movw   $0xfffe,0x4e(%rsp)
movl   $0xfffefffe,0x50(%rsp)
ff
movw   $0xfffe,0x54(%rsp)
movups %xmm0,0x56(%rsp)
movups %xmm0,0x66(%rsp)
movw   $0xfffe,0xe(%rsp)
movups %xmm0,0x76(%rsp)
movups %xmm0,0x86(%rsp)
mov    %rax,0x96(%rsp)
movw   $0xfffe,0x9e(%rsp)
movl   $0xfffefffe,0x10(%rsp)
ff
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0xb0(%rsp)
mov    %rax,0xc0(%rsp)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
cmpw   $0xfffe,(%rsp,%rbx,2)
sete   %dil
call   1030 <assert@plt>
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    11e0 <test_short+0xd0>
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @test_short() {
%1 = alloca [100 x i16]
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 -1, i16* %4
store i16 -1, i16* %5
store i16 0, i16* %3
br label %7
7: ; preds = %43, %0
%8 = load i16, i16* %3
%9 = sext i16 %8 to i32
%10 = icmp sgt i32 %9, -5
br i1 %10, label %11, label %46
11: ; preds = %7
%12 = load i16, i16* %4
%13 = sext i16 %12 to i32
%14 = load i16, i16* %5
%15 = sext i16 %14 to i32
%16 = add nsw i32 %13, %15
%17 = trunc i32 %16 to i16
store i16 %17, i16* %6
store i16 0, i16* %2
br label %18
18: ; preds = %33, %11
%19 = load i16, i16* %2
%20 = sext i16 %19 to i32
%21 = icmp slt i32 %20, 20
br i1 %21, label %22, label %36
22: ; preds = %18
%23 = load i16, i16* %6
%24 = load i16, i16* %3
%25 = sext i16 %24 to i32
%26 = sub nsw i32 0, %25
%27 = mul nsw i32 %26, 20
%28 = load i16, i16* %2
%29 = sext i16 %28 to i32
%30 = add nsw i32 %27, %29
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 %31
store i16 %23, i16* %32
br label %33
33: ; preds = %22
%34 = load i16, i16* %2
%35 = add i16 %34, 1
store i16 %35, i16* %2
br label %18
36: ; preds = %18
%37 = load i16, i16* %6
%38 = load i16, i16* %3
%39 = sext i16 %38 to i32
%40 = sub nsw i32 5, %39
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 %41
store i16 %37, i16* %42
br label %43
43: ; preds = %36
%44 = load i16, i16* %3
%45 = add i16 %44, -1
store i16 %45, i16* %3
br label %7
46: ; preds = %7
store i16 0, i16* %2
br label %47
47: ; preds = %60, %46
%48 = load i16, i16* %2
%49 = sext i16 %48 to i32
%50 = icmp slt i32 %49, 100
br i1 %50, label %51, label %63
51: ; preds = %47
%52 = load i16, i16* %2
%53 = sext i16 %52 to i64
%54 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 %53
%55 = load i16, i16* %54
%56 = sext i16 %55 to i32
%57 = icmp eq i32 %56, -2
%58 = zext i1 %57 to i32
%59 = call i32 @assert(i32 %58)
br label %60
60: ; preds = %51
%61 = load i16, i16* %2
%62 = add i16 %61, 1
store i16 %62, i16* %2
br label %47
63: ; preds = %47
ret void
}

LLVM IR (-O2):
define void @test_short() {
%1 = alloca [100 x i16]
%2 = bitcast [100 x i16]* %1 to i8*
%3 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 0
store i16 -2, i16* %3
%4 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 1
store i16 -2, i16* %4
%5 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 2
store i16 -2, i16* %5
%6 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 3
store i16 -2, i16* %6
%7 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 4
store i16 -2, i16* %7
%8 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 5
%9 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 6
%10 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 7
%11 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 8
%12 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 9
%13 = bitcast i16* %12 to <8 x i16>*
store <8 x i16> <i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2>, <8 x i16>* %13
%14 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 17
store i16 -2, i16* %14
%15 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 18
store i16 -2, i16* %15
%16 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 19
store i16 -2, i16* %16
store i16 -2, i16* %8
%17 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 20
store i16 -2, i16* %17
%18 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 21
store i16 -2, i16* %18
%19 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 22
store i16 -2, i16* %19
%20 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 23
%21 = bitcast i16* %20 to <8 x i16>*
store <8 x i16> <i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2>, <8 x i16>* %21
%22 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 31
%23 = bitcast i16* %22 to <8 x i16>*
store <8 x i16> <i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2>, <8 x i16>* %23
%24 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 39
store i16 -2, i16* %24
store i16 -2, i16* %9
%25 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 40
store i16 -2, i16* %25
%26 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 41
store i16 -2, i16* %26
%27 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 42
store i16 -2, i16* %27
%28 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 43
%29 = bitcast i16* %28 to <8 x i16>*
store <8 x i16> <i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2>, <8 x i16>* %29
%30 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 51
%31 = bitcast i16* %30 to <8 x i16>*
store <8 x i16> <i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2>, <8 x i16>* %31
%32 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 59
store i16 -2, i16* %10
%33 = bitcast i16* %32 to <8 x i16>*
store <8 x i16> <i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2>, <8 x i16>* %33
%34 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 67
%35 = bitcast i16* %34 to <8 x i16>*
store <8 x i16> <i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2>, <8 x i16>* %35
%36 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 75
store i16 -2, i16* %36
%37 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 76
store i16 -2, i16* %37
%38 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 77
store i16 -2, i16* %38
%39 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 78
store i16 -2, i16* %39
%40 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 79
store i16 -2, i16* %40
store i16 -2, i16* %11
%41 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 80
%42 = bitcast i16* %41 to <8 x i16>*
store <8 x i16> <i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2>, <8 x i16>* %42
%43 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 88
%44 = bitcast i16* %43 to <8 x i16>*
store <8 x i16> <i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2, i16 -2>, <8 x i16>* %44
%45 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 96
store i16 -2, i16* %45
%46 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 97
store i16 -2, i16* %46
%47 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 98
store i16 -2, i16* %47
%48 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 99
store i16 -2, i16* %48
store i16 -2, i16* %12
br label %49
49: ; preds = %0, %49
%50 = phi i64 [ 0, %0 ], [ %56, %49 ]
%51 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 %50
%52 = load i16, i16* %51
%53 = icmp eq i16 %52, -2
%54 = zext i1 %53 to i32
%55 = tail call i32 @assert(i32 %54)
%56 = add nuw nsw i64 %50, 1
%57 = icmp eq i64 %56, 100
br i1 %57, label %58, label %49
58: ; preds = %49
ret void
}