#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_ARG_INDEX;
scalar_t__ CL_INVALID_ARG_SIZE;
scalar_t__ CL_INVALID_ARG_VALUE;
scalar_t__ CL_INVALID_KERNEL;
scalar_t__ CL_INVALID_MEM_OBJECT;
scalar_t__ CL_INVALID_SAMPLER;
scalar_t__ CL_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void clSetKernelArgChecker(cl_int *err) {
  if (*err == CL_INVALID_KERNEL)
    fprintf(stderr,
            "Err (clSetKernelArg): Kernel is not valid Kernel object\n");
  else if (*err == CL_INVALID_ARG_INDEX)
    fprintf(stderr, "Err (clSetKernelArg): You sure arg2 refering to the right "
                    "input parameter?\n");
  else if (*err == CL_INVALID_MEM_OBJECT)
    fprintf(stderr, "Err (clSetKernelArg): Invalid Memory Object associated "
                    "with Kernel Argument\n");
  else if (*err == CL_INVALID_ARG_VALUE)
    fprintf(stderr, "Err (clSetKernelArg): Invalid Argument Value. Check API "
                    "for details\n");
  else if (*err == CL_INVALID_SAMPLER)
    fprintf(stderr, "Err (clSetKernelArg): If argument is sampler_t declared "
                    "but actually it isn't\n");
  else if (*err == CL_INVALID_ARG_SIZE)
    fprintf(stderr, "Err (clSetKernelArg): If arg_size does not match the size "
                    "of the data for argument\n");
  else {
    if (*err != CL_SUCCESS)
      fprintf(stderr, "clSetKernelArgChecker\n");
  }
}


