#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_5__ TYPE_1__;

/* Type definitions */
typedef int time_t;
struct TYPE_5__ {
  int /*<<< orphan*/ flags;
  int /*<<< orphan*/ input;
};
typedef TYPE_1__ XWMHints;
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ DefaultRootWindow(int /*<<< orphan*/ *);
int /*<<< orphan*/ InputHint;
int /*<<< orphan*/ PropertyChangeMask;
int /*<<< orphan*/ True;
TYPE_1__ *XAllocWMHints();
int /*<<< orphan*/ XCreateSimpleWindow(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int /*<<< orphan*/,
                                       int, int, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ XFree(TYPE_1__ *);
int /*<<< orphan*/ XMapWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XNextEvent(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XSelectInput(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ XSetWMHints(int /*<<< orphan*/ *, int /*<<< orphan*/,
                               TYPE_1__ *);
int /*<<< orphan*/ raise_window(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ set_fullscreen(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ set_no_transitions(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ set_non_compositing(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/);
int /*<<< orphan*/ set_window_type(int /*<<< orphan*/ *, int /*<<< orphan*/);
int time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  Display *dpy;
  Window w;
  XWMHints *wmhints;
  time_t start_time;
  int raised = 0;
  dpy = XOpenDisplay(NULL);
  w = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, 800, 480, 0, 0, 0);
  set_fullscreen(dpy, w);
  set_window_type(dpy, w);
  wmhints = XAllocWMHints();
  wmhints->input = True;
  wmhints->flags = InputHint;
  XSetWMHints(dpy, w, wmhints);
  XFree(wmhints);
  set_non_compositing(dpy, w);
  set_no_transitions(dpy, w);
  XMapWindow(dpy, w);
  start_time = time(NULL);
  XSelectInput(dpy, DefaultRootWindow(dpy), PropertyChangeMask);
  for (;;) {
    XEvent xev;
    XNextEvent(dpy, &xev);
    if (!raised && time(NULL) - start_time > 10) {
      raised = 1;
      raise_window(dpy, w);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x30(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <XOpenDisplay@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <DefaultRootWindow@plt>
mov    -0x48(%rbp),%rdi
mov    %eax,%esi
xor    %ecx,%ecx
mov    $0x320,%r8d
mov    $0x1e0,%r9d
mov    %ecx,%edx
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   10f0 <XCreateSimpleWindow@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1080 <set_fullscreen@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1090 <set_window_type@plt>
mov    $0x0,%al
call   10c0 <XAllocWMHints@plt>
mov    %rax,-0x28(%rbp)
mov    0x2d4e(%rip),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    0x2d4e(%rip),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   1060 <XSetWMHints@plt>
mov    -0x28(%rbp),%rdi
call   1050 <XFree@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1100 <set_non_compositing@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <set_no_transitions@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1110 <XMapWindow@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10b0 <time@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <DefaultRootWindow@plt>
mov    -0x40(%rbp),%rdi
mov    %eax,%esi
mov    0x2cd7(%rip),%rax
mov    (%rax),%edx
call   10e0 <XSelectInput@plt>
mov    -0x18(%rbp),%rdi
lea    -0x34(%rbp),%rsi
call   10d0 <XNextEvent@plt>
cmpl   $0x0,-0x30(%rbp)
jne    134f <main+0x15f>
xor    %eax,%eax
mov    %eax,%edi
call   10b0 <time@plt>
sub    -0x2c(%rbp),%eax
cmp    $0xa,%eax
jle    134f <main+0x15f>
movl   $0x1,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10a0 <raise_window@plt>
jmp    1310 <main+0x120>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %edi,%edi
call   1070 <XOpenDisplay@plt>
mov    %rax,%r12
mov    %rax,%rdi
call   1040 <DefaultRootWindow@plt>
sub    $0x8,%rsp
mov    %r12,%rdi
mov    %eax,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x320,%r8d
mov    $0x1e0,%r9d
push   $0x0
push   $0x0
push   $0x0
call   10f0 <XCreateSimpleWindow@plt>
add    $0x20,%rsp
mov    %eax,%r14d
mov    %r12,%rdi
mov    %eax,%esi
call   1080 <set_fullscreen@plt>
mov    %r12,%rdi
mov    %r14d,%esi
call   1090 <set_window_type@plt>
xor    %eax,%eax
call   10c0 <XAllocWMHints@plt>
mov    %rax,%rbx
mov    0x2d78(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rbx)
mov    0x2d7c(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rbx)
mov    %r12,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
call   1060 <XSetWMHints@plt>
mov    %rbx,%rdi
call   1050 <XFree@plt>
mov    %r12,%rdi
mov    %r14d,%esi
call   1100 <set_non_compositing@plt>
mov    %r12,%rdi
mov    %r14d,%esi
call   1030 <set_no_transitions@plt>
mov    %r12,%rdi
mov    %r14d,%esi
call   1110 <XMapWindow@plt>
xor    %edi,%edi
call   10b0 <time@plt>
mov    %eax,%r15d
mov    %r12,%rdi
call   1040 <DefaultRootWindow@plt>
mov    0x2d20(%rip),%rcx
mov    (%rcx),%edx
mov    %r12,%rdi
mov    %eax,%esi
call   10e0 <XSelectInput@plt>
lea    0x4(%rsp),%r13
jmp    12e2 <main+0xf2>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%ebp
mov    %r12,%rdi
mov    %r13,%rsi
call   10d0 <XNextEvent@plt>
mov    $0x1,%ebx
test   %ebp,%ebp
jne    12e0 <main+0xf0>
xor    %ebx,%ebx
xor    %edi,%edi
call   10b0 <time@plt>
sub    %r15d,%eax
cmp    $0xb,%eax
jl     12e0 <main+0xf0>
mov    %r12,%rdi
mov    %r14d,%esi
call   10a0 <raise_window@plt>
mov    $0x1,%ebx
jmp    12e0 <main+0xf0>

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32, i32 }
@True = global i32 0
@InputHint = global i32 0
@PropertyChangeMask = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca %struct.TYPE_5__*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %10
%12 = call i32* @XOpenDisplay(i32* null)
store i32* %12, i32** %6
%13 = load i32*, i32** %6
%14 = load i32*, i32** %6
%15 = call i32 @DefaultRootWindow(i32* %14)
%16 = call i32 @XCreateSimpleWindow(i32* %13, i32 %15, i32 0, i32 0, i32 800, i32 480, i32 0, i32 0, i32 0)
store i32 %16, i32* %7
%17 = load i32*, i32** %6
%18 = load i32, i32* %7
%19 = call i32 @set_fullscreen(i32* %17, i32 %18)
%20 = load i32*, i32** %6
%21 = load i32, i32* %7
%22 = call i32 @set_window_type(i32* %20, i32 %21)
%23 = call %struct.TYPE_5__* (...) @XAllocWMHints()
store %struct.TYPE_5__* %23, %struct.TYPE_5__** %8
%24 = load i32, i32* @True
%25 = load %struct.TYPE_5__*, %struct.TYPE_5__** %8
%26 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %25, i32 0, i32 1
store i32 %24, i32* %26
%27 = load i32, i32* @InputHint
%28 = load %struct.TYPE_5__*, %struct.TYPE_5__** %8
%29 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %28, i32 0, i32 0
store i32 %27, i32* %29
%30 = load i32*, i32** %6
%31 = load i32, i32* %7
%32 = load %struct.TYPE_5__*, %struct.TYPE_5__** %8
%33 = call i32 @XSetWMHints(i32* %30, i32 %31, %struct.TYPE_5__* %32)
%34 = load %struct.TYPE_5__*, %struct.TYPE_5__** %8
%35 = call i32 @XFree(%struct.TYPE_5__* %34)
%36 = load i32*, i32** %6
%37 = load i32, i32* %7
%38 = call i32 @set_non_compositing(i32* %36, i32 %37)
%39 = load i32*, i32** %6
%40 = load i32, i32* %7
%41 = call i32 @set_no_transitions(i32* %39, i32 %40)
%42 = load i32*, i32** %6
%43 = load i32, i32* %7
%44 = call i32 @XMapWindow(i32* %42, i32 %43)
%45 = call i32 @time(i32* null)
store i32 %45, i32* %9
%46 = load i32*, i32** %6
%47 = load i32*, i32** %6
%48 = call i32 @DefaultRootWindow(i32* %47)
%49 = load i32, i32* @PropertyChangeMask
%50 = call i32 @XSelectInput(i32* %46, i32 %48, i32 %49)
br label %51
51: ; preds = %65, %2
%52 = load i32*, i32** %6
%53 = call i32 @XNextEvent(i32* %52, i32* %11)
%54 = load i32, i32* %10
%55 = icmp ne i32 %54, 0
br i1 %55, label %65, label %56
56: ; preds = %51
%57 = call i32 @time(i32* null)
%58 = load i32, i32* %9
%59 = sub nsw i32 %57, %58
%60 = icmp sgt i32 %59, 10
br i1 %60, label %61, label %65
61: ; preds = %56
store i32 1, i32* %10
%62 = load i32*, i32** %6
%63 = load i32, i32* %7
%64 = call i32 @raise_window(i32* %62, i32 %63)
br label %65
65: ; preds = %61, %56, %51
br label %51
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i32, i32 }
@True = global i32 0
@InputHint = global i32 0
@PropertyChangeMask = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = tail call i32* @XOpenDisplay(i32* null)
%5 = tail call i32 @DefaultRootWindow(i32* %4)
%6 = tail call i32 @XCreateSimpleWindow(i32* %4, i32 %5, i32 0, i32 0, i32 800, i32 480, i32 0, i32 0, i32 0)
%7 = tail call i32 @set_fullscreen(i32* %4, i32 %6)
%8 = tail call i32 @set_window_type(i32* %4, i32 %6)
%9 = tail call %struct.TYPE_5__* (...) @XAllocWMHints()
%10 = load i32, i32* @True
%11 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %9, i64 0, i32 1
store i32 %10, i32* %11
%12 = load i32, i32* @InputHint
%13 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %9, i64 0, i32 0
store i32 %12, i32* %13
%14 = tail call i32 @XSetWMHints(i32* %4, i32 %6, %struct.TYPE_5__* %9)
%15 = tail call i32 @XFree(%struct.TYPE_5__* %9)
%16 = tail call i32 @set_non_compositing(i32* %4, i32 %6)
%17 = tail call i32 @set_no_transitions(i32* %4, i32 %6)
%18 = tail call i32 @XMapWindow(i32* %4, i32 %6)
%19 = tail call i32 @time(i32* null)
%20 = tail call i32 @DefaultRootWindow(i32* %4)
%21 = load i32, i32* @PropertyChangeMask
%22 = tail call i32 @XSelectInput(i32* %4, i32 %20, i32 %21)
%23 = bitcast i32* %3 to i8*
br label %24
24: ; preds = %34, %2
%25 = phi i32 [ 0, %2 ], [ %35, %34 ]
%26 = call i32 @XNextEvent(i32* %4, i32* %3)
%27 = icmp eq i32 %25, 0
br i1 %27, label %28, label %34
28: ; preds = %24
%29 = call i32 @time(i32* null)
%30 = sub nsw i32 %29, %19
%31 = icmp sgt i32 %30, 10
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 @raise_window(i32* %4, i32 %6)
br label %34
34: ; preds = %32, %28, %24
%35 = phi i32 [ 1, %24 ], [ 1, %32 ], [ 0, %28 ]
br label %24
}