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

/* Variables and functions */
int /*<<< orphan*/ DefaultRootWindow(int /*<<< orphan*/ *);
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ None;
int /*<<< orphan*/ XCloseDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XFlush(int /*<<< orphan*/ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XQueryPointer(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int *, int *, int *, int *, unsigned int *);
int /*<<< orphan*/ XWarpPointer(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int, int);
int main() {
  Window w, c;
  int x, y, wx, wy;
  unsigned int m;
  Display *display = XOpenDisplay(NULL);
  if (display == NULL)
    return EXIT_FAILURE;
  Window root = DefaultRootWindow(display);
  XQueryPointer(display, root, &w, &c, &x, &y, &wx, &wy, &m);
  XWarpPointer(display, None, root, 0, 0, 0, 0, (x + 1280) % (1280 * 2), y);
  XFlush(display);
  XCloseDisplay(display);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <XOpenDisplay@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1198 <main+0x38>
mov    0x2e4a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1242 <main+0xe2>
mov    -0x28(%rbp),%rdi
call   1030 <DefaultRootWindow@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
lea    -0x14(%rbp),%r9
lea    -0x18(%rbp),%r11
lea    -0x1c(%rbp),%r10
lea    -0x20(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1060 <XQueryPointer@plt>
mov    -0x28(%rbp),%rdi
mov    0x2e03(%rip),%rax
mov    (%rax),%esi
mov    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%eax
add    $0x500,%eax
mov    $0xa00,%ecx
cltd
idiv   %ecx
mov    %edx,%r10d
mov    -0x30(%rbp),%edx
mov    -0x14(%rbp),%eax
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    -0x28(%rbp),%rdi
call   1070 <XFlush@plt>
mov    -0x28(%rbp),%rdi
call   1080 <XCloseDisplay@plt>
mov    0x2d93(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
xor    %edi,%edi
call   1050 <XOpenDisplay@plt>
test   %rax,%rax
je     1238 <main+0xd8>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <DefaultRootWindow@plt>
mov    %eax,%r14d
sub    $0x8,%rsp
lea    0x14(%rsp),%rax
lea    0x18(%rsp),%r10
lea    0x1c(%rsp),%r11
lea    0x24(%rsp),%rdx
lea    0x20(%rsp),%rcx
lea    0x10(%rsp),%r8
lea    0xc(%rsp),%r9
mov    %rbx,%rdi
mov    %r14d,%esi
push   %rax
push   %r10
push   %r11
call   1060 <XQueryPointer@plt>
add    $0x20,%rsp
mov    0x2e20(%rip),%rax
mov    (%rax),%esi
mov    0x8(%rsp),%eax
mov    %eax,%ecx
add    $0x500,%ecx
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2a,%rcx
add    %edx,%ecx
shl    $0x9,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x500,%eax
mov    0x4(%rsp),%ebp
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rbp
push   %rax
push   $0x0
call   1040 <XWarpPointer@plt>
add    $0x20,%rsp
mov    %rbx,%rdi
call   1070 <XFlush@plt>
mov    %rbx,%rdi
call   1080 <XCloseDisplay@plt>
mov    0x2d9a(%rip),%rax
jmp    123f <main+0xdf>
mov    0x2d99(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@None = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
store i32 0, i32* %1
%11 = call i32* @XOpenDisplay(i32* null)
store i32* %11, i32** %9
%12 = load i32*, i32** %9
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = load i32, i32* @EXIT_FAILURE
store i32 %15, i32* %1
br label %35
16: ; preds = %0
%17 = load i32*, i32** %9
%18 = call i32 @DefaultRootWindow(i32* %17)
store i32 %18, i32* %10
%19 = load i32*, i32** %9
%20 = load i32, i32* %10
%21 = call i32 @XQueryPointer(i32* %19, i32 %20, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8)
%22 = load i32*, i32** %9
%23 = load i32, i32* @None
%24 = load i32, i32* %10
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1280
%27 = srem i32 %26, 2560
%28 = load i32, i32* %5
%29 = call i32 @XWarpPointer(i32* %22, i32 %23, i32 %24, i32 0, i32 0, i32 0, i32 0, i32 %27, i32 %28)
%30 = load i32*, i32** %9
%31 = call i32 @XFlush(i32* %30)
%32 = load i32*, i32** %9
%33 = call i32 @XCloseDisplay(i32* %32)
%34 = load i32, i32* @EXIT_SUCCESS
store i32 %34, i32* %1
br label %35
35: ; preds = %16, %14
%36 = load i32, i32* %1
ret i32 %36
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@None = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = bitcast i32* %1 to i8*
%9 = bitcast i32* %2 to i8*
%10 = bitcast i32* %3 to i8*
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = tail call i32* @XOpenDisplay(i32* null)
%16 = icmp eq i32* %15, null
br i1 %16, label %28, label %17
17: ; preds = %0
%18 = tail call i32 @DefaultRootWindow(i32* %15)
%19 = call i32 @XQueryPointer(i32* %15, i32 %18, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7)
%20 = load i32, i32* @None
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1280
%23 = srem i32 %22, 2560
%24 = load i32, i32* %4
%25 = call i32 @XWarpPointer(i32* %15, i32 %20, i32 %18, i32 0, i32 0, i32 0, i32 0, i32 %23, i32 %24)
%26 = call i32 @XFlush(i32* %15)
%27 = call i32 @XCloseDisplay(i32* %15)
br label %28
28: ; preds = %0, %17
%29 = phi i32* [ @EXIT_SUCCESS, %17 ], [ @EXIT_FAILURE, %0 ]
%30 = load i32, i32* %29
ret i32 %30
}