#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_CONTEXT;
scalar_t__ CL_INVALID_VALUE;
scalar_t__ CL_OUT_OF_HOST_MEMORY;
scalar_t__ CL_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void clCreateProgramWithSourceChecker(cl_int *err) {
  if (*err == CL_INVALID_CONTEXT)
    fprintf(stderr,
            "Err (clCreateProgramWithSource): Context is not valid context\n");
  else if (*err == CL_INVALID_VALUE)
    fprintf(stderr, "Err (clCreateProgramWithSource): Count (arg2) is 0 | "
                    "Contents of source code is NULL\n");
  else if (*err == CL_OUT_OF_HOST_MEMORY)
    fprintf(stderr, "Err (clCreateProgramWithSource): Resource (Memory) "
                    "Allocation Failure on Host\n");
  else {
    if (*err != CL_SUCCESS)
      fprintf(stderr, "clCreateProgramWithSourceChecker\n");
  }
}


x86 assembly (clang, -O0):
<clCreateProgramWithSourceChecker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%rax
jne    114d <clCreateProgramWithSourceChecker+0x3d>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11ea <clCreateProgramWithSourceChecker+0xda>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%rax
jne    117e <clCreateProgramWithSourceChecker+0x6e>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11e5 <clCreateProgramWithSourceChecker+0xd5>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e44(%rip),%rcx
cmp    (%rcx),%rax
jne    11af <clCreateProgramWithSourceChecker+0x9f>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
lea    0xef0(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11e0 <clCreateProgramWithSourceChecker+0xd0>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e03(%rip),%rcx
cmp    (%rcx),%rax
je     11db <clCreateProgramWithSourceChecker+0xcb>
mov    0x2dfb(%rip),%rax
mov    (%rax),%edi
lea    0xf0e(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11e0 <clCreateProgramWithSourceChecker+0xd0>
jmp    11e5 <clCreateProgramWithSourceChecker+0xd5>
jmp    11ea <clCreateProgramWithSourceChecker+0xda>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clCreateProgramWithSourceChecker>:
mov    (%rdi),%rax
mov    0x2ec6(%rip),%rcx
cmp    (%rcx),%rax
jne    1128 <clCreateProgramWithSourceChecker+0x18>
lea    0xeda(%rip),%rsi
jmp    1166 <clCreateProgramWithSourceChecker+0x56>
mov    0x2eb9(%rip),%rcx
cmp    (%rcx),%rax
jne    113d <clCreateProgramWithSourceChecker+0x2d>
lea    0xf04(%rip),%rsi
jmp    1166 <clCreateProgramWithSourceChecker+0x56>
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%rax
jne    1152 <clCreateProgramWithSourceChecker+0x42>
lea    0xf45(%rip),%rsi
jmp    1166 <clCreateProgramWithSourceChecker+0x56>
mov    0x2e67(%rip),%rcx
cmp    (%rcx),%rax
jne    115f <clCreateProgramWithSourceChecker+0x4f>
ret
lea    0xf7e(%rip),%rsi
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@CL_INVALID_CONTEXT = global i64 0
@stderr = global i32 0
@.str = [63 x i8] c"Err (clCreateProgramWithSource): Context is not valid context\0A\00"
@CL_INVALID_VALUE = global i64 0
@.str.1 = [86 x i8] c"Err (clCreateProgramWithSource): Count (arg2) is 0 | Contents of source code is NULL\0A\00"
@CL_OUT_OF_HOST_MEMORY = global i64 0
@.str.2 = [79 x i8] c"Err (clCreateProgramWithSource): Resource (Memory) Allocation Failure on Host\0A\00"
@CL_SUCCESS = global i64 0
@.str.3 = [34 x i8] c"clCreateProgramWithSourceChecker\0A\00"
define void @clCreateProgramWithSourceChecker(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_CONTEXT
%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 ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
br label %37
10: ; preds = %1
%11 = load i64*, i64** %2
%12 = load i64, i64* %11
%13 = load i64, i64* @CL_INVALID_VALUE
%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 ([86 x i8], [86 x i8]* @.str.1, i64 0, i64 0))
br label %36
18: ; preds = %10
%19 = load i64*, i64** %2
%20 = load i64, i64* %19
%21 = load i64, i64* @CL_OUT_OF_HOST_MEMORY
%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 ([79 x i8], [79 x i8]* @.str.2, i64 0, i64 0))
br label %35
26: ; preds = %18
%27 = load i64*, i64** %2
%28 = load i64, i64* %27
%29 = load i64, i64* @CL_SUCCESS
%30 = icmp ne 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 ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
br label %34
34: ; preds = %31, %26
br label %35
35: ; preds = %34, %23
br label %36
36: ; preds = %35, %15
br label %37
37: ; preds = %36, %7
ret void
}

LLVM IR (-O2):
@CL_INVALID_CONTEXT = global i64 0
@stderr = global i32 0
@.str = [63 x i8] c"Err (clCreateProgramWithSource): Context is not valid context\0A\00"
@CL_INVALID_VALUE = global i64 0
@.str.1 = [86 x i8] c"Err (clCreateProgramWithSource): Count (arg2) is 0 | Contents of source code is NULL\0A\00"
@CL_OUT_OF_HOST_MEMORY = global i64 0
@.str.2 = [79 x i8] c"Err (clCreateProgramWithSource): Resource (Memory) Allocation Failure on Host\0A\00"
@CL_SUCCESS = global i64 0
@.str.3 = [34 x i8] c"clCreateProgramWithSourceChecker\0A\00"
define void @clCreateProgramWithSourceChecker(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = load i64, i64* @CL_INVALID_CONTEXT
%4 = icmp eq i64 %2, %3
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = load i64, i64* @CL_INVALID_VALUE
%7 = icmp eq i64 %2, %6
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = load i64, i64* @CL_OUT_OF_HOST_MEMORY
%10 = icmp eq i64 %2, %9
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i64, i64* @CL_SUCCESS
%13 = icmp eq i64 %2, %12
br i1 %13, label %18, label %14
14: ; preds = %11, %8, %5, %1
%15 = phi i8* [ getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([86 x i8], [86 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([79 x i8], [79 x i8]* @.str.2, i64 0, i64 0), %8 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), %11 ]
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* %15)
br label %18
18: ; preds = %14, %11
ret void
}