#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 int cl_int;

/* Variables and functions */
const char *get_error_string(cl_int err) {
  switch (err) {
  case 0:
    return "CL_SUCCESS";
  case -1:
    return "CL_DEVICE_NOT_FOUND";
  case -2:
    return "CL_DEVICE_NOT_AVAILABLE";
  case -3:
    return "CL_COMPILER_NOT_AVAILABLE";
  case -4:
    return "CL_MEM_OBJECT_ALLOCATION_FAILURE";
  case -5:
    return "CL_OUT_OF_RESOURCES";
  case -6:
    return "CL_OUT_OF_HOST_MEMORY";
  case -7:
    return "CL_PROFILING_INFO_NOT_AVAILABLE";
  case -8:
    return "CL_MEM_COPY_OVERLAP";
  case -9:
    return "CL_IMAGE_FORMAT_MISMATCH";
  case -10:
    return "CL_IMAGE_FORMAT_NOT_SUPPORTED";
  case -11:
    return "CL_BUILD_PROGRAM_FAILURE";
  case -12:
    return "CL_MAP_FAILURE";
  case -13:
    return "CL_MISALIGNED_SUB_BUFFER_OFFSET";
  case -14:
    return "CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST";
  case -30:
    return "CL_INVALID_VALUE";
  case -31:
    return "CL_INVALID_DEVICE_TYPE";
  case -32:
    return "CL_INVALID_PLATFORM";
  case -33:
    return "CL_INVALID_DEVICE";
  case -34:
    return "CL_INVALID_CONTEXT";
  case -35:
    return "CL_INVALID_QUEUE_PROPERTIES";
  case -36:
    return "CL_INVALID_COMMAND_QUEUE";
  case -37:
    return "CL_INVALID_HOST_PTR";
  case -38:
    return "CL_INVALID_MEM_OBJECT";
  case -39:
    return "CL_INVALID_IMAGE_FORMAT_DESCRIPTOR";
  case -40:
    return "CL_INVALID_IMAGE_SIZE";
  case -41:
    return "CL_INVALID_SAMPLER";
  case -42:
    return "CL_INVALID_BINARY";
  case -43:
    return "CL_INVALID_BUILD_OPTIONS";
  case -44:
    return "CL_INVALID_PROGRAM";
  case -45:
    return "CL_INVALID_PROGRAM_EXECUTABLE";
  case -46:
    return "CL_INVALID_KERNEL_NAME";
  case -47:
    return "CL_INVALID_KERNEL_DEFINITION";
  case -48:
    return "CL_INVALID_KERNEL";
  case -49:
    return "CL_INVALID_ARG_INDEX";
  case -50:
    return "CL_INVALID_ARG_VALUE";
  case -51:
    return "CL_INVALID_ARG_SIZE";
  case -52:
    return "CL_INVALID_KERNEL_ARGS";
  case -53:
    return "CL_INVALID_WORK_DIMENSION";
  case -54:
    return "CL_INVALID_WORK_GROUP_SIZE";
  case -55:
    return "CL_INVALID_WORK_ITEM_SIZE";
  case -56:
    return "CL_INVALID_GLOBAL_OFFSET";
  case -57:
    return "CL_INVALID_EVENT_WAIT_LIST";
  case -58:
    return "CL_INVALID_EVENT";
  case -59:
    return "CL_INVALID_OPERATION";
  case -60:
    return "CL_INVALID_GL_OBJECT";
  case -61:
    return "CL_INVALID_BUFFER_SIZE";
  case -62:
    return "CL_INVALID_MIP_LEVEL";
  case -63:
    return "CL_INVALID_GLOBAL_WORK_SIZE";
  case -64:
    return "CL_INVALID_PROPERTY";
  default:
    return "Unknown OpenCL error";
  }
}


