const char *CheckOpenCLError(const int error_code) {
  static const char *opencl_error_strings[] = {
      "CL_SUCCESS",
      "CL_DEVICE_NOT_FOUND",
      "CL_DEVICE_NOT_AVAILABLE",
      "CL_COMPILER_NOT_AVAILABLE",
      "CL_MEM_OBJECT_ALLOCATION_FAILURE",
      "CL_OUT_OF_RESOURCES",
      "CL_OUT_OF_HOST_MEMORY",
      "CL_PROFILING_INFO_NOT_AVAILABLE",
      "CL_MEM_COPY_OVERLAP",
      "CL_IMAGE_FORMAT_MISMATCH",
      "CL_IMAGE_FORMAT_NOT_SUPPORTED",
      "CL_BUILD_PROGRAM_FAILURE",
      "CL_MAP_FAILURE",
      "CL_MISALIGNED_SUB_BUFFER_OFFSET",
      "CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST",
      "CL_COMPILE_PROGRAM_FAILURE",
      "CL_LINKER_NOT_AVAILABLE",
      "CL_LINK_PROGRAM_FAILURE",
      "CL_DEVICE_PARTITION_FAILED",
      "CL_KERNEL_ARG_INFO_NOT_AVAILABLE",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "CL_INVALID_VALUE",
      "CL_INVALID_DEVICE_TYPE",
      "CL_INVALID_PLATFORM",
      "CL_INVALID_DEVICE",
      "CL_INVALID_CONTEXT",
      "CL_INVALID_QUEUE_PROPERTIES",
      "CL_INVALID_COMMAND_QUEUE",
      "CL_INVALID_HOST_PTR",
      "CL_INVALID_MEM_OBJECT",
      "CL_INVALID_IMAGE_FORMAT_DESCRIPTOR",
      "CL_INVALID_IMAGE_SIZE",
      "CL_INVALID_SAMPLER",
      "CL_INVALID_BINARY",
      "CL_INVALID_BUILD_OPTIONS",
      "CL_INVALID_PROGRAM",
      "CL_INVALID_PROGRAM_EXECUTABLE",
      "CL_INVALID_KERNEL_NAME",
      "CL_INVALID_KERNEL_DEFINITION",
      "CL_INVALID_KERNEL",
      "CL_INVALID_ARG_INDEX",
      "CL_INVALID_ARG_VALUE",
      "CL_INVALID_ARG_SIZE",
      "CL_INVALID_KERNEL_ARGS",
      "CL_INVALID_WORK_DIMENSION",
      "CL_INVALID_WORK_GROUP_SIZE",
      "CL_INVALID_WORK_ITEM_SIZE",
      "CL_INVALID_GLOBAL_OFFSET",
      "CL_INVALID_EVENT_WAIT_LIST",
      "CL_INVALID_EVENT",
      "CL_INVALID_OPERATION",
      "CL_INVALID_GL_OBJECT",
      "CL_INVALID_BUFFER_SIZE",
      "CL_INVALID_MIP_LEVEL",
      "CL_INVALID_GLOBAL_WORK_SIZE",
      "CL_INVALID_PROPERTY",
      "CL_INVALID_IMAGE_DESCRIPTOR",
      "CL_INVALID_COMPILER_OPTIONS",
      "CL_INVALID_LINKER_OPTIONS",
      "CL_INVALID_DEVICE_PARTITION_COUNT",
      "UNKNOWN_ERROR_CODE"};
  if ((error_code <= 0) && (error_code >= -68))
    return opencl_error_strings[-error_code];
  else
    return opencl_error_strings[69];
}


