#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__ {
  int event_mask;
  int /*<<< orphan*/ cursor;
  int /*<<< orphan*/ colormap;
  int /*<<< orphan*/ backing_store;
  int /*<<< orphan*/ override_redirect;
};
typedef TYPE_1__ XSetWindowAttributes;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Visual;
typedef int /*<<< orphan*/ Screen;
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Colormap;

/* Variables and functions */
int Button1MotionMask;
int ButtonPressMask;
int ButtonReleaseMask;
unsigned long CWBackingStore;
unsigned long CWColormap;
unsigned long CWCursor;
unsigned long CWEventMask;
unsigned long CWOverrideRedirect;
int /*<<< orphan*/ *DefaultVisualOfScreen(int /*<<< orphan*/ *);
int ExposureMask;
int /*<<< orphan*/ HeightOfScreen(int /*<<< orphan*/ *);
int /*<<< orphan*/ InputOutput;
int KeyPressMask;
int /*<<< orphan*/ NotUseful;
int /*<<< orphan*/ RootWindowOfScreen(int /*<<< orphan*/ *);
int /*<<< orphan*/ *ScreenOfDisplay(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ True;
int /*<<< orphan*/ WidthOfScreen(int /*<<< orphan*/ *);
int /*<<< orphan*/ XC_cross;
int /*<<< orphan*/ XCreateFontCursor(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XCreateWindow(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int /*<<< orphan*/ *, unsigned long,
                                 TYPE_1__ *);
int visual_depth(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
Window create_full_screen_window(Display *dpy, int screen, Colormap cmap) {
  XSetWindowAttributes attrs;
  Window win;
  Visual *visual;
  Screen *screen_obj;
  unsigned long attrmask;
  int depth;
  screen_obj = ScreenOfDisplay(dpy, screen);
  visual = DefaultVisualOfScreen(screen_obj);
  depth = visual_depth(screen_obj, visual);
  attrmask = (CWOverrideRedirect | CWEventMask | CWBackingStore | CWColormap |
              CWCursor);
  attrs.override_redirect = True;
  attrs.event_mask = (ExposureMask | KeyPressMask | ButtonPressMask |
                      Button1MotionMask | ButtonReleaseMask);
  attrs.backing_store = NotUseful;
  attrs.colormap = cmap;
  attrs.cursor = XCreateFontCursor(dpy, XC_cross);
  win = XCreateWindow(dpy, RootWindowOfScreen(screen_obj), 0, 0,
                      WidthOfScreen(screen_obj), HeightOfScreen(screen_obj), 0,
                      depth, InputOutput, visual, attrmask, &attrs);
  return win;
}


x86 assembly (clang, -O0):
<create_full_screen_window>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x90,%rsp
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %edx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10a0 <ScreenOfDisplay@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
call   1070 <DefaultVisualOfScreen@plt>
mov    %rax,-0x48(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1040 <visual_depth@plt>
mov    %eax,-0x5c(%rbp)
mov    0x2da4(%rip),%rax
mov    (%rax),%rax
mov    0x2db2(%rip),%rcx
or     (%rcx),%rax
mov    0x2d98(%rip),%rcx
or     (%rcx),%rax
mov    0x2dd6(%rip),%rcx
or     (%rcx),%rax
mov    0x2dbc(%rip),%rcx
or     (%rcx),%rax
mov    %rax,-0x58(%rbp)
mov    0x2dc6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    0x2d82(%rip),%rax
mov    (%rax),%eax
mov    0x2db9(%rip),%rcx
or     (%rcx),%eax
mov    0x2db8(%rip),%rcx
or     (%rcx),%eax
mov    0x2dbf(%rip),%rcx
or     (%rcx),%eax
mov    0x2d76(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x38(%rbp)
mov    0x2da2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d44(%rip),%rax
mov    (%rax),%esi
call   1030 <XCreateFontCursor@plt>
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x50(%rbp),%rdi
call   1080 <RootWindowOfScreen@plt>
mov    %eax,-0x64(%rbp)
mov    -0x50(%rbp),%rdi
call   1050 <WidthOfScreen@plt>
mov    %eax,-0x60(%rbp)
mov    -0x50(%rbp),%rdi
call   1090 <HeightOfScreen@plt>
mov    -0x70(%rbp),%rdi
mov    -0x64(%rbp),%esi
mov    -0x60(%rbp),%r8d
mov    %eax,%r9d
mov    -0x5c(%rbp),%r14d
mov    0x2d00(%rip),%rax
mov    (%rax),%ebx
mov    -0x48(%rbp),%r11
mov    -0x58(%rbp),%r10
xor    %ecx,%ecx
lea    -0x38(%rbp),%rax
mov    %ecx,%edx
movl   $0x0,(%rsp)
mov    %r14d,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
call   1060 <XCreateWindow@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x90,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_full_screen_window>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %edx,%ebp
mov    %rdi,%r15
call   10a0 <ScreenOfDisplay@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <DefaultVisualOfScreen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <visual_depth@plt>
mov    0x2db8(%rip),%rcx
mov    0x2dc9(%rip),%rdx
mov    (%rdx),%r12
or     (%rcx),%r12
mov    0x2dac(%rip),%rcx
or     (%rcx),%r12
mov    0x2dea(%rip),%rcx
or     (%rcx),%r12
mov    0x2dd0(%rip),%rcx
or     (%rcx),%r12
mov    0x2da6(%rip),%rcx
mov    0x2ddf(%rip),%rdx
mov    (%rdx),%edx
or     (%rcx),%edx
mov    %rax,0x20(%rsp)
mov    0x2dd7(%rip),%rax
or     (%rax),%edx
mov    0x2dde(%rip),%rax
or     (%rax),%edx
mov    0x2d95(%rip),%rax
or     (%rax),%edx
mov    0x2dac(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x18(%rsp)
mov    %edx,0x8(%rsp)
mov    0x2db3(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
mov    %ebp,0x10(%rsp)
mov    0x2d5a(%rip),%rax
mov    (%rax),%esi
mov    %r15,%rdi
call   1030 <XCreateFontCursor@plt>
mov    %eax,0xc(%rsp)
mov    %rbx,%rdi
call   1080 <RootWindowOfScreen@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
call   1050 <WidthOfScreen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1090 <HeightOfScreen@plt>
mov    0x2d30(%rip),%rcx
mov    (%rcx),%ebx
lea    0x8(%rsp),%r10
mov    %r15,%rdi
mov    %r13d,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %ebp,%r8d
mov    %eax,%r9d
push   %r10
push   %r12
push   %r14
push   %rbx
push   0x40(%rsp)
push   $0x0
call   1060 <XCreateWindow@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i32, i32, i32 }
@CWOverrideRedirect = global i64 0
@CWEventMask = global i64 0
@CWBackingStore = global i64 0
@CWColormap = global i64 0
@CWCursor = global i64 0
@True = global i32 0
@ExposureMask = global i32 0
@KeyPressMask = global i32 0
@ButtonPressMask = global i32 0
@Button1MotionMask = global i32 0
@ButtonReleaseMask = global i32 0
@NotUseful = global i32 0
@XC_cross = global i32 0
@InputOutput = global i32 0
define i32 @create_full_screen_window(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.TYPE_3__
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i64
%12 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = call i32* @ScreenOfDisplay(i32* %13, i32 %14)
store i32* %15, i32** %10
%16 = load i32*, i32** %10
%17 = call i32* @DefaultVisualOfScreen(i32* %16)
store i32* %17, i32** %9
%18 = load i32*, i32** %10
%19 = load i32*, i32** %9
%20 = call i32 @visual_depth(i32* %18, i32* %19)
store i32 %20, i32* %12
%21 = load i64, i64* @CWOverrideRedirect
%22 = load i64, i64* @CWEventMask
%23 = or i64 %21, %22
%24 = load i64, i64* @CWBackingStore
%25 = or i64 %23, %24
%26 = load i64, i64* @CWColormap
%27 = or i64 %25, %26
%28 = load i64, i64* @CWCursor
%29 = or i64 %27, %28
store i64 %29, i64* %11
%30 = load i32, i32* @True
%31 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 4
store i32 %30, i32* %31
%32 = load i32, i32* @ExposureMask
%33 = load i32, i32* @KeyPressMask
%34 = or i32 %32, %33
%35 = load i32, i32* @ButtonPressMask
%36 = or i32 %34, %35
%37 = load i32, i32* @Button1MotionMask
%38 = or i32 %36, %37
%39 = load i32, i32* @ButtonReleaseMask
%40 = or i32 %38, %39
%41 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 0
store i32 %40, i32* %41
%42 = load i32, i32* @NotUseful
%43 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 3
store i32 %42, i32* %43
%44 = load i32, i32* %6
%45 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 2
store i32 %44, i32* %45
%46 = load i32*, i32** %4
%47 = load i32, i32* @XC_cross
%48 = call i32 @XCreateFontCursor(i32* %46, i32 %47)
%49 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 1
store i32 %48, i32* %49
%50 = load i32*, i32** %4
%51 = load i32*, i32** %10
%52 = call i32 @RootWindowOfScreen(i32* %51)
%53 = load i32*, i32** %10
%54 = call i32 @WidthOfScreen(i32* %53)
%55 = load i32*, i32** %10
%56 = call i32 @HeightOfScreen(i32* %55)
%57 = load i32, i32* %12
%58 = load i32, i32* @InputOutput
%59 = load i32*, i32** %9
%60 = load i64, i64* %11
%61 = call i32 @XCreateWindow(i32* %50, i32 %52, i32 0, i32 0, i32 %54, i32 %56, i32 0, i32 %57, i32 %58, i32* %59, i64 %60, %struct.TYPE_3__* %7)
store i32 %61, i32* %8
%62 = load i32, i32* %8
ret i32 %62
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i32, i32, i32 }
@CWOverrideRedirect = global i64 0
@CWEventMask = global i64 0
@CWBackingStore = global i64 0
@CWColormap = global i64 0
@CWCursor = global i64 0
@True = global i32 0
@ExposureMask = global i32 0
@KeyPressMask = global i32 0
@ButtonPressMask = global i32 0
@Button1MotionMask = global i32 0
@ButtonReleaseMask = global i32 0
@NotUseful = global i32 0
@XC_cross = global i32 0
@InputOutput = global i32 0
define i32 @create_full_screen_window(i32* %0, i32 %1, i32 %2) {
%4 = alloca %struct.TYPE_3__
%5 = bitcast %struct.TYPE_3__* %4 to i8*
%6 = tail call i32* @ScreenOfDisplay(i32* %0, i32 %1)
%7 = tail call i32* @DefaultVisualOfScreen(i32* %6)
%8 = tail call i32 @visual_depth(i32* %6, i32* %7)
%9 = load i64, i64* @CWOverrideRedirect
%10 = load i64, i64* @CWEventMask
%11 = or i64 %10, %9
%12 = load i64, i64* @CWBackingStore
%13 = or i64 %11, %12
%14 = load i64, i64* @CWColormap
%15 = or i64 %13, %14
%16 = load i64, i64* @CWCursor
%17 = or i64 %15, %16
%18 = load i32, i32* @True
%19 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i64 0, i32 4
store i32 %18, i32* %19
%20 = load i32, i32* @ExposureMask
%21 = load i32, i32* @KeyPressMask
%22 = or i32 %21, %20
%23 = load i32, i32* @ButtonPressMask
%24 = or i32 %22, %23
%25 = load i32, i32* @Button1MotionMask
%26 = or i32 %24, %25
%27 = load i32, i32* @ButtonReleaseMask
%28 = or i32 %26, %27
%29 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i64 0, i32 0
store i32 %28, i32* %29
%30 = load i32, i32* @NotUseful
%31 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i64 0, i32 3
store i32 %30, i32* %31
%32 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i64 0, i32 2
store i32 %2, i32* %32
%33 = load i32, i32* @XC_cross
%34 = tail call i32 @XCreateFontCursor(i32* %0, i32 %33)
%35 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i64 0, i32 1
store i32 %34, i32* %35
%36 = tail call i32 @RootWindowOfScreen(i32* %6)
%37 = tail call i32 @WidthOfScreen(i32* %6)
%38 = tail call i32 @HeightOfScreen(i32* %6)
%39 = load i32, i32* @InputOutput
%40 = call i32 @XCreateWindow(i32* %0, i32 %36, i32 0, i32 0, i32 %37, i32 %38, i32 0, i32 %8, i32 %39, i32* %7, i64 %17, %struct.TYPE_3__* %4)
ret i32 %40
}