#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*/ printf(char *);
int main(void) {
  int i, sum;
  sum = 0;
#pragma acc parallel loop reduction(+ : sum)
  for (i = 1; i < 4; i += 3) {
    sum += i;
  }
  if (sum != 1)
    return 1;
  sum = 0;
#pragma acc parallel loop reduction(+ : sum)
  for (i = 1; i < 5; i += 3) {
    sum += i;
  }
  if (sum != 5)
    return 2;
  sum = 0;
#pragma acc parallel loop reduction(+ : sum)
  for (i = 1; i < 6; i += 3) {
    sum += i;
  }
  if (sum != 5)
    return 3;
  sum = 0;
#pragma acc parallel loop reduction(+ : sum)
  for (i = 3; i > 0; i -= 3) {
    sum += i;
  }
  if (sum != 3)
    return 4;
  sum = 0;
#pragma acc parallel loop reduction(+ : sum)
  for (i = 4; i > 0; i -= 3) {
    sum += i;
  }
  if (sum != 5)
    return 5;
  sum = 0;
#pragma acc parallel loop reduction(+ : sum)
  for (i = 5; i > 0; i -= 3) {
    sum += i;
  }
  if (sum != 7)
    return 6;
  printf("PASS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    114e <main+0x3e>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
cmpl   $0x1,-0xc(%rbp)
je     1164 <main+0x54>
movl   $0x1,-0x4(%rbp)
jmp    12d0 <main+0x1c0>
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1193 <main+0x83>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
jmp    1172 <main+0x62>
cmpl   $0x5,-0xc(%rbp)
je     11a9 <main+0x99>
movl   $0x2,-0x4(%rbp)
jmp    12d0 <main+0x1c0>
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    11d8 <main+0xc8>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
jmp    11b7 <main+0xa7>
cmpl   $0x5,-0xc(%rbp)
je     11ee <main+0xde>
movl   $0x3,-0x4(%rbp)
jmp    12d0 <main+0x1c0>
movl   $0x0,-0xc(%rbp)
movl   $0x3,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    121d <main+0x10d>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x8(%rbp)
jmp    11fc <main+0xec>
cmpl   $0x3,-0xc(%rbp)
je     1233 <main+0x123>
movl   $0x4,-0x4(%rbp)
jmp    12d0 <main+0x1c0>
movl   $0x0,-0xc(%rbp)
movl   $0x4,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1262 <main+0x152>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x8(%rbp)
jmp    1241 <main+0x131>
cmpl   $0x5,-0xc(%rbp)
je     1278 <main+0x168>
movl   $0x5,-0x4(%rbp)
jmp    12d0 <main+0x1c0>
movl   $0x0,-0xc(%rbp)
movl   $0x5,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    12a7 <main+0x197>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x8(%rbp)
jmp    1286 <main+0x176>
cmpl   $0x7,-0xc(%rbp)
je     12bd <main+0x1ad>
movl   $0x6,-0x4(%rbp)
jmp    12d0 <main+0x1c0>
lea    0xd3c(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"PASS\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 1, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 4
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %9, %8
store i32 %10, i32* %3
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 3
store i32 %13, i32* %2
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 1
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 1, i32* %1
br label %95
18: ; preds = %14
store i32 0, i32* %3
store i32 1, i32* %2
br label %19
19: ; preds = %26, %18
%20 = load i32, i32* %2
%21 = icmp slt i32 %20, 5
br i1 %21, label %22, label %29
22: ; preds = %19
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = add nsw i32 %24, %23
store i32 %25, i32* %3
br label %26
26: ; preds = %22
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 3
store i32 %28, i32* %2
br label %19
29: ; preds = %19
%30 = load i32, i32* %3
%31 = icmp ne i32 %30, 5
br i1 %31, label %32, label %33
32: ; preds = %29
store i32 2, i32* %1
br label %95
33: ; preds = %29
store i32 0, i32* %3
store i32 1, i32* %2
br label %34
34: ; preds = %41, %33
%35 = load i32, i32* %2
%36 = icmp slt i32 %35, 6
br i1 %36, label %37, label %44
37: ; preds = %34
%38 = load i32, i32* %2
%39 = load i32, i32* %3
%40 = add nsw i32 %39, %38
store i32 %40, i32* %3
br label %41
41: ; preds = %37
%42 = load i32, i32* %2
%43 = add nsw i32 %42, 3
store i32 %43, i32* %2
br label %34
44: ; preds = %34
%45 = load i32, i32* %3
%46 = icmp ne i32 %45, 5
br i1 %46, label %47, label %48
47: ; preds = %44
store i32 3, i32* %1
br label %95
48: ; preds = %44
store i32 0, i32* %3
store i32 3, i32* %2
br label %49
49: ; preds = %56, %48
%50 = load i32, i32* %2
%51 = icmp sgt i32 %50, 0
br i1 %51, label %52, label %59
52: ; preds = %49
%53 = load i32, i32* %2
%54 = load i32, i32* %3
%55 = add nsw i32 %54, %53
store i32 %55, i32* %3
br label %56
56: ; preds = %52
%57 = load i32, i32* %2
%58 = sub nsw i32 %57, 3
store i32 %58, i32* %2
br label %49
59: ; preds = %49
%60 = load i32, i32* %3
%61 = icmp ne i32 %60, 3
br i1 %61, label %62, label %63
62: ; preds = %59
store i32 4, i32* %1
br label %95
63: ; preds = %59
store i32 0, i32* %3
store i32 4, i32* %2
br label %64
64: ; preds = %71, %63
%65 = load i32, i32* %2
%66 = icmp sgt i32 %65, 0
br i1 %66, label %67, label %74
67: ; preds = %64
%68 = load i32, i32* %2
%69 = load i32, i32* %3
%70 = add nsw i32 %69, %68
store i32 %70, i32* %3
br label %71
71: ; preds = %67
%72 = load i32, i32* %2
%73 = sub nsw i32 %72, 3
store i32 %73, i32* %2
br label %64
74: ; preds = %64
%75 = load i32, i32* %3
%76 = icmp ne i32 %75, 5
br i1 %76, label %77, label %78
77: ; preds = %74
store i32 5, i32* %1
br label %95
78: ; preds = %74
store i32 0, i32* %3
store i32 5, i32* %2
br label %79
79: ; preds = %86, %78
%80 = load i32, i32* %2
%81 = icmp sgt i32 %80, 0
br i1 %81, label %82, label %89
82: ; preds = %79
%83 = load i32, i32* %2
%84 = load i32, i32* %3
%85 = add nsw i32 %84, %83
store i32 %85, i32* %3
br label %86
86: ; preds = %82
%87 = load i32, i32* %2
%88 = sub nsw i32 %87, 3
store i32 %88, i32* %2
br label %79
89: ; preds = %79
%90 = load i32, i32* %3
%91 = icmp ne i32 %90, 7
br i1 %91, label %92, label %93
92: ; preds = %89
store i32 6, i32* %1
br label %95
93: ; preds = %89
%94 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %95
95: ; preds = %93, %92, %77, %62, %47, %32, %17
%96 = load i32, i32* %1
ret i32 %96
}

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}