//
// sub_1800CE750 from 0x1800ce750 to 0x1800ce7b4 (100 bytes)
//
// 2 xrefs:
// > sub_1800E5F70 @ 0x1800e6024
// > sub_1800E6060 @ 0x1800e6280
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_1800CE750(__int64 a1, char a2)
{
unsigned __int64 v2; // rax
unsigned __int64 v4; // r10
unsigned __int64 v5; // r8
int v6; // ecx
int v7; // eax
unsigned int v8; // ecx
unsigned int v9; // r8d
__int64 v10; // rax
v2 = *(_QWORD *)(a1 + 80);
v4 = v2 >> 29;
v5 = v2 >> 17;
if ( !a2 )
v2 = *(unsigned int *)(a1 + 468);
v6 = (unsigned __int16)(v2 >> 1);
v7 = 1;
v8 = v6 + 1;
v9 = (((_DWORD)v4 << 12) | v5 & 0xFFF) << 16;
if ( v8 < 0xFFFF )
v7 = v8;
v10 = (2 * (v7 | v9)) | 1LL;
*(_QWORD *)(a1 + 80) = v10;
if ( a2 )
*(_DWORD *)(a1 + 468) = v10;
return 0;
}