#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*/ RootWindow(int /*<<< orphan*/ *, int);
int XDefaultScreen(int /*<<< orphan*/ *);
int /*<<< orphan*/ XQueryPointer(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int *, int *, int *, int *, unsigned int *);
scalar_t__ iupdrvGetDisplay();
void iupdrvGetCursorPos(int *x, int *y) {
  Window root, child;
  int cx, cy;
  unsigned int keys;
  Display *display = (Display *)iupdrvGetDisplay();
  int screen = XDefaultScreen(display);
  XQueryPointer(display, RootWindow(display, screen), &root, &child, x, y, &cx,
                &cy, &keys);
}


x86 assembly (clang, -O0):
<iupdrvGetCursorPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <iupdrvGetDisplay@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <XDefaultScreen@plt>
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1050 <RootWindow@plt>
mov    -0x40(%rbp),%rdi
mov    %eax,%esi
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r11
lea    -0x20(%rbp),%r10
lea    -0x24(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <XQueryPointer@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iupdrvGetCursorPos>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
xor    %eax,%eax
call   1060 <iupdrvGetDisplay@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <XDefaultScreen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <RootWindow@plt>
sub    $0x8,%rsp
lea    0xc(%rsp),%r10
lea    0x10(%rsp),%r11
lea    0x14(%rsp),%r12
lea    0x1c(%rsp),%rdx
lea    0x18(%rsp),%rcx
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r15,%r8
mov    %r14,%r9
push   %r10
push   %r11
push   %r12
call   1040 <XQueryPointer@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @iupdrvGetCursorPos(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%12 = call i64 (...) @iupdrvGetDisplay()
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %10
%14 = load i32*, i32** %10
%15 = call i32 @XDefaultScreen(i32* %14)
store i32 %15, i32* %11
%16 = load i32*, i32** %10
%17 = load i32*, i32** %10
%18 = load i32, i32* %11
%19 = call i32 @RootWindow(i32* %17, i32 %18)
%20 = load i32*, i32** %3
%21 = load i32*, i32** %4
%22 = call i32 @XQueryPointer(i32* %16, i32 %19, i32* %5, i32* %6, i32* %20, i32* %21, i32* %7, i32* %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @iupdrvGetCursorPos(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = bitcast i32* %6 to i8*
%12 = bitcast i32* %7 to i8*
%13 = tail call i64 (...) @iupdrvGetDisplay()
%14 = inttoptr i64 %13 to i32*
%15 = tail call i32 @XDefaultScreen(i32* %14)
%16 = tail call i32 @RootWindow(i32* %14, i32 %15)
%17 = call i32 @XQueryPointer(i32* %14, i32 %16, i32* %3, i32* %4, i32* %0, i32* %1, i32* %5, i32* %6, i32* %7)
ret void
}