//
// sub_51802 from 0x51802 to 0x51846 (68 bytes)
//
// 3 xrefs:
// > sub_50EB0 @ 0x50ebe
// > sub_51AF4 @ 0x51afc
// > sub_51B12 @ 0x51b2e
//
// 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
//
int __fastcall sub_51802(int a1, int a2, int a3, int a4)
{
int v7; // [sp+4h] [bp-14h] BYREF
int v8; // [sp+8h] [bp-10h] BYREF
int v9; // [sp+Ch] [bp-Ch]
v7 = a2;
v8 = a3;
v9 = a4;
if ( !sub_51A4C(a1) )
return *(_DWORD *)(v9 + 68);
if ( !sub_519F8(a1, a2, &v8) )
return *(_DWORD *)(v8 + 148);
if ( sub_51A22(a1, a2, &v7) )
return 0;
return *(_DWORD *)(v7 + 140);
}