//
// sub_B7E3AC from 0xb7e3ac to 0xb7e560 (436 bytes)
//
// 2 xrefs:
// > sub_B7E560 @ 0xb7e748
// > sub_B7F490 @ 0xb801f0
//
// 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_B7E3AC(__int64 *a1)
{
__int64 v1; // x1
__int64 v2; // x3
__int64 *v3; // x19
const char *v4; // x4
int v5; // w2
__int64 v6; // x2
int v7; // w20
__int64 result; // x0
const char *v9; // x2
__int64 *v10; // x19
int v11; // w1
__int64 *v12; // x19
const char *v13; // x2
v1 = *a1;
if ( !*(_BYTE *)(*a1 + 1553) && !*(_DWORD *)(v1 + 1056) )
{
v2 = *(_QWORD *)(v1 + 536);
if ( !*(_BYTE *)(v1 + 1568) )
{
v11 = *(_DWORD *)(v2 + 24);
if ( v11 == 1 )
{
v13 = (const char *)a1[212];
v3 = a1 + 195;
if ( v13 )
goto LABEL_24;
return sub_B7E798();
}
LABEL_16:
if ( v11 )
{
v12 = a1 + 195;
if ( a1[212] )
{
result = sub_BAA4B0(a1 + 195, "REST %d", 0);
if ( !(_DWORD)result )
*((_DWORD *)v12 + 44) = 26;
return result;
}
}
return sub_B7E798();
}
v3 = a1 + 195;
v4 = (const char *)a1[212];
if ( v4 )
{
v5 = *((unsigned __int8 *)a1 + 1720);
if ( *(_BYTE *)(v1 + 1555) )
{
if ( v5 != 65 )
{
v6 = 65;
v7 = 65;
*(_DWORD *)(v2 + 24) = 1;
goto LABEL_8;
}
}
else if ( v5 != 73 )
{
v6 = 73;
v7 = 73;
*(_DWORD *)(v2 + 24) = 1;
LABEL_8:
if ( *((unsigned __int8 *)a1 + 1720) == v7 )
{
*((_DWORD *)a1 + 434) = 19;
result = sub_BAA4B0(v3, "SIZE %s", v4);
if ( !(_DWORD)result )
{
*((_DWORD *)v3 + 44) = 23;
return 0;
}
}
else
{
result = sub_BAA4B0(v3, "TYPE %c", v6);
if ( !(_DWORD)result )
{
*((_BYTE *)v3 + 160) = v7;
*((_DWORD *)v3 + 44) = 19;
return 0;
}
}
return result;
}
v11 = *(_DWORD *)(v2 + 24);
if ( v11 == 1 )
{
v13 = (const char *)a1[212];
LABEL_24:
result = sub_BAA4B0(v3, "SIZE %s", v13);
if ( !(_DWORD)result )
*((_DWORD *)v3 + 44) = 23;
return result;
}
goto LABEL_16;
}
LABEL_21:
v11 = *(_DWORD *)(v2 + 24);
if ( v11 == 1 )
return sub_B7E798();
goto LABEL_16;
}
v9 = (const char *)a1[212];
v10 = a1 + 195;
if ( !v9 )
{
v2 = *(_QWORD *)(v1 + 536);
goto LABEL_21;
}
result = sub_BAA4B0(a1 + 195, "MDTM %s", v9);
if ( !(_DWORD)result )
*((_DWORD *)v10 + 44) = 18;
return result;
}