#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 /*<<< orphan*/ vendor;
typedef int /*<<< orphan*/ type;
typedef int /*<<< orphan*/ devices;
typedef int /*<<< orphan*/ dev_name;
typedef int cl_uint;
typedef int /*<<< orphan*/ cl_platform_id;
typedef scalar_t__ cl_int;
typedef int cl_device_type;
typedef int /*<<< orphan*/ cl_device_id;

/* Variables and functions */
int /*<<< orphan*/ CL_DEVICE_NAME;
int /*<<< orphan*/ CL_DEVICE_TYPE;
#define CL_DEVICE_TYPE_ACCELERATOR 131
int /*<<< orphan*/ CL_DEVICE_TYPE_ALL;
#define CL_DEVICE_TYPE_CPU 130
#define CL_DEVICE_TYPE_DEFAULT 129
#define CL_DEVICE_TYPE_GPU 128
int /*<<< orphan*/ CL_DEVICE_VENDOR;
scalar_t__ CL_SUCCESS;
scalar_t__ clGetDeviceIDs(int /*<<< orphan*/, int /*<<< orphan*/, int,
                          int /*<<< orphan*/ *, int *);
scalar_t__ clGetDeviceInfo(int /*<<< orphan*/, int /*<<< orphan*/, int, ...);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, scalar_t__);
int /*<<< orphan*/ printf(char *, int, char *, char *, char const *);
int /*<<< orphan*/ stderr;
cl_int list_devices(cl_platform_id platform) {
  cl_device_id devices[10];
  cl_uint num_devices;
  ({
    cl_int ret = clGetDeviceIDs(platform, CL_DEVICE_TYPE_ALL,
                                (sizeof(devices) / sizeof(*devices)), devices,
                                &num_devices);
    if (ret != CL_SUCCESS) {
      if ("getting device list"[0] != 0)
        fprintf(stderr, "Error %s: %d\n", "getting device list", ret);
      return -1;
    }
  });
  for (int i = 0; i < num_devices; i++) {
    char vendor[80];
    char dev_name[80];
    cl_device_type type;
    ({
      cl_int ret = clGetDeviceInfo(devices[i], CL_DEVICE_VENDOR, sizeof(vendor),
                                   vendor, NULL);
      if (ret != CL_SUCCESS) {
        if ("getting device vendor name"[0] != 0)
          fprintf(stderr, "Error %s: %d\n", "getting device vendor name", ret);
        return -1;
      }
    });
    ({
      cl_int ret = clGetDeviceInfo(devices[i], CL_DEVICE_NAME, sizeof(dev_name),
                                   dev_name, NULL);
      if (ret != CL_SUCCESS) {
        if ("getting device name"[0] != 0)
          fprintf(stderr, "Error %s: %d\n", "getting device name", ret);
        return -1;
      }
    });
    ({
      cl_int ret = clGetDeviceInfo(devices[i], CL_DEVICE_TYPE, sizeof(type),
                                   &type, NULL);
      if (ret != CL_SUCCESS) {
        if ("getting device type"[0] != 0)
          fprintf(stderr, "Error %s: %d\n", "getting device type", ret);
        return -1;
      }
    });
    const char *type_str = "UNKNOWN";
    switch (type) {
    case CL_DEVICE_TYPE_CPU:
      type_str = "CPU";
      break;
    case CL_DEVICE_TYPE_GPU:
      type_str = "GPU";
      break;
    case CL_DEVICE_TYPE_ACCELERATOR:
      type_str = "ACCEL";
      break;
    case CL_DEVICE_TYPE_DEFAULT:
      type_str = "DEFAULT";
      break;
    }
    printf("      %d - %s - %s (%s)\n", i + 1, vendor, dev_name, type_str);
  }
  return CL_SUCCESS;
}


