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

/* Variables and functions */
int /*<<< orphan*/ RCT2_CALLFUNC_X(int, int *, int *, int *, int *, int *,
                                   int *, int *);
void screen_pos_to_map_pos(int *x, int *y) {
  int eax, ebx, ecx, edx, esi, edi, ebp;
  eax = *x;
  ebx = *y;
  RCT2_CALLFUNC_X(0x0068958D, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
  *x = eax & 0xFFFF;
  *y = ebx & 0xFFFF;
}


x86 assembly (clang, -O0):
<screen_pos_to_map_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x68958d,%edi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
lea    -0x24(%rbp),%r9
lea    -0x28(%rbp),%r10
lea    -0x2c(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <RCT2_CALLFUNC_X@plt>
mov    -0x14(%rbp),%ecx
and    $0xffff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%ecx
and    $0xffff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_pos_to_map_pos>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%eax
mov    %eax,0x10(%rsp)
mov    (%rsi),%eax
mov    %eax,0xc(%rsp)
lea    0x14(%rsp),%rax
lea    0x18(%rsp),%r10
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x24(%rsp),%rcx
lea    0x20(%rsp),%r8
lea    0x1c(%rsp),%r9
mov    $0x68958d,%edi
push   %rax
push   %r10
call   1030 <RCT2_CALLFUNC_X@plt>
add    $0x10,%rsp
movzwl 0x10(%rsp),%eax
mov    %eax,(%rbx)
movzwl 0xc(%rsp),%eax
mov    %eax,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @screen_pos_to_map_pos(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 = load i32*, i32** %3
%13 = load i32, i32* %12
store i32 %13, i32* %5
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
store i32 %15, i32* %6
%16 = call i32 @RCT2_CALLFUNC_X(i32 6854029, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i32* %11)
%17 = load i32, i32* %5
%18 = and i32 %17, 65535
%19 = load i32*, i32** %3
store i32 %18, i32* %19
%20 = load i32, i32* %6
%21 = and i32 %20, 65535
%22 = load i32*, i32** %4
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @screen_pos_to_map_pos(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = bitcast i32* %3 to i8*
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = bitcast i32* %8 to i8*
%16 = bitcast i32* %9 to i8*
%17 = load i32, i32* %0
store i32 %17, i32* %3
%18 = load i32, i32* %1
store i32 %18, i32* %4
%19 = call i32 @RCT2_CALLFUNC_X(i32 6854029, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9)
%20 = load i32, i32* %3
%21 = and i32 %20, 65535
store i32 %21, i32* %0
%22 = load i32, i32* %4
%23 = and i32 %22, 65535
store i32 %23, i32* %1
ret void
}