#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_MEM_OBJECT;
scalar_t__ CL_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void clReleaseMemObjectChecker(cl_int *err) {
  if (*err == CL_INVALID_MEM_OBJECT)
    fprintf(stderr, "Err (clReleaseMemObject): Not Valid Mem Object\n");
  else {
    if (*err != CL_SUCCESS)
      fprintf(stderr,
              "Err (clReleaseMemObject): Failure in deleting mem object\n");
  }
}


x86 assembly (clang, -O0):
<clReleaseMemObjectChecker>:
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 <clReleaseMemObjectChecker+0x3d>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
jmp    117e <clReleaseMemObjectChecker+0x6e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e75(%rip),%rcx
cmp    (%rcx),%rax
je     1179 <clReleaseMemObjectChecker+0x69>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
jmp    117e <clReleaseMemObjectChecker+0x6e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clReleaseMemObjectChecker>:
mov    (%rdi),%rax
mov    0x2ebe(%rip),%rcx
cmp    (%rcx),%rax
jne    1128 <clReleaseMemObjectChecker+0x18>
lea    0xeda(%rip),%rsi
jmp    113c <clReleaseMemObjectChecker+0x2c>
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%rax
jne    1135 <clReleaseMemObjectChecker+0x25>
ret
lea    0xef4(%rip),%rsi
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@CL_INVALID_MEM_OBJECT = global i64 0
@stderr = global i32 0
@.str = [48 x i8] c"Err (clReleaseMemObject): Not Valid Mem Object\0A\00"
@CL_SUCCESS = global i64 0
@.str.1 = [58 x i8] c"Err (clReleaseMemObject): Failure in deleting mem object\0A\00"
define void @clReleaseMemObjectChecker(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_MEM_OBJECT
%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 ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %19
10: ; preds = %1
%11 = load i64*, i64** %2
%12 = load i64, i64* %11
%13 = load i64, i64* @CL_SUCCESS
%14 = icmp ne 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 ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %15, %10
br label %19
19: ; preds = %18, %7
ret void
}

LLVM IR (-O2):
@CL_INVALID_MEM_OBJECT = global i64 0
@stderr = global i32 0
@.str = [48 x i8] c"Err (clReleaseMemObject): Not Valid Mem Object\0A\00"
@CL_SUCCESS = global i64 0
@.str.1 = [58 x i8] c"Err (clReleaseMemObject): Failure in deleting mem object\0A\00"
define void @clReleaseMemObjectChecker(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = load i64, i64* @CL_INVALID_MEM_OBJECT
%4 = icmp eq i64 %2, %3
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* @CL_SUCCESS
%7 = icmp eq i64 %2, %6
br i1 %7, label %12, label %8
8: ; preds = %5, %1
%9 = phi i8* [ getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), %5 ]
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* %9)
br label %12
12: ; preds = %8, %5
ret void
}