#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_7__ TYPE_3__;
typedef struct TYPE_6__ TYPE_2__;
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
struct TYPE_6__ {
  int /*<<< orphan*/ send_event;
};
struct TYPE_5__ {
  int /*<<< orphan*/ window;
};
struct TYPE_7__ {
  scalar_t__ type;
  TYPE_2__ xany;
  TYPE_1__ xcreatewindow;
};
typedef TYPE_3__ XEvent;

/* Variables and functions */
scalar_t__ CreateNotify;
scalar_t__ KeyPress;
int /*<<< orphan*/ addToQueue(int /*<<< orphan*/);
int /*<<< orphan*/ xautolock_resetTriggers();
void xautolock_processEvent(XEvent *event) {
  if (event->type == CreateNotify) {
    addToQueue(event->xcreatewindow.window);
  }
  if (event->type == KeyPress && !event->xany.send_event) {
    xautolock_resetTriggers();
  }
}


x86 assembly (clang, -O0):
<xautolock_processEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%rax
jne    114f <xautolock_processEvent+0x2f>
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%edi
call   1040 <addToQueue@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e83(%rip),%rcx
cmp    (%rcx),%rax
jne    117b <xautolock_processEvent+0x5b>
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x8(%rax)
jne    117b <xautolock_processEvent+0x5b>
mov    $0x0,%al
call   1030 <xautolock_resetTriggers@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xautolock_processEvent>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    0x2ec2(%rip),%rcx
cmp    (%rcx),%rax
jne    113e <xautolock_processEvent+0x1e>
mov    0xc(%rbx),%edi
call   1040 <addToQueue@plt>
mov    (%rbx),%rax
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%rax
jne    1150 <xautolock_processEvent+0x30>
cmpl   $0x0,0x8(%rbx)
je     1152 <xautolock_processEvent+0x32>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
jmp    1030 <xautolock_resetTriggers@plt>

LLVM IR (-O0):
%struct.TYPE_7__ = type { i64, %struct.TYPE_6__, %struct.TYPE_5__ }
%struct.TYPE_6__ = type { i32 }
%struct.TYPE_5__ = type { i32 }
@CreateNotify = global i64 0
@KeyPress = global i64 0
define void @xautolock_processEvent(%struct.TYPE_7__* %0) {
%2 = alloca %struct.TYPE_7__*
store %struct.TYPE_7__* %0, %struct.TYPE_7__** %2
%3 = load %struct.TYPE_7__*, %struct.TYPE_7__** %2
%4 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = load i64, i64* @CreateNotify
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load %struct.TYPE_7__*, %struct.TYPE_7__** %2
%10 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %9, i32 0, i32 2
%11 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @addToQueue(i32 %12)
br label %14
14: ; preds = %8, %1
%15 = load %struct.TYPE_7__*, %struct.TYPE_7__** %2
%16 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %15, i32 0, i32 0
%17 = load i64, i64* %16
%18 = load i64, i64* @KeyPress
%19 = icmp eq i64 %17, %18
br i1 %19, label %20, label %28
20: ; preds = %14
%21 = load %struct.TYPE_7__*, %struct.TYPE_7__** %2
%22 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %21, i32 0, i32 1
%23 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %22, i32 0, i32 0
%24 = load i32, i32* %23
%25 = icmp ne i32 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %20
%27 = call i32 (...) @xautolock_resetTriggers()
br label %28
28: ; preds = %26, %20, %14
ret void
}

LLVM IR (-O2):
%struct.TYPE_7__ = type { i64, %struct.TYPE_6__, %struct.TYPE_5__ }
%struct.TYPE_6__ = type { i32 }
%struct.TYPE_5__ = type { i32 }
@CreateNotify = global i64 0
@KeyPress = global i64 0
define void @xautolock_processEvent(%struct.TYPE_7__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @CreateNotify
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %0, i64 0, i32 2, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @addToQueue(i32 %8)
%10 = load i64, i64* %2
br label %11
11: ; preds = %6, %1
%12 = phi i64 [ %10, %6 ], [ %3, %1 ]
%13 = load i64, i64* @KeyPress
%14 = icmp eq i64 %12, %13
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %0, i64 0, i32 1, i32 0
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = tail call i32 (...) @xautolock_resetTriggers()
br label %21
21: ; preds = %19, %15, %11
ret void
}