#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 */
typedef scalar_t__ cl_int;

/* Variables and functions */
scalar_t__ CL_INVALID_KERNEL_DEFINITION;
scalar_t__ CL_INVALID_KERNEL_NAME;
scalar_t__ CL_INVALID_PROGRAM;
scalar_t__ CL_INVALID_PROGRAM_EXECUTABLE;
scalar_t__ CL_INVALID_VALUE;
scalar_t__ CL_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void clCreateKernelChecker(cl_int *err) {
  if (*err == CL_INVALID_PROGRAM)
    fprintf(stderr,
            "Err (clCreateKernel): Program is not valid Program Object\n");
  else if (*err == CL_INVALID_PROGRAM_EXECUTABLE)
    fprintf(stderr, "Err (clCreateKernel): Kernel Binary is Invalid\n");
  else if (*err == CL_INVALID_KERNEL_NAME)
    fprintf(stderr,
            "Err (clCreateKernel): Invalid Kernel Name in Program Object\n");
  else if (*err == CL_INVALID_VALUE)
    fprintf(stderr, "Err (clCreateKernel): Kernel Name is NULL\n");
  else if (*err == CL_INVALID_KERNEL_DEFINITION)
    fprintf(stderr, "Err (clCreateKernel): Function Definition defined for "
                    "Kernel is not conformant with device\n");
  else {
    if (*err != CL_SUCCESS)
      fprintf(stderr, "clCreateKernelChecker\n");
  }
}


