//
// sub_B938D4 from 0xb938d4 to 0xb939a4 (208 bytes)
//
// 1 xrefs:
// > sub_B9A1C4 @ 0xb9a2ac
//
// 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_B938D4(__int64 result, _DWORD *a2, int a3)
{
__int64 v3; // x4
__int64 v5; // x5
__int64 (*v6)(void); // x3
int v7; // w2
unsigned int v8; // w1
int v9; // w2
__int64 v10; // x1
v3 = result;
v5 = *(_QWORD *)result;
v6 = *(__int64 (**)(void))(*(_QWORD *)(result + 1024) + 88LL);
if ( v6 )
return v6();
if ( a3 <= 1 )
return (unsigned int)v6;
if ( (*(_DWORD *)(v5 + 484) & 0x15) == 1 )
{
*a2 = *(_DWORD *)(result + 1048);
LODWORD(v6) = 1;
v8 = 65537;
LODWORD(result) = 131073;
v7 = *(_DWORD *)(v5 + 484);
}
else
{
LOBYTE(v7) = *(_DWORD *)(v5 + 484);
v8 = 0x10000;
LODWORD(result) = 0x20000;
}
if ( (v7 & 0x2A) != 2 )
return (unsigned int)v6;
v9 = *(_DWORD *)(v3 + 1052);
if ( *(_DWORD *)(v3 + 1048) == v9 )
{
result = v8;
if ( !(_DWORD)v6 )
*a2 = v9;
}
else
{
if ( (_DWORD)v6 )
result = (unsigned int)result;
else
result = v8;
v10 = 1;
if ( !(_DWORD)v6 )
v10 = 0;
a2[v10] = v9;
}
return result;
}