#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_char() {
  char b[100];
  char i, j, x = -1, y = -1;
#pragma acc parallel loop copyout(b)
  for (j = 0; j > -5; j--) {
    char 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_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movb   $0xff,-0x73(%rbp)
movb   $0xff,-0x74(%rbp)
movb   $0x0,-0x72(%rbp)
movsbl -0x72(%rbp),%eax
cmp    $0xfffffffb,%eax
jle    119a <test_char+0x8a>
movsbl -0x73(%rbp),%eax
movsbl -0x74(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x75(%rbp)
movb   $0x0,-0x71(%rbp)
movsbl -0x71(%rbp),%eax
cmp    $0x14,%eax
jge    1179 <test_char+0x69>
mov    -0x75(%rbp),%cl
movsbl -0x72(%rbp),%edx
xor    %eax,%eax
sub    %edx,%eax
imul   $0x14,%eax,%eax
movsbl -0x71(%rbp),%edx
add    %edx,%eax
cltq
mov    %cl,-0x70(%rbp,%rax,1)
mov    -0x71(%rbp),%al
add    $0x1,%al
mov    %al,-0x71(%rbp)
jmp    1145 <test_char+0x35>
mov    -0x75(%rbp),%cl
movsbl -0x72(%rbp),%edx
mov    $0x5,%eax
sub    %edx,%eax
cltq
mov    %cl,-0x70(%rbp,%rax,1)
mov    -0x72(%rbp),%al
add    $0xff,%al
mov    %al,-0x72(%rbp)
jmp    1127 <test_char+0x17>
movb   $0x0,-0x71(%rbp)
movsbl -0x71(%rbp),%eax
cmp    $0x64,%eax
jge    11d2 <test_char+0xc2>
movsbq -0x71(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0xfffffffe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x71(%rbp),%al
add    $0x1,%al
mov    %al,-0x71(%rbp)
jmp    119e <test_char+0x8e>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_char>:
push   %rbx
sub    $0x70,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0xfefefefe,0x60(%rsp)
fe
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%ebx
xor    %edi,%edi
cmpb   $0xfe,(%rsp,%rbx,1)
sete   %dil
call   1030 <assert@plt>
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1150 <test_char+0x40>
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @test_char() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = tail call i32 @assert(i32 1)
br label %5
5: ; preds = %0, %5
%6 = phi i64 [ 1, %0 ], [ %12, %5 ]
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, -2
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = add nuw nsw i64 %6, 1
%13 = icmp eq i64 %12, 100
br i1 %13, label %14, label %5
14: ; preds = %5
ret void
}