//
// sub_1003AB6B4 from 0x1003ab6b4 to 0x1003ab744 (144 bytes)
//
// 2 xrefs:
// > sub_1003AB648 @ 0x1003ab67c
// > sub_1003AD50C @ 0x1003addac
//
// 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_1003AB6B4(__int64 a1, __int64 *a2)
{
__int64 v3; // x10
__int64 result; // x0
__int64 v5; // x8
__int64 v6; // x8
__int64 *v7; // x8
__int64 v8; // t1
__int64 v9; // [xsp+8h] [xbp-18h] BYREF
v3 = a2[1];
if ( (unsigned __int64)(v3 + 40) <= 0x8000 )
{
v5 = *a2;
result = *a2 + v3 + 48;
a2[1] = v3 + 40;
}
else
{
result = sub_1003AD290(a2, 40, &v9);
v5 = v9;
}
*(_QWORD *)result = v5;
*(_OWORD *)(result + 8) = 0u;
*(_OWORD *)(result + 24) = 0u;
v6 = *(_QWORD *)(a1 + 56);
if ( v6 )
{
v8 = *(_QWORD *)(v6 + 24);
v7 = (__int64 *)(v6 + 24);
*(_QWORD *)(v8 + 32) = result;
*(_QWORD *)(result + 24) = v8;
}
else
{
*(_QWORD *)(a1 + 56) = result;
v7 = (__int64 *)(result + 24);
}
*v7 = result;
return result;
}