//
// sub_100602E7C from 0x100602e7c to 0x100602fb0 (308 bytes)
//
// 4 xrefs:
// > sub_100520EC8 @ 0x100520f5c
// > sub_100524748 @ 0x100524868
// > sub_10052CC14 @ 0x10052ccbc
// > sub_100534FD8 @ 0x10053569c
//
// 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_100602E7C(__int64 a1, _BYTE *a2)
{
_BYTE *v4; // x20
int v5; // w8
unsigned int v6; // w9
int v7; // w11
unsigned int v8; // w10
int v9; // w12
int v10; // w11
__int64 v11; // x21
int v12; // w0
int v14; // [xsp+Ch] [xbp-24h] BYREF
if ( !a1 )
return 0;
v4 = a2;
if ( !a2 )
{
v4 = sub_1005FF0F0(a1);
if ( !v4 )
return 0;
}
v5 = *(_DWORD *)v4;
if ( (unsigned int)(*(_DWORD *)v4 - 811) >= 2 )
v6 = 0;
else
v6 = 80;
if ( v5 == 408 )
v7 = 88;
else
v7 = 0;
if ( v5 == 116 )
v8 = 18;
else
v8 = v7;
if ( v5 == 28 )
v9 = 68;
else
v9 = 0;
if ( v5 == 6 )
v10 = 49;
else
v10 = v9;
if ( v5 <= 115 )
v8 = v10;
if ( v5 <= 810 )
v11 = v8;
else
v11 = v6;
v12 = sub_10058AE10(**(_QWORD **)(a1 + 8));
v14 = v12;
if ( v12 && (unsigned int)sub_10058C078(v12, nullptr, &v14) )
{
if ( v14 > 407 )
{
if ( v14 == 408 )
v11 = (unsigned int)v11 | 0x400;
}
else if ( v14 > 66 )
{
if ( v14 == 67 || v14 == 116 )
v11 = (unsigned int)v11 | 0x200;
}
else if ( v14 == 6 || v14 == 19 )
{
v11 = (unsigned int)v11 | 0x100;
}
}
if ( !a2 )
sub_1005E9A8C((__int64)v4);
return v11;
}