//
// 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 (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:40:43 +0000
//
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);
}