//
// sub_62A1DC from 0x62a1dc to 0x62a254 (120 bytes)
//
// 2 xrefs:
// > sub_62E8F8 @ 0x62e948
// > ??> @ 0x62f108
//
// 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_62A1DC(int (*result)(void), _DWORD *a2, int a3))(void)
{
int (*v3)(void); // r4
int v4; // r5
int (*v5)(void); // r3
int v6; // r2
bool v8; // zf
int v9; // r1
int v10; // r5
int v11; // r2
v3 = result;
v4 = *(_DWORD *)result;
v5 = *(int (**)(void))(*((_DWORD *)result + 166) + 44);
if ( v5 )
return (int (*)(void))v5();
if ( a3 <= 1 )
return v5;
v6 = *(_DWORD *)(v4 + 304);
v8 = (v6 & 0x15) == 1;
if ( (v6 & 0x15) == 1 )
{
v6 = *((_DWORD *)result + 169);
result = (int (*)(void))((char *)&stru_1FFFC.st_value + 1);
v5 = (int (*)(void))(&dword_0 + 1);
v9 = 65537;
}
else
{
v9 = 0x10000;
}
if ( (*(_DWORD *)(v4 + 304) & 0x15) == 1 )
*a2 = v6;
else
result = (int (*)(void))(&stru_1FFFC + 4);
if ( v8 )
v6 = *(_DWORD *)(v4 + 304);
if ( (v6 & 0x2A) != 2 )
return v5;
v10 = *((_DWORD *)v3 + 170);
v11 = *((_DWORD *)v3 + 169);
if ( v11 != v10 )
{
if ( v5 )
v11 = 4;
else
result = (int (*)(void))v9;
if ( !v5 )
v11 = 0;
goto LABEL_21;
}
result = (int (*)(void))v9;
if ( !v5 )
{
v11 = 0;
LABEL_21:
*(_DWORD *)((char *)a2 + v11) = v10;
}
return result;
}