#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*/ Button1;
int /*<<< orphan*/ click(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ moveTo(int /*<<< orphan*/ *, int, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void clickXY(Display *display, int x, int y) {
  srand(time(NULL));
  int xi = rand() % 4;
  int yi = rand() % 4;
  moveTo(display, x + xi, y + yi);
  click(display, Button1);
}


x86 assembly (clang, -O0):
<clickXY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
add    -0x18(%rbp),%edx
call   1050 <moveTo@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e32(%rip),%rax
mov    (%rax),%esi
call   1060 <click@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clickXY>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%r15
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1070 <rand@plt>
mov    %eax,%ebx
lea    0x3(%rbx),%eax
test   %ebx,%ebx
cmovns %ebx,%eax
and    $0xfffffffc,%eax
sub    %eax,%ebx
xor    %eax,%eax
call   1070 <rand@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
sub    %ecx,%eax
add    %r14d,%ebx
add    %eax,%ebp
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1050 <moveTo@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%esi
mov    %r15,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <click@plt>

LLVM IR (-O0):
@Button1 = global i32 0
define void @clickXY(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = call i32 @time(i32* null)
%10 = call i32 @srand(i32 %9)
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 4
store i32 %12, i32* %7
%13 = call i32 (...) @rand()
%14 = srem i32 %13, 4
store i32 %14, i32* %8
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = load i32, i32* %7
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %6
%20 = load i32, i32* %8
%21 = add nsw i32 %19, %20
%22 = call i32 @moveTo(i32* %15, i32 %18, i32 %21)
%23 = load i32*, i32** %4
%24 = load i32, i32* @Button1
%25 = call i32 @click(i32* %23, i32 %24)
ret void
}

LLVM IR (-O2):
@Button1 = global i32 0
define void @clickXY(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @time(i32* null)
%5 = tail call i32 @srand(i32 %4)
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 4
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 4
%10 = add nsw i32 %7, %1
%11 = add nsw i32 %9, %2
%12 = tail call i32 @moveTo(i32* %0, i32 %10, i32 %11)
%13 = load i32, i32* @Button1
%14 = tail call i32 @click(i32* %0, i32 %13)
ret void
}