#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
typedef TYPE_1__ XEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
scalar_t__ ClientMessage;
scalar_t__ ColormapNotify;
scalar_t__ ConfigureNotify;
scalar_t__ Expose;
scalar_t__ KeyPress;
scalar_t__ MotionNotify;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int CheckEvent(Display *display, XEvent *event, char *arg) {
  if (display || arg) {
  }
  if (event == NULL) {
    fprintf(stderr, "WARNING: Null event in CheckEvent()!!\n");
    return 0;
  }
  if ((event->type == MotionNotify) || (event->type == KeyPress) ||
      (event->type == ConfigureNotify) || (event->type == Expose) ||
      (event->type == ColormapNotify) || (event->type == ClientMessage))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<CheckEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113a <CheckEvent+0x2a>
cmpq   $0x0,-0x20(%rbp)
je     113f <CheckEvent+0x2f>
jmp    113f <CheckEvent+0x2f>
cmpq   $0x0,-0x18(%rbp)
jne    116b <CheckEvent+0x5b>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1208 <CheckEvent+0xf8>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2e67(%rip),%rcx
cmp    (%rcx),%rax
je     11f5 <CheckEvent+0xe5>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2e30(%rip),%rcx
cmp    (%rcx),%rax
je     11f5 <CheckEvent+0xe5>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2e21(%rip),%rcx
cmp    (%rcx),%rax
je     11f5 <CheckEvent+0xe5>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2e2a(%rip),%rcx
cmp    (%rcx),%rax
je     11f5 <CheckEvent+0xe5>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2e03(%rip),%rcx
cmp    (%rcx),%rax
je     11f5 <CheckEvent+0xe5>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2de4(%rip),%rcx
cmp    (%rcx),%rax
jne    1201 <CheckEvent+0xf1>
movl   $0x1,-0x4(%rbp)
jmp    1208 <CheckEvent+0xf8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckEvent>:
push   %rax
test   %rsi,%rsi
je     1178 <CheckEvent+0x68>
mov    (%rsi),%rax
mov    0x2ec0(%rip),%rcx
cmp    (%rcx),%rax
sete   %cl
mov    0x2e93(%rip),%rdx
cmp    (%rdx),%rax
sete   %dl
or     %cl,%dl
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%rax
sete   %dil
mov    0x2e9e(%rip),%rsi
cmp    (%rsi),%rax
sete   %cl
or     %dil,%cl
or     %dl,%cl
mov    0x2e7c(%rip),%rdx
cmp    (%rdx),%rax
sete   %dl
mov    0x2e67(%rip),%rsi
cmp    (%rsi),%rax
sete   %al
or     %dl,%al
or     %cl,%al
movzbl %al,%eax
pop    %rcx
ret
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
lea    0xe78(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
@stderr = global i32 0
@.str = [39 x i8] c"WARNING: Null event in CheckEvent()!!\0A\00"
@MotionNotify = global i64 0
@KeyPress = global i64 0
@ConfigureNotify = global i64 0
@Expose = global i64 0
@ColormapNotify = global i64 0
@ClientMessage = global i64 0
define i32 @CheckEvent(i32* %0, %struct.TYPE_3__* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.TYPE_3__*
%7 = alloca i8*
store i32* %0, i32** %5
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %6
store i8* %2, i8** %7
%8 = load i32*, i32** %5
%9 = icmp ne i32* %8, null
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i8*, i8** %7
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %10, %3
br label %14
14: ; preds = %13, %10
%15 = load %struct.TYPE_3__*, %struct.TYPE_3__** %6
%16 = icmp eq %struct.TYPE_3__* %15, null
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* @stderr
%19 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %58
20: ; preds = %14
%21 = load %struct.TYPE_3__*, %struct.TYPE_3__** %6
%22 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %21, i32 0, i32 0
%23 = load i64, i64* %22
%24 = load i64, i64* @MotionNotify
%25 = icmp eq i64 %23, %24
br i1 %25, label %56, label %26
26: ; preds = %20
%27 = load %struct.TYPE_3__*, %struct.TYPE_3__** %6
%28 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %27, i32 0, i32 0
%29 = load i64, i64* %28
%30 = load i64, i64* @KeyPress
%31 = icmp eq i64 %29, %30
br i1 %31, label %56, label %32
32: ; preds = %26
%33 = load %struct.TYPE_3__*, %struct.TYPE_3__** %6
%34 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %33, i32 0, i32 0
%35 = load i64, i64* %34
%36 = load i64, i64* @ConfigureNotify
%37 = icmp eq i64 %35, %36
br i1 %37, label %56, label %38
38: ; preds = %32
%39 = load %struct.TYPE_3__*, %struct.TYPE_3__** %6
%40 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %39, i32 0, i32 0
%41 = load i64, i64* %40
%42 = load i64, i64* @Expose
%43 = icmp eq i64 %41, %42
br i1 %43, label %56, label %44
44: ; preds = %38
%45 = load %struct.TYPE_3__*, %struct.TYPE_3__** %6
%46 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %45, i32 0, i32 0
%47 = load i64, i64* %46
%48 = load i64, i64* @ColormapNotify
%49 = icmp eq i64 %47, %48
br i1 %49, label %56, label %50
50: ; preds = %44
%51 = load %struct.TYPE_3__*, %struct.TYPE_3__** %6
%52 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %51, i32 0, i32 0
%53 = load i64, i64* %52
%54 = load i64, i64* @ClientMessage
%55 = icmp eq i64 %53, %54
br i1 %55, label %56, label %57
56: ; preds = %50, %44, %38, %32, %26, %20
store i32 1, i32* %4
br label %58
57: ; preds = %50
store i32 0, i32* %4
br label %58
58: ; preds = %57, %56, %17
%59 = load i32, i32* %4
ret i32 %59
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
@stderr = global i32 0
@.str = [39 x i8] c"WARNING: Null event in CheckEvent()!!\0A\00"
@MotionNotify = global i64 0
@KeyPress = global i64 0
@ConfigureNotify = global i64 0
@Expose = global i64 0
@ColormapNotify = global i64 0
@ClientMessage = global i64 0
define i32 @CheckEvent(i32* nocapture readnone %0, %struct.TYPE_3__* %1, i8* nocapture readnone %2) {
%4 = icmp eq %struct.TYPE_3__* %1, null
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %29
8: ; preds = %3
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = load i64, i64* @MotionNotify
%12 = icmp eq i64 %10, %11
%13 = load i64, i64* @KeyPress
%14 = icmp eq i64 %10, %13
%15 = select i1 %12, i1 true, i1 %14
%16 = load i64, i64* @ConfigureNotify
%17 = icmp eq i64 %10, %16
%18 = select i1 %15, i1 true, i1 %17
%19 = load i64, i64* @Expose
%20 = icmp eq i64 %10, %19
%21 = select i1 %18, i1 true, i1 %20
%22 = load i64, i64* @ColormapNotify
%23 = icmp eq i64 %10, %22
%24 = select i1 %21, i1 true, i1 %23
%25 = load i64, i64* @ClientMessage
%26 = icmp eq i64 %10, %25
%27 = select i1 %24, i1 true, i1 %26
%28 = zext i1 %27 to i32
br label %29
29: ; preds = %8, %5
%30 = phi i32 [ 0, %5 ], [ %28, %8 ]
ret i32 %30
}