#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*/ Window;
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
int /*<<< orphan*/ False;
int /*<<< orphan*/ PropModeReplace;
int /*<<< orphan*/ XA_ATOM;
int /*<<< orphan*/ XChangeProperty(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/, int,
                                   int /*<<< orphan*/, unsigned char *, int);
int /*<<< orphan*/ XInternAtom(int /*<<< orphan*/ *, char *,
                               int /*<<< orphan*/);
void set_window_type(Display *dpy, Window w) {
  Atom w_type, normal;
  w_type = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
  normal = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_NORMAL", False);
  XChangeProperty(dpy, w, w_type, XA_ATOM, 32, PropModeReplace,
                  (unsigned char *)&normal, 1);
}


x86 assembly (clang, -O0):
<set_window_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea6(%rip),%rax
mov    (%rax),%edx
lea    0xebd(%rip),%rsi
call   1030 <XInternAtom@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e8a(%rip),%rax
mov    (%rax),%edx
lea    0xeb5(%rip),%rsi
call   1030 <XInternAtom@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    0x2e70(%rip),%rax
mov    (%rax),%ecx
mov    0x2e4f(%rip),%rax
mov    (%rax),%r9d
lea    -0x14(%rbp),%rax
mov    $0x20,%r8d
mov    %rax,(%rsp)
movl   $0x1,0x8(%rsp)
call   1040 <XChangeProperty@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_window_type>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%rbx
mov    0x2eac(%rip),%r15
mov    (%r15),%edx
lea    0xec2(%rip),%rsi
call   1030 <XInternAtom@plt>
mov    %eax,%ebp
mov    (%r15),%edx
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <XInternAtom@plt>
mov    %eax,0x4(%rsp)
mov    0x2e86(%rip),%rax
mov    (%rax),%ecx
mov    0x2e65(%rip),%rax
mov    (%rax),%r9d
lea    0x4(%rsp),%rax
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    $0x20,%r8d
push   $0x1
push   %rax
call   1040 <XChangeProperty@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"_NET_WM_WINDOW_TYPE\00"
@False = global i32 0
@.str.1 = [27 x i8] c"_NET_WM_WINDOW_TYPE_NORMAL\00"
@XA_ATOM = global i32 0
@PropModeReplace = global i32 0
define void @set_window_type(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* @False
%9 = call i32 @XInternAtom(i32* %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %8)
store i32 %9, i32* %5
%10 = load i32*, i32** %3
%11 = load i32, i32* @False
%12 = call i32 @XInternAtom(i32* %10, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %11)
store i32 %12, i32* %6
%13 = load i32*, i32** %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = load i32, i32* @XA_ATOM
%17 = load i32, i32* @PropModeReplace
%18 = bitcast i32* %6 to i8*
%19 = call i32 @XChangeProperty(i32* %13, i32 %14, i32 %15, i32 %16, i32 32, i32 %17, i8* %18, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"_NET_WM_WINDOW_TYPE\00"
@False = global i32 0
@.str.1 = [27 x i8] c"_NET_WM_WINDOW_TYPE_NORMAL\00"
@XA_ATOM = global i32 0
@PropModeReplace = global i32 0
define void @set_window_type(i32* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* @False
%6 = tail call i32 @XInternAtom(i32* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @False
%8 = tail call i32 @XInternAtom(i32* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* @XA_ATOM
%10 = load i32, i32* @PropModeReplace
%11 = call i32 @XChangeProperty(i32* %0, i32 %1, i32 %6, i32 %9, i32 32, i32 %10, i8* %4, i32 1)
ret void
}