x86 assembly (clang, -O0):
<get_error_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x40,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x40,%eax
ja     1450 <get_error_string+0x350>
mov    -0x18(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xfcd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0xfc8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0xfcc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0xfd4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0xfde(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0xfef(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0xff3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0xff9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1009(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x100d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1016(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1024(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x102d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x102c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x103c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1059(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x105a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1061(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1065(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1067(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x106a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1076(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x107f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1083(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1089(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x109c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x10a2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x10a5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x10a7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x10b0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x10b3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x10c1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x10c8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x10d5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x10d7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x10dc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x10e1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x10e5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x10ec(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x10f6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1101(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x110b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1114(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x111f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1120(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1125(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x112a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1131(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1136(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1142(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    145b <get_error_string+0x35b>
lea    0x1146(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_error_string>:
add    $0x40,%edi
cmp    $0x40,%edi
ja     111a <get_error_string+0x1a>
movslq %edi,%rax
lea    0x139e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0x1378(%rip),%rax
ret

LLVM IR (-O0):
@.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 = [17 x i8] c"CL_INVALID_VALUE\00"
@.str.16 = [23 x i8] c"CL_INVALID_DEVICE_TYPE\00"
@.str.17 = [20 x i8] c"CL_INVALID_PLATFORM\00"
@.str.18 = [18 x i8] c"CL_INVALID_DEVICE\00"
@.str.19 = [19 x i8] c"CL_INVALID_CONTEXT\00"
@.str.20 = [28 x i8] c"CL_INVALID_QUEUE_PROPERTIES\00"
@.str.21 = [25 x i8] c"CL_INVALID_COMMAND_QUEUE\00"
@.str.22 = [20 x i8] c"CL_INVALID_HOST_PTR\00"
@.str.23 = [22 x i8] c"CL_INVALID_MEM_OBJECT\00"
@.str.24 = [35 x i8] c"CL_INVALID_IMAGE_FORMAT_DESCRIPTOR\00"
@.str.25 = [22 x i8] c"CL_INVALID_IMAGE_SIZE\00"
@.str.26 = [19 x i8] c"CL_INVALID_SAMPLER\00"
@.str.27 = [18 x i8] c"CL_INVALID_BINARY\00"
@.str.28 = [25 x i8] c"CL_INVALID_BUILD_OPTIONS\00"
@.str.29 = [19 x i8] c"CL_INVALID_PROGRAM\00"
@.str.30 = [30 x i8] c"CL_INVALID_PROGRAM_EXECUTABLE\00"
@.str.31 = [23 x i8] c"CL_INVALID_KERNEL_NAME\00"
@.str.32 = [29 x i8] c"CL_INVALID_KERNEL_DEFINITION\00"
@.str.33 = [18 x i8] c"CL_INVALID_KERNEL\00"
@.str.34 = [21 x i8] c"CL_INVALID_ARG_INDEX\00"
@.str.35 = [21 x i8] c"CL_INVALID_ARG_VALUE\00"
@.str.36 = [20 x i8] c"CL_INVALID_ARG_SIZE\00"
@.str.37 = [23 x i8] c"CL_INVALID_KERNEL_ARGS\00"
@.str.38 = [26 x i8] c"CL_INVALID_WORK_DIMENSION\00"
@.str.39 = [27 x i8] c"CL_INVALID_WORK_GROUP_SIZE\00"
@.str.40 = [26 x i8] c"CL_INVALID_WORK_ITEM_SIZE\00"
@.str.41 = [25 x i8] c"CL_INVALID_GLOBAL_OFFSET\00"
@.str.42 = [27 x i8] c"CL_INVALID_EVENT_WAIT_LIST\00"
@.str.43 = [17 x i8] c"CL_INVALID_EVENT\00"
@.str.44 = [21 x i8] c"CL_INVALID_OPERATION\00"
@.str.45 = [21 x i8] c"CL_INVALID_GL_OBJECT\00"
@.str.46 = [23 x i8] c"CL_INVALID_BUFFER_SIZE\00"
@.str.47 = [21 x i8] c"CL_INVALID_MIP_LEVEL\00"
@.str.48 = [28 x i8] c"CL_INVALID_GLOBAL_WORK_SIZE\00"
@.str.49 = [20 x i8] c"CL_INVALID_PROPERTY\00"
@.str.50 = [21 x i8] c"Unknown OpenCL error\00"
define i8* @get_error_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %55 [
i32 0, label %5
i32 -1, label %6
i32 -2, label %7
i32 -3, label %8
i32 -4, label %9
i32 -5, label %10
i32 -6, label %11
i32 -7, label %12
i32 -8, label %13
i32 -9, label %14
i32 -10, label %15
i32 -11, label %16
i32 -12, label %17
i32 -13, label %18
i32 -14, label %19
i32 -30, label %20
i32 -31, label %21
i32 -32, label %22
i32 -33, label %23
i32 -34, label %24
i32 -35, label %25
i32 -36, label %26
i32 -37, label %27
i32 -38, label %28
i32 -39, label %29
i32 -40, label %30
i32 -41, label %31
i32 -42, label %32
i32 -43, label %33
i32 -44, label %34
i32 -45, label %35
i32 -46, label %36
i32 -47, label %37
i32 -48, label %38
i32 -49, label %39
i32 -50, label %40
i32 -51, label %41
i32 -52, label %42
i32 -53, label %43
i32 -54, label %44
i32 -55, label %45
i32 -56, label %46
i32 -57, label %47
i32 -58, label %48
i32 -59, label %49
i32 -60, label %50
i32 -61, label %51
i32 -62, label %52
i32 -63, label %53
i32 -64, label %54
]
5: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
br label %56
6: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %56
7: ; preds = %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %56
8: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %56
9: ; preds = %1
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %56
10: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %56
11: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %56
12: ; preds = %1
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %56
13: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %56
14: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %56
15: ; preds = %1
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %56
16: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %56
17: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %56
18: ; preds = %1
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %56
19: ; preds = %1
store i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %56
20: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %56
21: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %56
22: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0), i8** %2
br label %56
23: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.18, i64 0, i64 0), i8** %2
br label %56
24: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.19, i64 0, i64 0), i8** %2
br label %56
25: ; preds = %1
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.20, i64 0, i64 0), i8** %2
br label %56
26: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.21, i64 0, i64 0), i8** %2
br label %56
27: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.22, i64 0, i64 0), i8** %2
br label %56
28: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.23, i64 0, i64 0), i8** %2
br label %56
29: ; preds = %1
store i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.24, i64 0, i64 0), i8** %2
br label %56
30: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.25, i64 0, i64 0), i8** %2
br label %56
31: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.26, i64 0, i64 0), i8** %2
br label %56
32: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.27, i64 0, i64 0), i8** %2
br label %56
33: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.28, i64 0, i64 0), i8** %2
br label %56
34: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.29, i64 0, i64 0), i8** %2
br label %56
35: ; preds = %1
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.30, i64 0, i64 0), i8** %2
br label %56
36: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.31, i64 0, i64 0), i8** %2
br label %56
37: ; preds = %1
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.32, i64 0, i64 0), i8** %2
br label %56
38: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.33, i64 0, i64 0), i8** %2
br label %56
39: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.34, i64 0, i64 0), i8** %2
br label %56
40: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.35, i64 0, i64 0), i8** %2
br label %56
41: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.36, i64 0, i64 0), i8** %2
br label %56
42: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.37, i64 0, i64 0), i8** %2
br label %56
43: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.38, i64 0, i64 0), i8** %2
br label %56
44: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.39, i64 0, i64 0), i8** %2
br label %56
45: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.40, i64 0, i64 0), i8** %2
br label %56
46: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.41, i64 0, i64 0), i8** %2
br label %56
47: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.42, i64 0, i64 0), i8** %2
br label %56
48: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.43, i64 0, i64 0), i8** %2
br label %56
49: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.44, i64 0, i64 0), i8** %2
br label %56
50: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.45, i64 0, i64 0), i8** %2
br label %56
51: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.46, i64 0, i64 0), i8** %2
br label %56
52: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.47, i64 0, i64 0), i8** %2
br label %56
53: ; preds = %1
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.48, i64 0, i64 0), i8** %2
br label %56
54: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.49, i64 0, i64 0), i8** %2
br label %56
55: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.50, i64 0, i64 0), i8** %2
br label %56
56: ; preds = %55, %54, %53, %52, %51, %50, %49, %48, %47, %46, %45, %44, %43, %42, %41, %40, %39, %38, %37, %36, %35, %34, %33, %32, %31, %30, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%57 = load i8*, i8** %2
ret i8* %57
}

