//
// sub_100669304 from 0x100669304 to 0x1006693dc (216 bytes)
//
// 1 xrefs:
// > sub_100669274 @ 0x1006692c0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:11:02 +0000
//
__int64 __fastcall sub_100669304(__int64 result, __int64 *a2)
{
__int64 v3; // x19
__int64 v4; // x8
__int64 v5; // x0
__int64 v6; // x10
_QWORD *v7; // x9
__int64 v8; // x8
_QWORD *v9; // x12
_QWORD *v10; // x11
void (*v11)(void); // x8
v3 = result;
v4 = a2[1];
if ( !v4 || v4 > *(_QWORD *)(result + 200) + *(_QWORD *)(result + 208) )
{
sub_10070512C(a2[2], result);
v5 = *a2;
v6 = *(_QWORD *)(v3 + 272);
if ( v6 )
{
v7 = *(_QWORD **)(v3 + 264);
if ( v7 )
{
v8 = v3 + 264;
v9 = (_QWORD *)(v5 + 56);
v10 = (_QWORD *)(v5 + 48);
if ( v6 == v5 + 56 )
{
if ( v7 == v10 )
{
*v10 = 0;
*(_QWORD *)(v5 + 56) = 0;
}
else
{
*v9 = v7;
v7[34] = v9;
}
}
else if ( v7 == v10 )
{
*v10 = v6;
*(_QWORD *)(v6 + 264) = v10;
}
else
{
*(_QWORD *)(v6 + 264) = v7;
*(_QWORD *)(*(_QWORD *)v8 + 272LL) = v6;
}
*(_QWORD *)v8 = 0;
*(_QWORD *)(v3 + 272) = 0;
v5 = *a2;
}
}
*(_DWORD *)(v3 + 160) = 1;
v11 = *(void (**)(void))(v5 + 88);
if ( v11 )
v11();
return sub_100668448(v3);
}
return result;
}