//
// sub_100682E10 from 0x100682e10 to 0x100682ecc (188 bytes)
//
// 2 xrefs:
// > sub_10068D864 @ 0x10068d8d4
// > sub_100693C98 @ 0x100693e44
//
// This function is hookable on this platform (idp: arm, 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 11:11:18 +0000
//
__int64 __fastcall sub_100682E10(__int64 a1, __int64 **a2, _BYTE *a3, _BYTE *a4)
{
__int64 v7; // x20
__int64 v8; // x0
*a3 = 0;
v7 = sub_100682ECC();
if ( !(_DWORD)v7 )
{
v8 = (__int64)*a2;
if ( *(_QWORD *)((*a2)[115] + 24) || *(_QWORD *)(*(_QWORD *)(v8 + 928) + 24LL) )
{
v7 = 0;
*a4 = 1;
return v7;
}
if ( *a3 )
return 0;
v7 = sub_100682CAC(v8, a4);
}
if ( !(_DWORD)v7 )
return 0;
if ( (_DWORD)v7 == 89 )
{
*a2 = nullptr;
return 89;
}
else if ( *a2 )
{
sub_1006825B8(*a2, 0);
*a2 = nullptr;
}
return v7;
}