x86 assembly (clang, -O0):
<clSetKernelArgChecker>:
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 <clSetKernelArgChecker+0x3d>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
jmp    128c <clSetKernelArgChecker+0x17c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e6d(%rip),%rcx
cmp    (%rcx),%rax
jne    117e <clSetKernelArgChecker+0x6e>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1287 <clSetKernelArgChecker+0x177>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e24(%rip),%rcx
cmp    (%rcx),%rax
jne    11af <clSetKernelArgChecker+0x9f>
mov    0x2e1c(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1282 <clSetKernelArgChecker+0x172>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e13(%rip),%rcx
cmp    (%rcx),%rax
jne    11e0 <clSetKernelArgChecker+0xd0>
mov    0x2deb(%rip),%rax
mov    (%rax),%edi
lea    0xefc(%rip),%rsi
call   1030 <fprintf@plt>
jmp    127d <clSetKernelArgChecker+0x16d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e02(%rip),%rcx
cmp    (%rcx),%rax
jne    1211 <clSetKernelArgChecker+0x101>
mov    0x2dba(%rip),%rax
mov    (%rax),%edi
lea    0xf10(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1278 <clSetKernelArgChecker+0x168>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2dc1(%rip),%rcx
cmp    (%rcx),%rax
jne    1242 <clSetKernelArgChecker+0x132>
mov    0x2d89(%rip),%rax
mov    (%rax),%edi
lea    0xf2e(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1273 <clSetKernelArgChecker+0x163>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2d58(%rip),%rcx
cmp    (%rcx),%rax
je     126e <clSetKernelArgChecker+0x15e>
mov    0x2d58(%rip),%rax
mov    (%rax),%edi
lea    0xf51(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1273 <clSetKernelArgChecker+0x163>
jmp    1278 <clSetKernelArgChecker+0x168>
jmp    127d <clSetKernelArgChecker+0x16d>
jmp    1282 <clSetKernelArgChecker+0x172>
jmp    1287 <clSetKernelArgChecker+0x177>
jmp    128c <clSetKernelArgChecker+0x17c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clSetKernelArgChecker>:
mov    (%rdi),%rax
mov    0x2ebe(%rip),%rcx
cmp    (%rcx),%rax
jne    1128 <clSetKernelArgChecker+0x18>
lea    0xeda(%rip),%rsi
jmp    11a5 <clSetKernelArgChecker+0x95>
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%rax
jne    113d <clSetKernelArgChecker+0x2d>
lea    0xefe(%rip),%rsi
jmp    11a5 <clSetKernelArgChecker+0x95>
mov    0x2e6c(%rip),%rcx
cmp    (%rcx),%rax
jne    1152 <clSetKernelArgChecker+0x42>
lea    0xf35(%rip),%rsi
jmp    11a5 <clSetKernelArgChecker+0x95>
mov    0x2e77(%rip),%rcx
cmp    (%rcx),%rax
jne    1167 <clSetKernelArgChecker+0x57>
lea    0xf6d(%rip),%rsi
jmp    11a5 <clSetKernelArgChecker+0x95>
mov    0x2e82(%rip),%rcx
cmp    (%rcx),%rax
jne    117c <clSetKernelArgChecker+0x6c>
lea    0xf9d(%rip),%rsi
jmp    11a5 <clSetKernelArgChecker+0x95>
mov    0x2e5d(%rip),%rcx
cmp    (%rcx),%rax
jne    1191 <clSetKernelArgChecker+0x81>
lea    0xfd7(%rip),%rsi
jmp    11a5 <clSetKernelArgChecker+0x95>
mov    0x2e10(%rip),%rcx
cmp    (%rcx),%rax
jne    119e <clSetKernelArgChecker+0x8e>
ret
lea    0x1015(%rip),%rsi
mov    0x2e0c(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@CL_INVALID_KERNEL = global i64 0
@stderr = global i32 0
@.str = [57 x i8] c"Err (clSetKernelArg): Kernel is not valid Kernel object\0A\00"
@CL_INVALID_ARG_INDEX = global i64 0
@.str.1 = [76 x i8] c"Err (clSetKernelArg): You sure arg2 refering to the right input parameter?\0A\00"
@CL_INVALID_MEM_OBJECT = global i64 0
@.str.2 = [77 x i8] c"Err (clSetKernelArg): Invalid Memory Object associated with Kernel Argument\0A\00"
@CL_INVALID_ARG_VALUE = global i64 0
@.str.3 = [69 x i8] c"Err (clSetKernelArg): Invalid Argument Value. Check API for details\0A\00"
@CL_INVALID_SAMPLER = global i64 0
@.str.4 = [79 x i8] c"Err (clSetKernelArg): If argument is sampler_t declared but actually it isn't\0A\00"
@CL_INVALID_ARG_SIZE = global i64 0
@.str.5 = [84 x i8] c"Err (clSetKernelArg): If arg_size does not match the size of the data for argument\0A\00"
@CL_SUCCESS = global i64 0
@.str.6 = [23 x i8] c"clSetKernelArgChecker\0A\00"
define void @clSetKernelArgChecker(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_KERNEL
%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 ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
br label %64
10: ; preds = %1
%11 = load i64*, i64** %2
%12 = load i64, i64* %11
%13 = load i64, i64* @CL_INVALID_ARG_INDEX
%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 ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
br label %63
18: ; preds = %10
%19 = load i64*, i64** %2
%20 = load i64, i64* %19
%21 = load i64, i64* @CL_INVALID_MEM_OBJECT
%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 ([77 x i8], [77 x i8]* @.str.2, i64 0, i64 0))
br label %62
26: ; preds = %18
%27 = load i64*, i64** %2
%28 = load i64, i64* %27
%29 = load i64, i64* @CL_INVALID_ARG_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 ([69 x i8], [69 x i8]* @.str.3, i64 0, i64 0))
br label %61
34: ; preds = %26
%35 = load i64*, i64** %2
%36 = load i64, i64* %35
%37 = load i64, i64* @CL_INVALID_SAMPLER
%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 ([79 x i8], [79 x i8]* @.str.4, i64 0, i64 0))
br label %60
42: ; preds = %34
%43 = load i64*, i64** %2
%44 = load i64, i64* %43
%45 = load i64, i64* @CL_INVALID_ARG_SIZE
%46 = icmp eq 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 ([84 x i8], [84 x i8]* @.str.5, i64 0, i64 0))
br label %59
50: ; preds = %42
%51 = load i64*, i64** %2
%52 = load i64, i64* %51
%53 = load i64, i64* @CL_SUCCESS
%54 = icmp ne i64 %52, %53
br i1 %54, label %55, label %58
55: ; preds = %50
%56 = load i32, i32* @stderr
%57 = call i32 @fprintf(i32 %56, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
br label %58
58: ; preds = %55, %50
br label %59
59: ; preds = %58, %47
br label %60
60: ; preds = %59, %39
br label %61
61: ; preds = %60, %31
br label %62
62: ; preds = %61, %23
br label %63
63: ; preds = %62, %15
br label %64
64: ; preds = %63, %7
ret void
}

LLVM IR (-O2):
@CL_INVALID_KERNEL = global i64 0
@stderr = global i32 0
@.str = [57 x i8] c"Err (clSetKernelArg): Kernel is not valid Kernel object\0A\00"
@CL_INVALID_ARG_INDEX = global i64 0
@.str.1 = [76 x i8] c"Err (clSetKernelArg): You sure arg2 refering to the right input parameter?\0A\00"
@CL_INVALID_MEM_OBJECT = global i64 0
@.str.2 = [77 x i8] c"Err (clSetKernelArg): Invalid Memory Object associated with Kernel Argument\0A\00"
@CL_INVALID_ARG_VALUE = global i64 0
@.str.3 = [69 x i8] c"Err (clSetKernelArg): Invalid Argument Value. Check API for details\0A\00"
@CL_INVALID_SAMPLER = global i64 0
@.str.4 = [79 x i8] c"Err (clSetKernelArg): If argument is sampler_t declared but actually it isn't\0A\00"
@CL_INVALID_ARG_SIZE = global i64 0
@.str.5 = [84 x i8] c"Err (clSetKernelArg): If arg_size does not match the size of the data for argument\0A\00"
@CL_SUCCESS = global i64 0
@.str.6 = [23 x i8] c"clSetKernelArgChecker\0A\00"
define void @clSetKernelArgChecker(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = load i64, i64* @CL_INVALID_KERNEL
%4 = icmp eq i64 %2, %3
br i1 %4, label %23, label %5
5: ; preds = %1
%6 = load i64, i64* @CL_INVALID_ARG_INDEX
%7 = icmp eq i64 %2, %6
br i1 %7, label %23, label %8
8: ; preds = %5
%9 = load i64, i64* @CL_INVALID_MEM_OBJECT
%10 = icmp eq i64 %2, %9
br i1 %10, label %23, label %11
11: ; preds = %8
%12 = load i64, i64* @CL_INVALID_ARG_VALUE
%13 = icmp eq i64 %2, %12
br i1 %13, label %23, label %14
14: ; preds = %11
%15 = load i64, i64* @CL_INVALID_SAMPLER
%16 = icmp eq i64 %2, %15
br i1 %16, label %23, label %17
17: ; preds = %14
%18 = load i64, i64* @CL_INVALID_ARG_SIZE
%19 = icmp eq i64 %2, %18
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load i64, i64* @CL_SUCCESS
%22 = icmp eq i64 %2, %21
br i1 %22, label %27, label %23
23: ; preds = %20, %17, %14, %11, %8, %5, %1
%24 = phi i8* [ getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([77 x i8], [77 x i8]* @.str.2, i64 0, i64 0), %8 ], [ getelementptr inbounds ([69 x i8], [69 x i8]* @.str.3, i64 0, i64 0), %11 ], [ getelementptr inbounds ([79 x i8], [79 x i8]* @.str.4, i64 0, i64 0), %14 ], [ getelementptr inbounds ([84 x i8], [84 x i8]* @.str.5, i64 0, i64 0), %17 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), %20 ]
%25 = load i32, i32* @stderr
%26 = tail call i32 @fprintf(i32 %25, i8* %24)
br label %27
27: ; preds = %23, %20
ret void
}