x86 assembly (clang, -O0):
<list_devices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
lea    -0x40(%rbp),%rcx
mov    $0xa,%edx
lea    -0x44(%rbp),%r8
call   1030 <clGetDeviceIDs@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    0x2e45(%rip),%rcx
cmp    (%rcx),%rax
je     11b1 <list_devices+0x71>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
mov    -0x50(%rbp),%rcx
lea    0xe78(%rip),%rsi
lea    0xe7f(%rip),%rdx
call   1060 <fprintf@plt>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    13f3 <list_devices+0x2b3>
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    13e5 <list_devices+0x2a5>
movslq -0x54(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edi
mov    0x2df5(%rip),%rax
mov    (%rax),%esi
lea    -0xb0(%rbp),%rcx
mov    $0x50,%edx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1040 <clGetDeviceInfo@plt>
mov    %rax,-0x110(%rbp)
mov    -0x110(%rbp),%rax
mov    0x2dbe(%rip),%rcx
cmp    (%rcx),%rax
je     123b <list_devices+0xfb>
mov    0x2dbe(%rip),%rax
mov    (%rax),%edi
mov    -0x110(%rbp),%rcx
lea    0xdee(%rip),%rsi
lea    0xe09(%rip),%rdx
call   1060 <fprintf@plt>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    13f3 <list_devices+0x2b3>
movslq -0x54(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edi
mov    0x2d8e(%rip),%rax
mov    (%rax),%esi
lea    -0x100(%rbp),%rcx
mov    $0x50,%edx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1040 <clGetDeviceInfo@plt>
mov    %rax,-0x118(%rbp)
mov    -0x118(%rbp),%rax
mov    0x2d47(%rip),%rcx
cmp    (%rcx),%rax
je     12b2 <list_devices+0x172>
mov    0x2d47(%rip),%rax
mov    (%rax),%edi
mov    -0x118(%rbp),%rcx
lea    0xd77(%rip),%rsi
lea    0xdad(%rip),%rdx
call   1060 <fprintf@plt>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    13f3 <list_devices+0x2b3>
movslq -0x54(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edi
mov    0x2cef(%rip),%rax
mov    (%rax),%esi
mov    $0x4,%edx
lea    -0x104(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1040 <clGetDeviceInfo@plt>
mov    %rax,-0x120(%rbp)
mov    -0x120(%rbp),%rax
mov    0x2cd0(%rip),%rcx
cmp    (%rcx),%rax
je     1329 <list_devices+0x1e9>
mov    0x2cd0(%rip),%rax
mov    (%rax),%edi
mov    -0x120(%rbp),%rcx
lea    0xd00(%rip),%rsi
lea    0xd4a(%rip),%rdx
call   1060 <fprintf@plt>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    13f3 <list_devices+0x2b3>
lea    0xd45(%rip),%rax
mov    %rax,-0x128(%rbp)
mov    -0x104(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x130(%rbp)
sub    $0x3,%eax
ja     13b0 <list_devices+0x270>
mov    -0x130(%rbp),%rax
lea    0xca0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xd0d(%rip),%rax
mov    %rax,-0x128(%rbp)
jmp    13b0 <list_devices+0x270>
lea    0xcfe(%rip),%rax
mov    %rax,-0x128(%rbp)
jmp    13b0 <list_devices+0x270>
lea    0xcef(%rip),%rax
mov    %rax,-0x128(%rbp)
jmp    13b0 <list_devices+0x270>
lea    0xce2(%rip),%rax
mov    %rax,-0x128(%rbp)
mov    -0x54(%rbp),%esi
add    $0x1,%esi
lea    -0xb0(%rbp),%rdx
lea    -0x100(%rbp),%rcx
mov    -0x128(%rbp),%r8
lea    0xcc1(%rip),%rdi
call   1050 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11b8 <list_devices+0x78>
mov    0x2bd4(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_devices>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    $0xa,%edx
call   1030 <clGetDeviceIDs@plt>
mov    0x2e4b(%rip),%rbp
cmp    0x0(%rbp),%rax
jne    1279 <list_devices+0x139>
cmpl   $0x0,0x8(%rsp)
jle    12a1 <list_devices+0x161>
lea    0x90(%rsp),%r14
lea    0x40(%rsp),%r13
lea    0xc(%rsp),%r15
lea    0xee0(%rip),%r12
xor    %ebx,%ebx
jmp    11d2 <list_devices+0x92>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
mov    %r12,%rdi
mov    %ebx,%esi
mov    %r14,%rdx
mov    %r13,%rcx
call   1050 <printf@plt>
movslq 0x8(%rsp),%rax
cmp    %rax,%rbx
jge    12a1 <list_devices+0x161>
mov    0x10(%rsp,%rbx,4),%edi
mov    0x2deb(%rip),%rax
mov    (%rax),%esi
mov    $0x50,%edx
mov    %r14,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1040 <clGetDeviceInfo@plt>
cmp    0x0(%rbp),%rax
jne    12b7 <list_devices+0x177>
mov    0x10(%rsp,%rbx,4),%edi
mov    0x2dd2(%rip),%rax
mov    (%rax),%esi
mov    $0x50,%edx
mov    %r13,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1040 <clGetDeviceInfo@plt>
cmp    0x0(%rbp),%rax
jne    12d0 <list_devices+0x190>
mov    0x10(%rsp,%rbx,4),%edi
mov    0x2d81(%rip),%rax
mov    (%rax),%esi
mov    $0x4,%edx
mov    %r15,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1040 <clGetDeviceInfo@plt>
cmp    0x0(%rbp),%rax
jne    12e9 <list_devices+0x1a9>
mov    0xc(%rsp),%eax
add    $0xffffff80,%eax
lea    0xe0a(%rip),%r8
cmp    $0x3,%eax
ja     11b0 <list_devices+0x70>
cltq
lea    0xe2f(%rip),%rcx
movslq (%rcx,%rax,4),%r8
add    %rcx,%r8
jmp    11b0 <list_devices+0x70>
mov    0x2d50(%rip),%rcx
mov    (%rcx),%edi
lea    0xd77(%rip),%rsi
lea    0xd7e(%rip),%rdx
mov    %rax,%rcx
call   1060 <fprintf@plt>
mov    $0xffffffffffffffff,%rax
jmp    12a5 <list_devices+0x165>
mov    0x0(%rbp),%rax
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d12(%rip),%rcx
mov    (%rcx),%edi
lea    0xd39(%rip),%rsi
lea    0xd54(%rip),%rdx
jmp    1290 <list_devices+0x150>
mov    0x2cf9(%rip),%rcx
mov    (%rcx),%edi
lea    0xd20(%rip),%rsi
lea    0xd56(%rip),%rdx
jmp    1290 <list_devices+0x150>
mov    0x2ce0(%rip),%rcx
mov    (%rcx),%edi
lea    0xd07(%rip),%rsi
lea    0xd51(%rip),%rdx
jmp    1290 <list_devices+0x150>

LLVM IR (-O0):
@CL_DEVICE_TYPE_ALL = global i32 0
@CL_SUCCESS = global i64 0
@stderr = global i32 0
@.str = [14 x i8] c"Error %s: %d\0A\00"
@.str.1 = [20 x i8] c"getting device list\00"
@CL_DEVICE_VENDOR = global i32 0
@.str.2 = [27 x i8] c"getting device vendor name\00"
@CL_DEVICE_NAME = global i32 0
@.str.3 = [20 x i8] c"getting device name\00"
@CL_DEVICE_TYPE = global i32 0
@.str.4 = [20 x i8] c"getting device type\00"
@.str.5 = [8 x i8] c"UNKNOWN\00"
@.str.6 = [4 x i8] c"CPU\00"
@.str.7 = [4 x i8] c"GPU\00"
@.str.8 = [6 x i8] c"ACCEL\00"
@.str.9 = [8 x i8] c"DEFAULT\00"
@.str.10 = [25 x i8] c" %d - %s - %s (%s)\0A\00"
define i64 @list_devices(i32 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca [10 x i32]
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32
%8 = alloca [80 x i8]
%9 = alloca [80 x i8]
%10 = alloca i32
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i8*
store i32 %0, i32* %3
%15 = load i32, i32* %3
%16 = load i32, i32* @CL_DEVICE_TYPE_ALL
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
%18 = call i64 @clGetDeviceIDs(i32 %15, i32 %16, i32 10, i32* %17, i32* %5)
store i64 %18, i64* %6
%19 = load i64, i64* %6
%20 = load i64, i64* @CL_SUCCESS
%21 = icmp ne i64 %19, %20
br i1 %21, label %22, label %26
22: ; preds = %1
%23 = load i32, i32* @stderr
%24 = load i64, i64* %6
%25 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i64 %24)
store i64 -1, i64* %2
br label %93
26: ; preds = %1
store i32 0, i32* %7
br label %27
27: ; preds = %88, %26
%28 = load i32, i32* %7
%29 = load i32, i32* %5
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %91
31: ; preds = %27
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = load i32, i32* @CL_DEVICE_VENDOR
%37 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%38 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %35, i32 %36, i32 80, i8* %37, i8* null)
store i64 %38, i64* %11
%39 = load i64, i64* %11
%40 = load i64, i64* @CL_SUCCESS
%41 = icmp ne i64 %39, %40
br i1 %41, label %42, label %46
42: ; preds = %31
%43 = load i32, i32* @stderr
%44 = load i64, i64* %11
%45 = call i32 @fprintf(i32 %43, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i64 %44)
store i64 -1, i64* %2
br label %93
46: ; preds = %31
%47 = load i32, i32* %7
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %48
%50 = load i32, i32* %49
%51 = load i32, i32* @CL_DEVICE_NAME
%52 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%53 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %50, i32 %51, i32 80, i8* %52, i8* null)
store i64 %53, i64* %12
%54 = load i64, i64* %12
%55 = load i64, i64* @CL_SUCCESS
%56 = icmp ne i64 %54, %55
br i1 %56, label %57, label %61
57: ; preds = %46
%58 = load i32, i32* @stderr
%59 = load i64, i64* %12
%60 = call i32 @fprintf(i32 %58, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i64 %59)
store i64 -1, i64* %2
br label %93
61: ; preds = %46
%62 = load i32, i32* %7
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %63
%65 = load i32, i32* %64
%66 = load i32, i32* @CL_DEVICE_TYPE
%67 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %65, i32 %66, i32 4, i32* %10, i8* null)
store i64 %67, i64* %13
%68 = load i64, i64* %13
%69 = load i64, i64* @CL_SUCCESS
%70 = icmp ne i64 %68, %69
br i1 %70, label %71, label %75
71: ; preds = %61
%72 = load i32, i32* @stderr
%73 = load i64, i64* %13
%74 = call i32 @fprintf(i32 %72, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i64 %73)
store i64 -1, i64* %2
br label %93
75: ; preds = %61
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8** %14
%76 = load i32, i32* %10
switch i32 %76, label %81 [
i32 130, label %77
i32 128, label %78
i32 131, label %79
i32 129, label %80
]
77: ; preds = %75
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8** %14
br label %81
78: ; preds = %75
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8** %14
br label %81
79: ; preds = %75
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8** %14
br label %81
80: ; preds = %75
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8** %14
br label %81
81: ; preds = %75, %80, %79, %78, %77
%82 = load i32, i32* %7
%83 = add nsw i32 %82, 1
%84 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%85 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%86 = load i8*, i8** %14
%87 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i32 %83, i8* %84, i8* %85, i8* %86)
br label %88
88: ; preds = %81
%89 = load i32, i32* %7
%90 = add nsw i32 %89, 1
store i32 %90, i32* %7
br label %27
91: ; preds = %27
%92 = load i64, i64* @CL_SUCCESS
store i64 %92, i64* %2
br label %93
93: ; preds = %91, %71, %57, %42, %22
%94 = load i64, i64* %2
ret i64 %94
}

LLVM IR (-O2):
@CL_DEVICE_TYPE_ALL = global i32 0
@CL_SUCCESS = global i64 0
@stderr = global i32 0
@.str = [14 x i8] c"Error %s: %d\0A\00"
@.str.1 = [20 x i8] c"getting device list\00"
@CL_DEVICE_VENDOR = global i32 0
@.str.2 = [27 x i8] c"getting device vendor name\00"
@CL_DEVICE_NAME = global i32 0
@.str.3 = [20 x i8] c"getting device name\00"
@CL_DEVICE_TYPE = global i32 0
@.str.4 = [20 x i8] c"getting device type\00"
@.str.5 = [8 x i8] c"UNKNOWN\00"
@.str.6 = [4 x i8] c"CPU\00"
@.str.7 = [4 x i8] c"GPU\00"
@.str.8 = [6 x i8] c"ACCEL\00"
@.str.9 = [8 x i8] c"DEFAULT\00"
@.str.10 = [25 x i8] c" %d - %s - %s (%s)\0A\00"
@reltable.list_devices = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.7 to i64), i64 ptrtoint ([4 x i32]* @reltable.list_devices to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.9 to i64), i64 ptrtoint ([4 x i32]* @reltable.list_devices to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.6 to i64), i64 ptrtoint ([4 x i32]* @reltable.list_devices to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.8 to i64), i64 ptrtoint ([4 x i32]* @reltable.list_devices to i64)) to i32)]
define i64 @list_devices(i32 %0) {
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca [80 x i8]
%5 = alloca [80 x i8]
%6 = alloca i32
%7 = bitcast [10 x i32]* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = load i32, i32* @CL_DEVICE_TYPE_ALL
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%11 = call i64 @clGetDeviceIDs(i32 %0, i32 %9, i32 10, i32* %10, i32* %3)
%12 = load i64, i64* @CL_SUCCESS
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %21
14: ; preds = %1
%15 = load i32, i32* %3
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %69
17: ; preds = %14
%18 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%19 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%20 = bitcast i32* %6 to i8*
br label %24
21: ; preds = %1
%22 = load i32, i32* @stderr
%23 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i64 %11)
br label %71
24: ; preds = %17, %61
%25 = phi i64 [ 0, %17 ], [ %63, %61 ]
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = load i32, i32* @CL_DEVICE_VENDOR
%29 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %27, i32 %28, i32 80, i8* %18, i8* null)
%30 = load i64, i64* @CL_SUCCESS
%31 = icmp eq i64 %29, %30
br i1 %31, label %35, label %32
32: ; preds = %24
%33 = load i32, i32* @stderr
%34 = call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i64 %29)
br label %71
35: ; preds = %24
%36 = load i32, i32* %26
%37 = load i32, i32* @CL_DEVICE_NAME
%38 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %36, i32 %37, i32 80, i8* %19, i8* null)
%39 = load i64, i64* @CL_SUCCESS
%40 = icmp eq i64 %38, %39
br i1 %40, label %44, label %41
41: ; preds = %35
%42 = load i32, i32* @stderr
%43 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i64 %38)
br label %71
44: ; preds = %35
%45 = load i32, i32* %26
%46 = load i32, i32* @CL_DEVICE_TYPE
%47 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %45, i32 %46, i32 4, i32* %6, i8* null)
%48 = load i64, i64* @CL_SUCCESS
%49 = icmp eq i64 %47, %48
br i1 %49, label %53, label %50
50: ; preds = %44
%51 = load i32, i32* @stderr
%52 = call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i64 %47)
br label %71
53: ; preds = %44
%54 = load i32, i32* %6
%55 = add i32 %54, -128
%56 = icmp ult i32 %55, 4
br i1 %56, label %57, label %61
57: ; preds = %53
%58 = sext i32 %55 to i64
%59 = shl i64 %58, 2
%60 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.list_devices to i8*), i64 %59)
br label %61
61: ; preds = %57, %53
%62 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), %53 ], [ %60, %57 ]
%63 = add nuw nsw i64 %25, 1
%64 = trunc i64 %63 to i32
%65 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i32 %64, i8* %18, i8* %19, i8* %62)
%66 = load i32, i32* %3
%67 = sext i32 %66 to i64
%68 = icmp slt i64 %63, %67
br i1 %68, label %24, label %69
69: ; preds = %61, %14
%70 = load i64, i64* @CL_SUCCESS
br label %71
71: ; preds = %69, %32, %41, %50, %21
%72 = phi i64 [ -1, %21 ], [ %70, %69 ], [ -1, %32 ], [ -1, %41 ], [ -1, %50 ]
ret i64 %72
}