#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*/ gang();
int /*<<< orphan*/ seq();
int /*<<< orphan*/ vector();
void worker(void) {
  gang();
  worker();
  vector();
  seq();
  int red;
#pragma acc loop reduction(+ : red)
  for (int i = 0; i < 10; i++)
    red++;
#pragma acc loop gang reduction(+ : red)
  for (int i = 0; i < 10; i++)
    red++;
#pragma acc loop worker reduction(+ : red)
  for (int i = 0; i < 10; i++)
    red++;
#pragma acc loop vector reduction(+ : red)
  for (int i = 0; i < 10; i++)
    red++;
}


x86 assembly (clang, -O0):
<worker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <gang@plt>
call   1040 <worker@plt>
mov    $0x0,%al
call   1060 <vector@plt>
mov    $0x0,%al
call   1050 <seq@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    118a <worker+0x4a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1169 <worker+0x29>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    11b2 <worker+0x72>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1191 <worker+0x51>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    11da <worker+0x9a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11b9 <worker+0x79>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1202 <worker+0xc2>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e1 <worker+0xa1>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<worker>:
push   %rax
xor    %eax,%eax
call   1030 <gang@plt>
call   1040 <worker@plt>
xor    %eax,%eax
call   1060 <vector@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <seq@plt>

LLVM IR (-O0):
define void @worker() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = call i32 (...) @gang()
%7 = call i32 (...) @vector()
%8 = call i32 (...) @seq()
store i32 0, i32* %2
br label %9
9: ; preds = %15, %0
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %15
15: ; preds = %12
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %9
18: ; preds = %9
store i32 0, i32* %3
br label %19
19: ; preds = %25, %18
%20 = load i32, i32* %3
%21 = icmp slt i32 %20, 10
br i1 %21, label %22, label %28
22: ; preds = %19
%23 = load i32, i32* %1
%24 = add nsw i32 %23, 1
store i32 %24, i32* %1
br label %25
25: ; preds = %22
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %19
28: ; preds = %19
store i32 0, i32* %4
br label %29
29: ; preds = %35, %28
%30 = load i32, i32* %4
%31 = icmp slt i32 %30, 10
br i1 %31, label %32, label %38
32: ; preds = %29
%33 = load i32, i32* %1
%34 = add nsw i32 %33, 1
store i32 %34, i32* %1
br label %35
35: ; preds = %32
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %29
38: ; preds = %29
store i32 0, i32* %5
br label %39
39: ; preds = %45, %38
%40 = load i32, i32* %5
%41 = icmp slt i32 %40, 10
br i1 %41, label %42, label %48
42: ; preds = %39
%43 = load i32, i32* %1
%44 = add nsw i32 %43, 1
store i32 %44, i32* %1
br label %45
45: ; preds = %42
%46 = load i32, i32* %5
%47 = add nsw i32 %46, 1
store i32 %47, i32* %5
br label %39
48: ; preds = %39
ret void
}

LLVM IR (-O2):
define void @worker() {
%1 = tail call i32 (...) @gang()
tail call void @worker()
%2 = tail call i32 (...) @vector()
%3 = tail call i32 (...) @seq()
ret void
}