#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*/ XQueryPointer(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int *, int *, int *, int *, unsigned int *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void querypointer(Display *dpy, Window w, int *x, int *y) {
  Window _root, _child;
  int _win_x, _win_y;
  unsigned int _mask;
  if (!XQueryPointer(dpy, w, &_root, &_child, x, y, &_win_x, &_win_y, &_mask))
    fprintf(stderr, "Couldn't query pointer?\n");
}


x86 assembly (clang, -O0):
<querypointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    -0x24(%rbp),%rdx
lea    -0x28(%rbp),%rcx
lea    -0x2c(%rbp),%r11
lea    -0x30(%rbp),%r10
lea    -0x34(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <XQueryPointer@plt>
cmp    $0x0,%eax
jne    118b <querypointer+0x6b>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
lea    0xe7a(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<querypointer>:
sub    $0x18,%rsp
mov    %rcx,%r9
mov    %rdx,%r8
sub    $0x8,%rsp
lea    0xc(%rsp),%rax
lea    0x10(%rsp),%r10
lea    0x14(%rsp),%r11
lea    0x1c(%rsp),%rdx
lea    0x18(%rsp),%rcx
push   %rax
push   %r10
push   %r11
call   1040 <XQueryPointer@plt>
add    $0x20,%rsp
test   %eax,%eax
je     115e <querypointer+0x3e>
add    $0x18,%rsp
ret
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Couldn't query pointer?\0A\00"
define void @querypointer(i32* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%14 = load i32*, i32** %5
%15 = load i32, i32* %6
%16 = load i32*, i32** %7
%17 = load i32*, i32** %8
%18 = call i32 @XQueryPointer(i32* %14, i32 %15, i32* %9, i32* %10, i32* %16, i32* %17, i32* %11, i32* %12, i32* %13)
%19 = icmp ne i32 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %4
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %20, %4
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Couldn't query pointer?\0A\00"
define void @querypointer(i32* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = bitcast i32* %5 to i8*
%11 = bitcast i32* %6 to i8*
%12 = bitcast i32* %7 to i8*
%13 = bitcast i32* %8 to i8*
%14 = bitcast i32* %9 to i8*
%15 = call i32 @XQueryPointer(i32* %0, i32 %1, i32* %5, i32* %6, i32* %2, i32* %3, i32* %7, i32* %8, i32* %9)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %4
%18 = load i32, i32* @stderr
%19 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %17, %4
ret void
}