#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 */

/* Type definitions */
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
int DefaultRootWindow(int /*<<< orphan*/ *);
int /*<<< orphan*/ False;
int /*<<< orphan*/ PropModeReplace;
int /*<<< orphan*/ XA_ATOM;
int /*<<< orphan*/ XA_WINDOW;
int /*<<< orphan*/ XChangeProperty(int /*<<< orphan*/ *, int,
                                   int /*<<< orphan*/, int /*<<< orphan*/, int,
                                   int /*<<< orphan*/, unsigned char *, int);
int /*<<< orphan*/ XInternAtom(int /*<<< orphan*/ *, char *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ XSync(int /*<<< orphan*/ *, int /*<<< orphan*/);
void set_atoms(Display *dpy) {
  int root = DefaultRootWindow(dpy);
  Atom wm_change_state = XInternAtom(dpy, "_NET_WM_STATE", False);
  Atom wm_supported = XInternAtom(dpy, "_NET_SUPPORTED", False);
  Atom wm_check = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False);
  Atom wm_name = XInternAtom(dpy, "_NET_WM_NAME", False);
  Atom utf8 = XInternAtom(dpy, "UTF8_STRING", False);
  Atom supported[] = {wm_supported, wm_name, wm_change_state};
  XChangeProperty(dpy, root, wm_check, XA_WINDOW, 32, PropModeReplace,
                  (unsigned char *)&root, 1);
  XChangeProperty(dpy, root, wm_name, utf8, 8, PropModeReplace,
                  (unsigned char *)"LG3D", 5);
  XChangeProperty(dpy, root, wm_supported, XA_ATOM, 32, PropModeReplace,
                  (unsigned char *)supported, 4);
  XSync(dpy, False);
}


