#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 */
int /*<<< orphan*/ exit(scalar_t__);
char *oclErrorString(scalar_t__);
int /*<<< orphan*/ printf(char *, ...);
void __oclCheckErrorEX(cl_int iSample, cl_int iReference, const char *cFile,
                       const int iLine) {
  if (iReference != iSample) {
    iSample = (iSample == 0) ? -9999 : iSample;
    printf("\n !!! Error # %i (%s) at line %i , in file %s !!!\n\n", iSample,
           oclErrorString(iSample), iLine, cFile);
    printf("Exiting...\n");
    exit(iSample);
  }
}


x86 assembly (clang, -O0):
<__oclCheckErrorEX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     11c4 <__oclCheckErrorEX+0x94>
cmpq   $0x0,-0x8(%rbp)
jne    1170 <__oclCheckErrorEX+0x40>
mov    $0xffffffffffffd8f1,%rax
mov    %rax,-0x28(%rbp)
jmp    1178 <__oclCheckErrorEX+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <oclErrorString@plt>
mov    -0x30(%rbp),%rsi
mov    %rax,%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__oclCheckErrorEX>:
cmp    %rdi,%rsi
jne    1146 <__oclCheckErrorEX+0x6>
ret
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebp
mov    %rdx,%rbx
test   %rdi,%rdi
mov    $0xffffffffffffd8f1,%r14
cmovne %rdi,%r14
mov    %r14,%rdi
call   1050 <oclErrorString@plt>
lea    0xe94(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
mov    %ebp,%ecx
mov    %rbx,%r8
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"\0A !!! Error # %i (%s) at line %i , in file %s !!!\0A\0A\00"
@.str.1 = [12 x i8] c"Exiting...\0A\00"
define void @__oclCheckErrorEX(i64 %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i64 %0, i64* %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i64, i64* %6
%10 = load i64, i64* %5
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %29
12: ; preds = %4
%13 = load i64, i64* %5
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
br label %18
16: ; preds = %12
%17 = load i64, i64* %5
br label %18
18: ; preds = %16, %15
%19 = phi i64 [ -9999, %15 ], [ %17, %16 ]
store i64 %19, i64* %5
%20 = load i64, i64* %5
%21 = load i64, i64* %5
%22 = call i8* @oclErrorString(i64 %21)
%23 = load i32, i32* %8
%24 = load i8*, i8** %7
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i64 %20, i8* %22, i32 %23, i8* %24)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%27 = load i64, i64* %5
%28 = call i32 @exit(i64 %27)
unreachable
29: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"\0A !!! Error # %i (%s) at line %i , in file %s !!!\0A\0A\00"
@str = [11 x i8] c"Exiting...\00"
define void @__oclCheckErrorEX(i64 %0, i64 %1, i8* %2, i32 %3) {
%5 = icmp eq i64 %1, %0
br i1 %5, label %13, label %6
6: ; preds = %4
%7 = icmp eq i64 %0, 0
%8 = select i1 %7, i64 -9999, i64 %0
%9 = tail call i8* @oclErrorString(i64 %8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i64 %8, i8* %9, i32 %3, i8* %2)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @exit(i64 %8)
unreachable
13: ; preds = %4
ret void
}