//
// sub_1004AF374 from 0x1004af374 to 0x1004af3d8 (100 bytes)
//
// 1 xrefs:
// > FMOD::Geometry::getPolygonVertex @ 0x1004ada30
//
// 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_1004AF374(__int64 a1, unsigned int a2, unsigned int a3, __int64 a4)
{
__int64 result; // x0
__int64 v6; // x8
__int64 v7; // x8
__int64 v8; // x9
if ( (a2 & 0x80000000) != 0 )
return 31;
result = 31;
if ( a4 && *(_DWORD *)(a1 + 44) > (signed int)a2 )
{
if ( (a3 & 0x80000000) == 0 )
{
v6 = *(_QWORD *)(a1 + 64) + *(int *)(*(_QWORD *)(a1 + 48) + 4LL * a2);
if ( *(unsigned __int16 *)(v6 + 184) > a3 )
{
result = 0;
v7 = v6 + 12LL * a3;
v8 = *(_QWORD *)(v7 + 188);
*(_DWORD *)(a4 + 8) = *(_DWORD *)(v7 + 196);
*(_QWORD *)a4 = v8;
return result;
}
}
return 31;
}
return result;
}