//
// sub_838F0 from 0x838f0 to 0x839cc (220 bytes)
//
// 1 xrefs:
// > sub_639EC @ 0x63a6c
//
// 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
//
bool __fastcall sub_838F0(__int64 a1, unsigned __int8 *a2)
{
__int64 v4; // x12
__int64 v5; // x11
__int64 v6; // x12
_BOOL4 v7; // w13
int v8; // w16
int v9; // w12
_BOOL4 v10; // w14
_BOOL4 v11; // w15
_BOOL4 v12; // w16
int v13; // w20
int v15; // [xsp+Ch] [xbp-14h] BYREF
if ( !*(_BYTE *)(a1 + 720) )
{
sub_E694C(&v15);
v4 = 0;
while ( 1 )
{
v5 = v4 + 16;
if ( v4 == 512 )
break;
v6 = a1 + v4;
v7 = *(unsigned __int8 *)(v6 + 724) == *a2
&& (*(unsigned __int8 *)(v6 + 725) == 255 || *(unsigned __int8 *)(v6 + 725) == a2[1]);
v8 = *(_DWORD *)(v6 + 728);
v9 = *(_DWORD *)(v6 + 732);
v10 = v8 == -1;
v11 = v9 == 0;
v12 = v15 - v9 > v8;
v4 = v5;
if ( v7 )
{
v4 = v5;
if ( v10 || v11 || v12 )
{
v13 = *(_DWORD *)(a1 + v5 + 720);
return (int)sub_82D94(a1 + 1240) >= v13;
}
}
}
}
return 0;
}