#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*/ Button1;
int /*<<< orphan*/ DefaultRootWindow(int /*<<< orphan*/ *);
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ None;
int /*<<< orphan*/ XCloseDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XFlush(int /*<<< orphan*/ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ mouseClick(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage_on_failure();
int main(int argc, char *argv[]) {
  if (argc != 3)
    usage_on_failure();
  int x = atoi(argv[1]);
  int y = atoi(argv[2]);
  if (x <= 0 || y <= 0)
    usage_on_failure();
  Display *display = XOpenDisplay(NULL);
  if (display == NULL) {
    fprintf(stderr, "Error in opening display!!!\n");
    exit(EXIT_FAILURE);
  }
  Window root = DefaultRootWindow(display);
  XWarpPointer(display, None, root, 0, 0, 0, 0, x, y);
  mouseClick(display, Button1);
  XFlush(display);
  XCloseDisplay(display);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11c7 <main+0x27>
mov    $0x0,%al
call   1080 <usage_on_failure@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11fb <main+0x5b>
cmpl   $0x0,-0x18(%rbp)
jg     1202 <main+0x62>
mov    $0x0,%al
call   1080 <usage_on_failure@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <XOpenDisplay@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    123d <main+0x9d>
mov    0x2daf(%rip),%rax
mov    (%rax),%edi
lea    0xdd6(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2d92(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
mov    -0x20(%rbp),%rdi
call   1030 <DefaultRootWindow@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2d8c(%rip),%rax
mov    (%rax),%esi
mov    -0x24(%rbp),%edx
mov    -0x14(%rbp),%r10d
mov    -0x18(%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    -0x20(%rbp),%rdi
mov    0x2d5f(%rip),%rax
mov    (%rax),%esi
call   1070 <mouseClick@plt>
mov    -0x20(%rbp),%rdi
call   1090 <XFlush@plt>
mov    -0x20(%rbp),%rdi
call   10c0 <XCloseDisplay@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
cmp    $0x3,%edi
je     11b4 <main+0x14>
xor    %eax,%eax
call   1080 <usage_on_failure@plt>
mov    0x8(%rbx),%rdi
call   10a0 <atoi@plt>
mov    %eax,%r14d
mov    0x10(%rbx),%rdi
call   10a0 <atoi@plt>
mov    %eax,%r15d
test   %r14d,%r14d
jle    11d6 <main+0x36>
test   %r15d,%r15d
jg     11dd <main+0x3d>
xor    %eax,%eax
call   1080 <usage_on_failure@plt>
xor    %edi,%edi
call   1050 <XOpenDisplay@plt>
test   %rax,%rax
je     1246 <main+0xa6>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <DefaultRootWindow@plt>
mov    0x2de5(%rip),%rcx
mov    (%rcx),%esi
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    %eax,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %r15
push   %r14
push   $0x0
call   1040 <XWarpPointer@plt>
add    $0x20,%rsp
mov    0x2dc4(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1070 <mouseClick@plt>
mov    %rbx,%rdi
call   1090 <XFlush@plt>
mov    %rbx,%rdi
call   10c0 <XCloseDisplay@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2d83(%rip),%rax
mov    (%rax),%edi
lea    0xdaa(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2d66(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Error in opening display!!!\0A\00"
@EXIT_FAILURE = global i32 0
@None = global i32 0
@Button1 = 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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 3
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @usage_on_failure()
br label %14
14: ; preds = %12, %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
store i32 %18, i32* %6
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 2
%21 = load i8*, i8** %20
%22 = call i32 @atoi(i8* %21)
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = icmp sle i32 %23, 0
br i1 %24, label %28, label %25
25: ; preds = %14
%26 = load i32, i32* %7
%27 = icmp sle i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %25, %14
%29 = call i32 (...) @usage_on_failure()
br label %30
30: ; preds = %28, %25
%31 = call i32* @XOpenDisplay(i32* null)
store i32* %31, i32** %8
%32 = load i32*, i32** %8
%33 = icmp eq i32* %32, null
br i1 %33, label %34, label %39
34: ; preds = %30
%35 = load i32, i32* @stderr
%36 = call i32 @fprintf(i32 %35, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%37 = load i32, i32* @EXIT_FAILURE
%38 = call i32 @exit(i32 %37)
unreachable
39: ; preds = %30
%40 = load i32*, i32** %8
%41 = call i32 @DefaultRootWindow(i32* %40)
store i32 %41, i32* %9
%42 = load i32*, i32** %8
%43 = load i32, i32* @None
%44 = load i32, i32* %9
%45 = load i32, i32* %6
%46 = load i32, i32* %7
%47 = call i32 @XWarpPointer(i32* %42, i32 %43, i32 %44, i32 0, i32 0, i32 0, i32 0, i32 %45, i32 %46)
%48 = load i32*, i32** %8
%49 = load i32, i32* @Button1
%50 = call i32 @mouseClick(i32* %48, i32 %49)
%51 = load i32*, i32** %8
%52 = call i32 @XFlush(i32* %51)
%53 = load i32*, i32** %8
%54 = call i32 @XCloseDisplay(i32* %53)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Error in opening display!!!\0A\00"
@EXIT_FAILURE = global i32 0
@None = global i32 0
@Button1 = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage_on_failure()
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = icmp slt i32 %9, 1
%14 = icmp slt i32 %12, 1
%15 = select i1 %13, i1 true, i1 %14
br i1 %15, label %16, label %18
16: ; preds = %6
%17 = tail call i32 (...) @usage_on_failure()
br label %18
18: ; preds = %6, %16
%19 = tail call i32* @XOpenDisplay(i32* null)
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = load i32, i32* @stderr
%23 = tail call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%24 = load i32, i32* @EXIT_FAILURE
%25 = tail call i32 @exit(i32 %24)
unreachable
26: ; preds = %18
%27 = tail call i32 @DefaultRootWindow(i32* %19)
%28 = load i32, i32* @None
%29 = tail call i32 @XWarpPointer(i32* %19, i32 %28, i32 %27, i32 0, i32 0, i32 0, i32 0, i32 %9, i32 %12)
%30 = load i32, i32* @Button1
%31 = tail call i32 @mouseClick(i32* %19, i32 %30)
%32 = tail call i32 @XFlush(i32* %19)
%33 = tail call i32 @XCloseDisplay(i32* %19)
ret i32 0
}