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

/* Variables and functions */
int /*<<< orphan*/ CurrentTime;
int /*<<< orphan*/ DefaultScreen(int /*<<< orphan*/ *);
int /*<<< orphan*/ None;
int /*<<< orphan*/ PointerRoot;
int /*<<< orphan*/ RevertToPointerRoot;
int /*<<< orphan*/ RootWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XCloseDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XDisplayHeight(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XDisplayWidth(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/);
int /*<<< orphan*/ XSetInputFocus(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ XWarpPointer(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main() {
  Display *dpy;
  if (!(dpy = XOpenDisplay(0))) {
    fprintf(stderr, "banish: Cannot open display\n");
    return 1;
  }
  XWarpPointer(dpy, None, RootWindow(dpy, DefaultScreen(dpy)), 0, 0, 0, 0,
               XDisplayWidth(dpy, DefaultScreen(dpy)),
               XDisplayHeight(dpy, DefaultScreen(dpy)));
  XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
  XCloseDisplay(dpy);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1050 <XOpenDisplay@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    11d5 <main+0x45>
mov    0x2e0d(%rip),%rax
mov    (%rax),%edi
lea    0xe3c(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12a3 <main+0x113>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    0x2df4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <DefaultScreen@plt>
mov    -0x40(%rbp),%rdi
mov    %eax,%esi
call   1070 <RootWindow@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <DefaultScreen@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%esi
call   1030 <XDisplayWidth@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <DefaultScreen@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
call   1080 <XDisplayHeight@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%r10d
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1040 <XWarpPointer@plt>
mov    -0x10(%rbp),%rdi
mov    0x2d46(%rip),%rax
mov    (%rax),%esi
mov    0x2d65(%rip),%rax
mov    (%rax),%edx
mov    0x2d54(%rip),%rax
mov    (%rax),%ecx
call   10b0 <XSetInputFocus@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <XCloseDisplay@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %r15d,%r15d
xor    %edi,%edi
call   1050 <XOpenDisplay@plt>
test   %rax,%rax
je     1242 <main+0xb2>
mov    %rax,%rbx
mov    0x2e23(%rip),%rax
mov    (%rax),%r14d
mov    %rbx,%rdi
call   1090 <DefaultScreen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1070 <RootWindow@plt>
mov    %eax,%r12d
mov    %rbx,%rdi
call   1090 <DefaultScreen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <XDisplayWidth@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1090 <DefaultScreen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1080 <XDisplayHeight@plt>
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %r12d,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rax
push   %rbp
push   $0x0
call   1040 <XWarpPointer@plt>
add    $0x20,%rsp
mov    0x2da4(%rip),%rax
mov    (%rax),%esi
mov    0x2dc3(%rip),%rax
mov    (%rax),%edx
mov    0x2db2(%rip),%rax
mov    (%rax),%ecx
mov    %rbx,%rdi
call   10b0 <XSetInputFocus@plt>
mov    %rbx,%rdi
call   10a0 <XCloseDisplay@plt>
jmp    125d <main+0xcd>
mov    0x2d7f(%rip),%rax
mov    (%rax),%edi
lea    0xdae(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%r15d
mov    %r15d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"banish: Cannot open display\0A\00"
@None = global i32 0
@PointerRoot = global i32 0
@RevertToPointerRoot = global i32 0
@CurrentTime = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @XOpenDisplay(i32 0)
store i32* %3, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %31
8: ; preds = %0
%9 = load i32*, i32** %2
%10 = load i32, i32* @None
%11 = load i32*, i32** %2
%12 = load i32*, i32** %2
%13 = call i32 @DefaultScreen(i32* %12)
%14 = call i32 @RootWindow(i32* %11, i32 %13)
%15 = load i32*, i32** %2
%16 = load i32*, i32** %2
%17 = call i32 @DefaultScreen(i32* %16)
%18 = call i32 @XDisplayWidth(i32* %15, i32 %17)
%19 = load i32*, i32** %2
%20 = load i32*, i32** %2
%21 = call i32 @DefaultScreen(i32* %20)
%22 = call i32 @XDisplayHeight(i32* %19, i32 %21)
%23 = call i32 @XWarpPointer(i32* %9, i32 %10, i32 %14, i32 0, i32 0, i32 0, i32 0, i32 %18, i32 %22)
%24 = load i32*, i32** %2
%25 = load i32, i32* @PointerRoot
%26 = load i32, i32* @RevertToPointerRoot
%27 = load i32, i32* @CurrentTime
%28 = call i32 @XSetInputFocus(i32* %24, i32 %25, i32 %26, i32 %27)
%29 = load i32*, i32** %2
%30 = call i32 @XCloseDisplay(i32* %29)
store i32 0, i32* %1
br label %31
31: ; preds = %8, %5
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"banish: Cannot open display\0A\00"
@None = global i32 0
@PointerRoot = global i32 0
@RevertToPointerRoot = global i32 0
@CurrentTime = global i32 0
define i32 @main() {
%1 = tail call i32* @XOpenDisplay(i32 0)
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %20
6: ; preds = %0
%7 = load i32, i32* @None
%8 = tail call i32 @DefaultScreen(i32* %1)
%9 = tail call i32 @RootWindow(i32* %1, i32 %8)
%10 = tail call i32 @DefaultScreen(i32* %1)
%11 = tail call i32 @XDisplayWidth(i32* %1, i32 %10)
%12 = tail call i32 @DefaultScreen(i32* %1)
%13 = tail call i32 @XDisplayHeight(i32* %1, i32 %12)
%14 = tail call i32 @XWarpPointer(i32* %1, i32 %7, i32 %9, i32 0, i32 0, i32 0, i32 0, i32 %11, i32 %13)
%15 = load i32, i32* @PointerRoot
%16 = load i32, i32* @RevertToPointerRoot
%17 = load i32, i32* @CurrentTime
%18 = tail call i32 @XSetInputFocus(i32* %1, i32 %15, i32 %16, i32 %17)
%19 = tail call i32 @XCloseDisplay(i32* %1)
br label %20
20: ; preds = %6, %3
%21 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %21
}