//
// sub_1800D21F0 from 0x1800d21f0 to 0x1800d229d (173 bytes)
//
// 4 xrefs:
// > FMOD::Geometry::getPolygonAttributes @ 0x1800a445c
// > ??> @ 0x18018be0c
// > ??> @ 0x18018be1c
// > ??> @ 0x1801fec34
//
// 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_1800D21F0(__int64 a1, int a2, _DWORD *a3, _DWORD *a4, _BYTE *a5)
{
__int64 v5; // rdi
struct _RTL_CRITICAL_SECTION *v9; // rbp
__int64 v10; // r8
v5 = a2;
if ( a2 < 0 || a2 >= *(_DWORD *)(a1 + 44) )
return 31;
v9 = *(struct _RTL_CRITICAL_SECTION **)(*(_QWORD *)(a1 + 24) + 400LL);
FMOD_OS_CriticalSection_Enter(v9);
v10 = *(_QWORD *)(a1 + 64) + *(int *)(*(_QWORD *)(a1 + 48) + 4 * v5);
if ( a3 )
*a3 = *(_DWORD *)(v10 + 176);
if ( a4 )
*a4 = *(_DWORD *)(v10 + 180);
if ( a5 )
*a5 = *(_BYTE *)(v10 + 186) & 1;
FMOD_OS_CriticalSection_Leave(v9);
return 0;
}