LLVM IR (-O2):
@.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 = [17 x i8] c"CL_INVALID_VALUE\00"
@.str.16 = [23 x i8] c"CL_INVALID_DEVICE_TYPE\00"
@.str.17 = [20 x i8] c"CL_INVALID_PLATFORM\00"
@.str.18 = [18 x i8] c"CL_INVALID_DEVICE\00"
@.str.19 = [19 x i8] c"CL_INVALID_CONTEXT\00"
@.str.20 = [28 x i8] c"CL_INVALID_QUEUE_PROPERTIES\00"
@.str.21 = [25 x i8] c"CL_INVALID_COMMAND_QUEUE\00"
@.str.22 = [20 x i8] c"CL_INVALID_HOST_PTR\00"
@.str.23 = [22 x i8] c"CL_INVALID_MEM_OBJECT\00"
@.str.24 = [35 x i8] c"CL_INVALID_IMAGE_FORMAT_DESCRIPTOR\00"
@.str.25 = [22 x i8] c"CL_INVALID_IMAGE_SIZE\00"
@.str.26 = [19 x i8] c"CL_INVALID_SAMPLER\00"
@.str.27 = [18 x i8] c"CL_INVALID_BINARY\00"
@.str.28 = [25 x i8] c"CL_INVALID_BUILD_OPTIONS\00"
@.str.29 = [19 x i8] c"CL_INVALID_PROGRAM\00"
@.str.30 = [30 x i8] c"CL_INVALID_PROGRAM_EXECUTABLE\00"
@.str.31 = [23 x i8] c"CL_INVALID_KERNEL_NAME\00"
@.str.32 = [29 x i8] c"CL_INVALID_KERNEL_DEFINITION\00"
@.str.33 = [18 x i8] c"CL_INVALID_KERNEL\00"
@.str.34 = [21 x i8] c"CL_INVALID_ARG_INDEX\00"
@.str.35 = [21 x i8] c"CL_INVALID_ARG_VALUE\00"
@.str.36 = [20 x i8] c"CL_INVALID_ARG_SIZE\00"
@.str.37 = [23 x i8] c"CL_INVALID_KERNEL_ARGS\00"
@.str.38 = [26 x i8] c"CL_INVALID_WORK_DIMENSION\00"
@.str.39 = [27 x i8] c"CL_INVALID_WORK_GROUP_SIZE\00"
@.str.40 = [26 x i8] c"CL_INVALID_WORK_ITEM_SIZE\00"
@.str.41 = [25 x i8] c"CL_INVALID_GLOBAL_OFFSET\00"
@.str.42 = [27 x i8] c"CL_INVALID_EVENT_WAIT_LIST\00"
@.str.43 = [17 x i8] c"CL_INVALID_EVENT\00"
@.str.44 = [21 x i8] c"CL_INVALID_OPERATION\00"
@.str.45 = [21 x i8] c"CL_INVALID_GL_OBJECT\00"
@.str.46 = [23 x i8] c"CL_INVALID_BUFFER_SIZE\00"
@.str.47 = [21 x i8] c"CL_INVALID_MIP_LEVEL\00"
@.str.48 = [28 x i8] c"CL_INVALID_GLOBAL_WORK_SIZE\00"
@.str.49 = [20 x i8] c"CL_INVALID_PROPERTY\00"
@.str.50 = [21 x i8] c"Unknown OpenCL error\00"
@reltable.get_error_string = [65 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.49 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([28 x i8]* @.str.48 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.47 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.46 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.45 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.44 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.43 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([27 x i8]* @.str.42 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str.41 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @.str.40 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([27 x i8]* @.str.39 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @.str.38 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.37 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.36 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.35 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.34 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.33 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([29 x i8]* @.str.32 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.31 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([30 x i8]* @.str.30 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.29 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str.28 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.27 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.26 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.25 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([35 x i8]* @.str.24 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.23 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.22 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str.21 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([28 x i8]* @.str.20 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.19 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.18 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.17 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.16 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.15 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.50 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.50 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.50 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.50 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.50 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.50 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.50 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.50 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.50 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.50 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.50 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.50 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.50 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.50 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.50 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([45 x i8]* @.str.14 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([32 x i8]* @.str.13 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.12 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str.11 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([30 x i8]* @.str.10 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str.9 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.8 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([32 x i8]* @.str.7 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.6 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.5 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([33 x i8]* @.str.4 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @.str.3 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.2 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.1 to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str to i64), i64 ptrtoint ([65 x i32]* @reltable.get_error_string to i64)) to i32)]
define i8* @get_error_string(i32 %0) {
%2 = add i32 %0, 64
%3 = icmp ult i32 %2, 65
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([65 x i32]* @reltable.get_error_string to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.50, i64 0, i64 0), %1 ]
ret i8* %9
}