#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*/ check_offloading();
int /*<<< orphan*/ printf(char *, int);
scalar_t__ test_aligned();
scalar_t__ test_collapsed();
scalar_t__ test_lastprivate();
scalar_t__ test_linear();
scalar_t__ test_private();
scalar_t__ test_safelen();
int main() {
  int error = 0;
  check_offloading();
  error += test_aligned();
  error += test_collapsed();
  error += test_lastprivate();
  error += test_linear();
  error += test_private();
  error += test_safelen();
  printf("done with %d errors\n", error);
  return error;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1060 <check_offloading@plt>
mov    $0x0,%al
call   1040 <test_aligned@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1080 <test_collapsed@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1070 <test_lastprivate@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1090 <test_linear@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test_private@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   10a0 <test_safelen@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xde1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1060 <check_offloading@plt>
xor    %eax,%eax
call   1040 <test_aligned@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1080 <test_collapsed@plt>
mov    %rax,%r15
add    %r14d,%r15d
xor    %eax,%eax
call   1070 <test_lastprivate@plt>
mov    %rax,%rbx
add    %r15d,%ebx
xor    %eax,%eax
call   1090 <test_linear@plt>
mov    %rax,%r14
add    %ebx,%r14d
xor    %eax,%eax
call   1050 <test_private@plt>
mov    %rax,%r15
add    %r14d,%r15d
xor    %eax,%eax
call   10a0 <test_safelen@plt>
mov    %rax,%rbx
add    %r15d,%ebx
lea    0xe22(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"done with %d errors\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @check_offloading()
%4 = call i64 (...) @test_aligned()
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = add nsw i64 %6, %4
%8 = trunc i64 %7 to i32
store i32 %8, i32* %2
%9 = call i64 (...) @test_collapsed()
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = add nsw i64 %11, %9
%13 = trunc i64 %12 to i32
store i32 %13, i32* %2
%14 = call i64 (...) @test_lastprivate()
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = add nsw i64 %16, %14
%18 = trunc i64 %17 to i32
store i32 %18, i32* %2
%19 = call i64 (...) @test_linear()
%20 = load i32, i32* %2
%21 = sext i32 %20 to i64
%22 = add nsw i64 %21, %19
%23 = trunc i64 %22 to i32
store i32 %23, i32* %2
%24 = call i64 (...) @test_private()
%25 = load i32, i32* %2
%26 = sext i32 %25 to i64
%27 = add nsw i64 %26, %24
%28 = trunc i64 %27 to i32
store i32 %28, i32* %2
%29 = call i64 (...) @test_safelen()
%30 = load i32, i32* %2
%31 = sext i32 %30 to i64
%32 = add nsw i64 %31, %29
%33 = trunc i64 %32 to i32
store i32 %33, i32* %2
%34 = load i32, i32* %2
%35 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %34)
%36 = load i32, i32* %2
ret i32 %36
}

LLVM IR (-O2):
@.str = [21 x i8] c"done with %d errors\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @check_offloading()
%2 = tail call i64 (...) @test_aligned()
%3 = tail call i64 (...) @test_collapsed()
%4 = add i64 %3, %2
%5 = tail call i64 (...) @test_lastprivate()
%6 = add i64 %4, %5
%7 = tail call i64 (...) @test_linear()
%8 = add i64 %6, %7
%9 = tail call i64 (...) @test_private()
%10 = add i64 %8, %9
%11 = tail call i64 (...) @test_safelen()
%12 = add i64 %10, %11
%13 = trunc i64 %12 to i32
%14 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 %13
}