#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*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ EV_REL;
int /*<<< orphan*/ REL_X;
int /*<<< orphan*/ REL_Y;
scalar_t__ suinput_write(int, int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int suinput_write_syn(int, int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/);
int suinput_move_pointer(int uinput_fd, int32_t x, int32_t y) {
  if (suinput_write(uinput_fd, EV_REL, REL_X, x))
    return -1;
  return suinput_write_syn(uinput_fd, EV_REL, REL_Y, y);
}


x86 assembly (clang, -O0):
<suinput_move_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
mov    0x2e94(%rip),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%ecx
call   1040 <suinput_write@plt>
cmp    $0x0,%rax
je     1164 <suinput_move_pointer+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    1184 <suinput_move_pointer+0x64>
mov    -0x8(%rbp),%edi
mov    0x2e72(%rip),%rax
mov    (%rax),%esi
mov    0x2e81(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%ecx
call   1030 <suinput_write_syn@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suinput_move_pointer>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ecx
mov    %edi,%ebp
mov    0x2eae(%rip),%rbx
mov    (%rbx),%esi
mov    0x2e9d(%rip),%rax
mov    (%rax),%edx
call   1040 <suinput_write@plt>
test   %rax,%rax
je     1151 <suinput_move_pointer+0x31>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    (%rbx),%esi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
mov    %ebp,%edi
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <suinput_write_syn@plt>

LLVM IR (-O0):
@EV_REL = global i32 0
@REL_X = global i32 0
@REL_Y = global i32 0
define i32 @suinput_move_pointer(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* @EV_REL
%10 = load i32, i32* @REL_X
%11 = load i32, i32* %6
%12 = call i64 @suinput_write(i32 %8, i32 %9, i32 %10, i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 -1, i32* %4
br label %21
15: ; preds = %3
%16 = load i32, i32* %5
%17 = load i32, i32* @EV_REL
%18 = load i32, i32* @REL_Y
%19 = load i32, i32* %7
%20 = call i32 @suinput_write_syn(i32 %16, i32 %17, i32 %18, i32 %19)
store i32 %20, i32* %4
br label %21
21: ; preds = %15, %14
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@EV_REL = global i32 0
@REL_X = global i32 0
@REL_Y = global i32 0
define i32 @suinput_move_pointer(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @EV_REL
%5 = load i32, i32* @REL_X
%6 = tail call i64 @suinput_write(i32 %0, i32 %4, i32 %5, i32 %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = load i32, i32* @EV_REL
%10 = load i32, i32* @REL_Y
%11 = tail call i32 @suinput_write_syn(i32 %0, i32 %9, i32 %10, i32 %2)
br label %12
12: ; preds = %3, %8
%13 = phi i32 [ %11, %8 ], [ -1, %3 ]
ret i32 %13
}