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

/* Type definitions */
struct TYPE_6__ {
  int *l;
};
struct TYPE_7__ {
  int format;
  TYPE_1__ data;
  int /*<<< orphan*/ window;
  int /*<<< orphan*/ *display;
  void *message_type;
  int /*<<< orphan*/ type;
};
struct TYPE_8__ {
  TYPE_2__ xclient;
};
typedef TYPE_3__ XEvent;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;
typedef void *Atom;

/* Variables and functions */
int /*<<< orphan*/ ClientMessage;
int /*<<< orphan*/ CopyFromParent;
int /*<<< orphan*/ DefaultScreen(int /*<<< orphan*/ *);
int /*<<< orphan*/ False;
int /*<<< orphan*/ RootWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int SubstructureNotifyMask;
int SubstructureRedirectMask;
int /*<<< orphan*/ True;
int /*<<< orphan*/ WhitePixel(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XCreateWindow(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                                 int, int, int, int, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ XFlush(int /*<<< orphan*/ *);
void *XInternAtom(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ XMapWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XNextEvent(int /*<<< orphan*/ *, TYPE_3__ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XSendEvent(int /*<<< orphan*/ *, int /*<<< orphan*/,
                              int /*<<< orphan*/, int, TYPE_3__ *);
int /*<<< orphan*/ XSetWindowBackground(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int main() {
  Display *display;
  Window win;
  XEvent report, ce;
  Atom state, skip;
  int x = 10, y = 10, h = 400, w = 400;
  display = XOpenDisplay(NULL);
  if (display == NULL) {
    fprintf(stderr, "couldn't connect to X server :0\n");
    return 0;
  }
  state = XInternAtom(display, "_NET_WM_STATE", True);
  skip = XInternAtom(display, "_NET_WM_STATE_SKIP_TASKBAR", True);
  win = XCreateWindow(display, RootWindow(display, 0), x, y, w, h, 10,
                      CopyFromParent, CopyFromParent, CopyFromParent, 0, 0);
  XSetWindowBackground(display, win, WhitePixel(display, 0));
  XMapWindow(display, win);
  XFlush(display);
  sleep(1);
  ce.xclient.type = ClientMessage;
  ce.xclient.message_type = state;
  ce.xclient.display = display;
  ce.xclient.window = win;
  ce.xclient.format = 32;
  ce.xclient.data.l[0] = 1;
  ce.xclient.data.l[1] = skip;
  ce.xclient.data.l[2] = 0;
  XSendEvent(display, RootWindow(display, DefaultScreen(display)), False,
             SubstructureNotifyMask | SubstructureRedirectMask, &ce);
  while (1) {
    XNextEvent(display, &report);
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0xf8,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0xa,-0x94(%rbp)
movl   $0xa,-0x98(%rbp)
movl   $0x190,-0x9c(%rbp)
movl   $0x190,-0xa0(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <XOpenDisplay@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1244 <main+0x74>
mov    0x2d9e(%rip),%rax
mov    (%rax),%edi
lea    0xdcd(%rip),%rsi
call   1060 <fprintf@plt>
xor    %eax,%eax
add    $0xf8,%rsp
pop    %rbx
pop    %rbp
ret
mov    -0x18(%rbp),%rdi
mov    0x2d91(%rip),%rax
mov    (%rax),%edx
lea    0xdc9(%rip),%rsi
call   1080 <XInternAtom@plt>
mov    %rax,-0x88(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d71(%rip),%rax
mov    (%rax),%edx
lea    0xdb7(%rip),%rsi
call   1080 <XInternAtom@plt>
mov    %rax,-0x90(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   10a0 <RootWindow@plt>
mov    -0xc8(%rbp),%rdi
mov    %eax,%esi
mov    -0x94(%rbp),%edx
mov    -0x98(%rbp),%ecx
mov    -0xa0(%rbp),%r8d
mov    -0x9c(%rbp),%r9d
mov    0x2cf4(%rip),%rax
mov    (%rax),%r11d
mov    0x2cea(%rip),%rax
mov    (%rax),%r10d
mov    0x2ce0(%rip),%rax
mov    (%rax),%eax
xor    %ebx,%ebx
movl   $0xa,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x28(%rsp)
call   1090 <XCreateWindow@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0xb4(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1040 <WhitePixel@plt>
mov    -0xc0(%rbp),%rdi
mov    -0xb4(%rbp),%esi
mov    %eax,%edx
call   10d0 <XSetWindowBackground@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10c0 <XMapWindow@plt>
mov    -0x18(%rbp),%rdi
call   10b0 <XFlush@plt>
mov    $0x1,%edi
call   10f0 <sleep@plt>
mov    0x2c76(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x70(%rbp)
movl   $0x20,-0x80(%rbp)
mov    -0x78(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x90(%rbp),%rax
mov    %eax,%ecx
mov    -0x78(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x78(%rbp),%rax
movl   $0x0,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x18(%rbp),%rdi
call   10e0 <DefaultScreen@plt>
mov    -0xb0(%rbp),%rdi
mov    %eax,%esi
call   10a0 <RootWindow@plt>
mov    -0xa8(%rbp),%rdi
mov    %eax,%esi
mov    0x2bff(%rip),%rax
mov    (%rax),%edx
mov    0x2bbe(%rip),%rax
mov    (%rax),%ecx
mov    0x2bc5(%rip),%rax
or     (%rax),%ecx
lea    -0x80(%rbp),%r8
call   1030 <XSendEvent@plt>
mov    -0x18(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1070 <XNextEvent@plt>
jmp    1406 <main+0x236>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1040 <XOpenDisplay@plt>
test   %rax,%rax
jne    11cd <main+0x2d>
mov    0x2e22(%rip),%rax
mov    (%rax),%edi
lea    0xe41(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rax,%rbx
mov    0x2e11(%rip),%rbp
mov    0x0(%rbp),%edx
lea    0xe40(%rip),%rsi
mov    %rax,%rdi
call   1060 <XInternAtom@plt>
mov    0x0(%rbp),%edx
lea    0xe3c(%rip),%rsi
mov    %rbx,%rdi
call   1060 <XInternAtom@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1080 <RootWindow@plt>
mov    0x2dc4(%rip),%rcx
mov    (%rcx),%ebp
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0xa,%edx
mov    $0xa,%ecx
mov    $0x190,%r8d
mov    $0x190,%r9d
push   $0x0
push   $0x0
push   %rbp
push   %rbp
push   %rbp
push   $0xa
call   1070 <XCreateWindow@plt>
add    $0x30,%rsp
mov    %eax,%ebp
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <WhitePixel@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   10b0 <XSetWindowBackground@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   10a0 <XMapWindow@plt>
mov    %rbx,%rdi
call   1090 <XFlush@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>

LLVM IR (-O0):
%struct.TYPE_8__ = type { %struct.TYPE_7__ }
%struct.TYPE_7__ = type { i32, %struct.TYPE_6__, i32, i32*, i8*, i32 }
%struct.TYPE_6__ = type { i32* }
@stderr = global i32 0
@.str = [33 x i8] c"couldn't connect to X server :0\0A\00"
@.str.1 = [14 x i8] c"_NET_WM_STATE\00"
@True = global i32 0
@.str.2 = [27 x i8] c"_NET_WM_STATE_SKIP_TASKBAR\00"
@CopyFromParent = global i32 0
@ClientMessage = global i32 0
@False = global i32 0
@SubstructureNotifyMask = global i32 0
@SubstructureRedirectMask = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca %struct.TYPE_8__
%5 = alloca %struct.TYPE_8__
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %8
store i32 10, i32* %9
store i32 400, i32* %10
store i32 400, i32* %11
%12 = call i32* @XOpenDisplay(i32* null)
store i32* %12, i32** %2
%13 = load i32*, i32** %2
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %18
15: ; preds = %0
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
18: ; preds = %0
%19 = load i32*, i32** %2
%20 = load i32, i32* @True
%21 = call i8* @XInternAtom(i32* %19, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %20)
store i8* %21, i8** %6
%22 = load i32*, i32** %2
%23 = load i32, i32* @True
%24 = call i8* @XInternAtom(i32* %22, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %23)
store i8* %24, i8** %7
%25 = load i32*, i32** %2
%26 = load i32*, i32** %2
%27 = call i32 @RootWindow(i32* %26, i32 0)
%28 = load i32, i32* %8
%29 = load i32, i32* %9
%30 = load i32, i32* %11
%31 = load i32, i32* %10
%32 = load i32, i32* @CopyFromParent
%33 = load i32, i32* @CopyFromParent
%34 = load i32, i32* @CopyFromParent
%35 = call i32 @XCreateWindow(i32* %25, i32 %27, i32 %28, i32 %29, i32 %30, i32 %31, i32 10, i32 %32, i32 %33, i32 %34, i32 0, i32 0)
store i32 %35, i32* %3
%36 = load i32*, i32** %2
%37 = load i32, i32* %3
%38 = load i32*, i32** %2
%39 = call i32 @WhitePixel(i32* %38, i32 0)
%40 = call i32 @XSetWindowBackground(i32* %36, i32 %37, i32 %39)
%41 = load i32*, i32** %2
%42 = load i32, i32* %3
%43 = call i32 @XMapWindow(i32* %41, i32 %42)
%44 = load i32*, i32** %2
%45 = call i32 @XFlush(i32* %44)
%46 = call i32 @sleep(i32 1)
%47 = load i32, i32* @ClientMessage
%48 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %5, i32 0, i32 0
%49 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %48, i32 0, i32 5
store i32 %47, i32* %49
%50 = load i8*, i8** %6
%51 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %5, i32 0, i32 0
%52 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %51, i32 0, i32 4
store i8* %50, i8** %52
%53 = load i32*, i32** %2
%54 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %5, i32 0, i32 0
%55 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %54, i32 0, i32 3
store i32* %53, i32** %55
%56 = load i32, i32* %3
%57 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %5, i32 0, i32 0
%58 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %57, i32 0, i32 2
store i32 %56, i32* %58
%59 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %5, i32 0, i32 0
%60 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %59, i32 0, i32 0
store i32 32, i32* %60
%61 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %5, i32 0, i32 0
%62 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %61, i32 0, i32 1
%63 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %62, i32 0, i32 0
%64 = load i32*, i32** %63
%65 = getelementptr inbounds i32, i32* %64, i64 0
store i32 1, i32* %65
%66 = load i8*, i8** %7
%67 = ptrtoint i8* %66 to i32
%68 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %5, i32 0, i32 0
%69 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %68, i32 0, i32 1
%70 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %69, i32 0, i32 0
%71 = load i32*, i32** %70
%72 = getelementptr inbounds i32, i32* %71, i64 1
store i32 %67, i32* %72
%73 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %5, i32 0, i32 0
%74 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %73, i32 0, i32 1
%75 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %74, i32 0, i32 0
%76 = load i32*, i32** %75
%77 = getelementptr inbounds i32, i32* %76, i64 2
store i32 0, i32* %77
%78 = load i32*, i32** %2
%79 = load i32*, i32** %2
%80 = load i32*, i32** %2
%81 = call i32 @DefaultScreen(i32* %80)
%82 = call i32 @RootWindow(i32* %79, i32 %81)
%83 = load i32, i32* @False
%84 = load i32, i32* @SubstructureNotifyMask
%85 = load i32, i32* @SubstructureRedirectMask
%86 = or i32 %84, %85
%87 = call i32 @XSendEvent(i32* %78, i32 %82, i32 %83, i32 %86, %struct.TYPE_8__* %5)
br label %88
88: ; preds = %18, %88
%89 = load i32*, i32** %2
%90 = call i32 @XNextEvent(i32* %89, %struct.TYPE_8__* %4)
br label %88
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"couldn't connect to X server :0\0A\00"
@.str.1 = [14 x i8] c"_NET_WM_STATE\00"
@True = global i32 0
@.str.2 = [27 x i8] c"_NET_WM_STATE_SKIP_TASKBAR\00"
@CopyFromParent = global i32 0
@ClientMessage = global i32 0
@False = global i32 0
@SubstructureNotifyMask = global i32 0
@SubstructureRedirectMask = global i32 0
define i32 @main() {
%1 = tail call i32* @XOpenDisplay(i32* null)
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
6: ; preds = %0
%7 = load i32, i32* @True
%8 = tail call i8* @XInternAtom(i32* %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @True
%10 = tail call i8* @XInternAtom(i32* %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = tail call i32 @RootWindow(i32* %1, i32 0)
%12 = load i32, i32* @CopyFromParent
%13 = tail call i32 @XCreateWindow(i32* %1, i32 %11, i32 10, i32 10, i32 400, i32 400, i32 10, i32 %12, i32 %12, i32 %12, i32 0, i32 0)
%14 = tail call i32 @WhitePixel(i32* %1, i32 0)
%15 = tail call i32 @XSetWindowBackground(i32* %1, i32 %13, i32 %14)
%16 = tail call i32 @XMapWindow(i32* %1, i32 %13)
%17 = tail call i32 @XFlush(i32* %1)
%18 = tail call i32 @sleep(i32 1)
unreachable
}