//
// sub_1800D7C40 from 0x1800d7c40 to 0x1800d7cb7 (119 bytes)
//
// 2 xrefs:
// > sub_1800E4480 @ 0x1800e44bd
// > ??> @ 0x1801ff084
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 10:54:12 +0000
//
__int64 __fastcall sub_1800D7C40(__int64 a1, int a2, int a3, _DWORD *a4)
{
__int64 v4; // rbx
__int64 v7; // rax
v4 = a3;
if ( a4 && a3 >= 0 )
{
v7 = sub_1800D7E40();
if ( v7 )
{
if ( (int)v4 < *(_DWORD *)v7 )
{
*a4 = *(_DWORD *)(*(_QWORD *)(v7 + 8) + 4 * v4);
return 0;
}
}
else if ( !(_DWORD)v4 )
{
*a4 = a2;
return 0;
}
}
return 31;
}