#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 scalar_t__ Atom;

/* Variables and functions */
int /*<<< orphan*/ DefaultRootWindow(int /*<<< orphan*/ *);
scalar_t__ None;
int /*<<< orphan*/ True;
int /*<<< orphan*/ XDeleteProperty(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   scalar_t__);
scalar_t__ XInternAtom(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
void unregisterInstance(Display *display) {
  Window root = DefaultRootWindow(display);
  Atom atom = XInternAtom(display, "ALOCK_INSTANCE_PID", True);
  if (atom != None) {
    ;
    XDeleteProperty(display, root, atom);
  }
}


x86 assembly (clang, -O0):
<unregisterInstance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <DefaultRootWindow@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e8d(%rip),%rax
mov    (%rax),%edx
lea    0xea4(%rip),%rsi
call   1050 <XInternAtom@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2e78(%rip),%rcx
cmp    (%rcx),%rax
je     1189 <unregisterInstance+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <XDeleteProperty@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unregisterInstance>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <DefaultRootWindow@plt>
mov    %eax,%ebp
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
call   1050 <XInternAtom@plt>
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%rax
jne    1168 <unregisterInstance+0x38>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <XDeleteProperty@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"ALOCK_INSTANCE_PID\00"
@True = global i32 0
@None = global i64 0
define void @unregisterInstance(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @DefaultRootWindow(i32* %5)
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = load i32, i32* @True
%9 = call i64 @XInternAtom(i32* %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8)
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = load i64, i64* @None
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %18
13: ; preds = %1
%14 = load i32*, i32** %2
%15 = load i32, i32* %3
%16 = load i64, i64* %4
%17 = call i32 @XDeleteProperty(i32* %14, i32 %15, i64 %16)
br label %18
18: ; preds = %13, %1
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"ALOCK_INSTANCE_PID\00"
@True = global i32 0
@None = global i64 0
define void @unregisterInstance(i32* %0) {
%2 = tail call i32 @DefaultRootWindow(i32* %0)
%3 = load i32, i32* @True
%4 = tail call i64 @XInternAtom(i32* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i64, i64* @None
%6 = icmp eq i64 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @XDeleteProperty(i32* %0, i32 %2, i64 %4)
br label %9
9: ; preds = %7, %1
ret void
}