#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*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ XDefaultRootWindow(int /*<<< orphan*/ *);
int /*<<< orphan*/ XQueryPointer(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int /*<<< orphan*/ *);
void get_absolute_mouse_position(Display *display, int32_t *p_mouse_x,
                                 int32_t *p_mouse_y) {
  int32_t unused_win_x = 0;
  int32_t unused_win_y = 0;
  uint32_t unused_mask = 0;
  Window unused_root_return = 0;
  Window unused_child_return = 0;
  XQueryPointer(display, XDefaultRootWindow(display), &unused_root_return,
                &unused_child_return, p_mouse_x, p_mouse_y, &unused_win_x,
                &unused_win_y, &unused_mask);
}


x86 assembly (clang, -O0):
<get_absolute_mouse_position>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <XDefaultRootWindow@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
lea    -0x28(%rbp),%rdx
lea    -0x2c(%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   1030 <XQueryPointer@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_absolute_mouse_position>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
call   1040 <XDefaultRootWindow@plt>
sub    $0x8,%rsp
lea    0x14(%rsp),%r10
lea    0x18(%rsp),%r11
lea    0x1c(%rsp),%r12
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r15,%r8
mov    %r14,%r9
push   %r10
push   %r11
push   %r12
call   1030 <XQueryPointer@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @get_absolute_mouse_position(i32* %0, i32* %1, i32* %2) {
%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** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
%12 = load i32*, i32** %4
%13 = load i32*, i32** %4
%14 = call i32 @XDefaultRootWindow(i32* %13)
%15 = load i32*, i32** %5
%16 = load i32*, i32** %6
%17 = call i32 @XQueryPointer(i32* %12, i32 %14, i32* %10, i32* %11, i32* %15, i32* %16, i32* %7, i32* %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @get_absolute_mouse_position(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%10 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%11 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%12 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%13 = bitcast i32* %8 to i8*
store i32 0, i32* %8
%14 = tail call i32 @XDefaultRootWindow(i32* %0)
%15 = call i32 @XQueryPointer(i32* %0, i32 %14, i32* %7, i32* %8, i32* %1, i32* %2, i32* %4, i32* %5, i32* %6)
ret void
}