#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_6__ TYPE_2__;
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
struct TYPE_5__ {
  int /*<<< orphan*/ input;
  int /*<<< orphan*/ flags;
};
typedef TYPE_1__ XWMHints;
struct TYPE_6__ {
  int flags;
  int x;
  int y;
  int width;
  int height;
};
typedef TYPE_2__ XSizeHints;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int DefaultScreen(int /*<<< orphan*/ *);
int /*<<< orphan*/ InputHint;
int /*<<< orphan*/ None;
int /*<<< orphan*/ RootWindow(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ True;
int USPosition;
int USSize;
int /*<<< orphan*/ XCreateSimpleWindow(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                       int, int, int, int, int, int, int);
int /*<<< orphan*/ XSetStandardProperties(int /*<<< orphan*/ *,
                                          int /*<<< orphan*/, char *, char *,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/, TYPE_2__ *);
int /*<<< orphan*/ XSetWMHints(int /*<<< orphan*/ *, int /*<<< orphan*/,
                               TYPE_1__ *);
Window xNewWindow(Display *dpy, int x, int y, int width, int height, int border,
                  int background, char *name) {
  Window root, win;
  XSizeHints size_hints;
  XWMHints wm_hints;
  int scr, border_w = 4;
  scr = DefaultScreen(dpy);
  root = RootWindow(dpy, scr);
  win = XCreateSimpleWindow(dpy, root, x, y, width, height, border_w, border,
                            background);
  size_hints.flags = USPosition | USSize;
  size_hints.x = x;
  size_hints.y = y;
  size_hints.width = width;
  size_hints.height = height;
  XSetStandardProperties(dpy, win, name, name, None, 0, 0, &size_hints);
  wm_hints.flags = InputHint;
  wm_hints.input = True;
  XSetWMHints(dpy, win, &wm_hints);
  return win;
}


x86 assembly (clang, -O0):
<xNewWindow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
movl   $0x4,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <DefaultScreen@plt>
mov    %eax,-0x44(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1050 <RootWindow@plt>
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x48(%rbp),%r11d
mov    -0x1c(%rbp),%r10d
mov    0x10(%rbp),%eax
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1060 <XCreateSimpleWindow@plt>
mov    %eax,-0x24(%rbp)
mov    0x2e26(%rip),%rax
mov    (%rax),%eax
mov    0x2de5(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    0x18(%rbp),%rdx
mov    0x18(%rbp),%rcx
mov    0x2dca(%rip),%rax
mov    (%rax),%r8d
xor    %r9d,%r9d
lea    -0x38(%rbp),%rax
movl   $0x0,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <XSetStandardProperties@plt>
mov    0x2db0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    0x2d94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
lea    -0x40(%rbp),%rdx
call   1040 <XSetWMHints@plt>
mov    -0x24(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xNewWindow>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1070 <DefaultScreen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <RootWindow@plt>
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    %r15d,%r9d
mov    0x68(%rsp),%eax
push   %rax
push   %r14
push   $0x4
call   1060 <XCreateSimpleWindow@plt>
add    $0x20,%rsp
mov    0x2e4d(%rip),%rcx
mov    0x2e0e(%rip),%rdx
mov    (%rdx),%edx
or     (%rcx),%edx
mov    %eax,%r14d
mov    %edx,0x10(%rsp)
mov    %ebp,0x14(%rsp)
mov    %r13d,0x18(%rsp)
mov    %r12d,0x1c(%rsp)
mov    %r15d,0x20(%rsp)
mov    0x2e01(%rip),%rax
mov    (%rax),%r8d
lea    0x10(%rsp),%rax
mov    %rbx,%rdi
mov    %r14d,%esi
mov    0x68(%rsp),%rcx
mov    %rcx,%rdx
xor    %r9d,%r9d
push   %rax
push   $0x0
call   1030 <XSetStandardProperties@plt>
add    $0x10,%rsp
mov    0x2ddd(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
mov    0x2dc0(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <XSetWMHints@plt>
mov    %r14d,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_6__ = type { i32, i32, i32, i32, i32 }
%struct.TYPE_5__ = type { i32, i32 }
@USPosition = global i32 0
@USSize = global i32 0
@None = global i32 0
@InputHint = global i32 0
@True = global i32 0
define i32 @xNewWindow(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i8* %7) {
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
%19 = alloca %struct.TYPE_6__
%20 = alloca %struct.TYPE_5__
%21 = alloca i32
%22 = alloca i32
store i32* %0, i32** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i8* %7, i8** %16
store i32 4, i32* %22
%23 = load i32*, i32** %9
%24 = call i32 @DefaultScreen(i32* %23)
store i32 %24, i32* %21
%25 = load i32*, i32** %9
%26 = load i32, i32* %21
%27 = call i32 @RootWindow(i32* %25, i32 %26)
store i32 %27, i32* %17
%28 = load i32*, i32** %9
%29 = load i32, i32* %17
%30 = load i32, i32* %10
%31 = load i32, i32* %11
%32 = load i32, i32* %12
%33 = load i32, i32* %13
%34 = load i32, i32* %22
%35 = load i32, i32* %14
%36 = load i32, i32* %15
%37 = call i32 @XCreateSimpleWindow(i32* %28, i32 %29, i32 %30, i32 %31, i32 %32, i32 %33, i32 %34, i32 %35, i32 %36)
store i32 %37, i32* %18
%38 = load i32, i32* @USPosition
%39 = load i32, i32* @USSize
%40 = or i32 %38, %39
%41 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %19, i32 0, i32 0
store i32 %40, i32* %41
%42 = load i32, i32* %10
%43 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %19, i32 0, i32 1
store i32 %42, i32* %43
%44 = load i32, i32* %11
%45 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %19, i32 0, i32 2
store i32 %44, i32* %45
%46 = load i32, i32* %12
%47 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %19, i32 0, i32 3
store i32 %46, i32* %47
%48 = load i32, i32* %13
%49 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %19, i32 0, i32 4
store i32 %48, i32* %49
%50 = load i32*, i32** %9
%51 = load i32, i32* %18
%52 = load i8*, i8** %16
%53 = load i8*, i8** %16
%54 = load i32, i32* @None
%55 = call i32 @XSetStandardProperties(i32* %50, i32 %51, i8* %52, i8* %53, i32 %54, i32 0, i32 0, %struct.TYPE_6__* %19)
%56 = load i32, i32* @InputHint
%57 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %20, i32 0, i32 1
store i32 %56, i32* %57
%58 = load i32, i32* @True
%59 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %20, i32 0, i32 0
store i32 %58, i32* %59
%60 = load i32*, i32** %9
%61 = load i32, i32* %18
%62 = call i32 @XSetWMHints(i32* %60, i32 %61, %struct.TYPE_5__* %20)
%63 = load i32, i32* %18
ret i32 %63
}

LLVM IR (-O2):
%struct.TYPE_6__ = type { i32, i32, i32, i32, i32 }
%struct.TYPE_5__ = type { i32, i32 }
@USPosition = global i32 0
@USSize = global i32 0
@None = global i32 0
@InputHint = global i32 0
@True = global i32 0
define i32 @xNewWindow(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i8* %7) {
%9 = alloca %struct.TYPE_6__
%10 = alloca %struct.TYPE_5__
%11 = bitcast %struct.TYPE_6__* %9 to i8*
%12 = bitcast %struct.TYPE_5__* %10 to i8*
%13 = tail call i32 @DefaultScreen(i32* %0)
%14 = tail call i32 @RootWindow(i32* %0, i32 %13)
%15 = tail call i32 @XCreateSimpleWindow(i32* %0, i32 %14, i32 %1, i32 %2, i32 %3, i32 %4, i32 4, i32 %5, i32 %6)
%16 = load i32, i32* @USPosition
%17 = load i32, i32* @USSize
%18 = or i32 %17, %16
%19 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %9, i64 0, i32 0
store i32 %18, i32* %19
%20 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %9, i64 0, i32 1
store i32 %1, i32* %20
%21 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %9, i64 0, i32 2
store i32 %2, i32* %21
%22 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %9, i64 0, i32 3
store i32 %3, i32* %22
%23 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %9, i64 0, i32 4
store i32 %4, i32* %23
%24 = load i32, i32* @None
%25 = call i32 @XSetStandardProperties(i32* %0, i32 %15, i8* %7, i8* %7, i32 %24, i32 0, i32 0, %struct.TYPE_6__* %9)
%26 = load i32, i32* @InputHint
%27 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %10, i64 0, i32 1
store i32 %26, i32* %27
%28 = load i32, i32* @True
%29 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %10, i64 0, i32 0
store i32 %28, i32* %29
%30 = call i32 @XSetWMHints(i32* %0, i32 %15, %struct.TYPE_5__* %10)
ret i32 %15
}