#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*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int False;
int /*<<< orphan*/ None;
int /*<<< orphan*/ RootWindow(int /*<<< orphan*/ *, int);
int ScreenCount(int /*<<< orphan*/ *);
int True;
int /*<<< orphan*/ XCloseDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XFlush(int /*<<< orphan*/ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int 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 atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ exit_usage(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int delay = 15;
  int timeout = 0;
  int deltaX = 50;
  int deltaT = 5;
  bool countdown;
  if (argc > 5) {
    exit_usage("invalid number of arguments");
  } else if (argc == 5) {
    delay = atoi(argv[1]);
    timeout = atoi(argv[2]);
    deltaX = atoi(argv[3]);
    deltaT = atoi(argv[4]);
  } else if (argc == 4) {
    delay = atoi(argv[1]);
    timeout = atoi(argv[2]);
    deltaX = atoi(argv[3]);
  } else if (argc == 3) {
    delay = atoi(argv[1]);
    timeout = atoi(argv[2]);
  } else if (argc == 2) {
    delay = atoi(argv[1]);
  }
  if (timeout == 0)
    countdown = False;
  else {
    countdown = True;
    if (deltaT > timeout)
      exit_usage("deltaT too large for timeout");
  }
  Display *display = XOpenDisplay(NULL);
  if (display == NULL) {
    fprintf(stderr, "Error opening display!!!\n");
    exit(EXIT_FAILURE);
  }
  int number_of_screens = ScreenCount(display);
  Window *root_windows;
  root_windows = (Window *)malloc(sizeof(Window) * number_of_screens);
  int ii;
  for (ii = 0; ii < number_of_screens; ii++) {
    root_windows[ii] = RootWindow(display, ii);
  }
  Window root_return, child_return;
  int root_x, root_y, win_x, win_y;
  unsigned int mask_return;
  while (timeout >= 0) {
    bool mouse_found;
    for (ii = 0; ii < number_of_screens; ii++) {
      mouse_found =
          XQueryPointer(display, root_windows[ii], &root_return, &child_return,
                        &root_x, &root_y, &win_x, &win_y, &mask_return);
      if (mouse_found)
        break;
    }
    if (!mouse_found) {
      fprintf(stderr, "No mouse found.\n");
      exit(EXIT_FAILURE);
    }
    XWarpPointer(display, None, *(root_windows + ii), 0, 0, 0, 0,
                 root_x + deltaX, root_y + deltaX);
    XFlush(display);
    if (deltaT > 0)
      sleep(deltaT);
    XWarpPointer(display, None, *(root_windows + ii), 0, 0, 0, 0, root_x,
                 root_y);
    XFlush(display);
    sleep(delay);
    if (countdown)
      timeout = timeout - delay + deltaT;
  }
  free(root_windows);
  XCloseDisplay(display);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xf,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x32,-0x1c(%rbp)
movl   $0x5,-0x20(%rbp)
cmpl   $0x5,-0x8(%rbp)
jle    1230 <main+0x50>
lea    0xdda(%rip),%rdi
call   1040 <exit_usage@plt>
jmp    131b <main+0x13b>
cmpl   $0x5,-0x8(%rbp)
jne    127f <main+0x9f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x20(%rbp)
jmp    1316 <main+0x136>
cmpl   $0x4,-0x8(%rbp)
jne    12be <main+0xde>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x1c(%rbp)
jmp    1311 <main+0x131>
cmpl   $0x3,-0x8(%rbp)
jne    12ed <main+0x10d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    130c <main+0x12c>
cmpl   $0x2,-0x8(%rbp)
jne    1307 <main+0x127>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    130c <main+0x12c>
jmp    1311 <main+0x131>
jmp    1316 <main+0x136>
jmp    131b <main+0x13b>
cmpl   $0x0,-0x18(%rbp)
jne    1336 <main+0x156>
mov    0x2cbc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    135f <main+0x17f>
mov    0x2c9b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    135a <main+0x17a>
lea    0xcc7(%rip),%rdi
call   1040 <exit_usage@plt>
jmp    135f <main+0x17f>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <XOpenDisplay@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    139a <main+0x1ba>
mov    0x2c4a(%rip),%rax
mov    (%rax),%edi
lea    0xcb2(%rip),%rsi
call   1080 <fprintf@plt>
mov    0x2c2d(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    -0x30(%rbp),%rdi
call   1060 <ScreenCount@plt>
mov    %eax,-0x34(%rbp)
movslq -0x34(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    13f3 <main+0x213>
mov    -0x30(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   10b0 <RootWindow@plt>
mov    %eax,%edx
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    13c0 <main+0x1e0>
jmp    13f8 <main+0x218>
cmpl   $0x0,-0x18(%rbp)
jl     156d <main+0x38d>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1478 <main+0x298>
mov    -0x30(%rbp),%rdi
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    -0x48(%rbp),%rdx
lea    -0x4c(%rbp),%rcx
lea    -0x50(%rbp),%r8
lea    -0x54(%rbp),%r9
lea    -0x58(%rbp),%r11
lea    -0x5c(%rbp),%r10
lea    -0x60(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1090 <XQueryPointer@plt>
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
je     1465 <main+0x285>
jmp    1478 <main+0x298>
jmp    146a <main+0x28a>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1409 <main+0x229>
cmpl   $0x0,-0x64(%rbp)
jne    14a5 <main+0x2c5>
mov    0x2b3f(%rip),%rax
mov    (%rax),%edi
lea    0xbc1(%rip),%rsi
call   1080 <fprintf@plt>
mov    0x2b22(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    -0x30(%rbp),%rdi
mov    0x2b30(%rip),%rax
mov    (%rax),%esi
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x50(%rbp),%r10d
add    -0x1c(%rbp),%r10d
mov    -0x54(%rbp),%eax
add    -0x1c(%rbp),%eax
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1050 <XWarpPointer@plt>
mov    -0x30(%rbp),%rdi
call   10c0 <XFlush@plt>
cmpl   $0x0,-0x20(%rbp)
jle    1504 <main+0x324>
mov    -0x20(%rbp),%edi
call   1100 <sleep@plt>
mov    -0x30(%rbp),%rdi
mov    0x2ad1(%rip),%rax
mov    (%rax),%esi
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x50(%rbp),%r10d
mov    -0x54(%rbp),%eax
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1050 <XWarpPointer@plt>
mov    -0x30(%rbp),%rdi
call   10c0 <XFlush@plt>
mov    -0x14(%rbp),%edi
call   1100 <sleep@plt>
cmpl   $0x0,-0x24(%rbp)
je     1568 <main+0x388>
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    13f8 <main+0x218>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   10f0 <XCloseDisplay@plt>
mov    0x2a32(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
cmp    $0x6,%edi
jl     121c <main+0x3c>
lea    0xe16(%rip),%rdi
call   1040 <exit_usage@plt>
movl   $0x5,0x10(%rsp)
movl   $0x32,0x14(%rsp)
movl   $0xf,0xc(%rsp)
jmp    12ff <main+0x11f>
movl   $0x32,0x14(%rsp)
add    $0xfffffffe,%edi
cmp    $0x3,%edi
ja     1259 <main+0x79>
mov    %rsi,%rbx
lea    0xdca(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
movl   $0x5,0x10(%rsp)
mov    0x8(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,0xc(%rsp)
jmp    12ff <main+0x11f>
movl   $0x5,0x10(%rsp)
movl   $0xf,0xc(%rsp)
jmp    12ff <main+0x11f>
mov    0x8(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,0xc(%rsp)
mov    0x10(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,%r15d
movl   $0x32,0x14(%rsp)
mov    $0x5,%eax
jmp    12f2 <main+0x112>
mov    0x8(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,0xc(%rsp)
mov    0x10(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,%r15d
mov    0x18(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,0x14(%rsp)
mov    $0x5,%eax
jmp    12f2 <main+0x112>
mov    0x8(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,0xc(%rsp)
mov    0x10(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,%r15d
mov    0x18(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,0x14(%rsp)
mov    0x20(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,0x10(%rsp)
test   %r15d,%r15d
jne    14fe <main+0x31e>
mov    0x2ce2(%rip),%rax
mov    (%rax),%r13d
xor    %r15d,%r15d
xor    %edi,%edi
call   1070 <XOpenDisplay@plt>
test   %rax,%rax
jne    132d <main+0x14d>
mov    0x2ca9(%rip),%rax
mov    (%rax),%edi
lea    0xd21(%rip),%rsi
jmp    14eb <main+0x30b>
mov    %rax,%r12
mov    %rax,%rdi
call   1060 <ScreenCount@plt>
mov    %eax,%ebx
lea    0x0(,%rbx,4),%edi
call   10a0 <malloc@plt>
mov    %rax,%r14
mov    %rbx,0x20(%rsp)
test   %ebx,%ebx
jle    1377 <main+0x197>
mov    0x20(%rsp),%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %ebx,%esi
call   10b0 <RootWindow@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1360 <main+0x180>
mov    %r15d,0x30(%rsp)
test   %r15d,%r15d
js     14bd <main+0x2dd>
mov    0x10(%rsp),%eax
sub    0xc(%rsp),%eax
test   %r13d,%r13d
mov    0x20(%rsp),%r15d
cmove  %r13d,%eax
mov    %eax,0x2c(%rsp)
lea    0x34(%rsp),%rbp
lea    0x18(%rsp),%rbx
jmp    1405 <main+0x225>
nopl   0x0(%rax)
mov    0x2c29(%rip),%rax
mov    (%rax),%esi
mov    (%r14,%r13,4),%edx
mov    0x1c(%rsp),%eax
mov    0x18(%rsp),%ebp
sub    $0x8,%rsp
mov    %r12,%rdi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rbp
push   %rax
push   $0x0
call   1050 <XWarpPointer@plt>
add    $0x20,%rsp
mov    %r12,%rdi
call   10c0 <XFlush@plt>
mov    0xc(%rsp),%edi
call   1100 <sleep@plt>
mov    0x2c(%rsp),%eax
add    %eax,0x30(%rsp)
lea    0x34(%rsp),%rbp
js     14bd <main+0x2dd>
cmpl   $0x0,0x20(%rsp)
jle    1460 <main+0x280>
xor    %r13d,%r13d
nop
mov    (%r14,%r13,4),%esi
sub    $0x8,%rsp
mov    %r12,%rdi
lea    0x4c(%rsp),%rdx
lea    0x48(%rsp),%rcx
lea    0x24(%rsp),%r8
mov    %rbx,%r9
push   %rbp
lea    0x48(%rsp),%rax
push   %rax
lea    0x54(%rsp),%rax
push   %rax
call   1090 <XQueryPointer@plt>
add    $0x20,%rsp
test   %eax,%eax
jne    1463 <main+0x283>
add    $0x1,%r13
cmp    %r13,%r15
jne    1410 <main+0x230>
jmp    14db <main+0x2fb>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %r13d,%r13d
mov    0x2b76(%rip),%rax
mov    (%rax),%esi
mov    %r13d,%r13d
mov    (%r14,%r13,4),%edx
mov    0x1c(%rsp),%eax
mov    0x14(%rsp),%ecx
add    %ecx,%eax
mov    0x18(%rsp),%ebp
add    %ecx,%ebp
sub    $0x8,%rsp
mov    %r12,%rdi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rbp
push   %rax
push   $0x0
call   1050 <XWarpPointer@plt>
add    $0x20,%rsp
mov    %r12,%rdi
call   10c0 <XFlush@plt>
mov    0x10(%rsp),%edi
test   %edi,%edi
jle    13b0 <main+0x1d0>
call   1100 <sleep@plt>
jmp    13b0 <main+0x1d0>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   10f0 <XCloseDisplay@plt>
mov    0x2ae4(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    0x2ae6(%rip),%rax
mov    (%rax),%edi
lea    0xb78(%rip),%rsi
call   1080 <fprintf@plt>
mov    0x2ac9(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    0x2ad3(%rip),%rax
mov    (%rax),%r13d
cmp    %r15d,0x10(%rsp)
jle    130c <main+0x12c>
lea    0xb12(%rip),%rdi
call   1040 <exit_usage@plt>
jmp    130c <main+0x12c>

LLVM IR (-O0):
@.str = [28 x i8] c"invalid number of arguments\00"
@False = global i32 0
@True = global i32 0
@.str.1 = [29 x i8] c"deltaT too large for timeout\00"
@stderr = global i32 0
@.str.2 = [26 x i8] c"Error opening display!!!\0A\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [17 x i8] c"No mouse found.\0A\00"
@None = global i32 0
@EXIT_SUCCESS = 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
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 15, i32* %6
store i32 0, i32* %7
store i32 50, i32* %8
store i32 5, i32* %9
%23 = load i32, i32* %4
%24 = icmp sgt i32 %23, 5
br i1 %24, label %25, label %27
25: ; preds = %2
%26 = call i32 @exit_usage(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %87
27: ; preds = %2
%28 = load i32, i32* %4
%29 = icmp eq i32 %28, 5
br i1 %29, label %30, label %47
30: ; preds = %27
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call i32 @atoi(i8* %33)
store i32 %34, i32* %6
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = call i32 @atoi(i8* %37)
store i32 %38, i32* %7
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 3
%41 = load i8*, i8** %40
%42 = call i32 @atoi(i8* %41)
store i32 %42, i32* %8
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 4
%45 = load i8*, i8** %44
%46 = call i32 @atoi(i8* %45)
store i32 %46, i32* %9
br label %86
47: ; preds = %27
%48 = load i32, i32* %4
%49 = icmp eq i32 %48, 4
br i1 %49, label %50, label %63
50: ; preds = %47
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 1
%53 = load i8*, i8** %52
%54 = call i32 @atoi(i8* %53)
store i32 %54, i32* %6
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 2
%57 = load i8*, i8** %56
%58 = call i32 @atoi(i8* %57)
store i32 %58, i32* %7
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 3
%61 = load i8*, i8** %60
%62 = call i32 @atoi(i8* %61)
store i32 %62, i32* %8
br label %85
63: ; preds = %47
%64 = load i32, i32* %4
%65 = icmp eq i32 %64, 3
br i1 %65, label %66, label %75
66: ; preds = %63
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 1
%69 = load i8*, i8** %68
%70 = call i32 @atoi(i8* %69)
store i32 %70, i32* %6
%71 = load i8**, i8*** %5
%72 = getelementptr inbounds i8*, i8** %71, i64 2
%73 = load i8*, i8** %72
%74 = call i32 @atoi(i8* %73)
store i32 %74, i32* %7
br label %84
75: ; preds = %63
%76 = load i32, i32* %4
%77 = icmp eq i32 %76, 2
br i1 %77, label %78, label %83
78: ; preds = %75
%79 = load i8**, i8*** %5
%80 = getelementptr inbounds i8*, i8** %79, i64 1
%81 = load i8*, i8** %80
%82 = call i32 @atoi(i8* %81)
store i32 %82, i32* %6
br label %83
83: ; preds = %78, %75
br label %84
84: ; preds = %83, %66
br label %85
85: ; preds = %84, %50
br label %86
86: ; preds = %85, %30
br label %87
87: ; preds = %86, %25
%88 = load i32, i32* %7
%89 = icmp eq i32 %88, 0
br i1 %89, label %90, label %92
90: ; preds = %87
%91 = load i32, i32* @False
store i32 %91, i32* %10
br label %100
92: ; preds = %87
%93 = load i32, i32* @True
store i32 %93, i32* %10
%94 = load i32, i32* %9
%95 = load i32, i32* %7
%96 = icmp sgt i32 %94, %95
br i1 %96, label %97, label %99
97: ; preds = %92
%98 = call i32 @exit_usage(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %99
99: ; preds = %97, %92
br label %100
100: ; preds = %99, %90
%101 = call i32* @XOpenDisplay(i32* null)
store i32* %101, i32** %11
%102 = load i32*, i32** %11
%103 = icmp eq i32* %102, null
br i1 %103, label %104, label %109
104: ; preds = %100
%105 = load i32, i32* @stderr
%106 = call i32 @fprintf(i32 %105, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%107 = load i32, i32* @EXIT_FAILURE
%108 = call i32 @exit(i32 %107)
unreachable
109: ; preds = %100
%110 = load i32*, i32** %11
%111 = call i32 @ScreenCount(i32* %110)
store i32 %111, i32* %12
%112 = load i32, i32* %12
%113 = sext i32 %112 to i64
%114 = mul i64 4, %113
%115 = trunc i64 %114 to i32
%116 = call i64 @malloc(i32 %115)
%117 = inttoptr i64 %116 to i32*
store i32* %117, i32** %13
store i32 0, i32* %14
br label %118
118: ; preds = %130, %109
%119 = load i32, i32* %14
%120 = load i32, i32* %12
%121 = icmp slt i32 %119, %120
br i1 %121, label %122, label %133
122: ; preds = %118
%123 = load i32*, i32** %11
%124 = load i32, i32* %14
%125 = call i32 @RootWindow(i32* %123, i32 %124)
%126 = load i32*, i32** %13
%127 = load i32, i32* %14
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds i32, i32* %126, i64 %128
store i32 %125, i32* %129
br label %130
130: ; preds = %122
%131 = load i32, i32* %14
%132 = add nsw i32 %131, 1
store i32 %132, i32* %14
br label %118
133: ; preds = %118
br label %134
134: ; preds = %210, %133
%135 = load i32, i32* %7
%136 = icmp sge i32 %135, 0
br i1 %136, label %137, label %211
137: ; preds = %134
store i32 0, i32* %14
br label %138
138: ; preds = %154, %137
%139 = load i32, i32* %14
%140 = load i32, i32* %12
%141 = icmp slt i32 %139, %140
br i1 %141, label %142, label %157
142: ; preds = %138
%143 = load i32*, i32** %11
%144 = load i32*, i32** %13
%145 = load i32, i32* %14
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds i32, i32* %144, i64 %146
%148 = load i32, i32* %147
%149 = call i32 @XQueryPointer(i32* %143, i32 %148, i32* %15, i32* %16, i32* %17, i32* %18, i32* %19, i32* %20, i32* %21)
store i32 %149, i32* %22
%150 = load i32, i32* %22
%151 = icmp ne i32 %150, 0
br i1 %151, label %152, label %153
152: ; preds = %142
br label %157
153: ; preds = %142
br label %154
154: ; preds = %153
%155 = load i32, i32* %14
%156 = add nsw i32 %155, 1
store i32 %156, i32* %14
br label %138
157: ; preds = %152, %138
%158 = load i32, i32* %22
%159 = icmp ne i32 %158, 0
br i1 %159, label %165, label %160
160: ; preds = %157
%161 = load i32, i32* @stderr
%162 = call i32 @fprintf(i32 %161, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%163 = load i32, i32* @EXIT_FAILURE
%164 = call i32 @exit(i32 %163)
unreachable
165: ; preds = %157
%166 = load i32*, i32** %11
%167 = load i32, i32* @None
%168 = load i32*, i32** %13
%169 = load i32, i32* %14
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds i32, i32* %168, i64 %170
%172 = load i32, i32* %171
%173 = load i32, i32* %17
%174 = load i32, i32* %8
%175 = add nsw i32 %173, %174
%176 = load i32, i32* %18
%177 = load i32, i32* %8
%178 = add nsw i32 %176, %177
%179 = call i32 @XWarpPointer(i32* %166, i32 %167, i32 %172, i32 0, i32 0, i32 0, i32 0, i32 %175, i32 %178)
%180 = load i32*, i32** %11
%181 = call i32 @XFlush(i32* %180)
%182 = load i32, i32* %9
%183 = icmp sgt i32 %182, 0
br i1 %183, label %184, label %187
184: ; preds = %165
%185 = load i32, i32* %9
%186 = call i32 @sleep(i32 %185)
br label %187
187: ; preds = %184, %165
%188 = load i32*, i32** %11
%189 = load i32, i32* @None
%190 = load i32*, i32** %13
%191 = load i32, i32* %14
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds i32, i32* %190, i64 %192
%194 = load i32, i32* %193
%195 = load i32, i32* %17
%196 = load i32, i32* %18
%197 = call i32 @XWarpPointer(i32* %188, i32 %189, i32 %194, i32 0, i32 0, i32 0, i32 0, i32 %195, i32 %196)
%198 = load i32*, i32** %11
%199 = call i32 @XFlush(i32* %198)
%200 = load i32, i32* %6
%201 = call i32 @sleep(i32 %200)
%202 = load i32, i32* %10
%203 = icmp ne i32 %202, 0
br i1 %203, label %204, label %210
204: ; preds = %187
%205 = load i32, i32* %7
%206 = load i32, i32* %6
%207 = sub nsw i32 %205, %206
%208 = load i32, i32* %9
%209 = add nsw i32 %207, %208
store i32 %209, i32* %7
br label %210
210: ; preds = %204, %187
br label %134
211: ; preds = %134
%212 = load i32*, i32** %13
%213 = call i32 @free(i32* %212)
%214 = load i32*, i32** %11
%215 = call i32 @XCloseDisplay(i32* %214)
%216 = load i32, i32* @EXIT_SUCCESS
%217 = call i32 @exit(i32 %216)
unreachable
}

LLVM IR (-O2):
@.str = [28 x i8] c"invalid number of arguments\00"
@False = global i32 0
@True = global i32 0
@.str.1 = [29 x i8] c"deltaT too large for timeout\00"
@stderr = global i32 0
@.str.2 = [26 x i8] c"Error opening display!!!\0A\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [17 x i8] c"No mouse found.\0A\00"
@None = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = icmp sgt i32 %0, 5
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = tail call i32 @exit_usage(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %54
13: ; preds = %2
switch i32 %0, label %54 [
i32 5, label %14
i32 4, label %27
i32 3, label %37
i32 2, label %44
]
14: ; preds = %13
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = getelementptr inbounds i8*, i8** %1, i64 3
%22 = load i8*, i8** %21
%23 = tail call i32 @atoi(i8* %22)
%24 = getelementptr inbounds i8*, i8** %1, i64 4
%25 = load i8*, i8** %24
%26 = tail call i32 @atoi(i8* %25)
br label %48
27: ; preds = %13
%28 = getelementptr inbounds i8*, i8** %1, i64 1
%29 = load i8*, i8** %28
%30 = tail call i32 @atoi(i8* %29)
%31 = getelementptr inbounds i8*, i8** %1, i64 2
%32 = load i8*, i8** %31
%33 = tail call i32 @atoi(i8* %32)
%34 = getelementptr inbounds i8*, i8** %1, i64 3
%35 = load i8*, i8** %34
%36 = tail call i32 @atoi(i8* %35)
br label %48
37: ; preds = %13
%38 = getelementptr inbounds i8*, i8** %1, i64 1
%39 = load i8*, i8** %38
%40 = tail call i32 @atoi(i8* %39)
%41 = getelementptr inbounds i8*, i8** %1, i64 2
%42 = load i8*, i8** %41
%43 = tail call i32 @atoi(i8* %42)
br label %48
44: ; preds = %13
%45 = getelementptr inbounds i8*, i8** %1, i64 1
%46 = load i8*, i8** %45
%47 = tail call i32 @atoi(i8* %46)
br label %54
48: ; preds = %14, %37, %27
%49 = phi i32 [ %26, %14 ], [ 5, %27 ], [ 5, %37 ]
%50 = phi i32 [ %23, %14 ], [ %36, %27 ], [ 50, %37 ]
%51 = phi i32 [ %20, %14 ], [ %33, %27 ], [ %43, %37 ]
%52 = phi i32 [ %17, %14 ], [ %30, %27 ], [ %40, %37 ]
%53 = icmp eq i32 %51, 0
br i1 %53, label %54, label %59
54: ; preds = %13, %44, %11, %48
%55 = phi i32 [ %52, %48 ], [ 15, %13 ], [ %47, %44 ], [ 15, %11 ]
%56 = phi i32 [ %50, %48 ], [ 50, %13 ], [ 50, %44 ], [ 50, %11 ]
%57 = phi i32 [ %49, %48 ], [ 5, %13 ], [ 5, %44 ], [ 5, %11 ]
%58 = load i32, i32* @False
br label %64
59: ; preds = %48
%60 = load i32, i32* @True
%61 = icmp sgt i32 %49, %51
br i1 %61, label %62, label %64
62: ; preds = %59
%63 = tail call i32 @exit_usage(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %64
64: ; preds = %59, %62, %54
%65 = phi i32 [ %55, %54 ], [ %52, %62 ], [ %52, %59 ]
%66 = phi i32 [ 0, %54 ], [ %51, %62 ], [ %51, %59 ]
%67 = phi i32 [ %56, %54 ], [ %50, %62 ], [ %50, %59 ]
%68 = phi i32 [ %57, %54 ], [ %49, %62 ], [ %49, %59 ]
%69 = phi i32 [ %58, %54 ], [ %60, %62 ], [ %60, %59 ]
%70 = tail call i32* @XOpenDisplay(i32* null)
%71 = icmp eq i32* %70, null
br i1 %71, label %72, label %77
72: ; preds = %64
%73 = load i32, i32* @stderr
%74 = tail call i32 @fprintf(i32 %73, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%75 = load i32, i32* @EXIT_FAILURE
%76 = tail call i32 @exit(i32 %75)
unreachable
77: ; preds = %64
%78 = tail call i32 @ScreenCount(i32* %70)
%79 = shl i32 %78, 2
%80 = tail call i64 @malloc(i32 %79)
%81 = inttoptr i64 %80 to i32*
%82 = icmp sgt i32 %78, 0
br i1 %82, label %83, label %92
83: ; preds = %77
%84 = zext i32 %78 to i64
br label %85
85: ; preds = %83, %85
%86 = phi i64 [ 0, %83 ], [ %90, %85 ]
%87 = trunc i64 %86 to i32
%88 = tail call i32 @RootWindow(i32* %70, i32 %87)
%89 = getelementptr inbounds i32, i32* %81, i64 %86
store i32 %88, i32* %89
%90 = add nuw nsw i64 %86, 1
%91 = icmp eq i64 %90, %84
br i1 %91, label %92, label %85
92: ; preds = %85, %77
%93 = bitcast i32* %3 to i8*
%94 = bitcast i32* %4 to i8*
%95 = bitcast i32* %5 to i8*
%96 = bitcast i32* %6 to i8*
%97 = bitcast i32* %7 to i8*
%98 = bitcast i32* %8 to i8*
%99 = bitcast i32* %9 to i8*
%100 = icmp sgt i32 %66, -1
br i1 %100, label %101, label %147
101: ; preds = %92
%102 = icmp sgt i32 %68, 0
%103 = icmp eq i32 %69, 0
%104 = sub i32 %68, %65
%105 = zext i32 %78 to i64
%106 = select i1 %103, i32 0, i32 %104
br label %107
107: ; preds = %101, %137
%108 = phi i32 [ %66, %101 ], [ %145, %137 ]
br i1 %82, label %109, label %123
109: ; preds = %107, %115
%110 = phi i64 [ %116, %115 ], [ 0, %107 ]
%111 = getelementptr inbounds i32, i32* %81, i64 %110
%112 = load i32, i32* %111
%113 = call i32 @XQueryPointer(i32* %70, i32 %112, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9)
%114 = icmp eq i32 %113, 0
br i1 %114, label %115, label %123
115: ; preds = %109
%116 = add nuw nsw i64 %110, 1
%117 = icmp eq i64 %116, %105
br i1 %117, label %118, label %109
118: ; preds = %115
%119 = load i32, i32* @stderr
%120 = call i32 @fprintf(i32 %119, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%121 = load i32, i32* @EXIT_FAILURE
%122 = call i32 @exit(i32 %121)
unreachable
123: ; preds = %109, %107
%124 = phi i64 [ 0, %107 ], [ %110, %109 ]
%125 = load i32, i32* @None
%126 = and i64 %124, 4294967295
%127 = getelementptr inbounds i32, i32* %81, i64 %126
%128 = load i32, i32* %127
%129 = load i32, i32* %5
%130 = add nsw i32 %129, %67
%131 = load i32, i32* %6
%132 = add nsw i32 %131, %67
%133 = call i32 @XWarpPointer(i32* %70, i32 %125, i32 %128, i32 0, i32 0, i32 0, i32 0, i32 %130, i32 %132)
%134 = call i32 @XFlush(i32* %70)
br i1 %102, label %135, label %137
135: ; preds = %123
%136 = call i32 @sleep(i32 %68)
br label %137
137: ; preds = %135, %123
%138 = load i32, i32* @None
%139 = load i32, i32* %127
%140 = load i32, i32* %5
%141 = load i32, i32* %6
%142 = call i32 @XWarpPointer(i32* %70, i32 %138, i32 %139, i32 0, i32 0, i32 0, i32 0, i32 %140, i32 %141)
%143 = call i32 @XFlush(i32* %70)
%144 = call i32 @sleep(i32 %65)
%145 = add i32 %108, %106
%146 = icmp sgt i32 %145, -1
br i1 %146, label %107, label %147
147: ; preds = %137, %92
%148 = call i32 @free(i32* %81)
%149 = call i32 @XCloseDisplay(i32* %70)
%150 = load i32, i32* @EXIT_SUCCESS
%151 = call i32 @exit(i32 %150)
unreachable
}