//
// sub_610B0 from 0x610b0 to 0x61190 (224 bytes)
//
// 1 xrefs:
// > sub_5D9B4 @ 0x5da44
//
// 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_610B0(__int64 *result, __int64 a2)
{
int v2; // w8
__int64 *v4; // x20
__int64 v5; // x19
__int64 v6; // x8
__int64 *v7; // x8
__int64 v8; // t1
__int64 v9; // x8
__int64 v10; // x8
__int64 v11; // x8
__int64 v12; // x8
__int64 v13; // x9
__int64 v14; // x9
v2 = *(_DWORD *)(a2 + 24);
if ( (v2 & 0x400) != 0 )
{
v4 = result;
*(_DWORD *)(a2 + 24) = v2 & 0xFFFFFBFF;
if ( (v2 & 0x20) != 0 )
{
v12 = *(_QWORD *)(a2 + 48);
v13 = *(_QWORD *)(a2 + 72);
if ( v12 )
{
*(_QWORD *)(v12 + 72) = v13;
v14 = *(_QWORD *)(a2 + 72);
if ( v14 )
*(_QWORD *)(v14 + 48) = v12;
}
else
{
result[3] = v13;
if ( v13 )
*(_QWORD *)(v13 + 48) = 0;
}
}
else
{
v5 = sub_61190(result);
result = (__int64 *)memcpy((void *)v5, (const void *)a2, 0x50u);
v6 = *(_QWORD *)(v5 + 48);
*(_DWORD *)(v5 + 24) |= 0x400u;
if ( v6 )
{
v4 = (__int64 *)(v6 + 72);
if ( *(_QWORD *)(v6 + 72) != a2 )
{
v8 = *(_QWORD *)(v6 + 56);
v7 = (__int64 *)(v6 + 56);
if ( v8 == a2 )
v4 = v7;
else
v4 = v7 + 1;
}
}
*v4 = v5;
v9 = *(_QWORD *)(v5 + 72);
if ( v9 )
*(_QWORD *)(v9 + 48) = v5;
v10 = *(_QWORD *)(v5 + 56);
if ( v10 )
*(_QWORD *)(v10 + 48) = v5;
v11 = *(_QWORD *)(v5 + 64);
if ( v11 )
*(_QWORD *)(v11 + 48) = v5;
}
}
return result;
}