#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_DEVICE;
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 clCreateCommandQueueChecker(cl_int *err) {
  if (*err == CL_INVALID_CONTEXT)
    fprintf(stderr, "Err (clCreateCommandQueue): Invalid Context\n");
  else if (*err == CL_INVALID_DEVICE)
    fprintf(stderr, "Err (clCreateCommandQueue): Invalid Device, or Device not "
                    "associated with context\n");
  else if (*err == CL_INVALID_VALUE)
    fprintf(stderr,
            "Err (clCreateCommandQueue): Properties (arg3) must be either out "
            "of order, or in order, or with/without profiling support\n");
  else if (*err == CL_OUT_OF_HOST_MEMORY)
    fprintf(stderr, "Err (clCreateCommandQueue): Error allocating resources\n");
  else {
    if (*err != CL_SUCCESS)
      fprintf(stderr, "clCreateCommandQueueChecker\n");
  }
}


x86 assembly (clang, -O0):
<clCreateCommandQueueChecker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2eae(%rip),%rcx
cmp    (%rcx),%rax
jne    114d <clCreateCommandQueueChecker+0x3d>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1220 <clCreateCommandQueueChecker+0x110>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%rax
jne    117e <clCreateCommandQueueChecker+0x6e>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
jmp    121b <clCreateCommandQueueChecker+0x10b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e5c(%rip),%rcx
cmp    (%rcx),%rax
jne    11af <clCreateCommandQueueChecker+0x9f>
mov    0x2e24(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1216 <clCreateCommandQueueChecker+0x106>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e0b(%rip),%rcx
cmp    (%rcx),%rax
jne    11e0 <clCreateCommandQueueChecker+0xd0>
mov    0x2df3(%rip),%rax
mov    (%rax),%edi
lea    0xf25(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1211 <clCreateCommandQueueChecker+0x101>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2dca(%rip),%rcx
cmp    (%rcx),%rax
je     120c <clCreateCommandQueueChecker+0xfc>
mov    0x2dc2(%rip),%rax
mov    (%rax),%edi
lea    0xf2c(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1211 <clCreateCommandQueueChecker+0x101>
jmp    1216 <clCreateCommandQueueChecker+0x106>
jmp    121b <clCreateCommandQueueChecker+0x10b>
jmp    1220 <clCreateCommandQueueChecker+0x110>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clCreateCommandQueueChecker>:
mov    (%rdi),%rax
mov    0x2ebe(%rip),%rcx
cmp    (%rcx),%rax
jne    1128 <clCreateCommandQueueChecker+0x18>
lea    0xeda(%rip),%rsi
jmp    117b <clCreateCommandQueueChecker+0x6b>
mov    0x2eb1(%rip),%rcx
cmp    (%rcx),%rax
jne    113d <clCreateCommandQueueChecker+0x2d>
lea    0xef2(%rip),%rsi
jmp    117b <clCreateCommandQueueChecker+0x6b>
mov    0x2ea4(%rip),%rcx
cmp    (%rcx),%rax
jne    1152 <clCreateCommandQueueChecker+0x42>
lea    0xf30(%rip),%rsi
jmp    117b <clCreateCommandQueueChecker+0x6b>
mov    0x2e6f(%rip),%rcx
cmp    (%rcx),%rax
jne    1167 <clCreateCommandQueueChecker+0x57>
lea    0xf96(%rip),%rsi
jmp    117b <clCreateCommandQueueChecker+0x6b>
mov    0x2e4a(%rip),%rcx
cmp    (%rcx),%rax
jne    1174 <clCreateCommandQueueChecker+0x64>
ret
lea    0xfb8(%rip),%rsi
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@CL_INVALID_CONTEXT = global i64 0
@stderr = global i32 0
@.str = [45 x i8] c"Err (clCreateCommandQueue): Invalid Context\0A\00"
@CL_INVALID_DEVICE = global i64 0
@.str.1 = [83 x i8] c"Err (clCreateCommandQueue): Invalid Device, or Device not associated with context\0A\00"
@CL_INVALID_VALUE = global i64 0
@.str.2 = [123 x i8] c"Err (clCreateCommandQueue): Properties (arg3) must be either out of order, or in order, or with/without profiling support\0A\00"
@CL_OUT_OF_HOST_MEMORY = global i64 0
@.str.3 = [56 x i8] c"Err (clCreateCommandQueue): Error allocating resources\0A\00"
@CL_SUCCESS = global i64 0
@.str.4 = [29 x i8] c"clCreateCommandQueueChecker\0A\00"
define void @clCreateCommandQueueChecker(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 ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
br label %46
10: ; preds = %1
%11 = load i64*, i64** %2
%12 = load i64, i64* %11
%13 = load i64, i64* @CL_INVALID_DEVICE
%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 ([83 x i8], [83 x i8]* @.str.1, i64 0, i64 0))
br label %45
18: ; preds = %10
%19 = load i64*, i64** %2
%20 = load i64, i64* %19
%21 = load i64, i64* @CL_INVALID_VALUE
%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 ([123 x i8], [123 x i8]* @.str.2, i64 0, i64 0))
br label %44
26: ; preds = %18
%27 = load i64*, i64** %2
%28 = load i64, i64* %27
%29 = load i64, i64* @CL_OUT_OF_HOST_MEMORY
%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 ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
br label %43
34: ; preds = %26
%35 = load i64*, i64** %2
%36 = load i64, i64* %35
%37 = load i64, i64* @CL_SUCCESS
%38 = icmp ne 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 ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
br label %42
42: ; preds = %39, %34
br label %43
43: ; preds = %42, %31
br label %44
44: ; preds = %43, %23
br label %45
45: ; preds = %44, %15
br label %46
46: ; preds = %45, %7
ret void
}

LLVM IR (-O2):
@CL_INVALID_CONTEXT = global i64 0
@stderr = global i32 0
@.str = [45 x i8] c"Err (clCreateCommandQueue): Invalid Context\0A\00"
@CL_INVALID_DEVICE = global i64 0
@.str.1 = [83 x i8] c"Err (clCreateCommandQueue): Invalid Device, or Device not associated with context\0A\00"
@CL_INVALID_VALUE = global i64 0
@.str.2 = [123 x i8] c"Err (clCreateCommandQueue): Properties (arg3) must be either out of order, or in order, or with/without profiling support\0A\00"
@CL_OUT_OF_HOST_MEMORY = global i64 0
@.str.3 = [56 x i8] c"Err (clCreateCommandQueue): Error allocating resources\0A\00"
@CL_SUCCESS = global i64 0
@.str.4 = [29 x i8] c"clCreateCommandQueueChecker\0A\00"
define void @clCreateCommandQueueChecker(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 %17, label %5
5: ; preds = %1
%6 = load i64, i64* @CL_INVALID_DEVICE
%7 = icmp eq i64 %2, %6
br i1 %7, label %17, label %8
8: ; preds = %5
%9 = load i64, i64* @CL_INVALID_VALUE
%10 = icmp eq i64 %2, %9
br i1 %10, label %17, label %11
11: ; preds = %8
%12 = load i64, i64* @CL_OUT_OF_HOST_MEMORY
%13 = icmp eq i64 %2, %12
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load i64, i64* @CL_SUCCESS
%16 = icmp eq i64 %2, %15
br i1 %16, label %21, label %17
17: ; preds = %14, %11, %8, %5, %1
%18 = phi i8* [ getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([83 x i8], [83 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([123 x i8], [123 x i8]* @.str.2, i64 0, i64 0), %8 ], [ getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0), %11 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), %14 ]
%19 = load i32, i32* @stderr
%20 = tail call i32 @fprintf(i32 %19, i8* %18)
br label %21
21: ; preds = %17, %14
ret void
}