#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_DEVICE;
scalar_t__ CL_INVALID_PROGRAM;
scalar_t__ CL_INVALID_VALUE;
scalar_t__ CL_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void clGetProgramBuildInfoChecker(cl_int *err) {
  if (*err == CL_INVALID_DEVICE)
    fprintf(stderr, "Err (clGetProgramBuildInfo): Device is not in list of "
                    "devices associated with program\n");
  else if (*err == CL_INVALID_VALUE)
    fprintf(stderr, "Err (clGetProgramBuildInfo): param_name is not valid or "
                    "param_value_size is less than return type\n");
  else if (*err == CL_INVALID_PROGRAM)
    fprintf(
        stderr,
        "Err (clGetProgramBuildInfo): program is not a valid program object\n");
  else {
    if (*err != CL_SUCCESS)
      fprintf(stderr, "clGetProgramBuildInfoChecker\n");
  }
}


x86 assembly (clang, -O0):
<clGetProgramBuildInfoChecker>:
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 <clGetProgramBuildInfoChecker+0x3d>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11ea <clGetProgramBuildInfoChecker+0xda>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%rax
jne    117e <clGetProgramBuildInfoChecker+0x6e>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
lea    0xee3(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11e5 <clGetProgramBuildInfoChecker+0xd5>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e4c(%rip),%rcx
cmp    (%rcx),%rax
jne    11af <clGetProgramBuildInfoChecker+0x9f>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
lea    0xf15(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11e0 <clGetProgramBuildInfoChecker+0xd0>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e03(%rip),%rcx
cmp    (%rcx),%rax
je     11db <clGetProgramBuildInfoChecker+0xcb>
mov    0x2dfb(%rip),%rax
mov    (%rax),%edi
lea    0xf28(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11e0 <clGetProgramBuildInfoChecker+0xd0>
jmp    11e5 <clGetProgramBuildInfoChecker+0xd5>
jmp    11ea <clGetProgramBuildInfoChecker+0xda>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@CL_INVALID_DEVICE = global i64 0
@stderr = global i32 0
@.str = [87 x i8] c"Err (clGetProgramBuildInfo): Device is not in list of devices associated with program\0A\00"
@CL_INVALID_VALUE = global i64 0
@.str.1 = [99 x i8] c"Err (clGetProgramBuildInfo): param_name is not valid or param_value_size is less than return type\0A\00"
@CL_INVALID_PROGRAM = global i64 0
@.str.2 = [68 x i8] c"Err (clGetProgramBuildInfo): program is not a valid program object\0A\00"
@CL_SUCCESS = global i64 0
@.str.3 = [30 x i8] c"clGetProgramBuildInfoChecker\0A\00"
define void @clGetProgramBuildInfoChecker(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_DEVICE
%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 ([87 x i8], [87 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 ([99 x i8], [99 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_INVALID_PROGRAM
%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 ([68 x i8], [68 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 ([30 x i8], [30 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_DEVICE = global i64 0
@stderr = global i32 0
@.str = [87 x i8] c"Err (clGetProgramBuildInfo): Device is not in list of devices associated with program\0A\00"
@CL_INVALID_VALUE = global i64 0
@.str.1 = [99 x i8] c"Err (clGetProgramBuildInfo): param_name is not valid or param_value_size is less than return type\0A\00"
@CL_INVALID_PROGRAM = global i64 0
@.str.2 = [68 x i8] c"Err (clGetProgramBuildInfo): program is not a valid program object\0A\00"
@CL_SUCCESS = global i64 0
@.str.3 = [30 x i8] c"clGetProgramBuildInfoChecker\0A\00"
define void @clGetProgramBuildInfoChecker(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = load i64, i64* @CL_INVALID_DEVICE
%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_INVALID_PROGRAM
%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 ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([99 x i8], [99 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0), %8 ], [ getelementptr inbounds ([30 x i8], [30 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
}