x86 assembly (clang, -O0):
<clCreateKernelChecker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
jne    114d <clCreateKernelChecker+0x3d>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1256 <clCreateKernelChecker+0x146>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%rax
jne    117e <clCreateKernelChecker+0x6e>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1251 <clCreateKernelChecker+0x141>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e54(%rip),%rcx
cmp    (%rcx),%rax
jne    11af <clCreateKernelChecker+0x9f>
mov    0x2e1c(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
jmp    124c <clCreateKernelChecker+0x13c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e1b(%rip),%rcx
cmp    (%rcx),%rax
jne    11e0 <clCreateKernelChecker+0xd0>
mov    0x2deb(%rip),%rax
mov    (%rax),%edi
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1247 <clCreateKernelChecker+0x137>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2de2(%rip),%rcx
cmp    (%rcx),%rax
jne    1211 <clCreateKernelChecker+0x101>
mov    0x2dba(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1242 <clCreateKernelChecker+0x132>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2d91(%rip),%rcx
cmp    (%rcx),%rax
je     123d <clCreateKernelChecker+0x12d>
mov    0x2d89(%rip),%rax
mov    (%rax),%edi
lea    0xef7(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1242 <clCreateKernelChecker+0x132>
jmp    1247 <clCreateKernelChecker+0x137>
jmp    124c <clCreateKernelChecker+0x13c>
jmp    1251 <clCreateKernelChecker+0x141>
jmp    1256 <clCreateKernelChecker+0x146>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clCreateKernelChecker>:
mov    (%rdi),%rax
mov    0x2eae(%rip),%rcx
cmp    (%rcx),%rax
jne    1128 <clCreateKernelChecker+0x18>
lea    0xeda(%rip),%rsi
jmp    1190 <clCreateKernelChecker+0x80>
mov    0x2eb9(%rip),%rcx
cmp    (%rcx),%rax
jne    113d <clCreateKernelChecker+0x2d>
lea    0xf00(%rip),%rsi
jmp    1190 <clCreateKernelChecker+0x80>
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%rax
jne    1152 <clCreateKernelChecker+0x42>
lea    0xf1b(%rip),%rsi
jmp    1190 <clCreateKernelChecker+0x80>
mov    0x2e7f(%rip),%rcx
cmp    (%rcx),%rax
jne    1167 <clCreateKernelChecker+0x57>
lea    0xf43(%rip),%rsi
jmp    1190 <clCreateKernelChecker+0x80>
mov    0x2e62(%rip),%rcx
cmp    (%rcx),%rax
jne    117c <clCreateKernelChecker+0x6c>
lea    0xf59(%rip),%rsi
jmp    1190 <clCreateKernelChecker+0x80>
mov    0x2e2d(%rip),%rcx
cmp    (%rcx),%rax
jne    1189 <clCreateKernelChecker+0x79>
ret
lea    0xf9f(%rip),%rsi
mov    0x2e21(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@CL_INVALID_PROGRAM = global i64 0
@stderr = global i32 0
@.str = [59 x i8] c"Err (clCreateKernel): Program is not valid Program Object\0A\00"
@CL_INVALID_PROGRAM_EXECUTABLE = global i64 0
@.str.1 = [48 x i8] c"Err (clCreateKernel): Kernel Binary is Invalid\0A\00"
@CL_INVALID_KERNEL_NAME = global i64 0
@.str.2 = [61 x i8] c"Err (clCreateKernel): Invalid Kernel Name in Program Object\0A\00"
@CL_INVALID_VALUE = global i64 0
@.str.3 = [43 x i8] c"Err (clCreateKernel): Kernel Name is NULL\0A\00"
@CL_INVALID_KERNEL_DEFINITION = global i64 0
@.str.4 = [92 x i8] c"Err (clCreateKernel): Function Definition defined for Kernel is not conformant with device\0A\00"
@CL_SUCCESS = global i64 0
@.str.5 = [23 x i8] c"clCreateKernelChecker\0A\00"
define void @clCreateKernelChecker(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = load i64, i64* @CL_INVALID_PROGRAM
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
br label %55
10: ; preds = %1
%11 = load i64*, i64** %2
%12 = load i64, i64* %11
%13 = load i64, i64* @CL_INVALID_PROGRAM_EXECUTABLE
%14 = icmp eq i64 %12, %13
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
br label %54
18: ; preds = %10
%19 = load i64*, i64** %2
%20 = load i64, i64* %19
%21 = load i64, i64* @CL_INVALID_KERNEL_NAME
%22 = icmp eq i64 %20, %21
br i1 %22, label %23, label %26
23: ; preds = %18
%24 = load i32, i32* @stderr
%25 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
br label %53
26: ; preds = %18
%27 = load i64*, i64** %2
%28 = load i64, i64* %27
%29 = load i64, i64* @CL_INVALID_VALUE
%30 = icmp eq i64 %28, %29
br i1 %30, label %31, label %34
31: ; preds = %26
%32 = load i32, i32* @stderr
%33 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
br label %52
34: ; preds = %26
%35 = load i64*, i64** %2
%36 = load i64, i64* %35
%37 = load i64, i64* @CL_INVALID_KERNEL_DEFINITION
%38 = icmp eq i64 %36, %37
br i1 %38, label %39, label %42
39: ; preds = %34
%40 = load i32, i32* @stderr
%41 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.4, i64 0, i64 0))
br label %51
42: ; preds = %34
%43 = load i64*, i64** %2
%44 = load i64, i64* %43
%45 = load i64, i64* @CL_SUCCESS
%46 = icmp ne i64 %44, %45
br i1 %46, label %47, label %50
47: ; preds = %42
%48 = load i32, i32* @stderr
%49 = call i32 @fprintf(i32 %48, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %50
50: ; preds = %47, %42
br label %51
51: ; preds = %50, %39
br label %52
52: ; preds = %51, %31
br label %53
53: ; preds = %52, %23
br label %54
54: ; preds = %53, %15
br label %55
55: ; preds = %54, %7
ret void
}

LLVM IR (-O2):
@CL_INVALID_PROGRAM = global i64 0
@stderr = global i32 0
@.str = [59 x i8] c"Err (clCreateKernel): Program is not valid Program Object\0A\00"
@CL_INVALID_PROGRAM_EXECUTABLE = global i64 0
@.str.1 = [48 x i8] c"Err (clCreateKernel): Kernel Binary is Invalid\0A\00"
@CL_INVALID_KERNEL_NAME = global i64 0
@.str.2 = [61 x i8] c"Err (clCreateKernel): Invalid Kernel Name in Program Object\0A\00"
@CL_INVALID_VALUE = global i64 0
@.str.3 = [43 x i8] c"Err (clCreateKernel): Kernel Name is NULL\0A\00"
@CL_INVALID_KERNEL_DEFINITION = global i64 0
@.str.4 = [92 x i8] c"Err (clCreateKernel): Function Definition defined for Kernel is not conformant with device\0A\00"
@CL_SUCCESS = global i64 0
@.str.5 = [23 x i8] c"clCreateKernelChecker\0A\00"
define void @clCreateKernelChecker(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = load i64, i64* @CL_INVALID_PROGRAM
%4 = icmp eq i64 %2, %3
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i64, i64* @CL_INVALID_PROGRAM_EXECUTABLE
%7 = icmp eq i64 %2, %6
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = load i64, i64* @CL_INVALID_KERNEL_NAME
%10 = icmp eq i64 %2, %9
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i64, i64* @CL_INVALID_VALUE
%13 = icmp eq i64 %2, %12
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i64, i64* @CL_INVALID_KERNEL_DEFINITION
%16 = icmp eq i64 %2, %15
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i64, i64* @CL_SUCCESS
%19 = icmp eq i64 %2, %18
br i1 %19, label %24, label %20
20: ; preds = %17, %14, %11, %8, %5, %1
%21 = phi i8* [ getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), %8 ], [ getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), %11 ], [ getelementptr inbounds ([92 x i8], [92 x i8]* @.str.4, i64 0, i64 0), %14 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), %17 ]
%22 = load i32, i32* @stderr
%23 = tail call i32 @fprintf(i32 %22, i8* %21)
br label %24
24: ; preds = %20, %17
ret void
}