x86 assembly (clang, -O0):
<set_atoms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <DefaultRootWindow@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
lea    0xe94(%rip),%rsi
call   1040 <XInternAtom@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e61(%rip),%rax
mov    (%rax),%edx
lea    0xe86(%rip),%rsi
call   1040 <XInternAtom@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e45(%rip),%rax
mov    (%rax),%edx
lea    0xe79(%rip),%rsi
call   1040 <XInternAtom@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e29(%rip),%rax
mov    (%rax),%edx
lea    0xe76(%rip),%rsi
call   1040 <XInternAtom@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e0d(%rip),%rax
mov    (%rax),%edx
lea    0xe67(%rip),%rsi
call   1040 <XInternAtom@plt>
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    0x2dc9(%rip),%rax
mov    (%rax),%ecx
mov    0x2db8(%rip),%rax
mov    (%rax),%r9d
lea    -0xc(%rbp),%rax
mov    $0x20,%r8d
mov    %rax,(%rsp)
movl   $0x1,0x8(%rsp)
call   1050 <XChangeProperty@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    0x2d86(%rip),%rax
mov    (%rax),%r9d
mov    $0x8,%r8d
lea    0xdfd(%rip),%rax
mov    %rax,(%rsp)
movl   $0x5,0x8(%rsp)
call   1050 <XChangeProperty@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    0x2d74(%rip),%rax
mov    (%rax),%ecx
mov    0x2d4b(%rip),%rax
mov    (%rax),%r9d
lea    -0x2c(%rbp),%rax
mov    $0x20,%r8d
mov    %rax,(%rsp)
movl   $0x4,0x8(%rsp)
call   1050 <XChangeProperty@plt>
mov    -0x8(%rbp),%rdi
mov    0x2d3a(%rip),%rax
mov    (%rax),%esi
call   1060 <XSync@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_atoms>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
call   1030 <DefaultRootWindow@plt>
mov    %eax,%r12d
mov    %eax,(%rsp)
mov    0x2e7d(%rip),%rbp
mov    0x0(%rbp),%edx
lea    0xe93(%rip),%rsi
mov    %rbx,%rdi
call   1040 <XInternAtom@plt>
mov    %eax,0x4(%rsp)
mov    0x0(%rbp),%edx
lea    0xe8b(%rip),%rsi
mov    %rbx,%rdi
call   1040 <XInternAtom@plt>
mov    %eax,%r15d
mov    %eax,0x8(%rsp)
mov    0x0(%rbp),%edx
lea    0xe81(%rip),%rsi
mov    %rbx,%rdi
call   1040 <XInternAtom@plt>
mov    %eax,%r13d
mov    0x0(%rbp),%edx
mov    %rbp,%r14
lea    0xe82(%rip),%rsi
mov    %rbx,%rdi
call   1040 <XInternAtom@plt>
mov    %eax,%ebp
mov    (%r14),%edx
lea    0xe7b(%rip),%rsi
mov    %rbx,%rdi
call   1040 <XInternAtom@plt>
mov    %eax,%r14d
mov    %r15d,0xc(%rsp)
mov    %ebp,0x10(%rsp)
mov    0x4(%rsp),%eax
mov    %eax,0x14(%rsp)
mov    0x2de5(%rip),%rax
mov    (%rax),%ecx
mov    0x2dd4(%rip),%r15
mov    (%r15),%r9d
mov    %rsp,%rax
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %r13d,%edx
mov    $0x20,%r8d
push   $0x1
push   %rax
call   1050 <XChangeProperty@plt>
add    $0x10,%rsp
mov    (%rsp),%esi
mov    (%r15),%r9d
lea    0xe2d(%rip),%rax
mov    %rbx,%rdi
mov    %ebp,%edx
mov    %r14d,%ecx
mov    $0x8,%r8d
push   $0x5
push   %rax
call   1050 <XChangeProperty@plt>
add    $0x10,%rsp
mov    (%rsp),%esi
mov    0x2da2(%rip),%rax
mov    (%rax),%ecx
mov    (%r15),%r9d
lea    0xc(%rsp),%rax
mov    %rbx,%rdi
mov    0x8(%rsp),%edx
mov    $0x20,%r8d
push   $0x4
push   %rax
call   1050 <XChangeProperty@plt>
add    $0x10,%rsp
mov    0x2d70(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1060 <XSync@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"_NET_WM_STATE\00"
@False = global i32 0
@.str.1 = [15 x i8] c"_NET_SUPPORTED\00"
@.str.2 = [25 x i8] c"_NET_SUPPORTING_WM_CHECK\00"
@.str.3 = [13 x i8] c"_NET_WM_NAME\00"
@.str.4 = [12 x i8] c"UTF8_STRING\00"
@XA_WINDOW = global i32 0
@PropModeReplace = global i32 0
@.str.5 = [5 x i8] c"LG3D\00"
@XA_ATOM = global i32 0
define void @set_atoms(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [3 x i32]
store i32* %0, i32** %2
%10 = load i32*, i32** %2
%11 = call i32 @DefaultRootWindow(i32* %10)
store i32 %11, i32* %3
%12 = load i32*, i32** %2
%13 = load i32, i32* @False
%14 = call i32 @XInternAtom(i32* %12, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %13)
store i32 %14, i32* %4
%15 = load i32*, i32** %2
%16 = load i32, i32* @False
%17 = call i32 @XInternAtom(i32* %15, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %16)
store i32 %17, i32* %5
%18 = load i32*, i32** %2
%19 = load i32, i32* @False
%20 = call i32 @XInternAtom(i32* %18, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %19)
store i32 %20, i32* %6
%21 = load i32*, i32** %2
%22 = load i32, i32* @False
%23 = call i32 @XInternAtom(i32* %21, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %22)
store i32 %23, i32* %7
%24 = load i32*, i32** %2
%25 = load i32, i32* @False
%26 = call i32 @XInternAtom(i32* %24, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %25)
store i32 %26, i32* %8
%27 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%28 = load i32, i32* %5
store i32 %28, i32* %27
%29 = getelementptr inbounds i32, i32* %27, i64 1
%30 = load i32, i32* %7
store i32 %30, i32* %29
%31 = getelementptr inbounds i32, i32* %29, i64 1
%32 = load i32, i32* %4
store i32 %32, i32* %31
%33 = load i32*, i32** %2
%34 = load i32, i32* %3
%35 = load i32, i32* %6
%36 = load i32, i32* @XA_WINDOW
%37 = load i32, i32* @PropModeReplace
%38 = bitcast i32* %3 to i8*
%39 = call i32 @XChangeProperty(i32* %33, i32 %34, i32 %35, i32 %36, i32 32, i32 %37, i8* %38, i32 1)
%40 = load i32*, i32** %2
%41 = load i32, i32* %3
%42 = load i32, i32* %7
%43 = load i32, i32* %8
%44 = load i32, i32* @PropModeReplace
%45 = call i32 @XChangeProperty(i32* %40, i32 %41, i32 %42, i32 %43, i32 8, i32 %44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 5)
%46 = load i32*, i32** %2
%47 = load i32, i32* %3
%48 = load i32, i32* %5
%49 = load i32, i32* @XA_ATOM
%50 = load i32, i32* @PropModeReplace
%51 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%52 = bitcast i32* %51 to i8*
%53 = call i32 @XChangeProperty(i32* %46, i32 %47, i32 %48, i32 %49, i32 32, i32 %50, i8* %52, i32 4)
%54 = load i32*, i32** %2
%55 = load i32, i32* @False
%56 = call i32 @XSync(i32* %54, i32 %55)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"_NET_WM_STATE\00"
@False = global i32 0
@.str.1 = [15 x i8] c"_NET_SUPPORTED\00"
@.str.2 = [25 x i8] c"_NET_SUPPORTING_WM_CHECK\00"
@.str.3 = [13 x i8] c"_NET_WM_NAME\00"
@.str.4 = [12 x i8] c"UTF8_STRING\00"
@XA_WINDOW = global i32 0
@PropModeReplace = global i32 0
@.str.5 = [5 x i8] c"LG3D\00"
@XA_ATOM = global i32 0
define void @set_atoms(i32* %0) {
%2 = alloca i32
%3 = alloca [3 x i32]
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @DefaultRootWindow(i32* %0)
store i32 %5, i32* %2
%6 = load i32, i32* @False
%7 = tail call i32 @XInternAtom(i32* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @False
%9 = tail call i32 @XInternAtom(i32* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @False
%11 = tail call i32 @XInternAtom(i32* %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @False
%13 = tail call i32 @XInternAtom(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @False
%15 = tail call i32 @XInternAtom(i32* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %14)
%16 = bitcast [3 x i32]* %3 to i8*
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
store i32 %9, i32* %17
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
store i32 %13, i32* %18
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
store i32 %7, i32* %19
%20 = load i32, i32* @XA_WINDOW
%21 = load i32, i32* @PropModeReplace
%22 = call i32 @XChangeProperty(i32* %0, i32 %5, i32 %11, i32 %20, i32 32, i32 %21, i8* %4, i32 1)
%23 = load i32, i32* %2
%24 = load i32, i32* @PropModeReplace
%25 = call i32 @XChangeProperty(i32* %0, i32 %23, i32 %13, i32 %15, i32 8, i32 %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 5)
%26 = load i32, i32* %2
%27 = load i32, i32* @XA_ATOM
%28 = load i32, i32* @PropModeReplace
%29 = call i32 @XChangeProperty(i32* %0, i32 %26, i32 %9, i32 %27, i32 32, i32 %28, i8* %16, i32 4)
%30 = load i32, i32* @False
%31 = call i32 @XSync(i32* %0, i32 %30)
ret void
}