#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 */
typedef int /*<<< orphan*/ XEvent;
struct TYPE_3__ {
  char *res_name;
  char *res_class;
};
typedef TYPE_1__ XClassHint;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
int /*<<< orphan*/ CopyFromParent;
int /*<<< orphan*/ PropModeReplace;
int /*<<< orphan*/ RootWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ True;
int /*<<< orphan*/ WhitePixel(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XA_ATOM;
int /*<<< orphan*/ XChangeProperty(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/, int,
                                   int /*<<< orphan*/, unsigned char *, int);
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*/ *);
int /*<<< orphan*/ XInternAtom(int /*<<< orphan*/ *, char *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ XMapWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XNextEvent(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XSetClassHint(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 TYPE_1__ *);
int /*<<< orphan*/ XSetWindowBackground(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main() {
  Display *display;
  Window win;
  XEvent report;
  Atom state, skip;
  XClassHint classhint;
  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));
  XChangeProperty(display, win, state, XA_ATOM, 32, PropModeReplace,
                  (unsigned char *)&skip, 1);
  classhint.res_name = "test";
  classhint.res_class = "Test";
  XSetClassHint(display, win, &classhint);
  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)
movl   $0xa,-0x3c(%rbp)
movl   $0xa,-0x40(%rbp)
movl   $0x190,-0x44(%rbp)
movl   $0x190,-0x48(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <XOpenDisplay@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1228 <main+0x68>
mov    0x2dc2(%rip),%rax
mov    (%rax),%edi
lea    0xde9(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %rbp
ret
mov    -0x18(%rbp),%rdi
mov    0x2dad(%rip),%rax
mov    (%rax),%edx
lea    0xde5(%rip),%rsi
call   1070 <XInternAtom@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d91(%rip),%rax
mov    (%rax),%edx
lea    0xdd7(%rip),%rsi
call   1070 <XInternAtom@plt>
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   10a0 <RootWindow@plt>
mov    -0x60(%rbp),%rdi
mov    %eax,%esi
mov    -0x3c(%rbp),%edx
mov    -0x40(%rbp),%ecx
mov    -0x48(%rbp),%r8d
mov    -0x44(%rbp),%r9d
mov    0x2d32(%rip),%rax
mov    (%rax),%r11d
mov    0x2d28(%rip),%rax
mov    (%rax),%r10d
mov    0x2d1e(%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,-0x58(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <WhitePixel@plt>
mov    -0x58(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    %eax,%edx
call   10e0 <XSetWindowBackground@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    0x2cdd(%rip),%rax
mov    (%rax),%ecx
mov    0x2cb4(%rip),%rax
mov    (%rax),%r9d
lea    -0x28(%rbp),%rax
mov    $0x20,%r8d
mov    %rax,(%rsp)
movl   $0x1,0x8(%rsp)
call   1080 <XChangeProperty@plt>
lea    0xd11(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xd0b(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
lea    -0x38(%rbp),%rdx
call   10b0 <XSetClassHint@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10d0 <XMapWindow@plt>
mov    -0x18(%rbp),%rdi
call   10c0 <XFlush@plt>
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1060 <XNextEvent@plt>
jmp    136d <main+0x1ad>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
xor    %edi,%edi
call   1040 <XOpenDisplay@plt>
test   %rax,%rax
je     12ed <main+0x12d>
mov    %rax,%rbx
mov    0x2dfe(%rip),%rbp
mov    0x0(%rbp),%edx
lea    0xe35(%rip),%rsi
mov    %rax,%rdi
call   1070 <XInternAtom@plt>
mov    %eax,%r14d
mov    0x0(%rbp),%edx
lea    0xe2e(%rip),%rsi
mov    %rbx,%rdi
call   1070 <XInternAtom@plt>
mov    %eax,0x8(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
call   10a0 <RootWindow@plt>
mov    0x2da2(%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   1090 <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   10e0 <XSetWindowBackground@plt>
mov    0x2d7c(%rip),%rax
mov    (%rax),%ecx
mov    0x2d53(%rip),%rax
mov    (%rax),%r9d
lea    0x8(%rsp),%rax
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    $0x20,%r8d
push   $0x1
push   %rax
call   1080 <XChangeProperty@plt>
add    $0x10,%rsp
lea    0xdac(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xda5(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
call   10b0 <XSetClassHint@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   10d0 <XMapWindow@plt>
mov    %rbx,%rdi
call   10c0 <XFlush@plt>
lea    0xc(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1060 <XNextEvent@plt>
jmp    12e0 <main+0x120>
mov    0x2cdc(%rip),%rax
mov    (%rax),%edi
lea    0xd03(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i8*, i8* }
@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
@XA_ATOM = global i32 0
@PropModeReplace = global i32 0
@.str.3 = [5 x i8] c"test\00"
@.str.4 = [5 x i8] c"Test\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%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 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 i32 @XInternAtom(i32* %19, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %20)
store i32 %21, i32* %5
%22 = load i32*, i32** %2
%23 = load i32, i32* @True
%24 = call i32 @XInternAtom(i32* %22, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %23)
store i32 %24, i32* %6
%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 = load i32, i32* %5
%44 = load i32, i32* @XA_ATOM
%45 = load i32, i32* @PropModeReplace
%46 = bitcast i32* %6 to i8*
%47 = call i32 @XChangeProperty(i32* %41, i32 %42, i32 %43, i32 %44, i32 32, i32 %45, i8* %46, i32 1)
%48 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %48
%49 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %49
%50 = load i32*, i32** %2
%51 = load i32, i32* %3
%52 = call i32 @XSetClassHint(i32* %50, i32 %51, %struct.TYPE_3__* %7)
%53 = load i32*, i32** %2
%54 = load i32, i32* %3
%55 = call i32 @XMapWindow(i32* %53, i32 %54)
%56 = load i32*, i32** %2
%57 = call i32 @XFlush(i32* %56)
br label %58
58: ; preds = %18, %58
%59 = load i32*, i32** %2
%60 = call i32 @XNextEvent(i32* %59, i32* %4)
br label %58
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i8*, i8* }
@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
@XA_ATOM = global i32 0
@PropModeReplace = global i32 0
@.str.3 = [5 x i8] c"test\00"
@.str.4 = [5 x i8] c"Test\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.TYPE_3__
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast %struct.TYPE_3__* %3 to i8*
%7 = tail call i32* @XOpenDisplay(i32* null)
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
12: ; preds = %0
%13 = load i32, i32* @True
%14 = tail call i32 @XInternAtom(i32* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i32, i32* @True
%16 = tail call i32 @XInternAtom(i32* %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %15)
store i32 %16, i32* %2
%17 = tail call i32 @RootWindow(i32* %7, i32 0)
%18 = load i32, i32* @CopyFromParent
%19 = tail call i32 @XCreateWindow(i32* %7, i32 %17, i32 10, i32 10, i32 400, i32 400, i32 10, i32 %18, i32 %18, i32 %18, i32 0, i32 0)
%20 = tail call i32 @WhitePixel(i32* %7, i32 0)
%21 = tail call i32 @XSetWindowBackground(i32* %7, i32 %19, i32 %20)
%22 = load i32, i32* @XA_ATOM
%23 = load i32, i32* @PropModeReplace
%24 = call i32 @XChangeProperty(i32* %7, i32 %19, i32 %14, i32 %22, i32 32, i32 %23, i8* %5, i32 1)
%25 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %25
%26 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %26
%27 = call i32 @XSetClassHint(i32* %7, i32 %19, %struct.TYPE_3__* %3)
%28 = call i32 @XMapWindow(i32* %7, i32 %19)
%29 = call i32 @XFlush(i32* %7)
br label %30
30: ; preds = %30, %12
%31 = call i32 @XNextEvent(i32* %7, i32* %1)
br label %30
}