#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_DEVICE_NOT_FOUND;
scalar_t__ CL_INVALID_DEVICE_TYPE;
scalar_t__ CL_INVALID_PLATFORM;
scalar_t__ CL_INVALID_VALUE;
scalar_t__ CL_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void clGetDeviceIDsChecker(cl_int *err) {
  if (*err == CL_INVALID_PLATFORM)
    fprintf(stderr, "Err (clGetDeviceIDs): Platform not valid\n");
  else if (*err == CL_INVALID_DEVICE_TYPE)
    fprintf(stderr, "Err (clGetDeviceIDs): Device type not valie\n");
  else if (*err == CL_INVALID_VALUE)
    fprintf(stderr, "Err (clGetDeviceIDs): 3rd arg 0, but devices != NULL, or "
                    "no devices found\n");
  else if (*err == CL_DEVICE_NOT_FOUND)
    fprintf(stderr, "Err (clGetDeviceIDs): No device matching arg2 found\n");
  else {
    if (*err != CL_SUCCESS)
      fprintf(stderr, "clGetDeviceIDsChecker\n");
  }
}


x86 assembly (clang, -O0):
<clGetDeviceIDsChecker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2ebe(%rip),%rcx
cmp    (%rcx),%rax
jne    114d <clGetDeviceIDsChecker+0x3d>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1220 <clGetDeviceIDsChecker+0x110>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e7d(%rip),%rcx
cmp    (%rcx),%rax
jne    117e <clGetDeviceIDsChecker+0x6e>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1030 <fprintf@plt>
jmp    121b <clGetDeviceIDsChecker+0x10b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e54(%rip),%rcx
cmp    (%rcx),%rax
jne    11af <clGetDeviceIDsChecker+0x9f>
mov    0x2e24(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1216 <clGetDeviceIDsChecker+0x106>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e13(%rip),%rcx
cmp    (%rcx),%rax
jne    11e0 <clGetDeviceIDsChecker+0xd0>
mov    0x2df3(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1211 <clGetDeviceIDsChecker+0x101>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2dca(%rip),%rcx
cmp    (%rcx),%rax
je     120c <clGetDeviceIDsChecker+0xfc>
mov    0x2dc2(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1211 <clGetDeviceIDsChecker+0x101>
jmp    1216 <clGetDeviceIDsChecker+0x106>
jmp    121b <clGetDeviceIDsChecker+0x10b>
jmp    1220 <clGetDeviceIDsChecker+0x110>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clGetDeviceIDsChecker>:
mov    (%rdi),%rax
mov    0x2ece(%rip),%rcx
cmp    (%rcx),%rax
jne    1128 <clGetDeviceIDsChecker+0x18>
lea    0xeda(%rip),%rsi
jmp    117b <clGetDeviceIDsChecker+0x6b>
mov    0x2ea9(%rip),%rcx
cmp    (%rcx),%rax
jne    113d <clGetDeviceIDsChecker+0x2d>
lea    0xeef(%rip),%rsi
jmp    117b <clGetDeviceIDsChecker+0x6b>
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%rax
jne    1152 <clGetDeviceIDsChecker+0x42>
lea    0xf07(%rip),%rsi
jmp    117b <clGetDeviceIDsChecker+0x6b>
mov    0x2e77(%rip),%rcx
cmp    (%rcx),%rax
jne    1167 <clGetDeviceIDsChecker+0x57>
lea    0xf3d(%rip),%rsi
jmp    117b <clGetDeviceIDsChecker+0x6b>
mov    0x2e4a(%rip),%rcx
cmp    (%rcx),%rax
jne    1174 <clGetDeviceIDsChecker+0x64>
ret
lea    0xf5c(%rip),%rsi
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@CL_INVALID_PLATFORM = global i64 0
@stderr = global i32 0
@.str = [42 x i8] c"Err (clGetDeviceIDs): Platform not valid\0A\00"
@CL_INVALID_DEVICE_TYPE = global i64 0
@.str.1 = [45 x i8] c"Err (clGetDeviceIDs): Device type not valie\0A\00"
@CL_INVALID_VALUE = global i64 0
@.str.2 = [75 x i8] c"Err (clGetDeviceIDs): 3rd arg 0, but devices != NULL, or no devices found\0A\00"
@CL_DEVICE_NOT_FOUND = global i64 0
@.str.3 = [53 x i8] c"Err (clGetDeviceIDs): No device matching arg2 found\0A\00"
@CL_SUCCESS = global i64 0
@.str.4 = [23 x i8] c"clGetDeviceIDsChecker\0A\00"
define void @clGetDeviceIDsChecker(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_PLATFORM
%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 ([42 x i8], [42 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_TYPE
%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 ([45 x i8], [45 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 ([75 x i8], [75 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_DEVICE_NOT_FOUND
%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 ([53 x i8], [53 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 ([23 x i8], [23 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_PLATFORM = global i64 0
@stderr = global i32 0
@.str = [42 x i8] c"Err (clGetDeviceIDs): Platform not valid\0A\00"
@CL_INVALID_DEVICE_TYPE = global i64 0
@.str.1 = [45 x i8] c"Err (clGetDeviceIDs): Device type not valie\0A\00"
@CL_INVALID_VALUE = global i64 0
@.str.2 = [75 x i8] c"Err (clGetDeviceIDs): 3rd arg 0, but devices != NULL, or no devices found\0A\00"
@CL_DEVICE_NOT_FOUND = global i64 0
@.str.3 = [53 x i8] c"Err (clGetDeviceIDs): No device matching arg2 found\0A\00"
@CL_SUCCESS = global i64 0
@.str.4 = [23 x i8] c"clGetDeviceIDsChecker\0A\00"
define void @clGetDeviceIDsChecker(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = load i64, i64* @CL_INVALID_PLATFORM
%4 = icmp eq i64 %2, %3
br i1 %4, label %17, label %5
5: ; preds = %1
%6 = load i64, i64* @CL_INVALID_DEVICE_TYPE
%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_DEVICE_NOT_FOUND
%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 ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([75 x i8], [75 x i8]* @.str.2, i64 0, i64 0), %8 ], [ getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), %11 ], [ getelementptr inbounds ([23 x i8], [23 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
}