x86 assembly (clang, -O0):
<CheckOpenCLError>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1137 <CheckOpenCLError+0x37>
cmpl   $0xffffffbc,-0xc(%rbp)
jl     1137 <CheckOpenCLError+0x37>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
movslq %eax,%rcx
lea    0x2f06(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    1142 <CheckOpenCLError+0x42>
mov    0x311a(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckOpenCLError>:
lea    0x44(%rdi),%eax
cmp    $0x44,%eax
ja     1119 <CheckOpenCLError+0x19>
neg    %edi
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rax
add    %rcx,%rax
ret
lea    0x158c(%rip),%rax
ret

LLVM IR (-O0):
@CheckOpenCLError.opencl_error_strings = internal global [70 x i8*] [i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.31, i32 0, i32 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.32, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.33, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.34, i32 0, i32 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.35, i32 0, i32 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.36, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.37, i32 0, i32 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.38, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.39, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.40, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.41, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.42, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.43, i32 0, i32 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.44, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.45, i32 0, i32 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.46, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.47, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.48, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.49, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.50, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.51, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.52, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.53, i32 0, i32 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.54, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.55, i32 0, i32 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.56, i32 0, i32 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.57, i32 0, i32 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.58, i32 0, i32 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.59, i32 0, i32 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.60, i32 0, i32 0)]
@.str = [11 x i8] c"CL_SUCCESS\00"
@.str.1 = [20 x i8] c"CL_DEVICE_NOT_FOUND\00"
@.str.2 = [24 x i8] c"CL_DEVICE_NOT_AVAILABLE\00"
@.str.3 = [26 x i8] c"CL_COMPILER_NOT_AVAILABLE\00"
@.str.4 = [33 x i8] c"CL_MEM_OBJECT_ALLOCATION_FAILURE\00"
@.str.5 = [20 x i8] c"CL_OUT_OF_RESOURCES\00"
@.str.6 = [22 x i8] c"CL_OUT_OF_HOST_MEMORY\00"
@.str.7 = [32 x i8] c"CL_PROFILING_INFO_NOT_AVAILABLE\00"
@.str.8 = [20 x i8] c"CL_MEM_COPY_OVERLAP\00"
@.str.9 = [25 x i8] c"CL_IMAGE_FORMAT_MISMATCH\00"
@.str.10 = [30 x i8] c"CL_IMAGE_FORMAT_NOT_SUPPORTED\00"
@.str.11 = [25 x i8] c"CL_BUILD_PROGRAM_FAILURE\00"
@.str.12 = [15 x i8] c"CL_MAP_FAILURE\00"
@.str.13 = [32 x i8] c"CL_MISALIGNED_SUB_BUFFER_OFFSET\00"
@.str.14 = [45 x i8] c"CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST\00"
@.str.15 = [27 x i8] c"CL_COMPILE_PROGRAM_FAILURE\00"
@.str.16 = [24 x i8] c"CL_LINKER_NOT_AVAILABLE\00"
@.str.17 = [24 x i8] c"CL_LINK_PROGRAM_FAILURE\00"
@.str.18 = [27 x i8] c"CL_DEVICE_PARTITION_FAILED\00"
@.str.19 = [33 x i8] c"CL_KERNEL_ARG_INFO_NOT_AVAILABLE\00"
@.str.20 = [1 x i8] zeroinitializer
@.str.21 = [17 x i8] c"CL_INVALID_VALUE\00"
@.str.22 = [23 x i8] c"CL_INVALID_DEVICE_TYPE\00"
@.str.23 = [20 x i8] c"CL_INVALID_PLATFORM\00"
@.str.24 = [18 x i8] c"CL_INVALID_DEVICE\00"
@.str.25 = [19 x i8] c"CL_INVALID_CONTEXT\00"
@.str.26 = [28 x i8] c"CL_INVALID_QUEUE_PROPERTIES\00"
@.str.27 = [25 x i8] c"CL_INVALID_COMMAND_QUEUE\00"
@.str.28 = [20 x i8] c"CL_INVALID_HOST_PTR\00"
@.str.29 = [22 x i8] c"CL_INVALID_MEM_OBJECT\00"
@.str.30 = [35 x i8] c"CL_INVALID_IMAGE_FORMAT_DESCRIPTOR\00"
@.str.31 = [22 x i8] c"CL_INVALID_IMAGE_SIZE\00"
@.str.32 = [19 x i8] c"CL_INVALID_SAMPLER\00"
@.str.33 = [18 x i8] c"CL_INVALID_BINARY\00"
@.str.34 = [25 x i8] c"CL_INVALID_BUILD_OPTIONS\00"
@.str.35 = [19 x i8] c"CL_INVALID_PROGRAM\00"
@.str.36 = [30 x i8] c"CL_INVALID_PROGRAM_EXECUTABLE\00"
@.str.37 = [23 x i8] c"CL_INVALID_KERNEL_NAME\00"
@.str.38 = [29 x i8] c"CL_INVALID_KERNEL_DEFINITION\00"
@.str.39 = [18 x i8] c"CL_INVALID_KERNEL\00"
@.str.40 = [21 x i8] c"CL_INVALID_ARG_INDEX\00"
@.str.41 = [21 x i8] c"CL_INVALID_ARG_VALUE\00"
@.str.42 = [20 x i8] c"CL_INVALID_ARG_SIZE\00"
@.str.43 = [23 x i8] c"CL_INVALID_KERNEL_ARGS\00"
@.str.44 = [26 x i8] c"CL_INVALID_WORK_DIMENSION\00"
@.str.45 = [27 x i8] c"CL_INVALID_WORK_GROUP_SIZE\00"
@.str.46 = [26 x i8] c"CL_INVALID_WORK_ITEM_SIZE\00"
@.str.47 = [25 x i8] c"CL_INVALID_GLOBAL_OFFSET\00"
@.str.48 = [27 x i8] c"CL_INVALID_EVENT_WAIT_LIST\00"
@.str.49 = [17 x i8] c"CL_INVALID_EVENT\00"
@.str.50 = [21 x i8] c"CL_INVALID_OPERATION\00"
@.str.51 = [21 x i8] c"CL_INVALID_GL_OBJECT\00"
@.str.52 = [23 x i8] c"CL_INVALID_BUFFER_SIZE\00"
@.str.53 = [21 x i8] c"CL_INVALID_MIP_LEVEL\00"
@.str.54 = [28 x i8] c"CL_INVALID_GLOBAL_WORK_SIZE\00"
@.str.55 = [20 x i8] c"CL_INVALID_PROPERTY\00"
@.str.56 = [28 x i8] c"CL_INVALID_IMAGE_DESCRIPTOR\00"
@.str.57 = [28 x i8] c"CL_INVALID_COMPILER_OPTIONS\00"
@.str.58 = [26 x i8] c"CL_INVALID_LINKER_OPTIONS\00"
@.str.59 = [34 x i8] c"CL_INVALID_DEVICE_PARTITION_COUNT\00"
@.str.60 = [19 x i8] c"UNKNOWN_ERROR_CODE\00"
define i8* @CheckOpenCLError(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, -68
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 0, %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [70 x i8*], [70 x i8*]* @CheckOpenCLError.opencl_error_strings, i64 0, i64 %12
%14 = load i8*, i8** %13
store i8* %14, i8** %2
br label %17
15: ; preds = %6, %1
%16 = load i8*, i8** getelementptr inbounds ([70 x i8*], [70 x i8*]* @CheckOpenCLError.opencl_error_strings, i64 0, i64 69)
store i8* %16, i8** %2
br label %17
17: ; preds = %15, %9
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@reltable.CheckOpenCLError = internal unnamed_addr constant [70 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.1 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.2 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @.str.3 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([33 x i8]* @.str.4 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.5 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.6 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([32 x i8]* @.str.7 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.8 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str.9 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([30 x i8]* @.str.10 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str.11 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.12 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([32 x i8]* @.str.13 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([45 x i8]* @.str.14 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([27 x i8]* @.str.15 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.16 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.17 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([27 x i8]* @.str.18 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([33 x i8]* @.str.19 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.20 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.20 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.20 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.20 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.20 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.20 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.20 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.20 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.20 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.20 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.21 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.22 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.23 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.24 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.25 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([28 x i8]* @.str.26 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str.27 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.28 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.29 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([35 x i8]* @.str.30 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.31 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.32 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.33 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str.34 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.35 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([30 x i8]* @.str.36 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.37 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([29 x i8]* @.str.38 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.39 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.40 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.41 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.42 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.43 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @.str.44 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([27 x i8]* @.str.45 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @.str.46 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str.47 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([27 x i8]* @.str.48 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.49 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.50 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.51 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.52 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.53 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([28 x i8]* @.str.54 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.55 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([28 x i8]* @.str.56 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([28 x i8]* @.str.57 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @.str.58 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([34 x i8]* @.str.59 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.60 to i64), i64 ptrtoint ([70 x i32]* @reltable.CheckOpenCLError to i64)) to i32)]
@.str = [11 x i8] c"CL_SUCCESS\00"
@.str.1 = [20 x i8] c"CL_DEVICE_NOT_FOUND\00"
@.str.2 = [24 x i8] c"CL_DEVICE_NOT_AVAILABLE\00"
@.str.3 = [26 x i8] c"CL_COMPILER_NOT_AVAILABLE\00"
@.str.4 = [33 x i8] c"CL_MEM_OBJECT_ALLOCATION_FAILURE\00"
@.str.5 = [20 x i8] c"CL_OUT_OF_RESOURCES\00"
@.str.6 = [22 x i8] c"CL_OUT_OF_HOST_MEMORY\00"
@.str.7 = [32 x i8] c"CL_PROFILING_INFO_NOT_AVAILABLE\00"
@.str.8 = [20 x i8] c"CL_MEM_COPY_OVERLAP\00"
@.str.9 = [25 x i8] c"CL_IMAGE_FORMAT_MISMATCH\00"
@.str.10 = [30 x i8] c"CL_IMAGE_FORMAT_NOT_SUPPORTED\00"
@.str.11 = [25 x i8] c"CL_BUILD_PROGRAM_FAILURE\00"
@.str.12 = [15 x i8] c"CL_MAP_FAILURE\00"
@.str.13 = [32 x i8] c"CL_MISALIGNED_SUB_BUFFER_OFFSET\00"
@.str.14 = [45 x i8] c"CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST\00"
@.str.15 = [27 x i8] c"CL_COMPILE_PROGRAM_FAILURE\00"
@.str.16 = [24 x i8] c"CL_LINKER_NOT_AVAILABLE\00"
@.str.17 = [24 x i8] c"CL_LINK_PROGRAM_FAILURE\00"
@.str.18 = [27 x i8] c"CL_DEVICE_PARTITION_FAILED\00"
@.str.19 = [33 x i8] c"CL_KERNEL_ARG_INFO_NOT_AVAILABLE\00"
@.str.20 = [1 x i8] zeroinitializer
@.str.21 = [17 x i8] c"CL_INVALID_VALUE\00"
@.str.22 = [23 x i8] c"CL_INVALID_DEVICE_TYPE\00"
@.str.23 = [20 x i8] c"CL_INVALID_PLATFORM\00"
@.str.24 = [18 x i8] c"CL_INVALID_DEVICE\00"
@.str.25 = [19 x i8] c"CL_INVALID_CONTEXT\00"
@.str.26 = [28 x i8] c"CL_INVALID_QUEUE_PROPERTIES\00"
@.str.27 = [25 x i8] c"CL_INVALID_COMMAND_QUEUE\00"
@.str.28 = [20 x i8] c"CL_INVALID_HOST_PTR\00"
@.str.29 = [22 x i8] c"CL_INVALID_MEM_OBJECT\00"
@.str.30 = [35 x i8] c"CL_INVALID_IMAGE_FORMAT_DESCRIPTOR\00"
@.str.31 = [22 x i8] c"CL_INVALID_IMAGE_SIZE\00"
@.str.32 = [19 x i8] c"CL_INVALID_SAMPLER\00"
@.str.33 = [18 x i8] c"CL_INVALID_BINARY\00"
@.str.34 = [25 x i8] c"CL_INVALID_BUILD_OPTIONS\00"
@.str.35 = [19 x i8] c"CL_INVALID_PROGRAM\00"
@.str.36 = [30 x i8] c"CL_INVALID_PROGRAM_EXECUTABLE\00"
@.str.37 = [23 x i8] c"CL_INVALID_KERNEL_NAME\00"
@.str.38 = [29 x i8] c"CL_INVALID_KERNEL_DEFINITION\00"
@.str.39 = [18 x i8] c"CL_INVALID_KERNEL\00"
@.str.40 = [21 x i8] c"CL_INVALID_ARG_INDEX\00"
@.str.41 = [21 x i8] c"CL_INVALID_ARG_VALUE\00"
@.str.42 = [20 x i8] c"CL_INVALID_ARG_SIZE\00"
@.str.43 = [23 x i8] c"CL_INVALID_KERNEL_ARGS\00"
@.str.44 = [26 x i8] c"CL_INVALID_WORK_DIMENSION\00"
@.str.45 = [27 x i8] c"CL_INVALID_WORK_GROUP_SIZE\00"
@.str.46 = [26 x i8] c"CL_INVALID_WORK_ITEM_SIZE\00"
@.str.47 = [25 x i8] c"CL_INVALID_GLOBAL_OFFSET\00"
@.str.48 = [27 x i8] c"CL_INVALID_EVENT_WAIT_LIST\00"
@.str.49 = [17 x i8] c"CL_INVALID_EVENT\00"
@.str.50 = [21 x i8] c"CL_INVALID_OPERATION\00"
@.str.51 = [21 x i8] c"CL_INVALID_GL_OBJECT\00"
@.str.52 = [23 x i8] c"CL_INVALID_BUFFER_SIZE\00"
@.str.53 = [21 x i8] c"CL_INVALID_MIP_LEVEL\00"
@.str.54 = [28 x i8] c"CL_INVALID_GLOBAL_WORK_SIZE\00"
@.str.55 = [20 x i8] c"CL_INVALID_PROPERTY\00"
@.str.56 = [28 x i8] c"CL_INVALID_IMAGE_DESCRIPTOR\00"
@.str.57 = [28 x i8] c"CL_INVALID_COMPILER_OPTIONS\00"
@.str.58 = [26 x i8] c"CL_INVALID_LINKER_OPTIONS\00"
@.str.59 = [34 x i8] c"CL_INVALID_DEVICE_PARTITION_COUNT\00"
@.str.60 = [19 x i8] c"UNKNOWN_ERROR_CODE\00"
define i8* @CheckOpenCLError(i32 %0) {
%2 = add i32 %0, 68
%3 = icmp ult i32 %2, 69
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = sub nsw i32 0, %0
%6 = zext i32 %5 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([70 x i32]* @reltable.CheckOpenCLError to i8*), i64 %7)
br label %9
9: ; preds = %1, %4
%10 = phi i8* [ %8, %4 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.60, i64 0, i64 0), %1 ]
ret i8* %10
}