#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 /*<<< orphan*/ override_redirect;
};
typedef TYPE_1__ XSetWindowAttributes;
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
unsigned long CWOverrideRedirect;
int /*<<< orphan*/ CopyFromParent;
int /*<<< orphan*/ InputOnly;
int /*<<< orphan*/ RootWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ True;
int /*<<< orphan*/ XCreateWindow(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                                 int, int, int, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, unsigned long, TYPE_1__ *);
int /*<<< orphan*/ XFlush(int /*<<< orphan*/ *);
int /*<<< orphan*/ XMapWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XNextEvent(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XParseGeometry(char *, int *, int *, int *, int *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  XSetWindowAttributes xswa;
  unsigned long xswamask;
  Display *display;
  Window win;
  XEvent report;
  int i, x = 0, y = 0, h = 1, w = 1;
  for (i = 0; i < argc; i++) {
    if (!strcmp(argv[i], "-g") || !strcmp(argv[i], "-geometry")) {
      XParseGeometry(argv[++i], &x, &y, &w, &h);
    }
  }
  display = XOpenDisplay(NULL);
  if (display == NULL) {
    fprintf(stderr, "couldn't connect to X server :0\n");
    return 0;
  }
  xswa.override_redirect = True;
  xswamask = CWOverrideRedirect;
  win = XCreateWindow(display, RootWindow(display, 0), x, y, w, h, 0, 0,
                      InputOnly, CopyFromParent, xswamask, &xswa);
  XMapWindow(display, win);
  XFlush(display);
  while (1) {
    XNextEvent(display, &report);
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x88,%rsp
movl   $0x0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x1,-0x48(%rbp)
movl   $0x1,-0x4c(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1257 <main+0xc7>
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe14(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     121b <main+0x8b>
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdf6(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1244 <main+0xb4>
mov    -0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x3c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x44(%rbp),%rdx
lea    -0x4c(%rbp),%rcx
lea    -0x48(%rbp),%r8
call   1030 <XParseGeometry@plt>
jmp    1249 <main+0xb9>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11cd <main+0x3d>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <XOpenDisplay@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1290 <main+0x100>
mov    0x2d62(%rip),%rax
mov    (%rax),%edi
lea    0xd8e(%rip),%rsi
call   1060 <fprintf@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2d51(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2d15(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%rdi
xor    %esi,%esi
call   1090 <RootWindow@plt>
mov    -0x58(%rbp),%rdi
mov    %eax,%esi
mov    -0x40(%rbp),%edx
mov    -0x44(%rbp),%ecx
mov    -0x4c(%rbp),%r8d
mov    -0x48(%rbp),%r9d
mov    0x2cf8(%rip),%rax
mov    (%rax),%ebx
mov    0x2ce7(%rip),%rax
mov    (%rax),%r11d
mov    -0x28(%rbp),%r10
xor    %eax,%eax
lea    -0x20(%rbp),%rax
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11d,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
call   1080 <XCreateWindow@plt>
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   10b0 <XMapWindow@plt>
mov    -0x30(%rbp),%rdi
call   10a0 <XFlush@plt>
mov    -0x30(%rbp),%rdi
lea    -0x38(%rbp),%rsi
call   1070 <XNextEvent@plt>
jmp    132d <main+0x19d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x1,0x4(%rsp)
movl   $0x1,(%rsp)
test   %edi,%edi
jle    1235 <main+0xa5>
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %r15d,%r15d
lea    0xe30(%rip),%r14
jmp    120a <main+0x7a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%r12),%r15d
mov    0x8(%rbx,%r12,8),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
lea    0x4(%rsp),%r8
call   1030 <XParseGeometry@plt>
add    $0x1,%r15d
cmp    %ebp,%r15d
jge    1235 <main+0xa5>
movslq %r15d,%r12
mov    (%rbx,%r12,8),%r13
mov    %r13,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11e0 <main+0x50>
mov    %r13,%rdi
lea    0xdd9(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1201 <main+0x71>
jmp    11e0 <main+0x50>
xor    %edi,%edi
call   1050 <XOpenDisplay@plt>
test   %rax,%rax
je     12dd <main+0x14d>
mov    %rax,%rbx
mov    0x2d99(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
mov    0x2d5c(%rip),%rax
mov    (%rax),%r14
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <RootWindow@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    (%rsp),%r8d
mov    0x4(%rsp),%r9d
mov    0x2d4f(%rip),%rsi
mov    (%rsi),%r10d
mov    0x2d3d(%rip),%rsi
mov    (%rsi),%ebp
lea    0x10(%rsp),%r11
mov    %rbx,%rdi
mov    %eax,%esi
push   %r11
push   %r14
push   %rbp
push   %r10
push   $0x0
push   $0x0
call   1080 <XCreateWindow@plt>
add    $0x30,%rsp
mov    %rbx,%rdi
mov    %eax,%esi
call   10b0 <XMapWindow@plt>
mov    %rbx,%rdi
call   10a0 <XFlush@plt>
lea    0x14(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1070 <XNextEvent@plt>
jmp    12d0 <main+0x140>
mov    0x2cf4(%rip),%rax
mov    (%rax),%edi
lea    0xd20(%rip),%rsi
call   1060 <fprintf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
@.str = [3 x i8] c"-g\00"
@.str.1 = [10 x i8] c"-geometry\00"
@stderr = global i32 0
@.str.2 = [33 x i8] c"couldn't connect to X server :0\0A\00"
@True = global i32 0
@CWOverrideRedirect = global i64 0
@InputOnly = global i32 0
@CopyFromParent = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.TYPE_3__
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %12
store i32 0, i32* %13
store i32 1, i32* %14
store i32 1, i32* %15
store i32 0, i32* %11
br label %16
16: ; preds = %45, %2
%17 = load i32, i32* %11
%18 = load i32, i32* %4
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %48
20: ; preds = %16
%21 = load i8**, i8*** %5
%22 = load i32, i32* %11
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %21, i64 %23
%25 = load i8*, i8** %24
%26 = call i32 @strcmp(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %36
28: ; preds = %20
%29 = load i8**, i8*** %5
%30 = load i32, i32* %11
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = call i32 @strcmp(i8* %33, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %44, label %36
36: ; preds = %28, %20
%37 = load i8**, i8*** %5
%38 = load i32, i32* %11
%39 = add nsw i32 %38, 1
store i32 %39, i32* %11
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8*, i8** %37, i64 %40
%42 = load i8*, i8** %41
%43 = call i32 @XParseGeometry(i8* %42, i32* %12, i32* %13, i32* %15, i32* %14)
br label %44
44: ; preds = %36, %28
br label %45
45: ; preds = %44
%46 = load i32, i32* %11
%47 = add nsw i32 %46, 1
store i32 %47, i32* %11
br label %16
48: ; preds = %16
%49 = call i32* @XOpenDisplay(i32* null)
store i32* %49, i32** %8
%50 = load i32*, i32** %8
%51 = icmp eq i32* %50, null
br i1 %51, label %52, label %55
52: ; preds = %48
%53 = load i32, i32* @stderr
%54 = call i32 @fprintf(i32 %53, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
55: ; preds = %48
%56 = load i32, i32* @True
%57 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
store i32 %56, i32* %57
%58 = load i64, i64* @CWOverrideRedirect
store i64 %58, i64* %7
%59 = load i32*, i32** %8
%60 = load i32*, i32** %8
%61 = call i32 @RootWindow(i32* %60, i32 0)
%62 = load i32, i32* %12
%63 = load i32, i32* %13
%64 = load i32, i32* %15
%65 = load i32, i32* %14
%66 = load i32, i32* @InputOnly
%67 = load i32, i32* @CopyFromParent
%68 = load i64, i64* %7
%69 = call i32 @XCreateWindow(i32* %59, i32 %61, i32 %62, i32 %63, i32 %64, i32 %65, i32 0, i32 0, i32 %66, i32 %67, i64 %68, %struct.TYPE_3__* %6)
store i32 %69, i32* %9
%70 = load i32*, i32** %8
%71 = load i32, i32* %9
%72 = call i32 @XMapWindow(i32* %70, i32 %71)
%73 = load i32*, i32** %8
%74 = call i32 @XFlush(i32* %73)
br label %75
75: ; preds = %55, %75
%76 = load i32*, i32** %8
%77 = call i32 @XNextEvent(i32* %76, i32* %10)
br label %75
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
@.str = [3 x i8] c"-g\00"
@.str.1 = [10 x i8] c"-geometry\00"
@stderr = global i32 0
@.str.2 = [33 x i8] c"couldn't connect to X server :0\0A\00"
@True = global i32 0
@CWOverrideRedirect = global i64 0
@InputOnly = global i32 0
@CopyFromParent = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = bitcast %struct.TYPE_3__* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%12 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%13 = bitcast i32* %7 to i8*
store i32 1, i32* %7
%14 = bitcast i32* %8 to i8*
store i32 1, i32* %8
%15 = icmp sgt i32 %0, 0
br i1 %15, label %16, label %36
16: ; preds = %2, %32
%17 = phi i32 [ %34, %32 ], [ 0, %2 ]
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %1, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 @strcmp(i8* dereferenceable(1) %20, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%22 = icmp eq i32 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %16
%24 = call i32 @strcmp(i8* dereferenceable(1) %20, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %32
26: ; preds = %23, %16
%27 = add nsw i32 %17, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8*, i8** %1, i64 %28
%30 = load i8*, i8** %29
%31 = call i32 @XParseGeometry(i8* %30, i32* %5, i32* %6, i32* %8, i32* %7)
br label %32
32: ; preds = %23, %26
%33 = phi i32 [ %17, %23 ], [ %27, %26 ]
%34 = add nsw i32 %33, 1
%35 = icmp slt i32 %34, %0
br i1 %35, label %16, label %36
36: ; preds = %32, %2
%37 = call i32* @XOpenDisplay(i32* null)
%38 = icmp eq i32* %37, null
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = load i32, i32* @stderr
%41 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
42: ; preds = %36
%43 = load i32, i32* @True
%44 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 0
store i32 %43, i32* %44
%45 = load i64, i64* @CWOverrideRedirect
%46 = call i32 @RootWindow(i32* %37, i32 0)
%47 = load i32, i32* %5
%48 = load i32, i32* %6
%49 = load i32, i32* %8
%50 = load i32, i32* %7
%51 = load i32, i32* @InputOnly
%52 = load i32, i32* @CopyFromParent
%53 = call i32 @XCreateWindow(i32* %37, i32 %46, i32 %47, i32 %48, i32 %49, i32 %50, i32 0, i32 0, i32 %51, i32 %52, i64 %45, %struct.TYPE_3__* %3)
%54 = call i32 @XMapWindow(i32* %37, i32 %53)
%55 = call i32 @XFlush(i32* %37)
br label %56
56: ; preds = %56, %42
%57 = call i32 @XNextEvent(i32* %37, i32* %4)
br label %56
}