#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int main() {
  int A[128];
  int n = 128;
  A[0] = 0;
#pragma scop
  for (int i = 0; i < n; ++i) {
    int set = 0;
    if (A[i] < 2)
      set = 1;
    if (set)
      A[i] = 2;
  }
#pragma endscop
  if (A[0] != 2)
    return EXIT_FAILURE;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x80,-0x214(%rbp)
movl   $0x0,-0x210(%rbp)
movl   $0x0,-0x218(%rbp)
mov    -0x218(%rbp),%eax
cmp    -0x214(%rbp),%eax
jge    11a3 <main+0xa3>
movl   $0x0,-0x21c(%rbp)
movslq -0x218(%rbp),%rax
cmpl   $0x2,-0x210(%rbp,%rax,4)
02
jge    116b <main+0x6b>
movl   $0x1,-0x21c(%rbp)
cmpl   $0x0,-0x21c(%rbp)
je     118a <main+0x8a>
movslq -0x218(%rbp),%rax
movl   $0x2,-0x210(%rbp,%rax,4)
jmp    118f <main+0x8f>
mov    -0x218(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x218(%rbp)
jmp    1130 <main+0x30>
cmpl   $0x2,-0x210(%rbp)
je     11c1 <main+0xc1>
mov    0x2e29(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11cd <main+0xcd>
mov    0x2e10(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x188,%rsp
movl   $0x2,-0x80(%rsp)
mov    $0xd,%eax
movdqa 0xee4(%rip),%xmm0
nopl   0x0(%rax)
movdqu -0xb0(%rsp,%rax,4),%xmm1
ff ff
movdqu -0xa0(%rsp,%rax,4),%xmm2
ff ff
movdqu -0x90(%rsp,%rax,4),%xmm3
ff ff
movdqa %xmm1,%xmm4
pcmpgtd %xmm0,%xmm4
pand   %xmm4,%xmm1
pandn  %xmm0,%xmm4
por    %xmm1,%xmm4
movdqu %xmm4,-0xb0(%rsp,%rax,4)
ff ff
movdqa %xmm2,%xmm1
pcmpgtd %xmm0,%xmm1
pand   %xmm1,%xmm2
pandn  %xmm0,%xmm1
por    %xmm2,%xmm1
movdqu %xmm1,-0xa0(%rsp,%rax,4)
ff ff
movdqa %xmm3,%xmm1
pcmpgtd %xmm0,%xmm1
pand   %xmm1,%xmm3
pandn  %xmm0,%xmm1
por    %xmm3,%xmm1
movdqu %xmm1,-0x90(%rsp,%rax,4)
ff ff
cmp    $0x7d,%rax
je     11c1 <main+0xc1>
movdqu -0x80(%rsp,%rax,4),%xmm1
movdqa %xmm1,%xmm2
pcmpgtd %xmm0,%xmm2
pand   %xmm2,%xmm1
pandn  %xmm0,%xmm2
por    %xmm1,%xmm2
movdqu %xmm2,-0x80(%rsp,%rax,4)
add    $0x10,%rax
jmp    1120 <main+0x20>
mov    -0x80(%rsp),%eax
mov    0x174(%rsp),%ecx
cmp    $0x3,%ecx
mov    $0x2,%edx
cmovl  %edx,%ecx
mov    %ecx,0x174(%rsp)
mov    0x178(%rsp),%ecx
cmp    $0x3,%ecx
cmovl  %edx,%ecx
mov    %ecx,0x178(%rsp)
mov    0x17c(%rsp),%ecx
cmp    $0x3,%ecx
cmovge %ecx,%edx
mov    %edx,0x17c(%rsp)
cmp    $0x2,%eax
jne    1214 <main+0x114>
mov    0x2dc6(%rip),%rax
jmp    121b <main+0x11b>
mov    0x2dc5(%rip),%rax
mov    (%rax),%eax
add    $0x188,%rsp
ret

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [128 x i32]
%2 = bitcast [128 x i32]* %1 to i8*
%3 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 0
store i32 2, i32* %3
br label %4
4: ; preds = %28, %0
%5 = phi i64 [ 0, %0 ], [ %36, %28 ]
%6 = or i64 %5, 1
%7 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 %6
%8 = bitcast i32* %7 to <4 x i32>*
%9 = load <4 x i32>, <4 x i32>* %8
%10 = icmp sgt <4 x i32> %9, <i32 2, i32 2, i32 2, i32 2>
%11 = select <4 x i1> %10, <4 x i32> %9, <4 x i32> <i32 2, i32 2, i32 2, i32 2>
%12 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> %11, <4 x i32>* %12
%13 = or i64 %5, 5
%14 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 %13
%15 = bitcast i32* %14 to <4 x i32>*
%16 = load <4 x i32>, <4 x i32>* %15
%17 = icmp sgt <4 x i32> %16, <i32 2, i32 2, i32 2, i32 2>
%18 = select <4 x i1> %17, <4 x i32> %16, <4 x i32> <i32 2, i32 2, i32 2, i32 2>
%19 = bitcast i32* %14 to <4 x i32>*
store <4 x i32> %18, <4 x i32>* %19
%20 = or i64 %5, 9
%21 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 %20
%22 = bitcast i32* %21 to <4 x i32>*
%23 = load <4 x i32>, <4 x i32>* %22
%24 = icmp sgt <4 x i32> %23, <i32 2, i32 2, i32 2, i32 2>
%25 = select <4 x i1> %24, <4 x i32> %23, <4 x i32> <i32 2, i32 2, i32 2, i32 2>
%26 = bitcast i32* %21 to <4 x i32>*
store <4 x i32> %25, <4 x i32>* %26
%27 = icmp eq i64 %5, 112
br i1 %27, label %37, label %28
28: ; preds = %4
%29 = or i64 %5, 13
%30 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 %29
%31 = bitcast i32* %30 to <4 x i32>*
%32 = load <4 x i32>, <4 x i32>* %31
%33 = icmp sgt <4 x i32> %32, <i32 2, i32 2, i32 2, i32 2>
%34 = select <4 x i1> %33, <4 x i32> %32, <4 x i32> <i32 2, i32 2, i32 2, i32 2>
%35 = bitcast i32* %30 to <4 x i32>*
store <4 x i32> %34, <4 x i32>* %35
%36 = add nuw nsw i64 %5, 16
br label %4
37: ; preds = %4
%38 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 125
%39 = load i32, i32* %38
%40 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 125
%41 = icmp sgt i32 %39, 2
%42 = select i1 %41, i32 %39, i32 2
store i32 %42, i32* %40
%43 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 126
%44 = load i32, i32* %43
%45 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 126
%46 = icmp sgt i32 %44, 2
%47 = select i1 %46, i32 %44, i32 2
store i32 %47, i32* %45
%48 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 127
%49 = load i32, i32* %48
%50 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 127
%51 = icmp sgt i32 %49, 2
%52 = select i1 %51, i32 %49, i32 2
store i32 %52, i32* %50
%53 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 0
%54 = load i32, i32* %53
%55 = icmp eq i32 %54, 2
%56 = load i32, i32* @EXIT_SUCCESS
%57 = load i32, i32* @EXIT_FAILURE
%58 = select i1 %55, i32 %56, i32 %57
ret i32 %58
}