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

/* Variables and functions */
int /*<<< orphan*/ CWOverrideRedirect;
int /*<<< orphan*/ XChangeWindowAttributes(int /*<<< orphan*/ *,
                                           int /*<<< orphan*/,
                                           int /*<<< orphan*/,
                                           int /*<<< orphan*/ *);
int /*<<< orphan*/ *XOpenDisplay(int);
int /*<<< orphan*/ atoi(char *);
int main(int argc, char **argv) {
  Display *dpy;
  XSetWindowAttributes c_wa;
  if (!(dpy = XOpenDisplay(0x0)))
    return -1;
  XChangeWindowAttributes(dpy, atoi(argv[1]), CWOverrideRedirect, &c_wa);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1040 <XOpenDisplay@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1167 <main+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    119b <main+0x6b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
mov    0x2e4f(%rip),%rax
mov    (%rax),%edx
lea    -0x1c(%rbp),%rcx
call   1030 <XChangeWindowAttributes@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbp
xor    %r14d,%r14d
xor    %edi,%edi
call   1040 <XOpenDisplay@plt>
test   %rax,%rax
je     1170 <main+0x40>
mov    %rax,%rbx
mov    0x8(%rbp),%rdi
call   1050 <atoi@plt>
mov    0x2e7b(%rip),%rcx
mov    (%rcx),%edx
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <XChangeWindowAttributes@plt>
jmp    1176 <main+0x46>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@CWOverrideRedirect = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32* @XOpenDisplay(i32 0)
store i32* %8, i32** %6
%9 = icmp ne i32* %8, null
br i1 %9, label %11, label %10
10: ; preds = %2
store i32 -1, i32* %3
br label %19
11: ; preds = %2
%12 = load i32*, i32** %6
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
%17 = load i32, i32* @CWOverrideRedirect
%18 = call i32 @XChangeWindowAttributes(i32* %12, i32 %16, i32 %17, i32* %7)
store i32 0, i32* %3
br label %19
19: ; preds = %11, %10
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@CWOverrideRedirect = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32* @XOpenDisplay(i32 0)
%6 = icmp eq i32* %5, null
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = load i32, i32* @CWOverrideRedirect
%12 = call i32 @XChangeWindowAttributes(i32* %5, i32 %10, i32 %11, i32* %3)
br label %13
13: ; preds = %2, %7
%14 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %14
}