//
// sub_100666600 from 0x100666600 to 0x1006666ac (172 bytes)
//
// 2 xrefs:
// > sub_100669170 @ 0x1006691d0
// > sub_100669170 @ 0x100669238
//
// 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:01 +0000
//
__int64 __fastcall sub_100666600(__int64 a1, __int64 a2)
{
__int64 v4; // x8
__int64 v5; // x9
int v6; // w21
__int64 result; // x0
__int64 v8; // x8
v4 = *(_QWORD *)(a1 + 8);
if ( v4 == a2 )
return 1;
v5 = *(_QWORD *)(a1 + 48);
if ( v5 )
v6 = v5 == *(_QWORD *)(v4 + 40);
else
v6 = -1;
if ( *(_DWORD *)v4 == *(_DWORD *)a2 )
{
*(_QWORD *)(a1 + 8) = a2;
result = 1;
}
else
{
(*(void (__fastcall **)(__int64))(v4 + 24))(a1);
*(_QWORD *)(a1 + 8) = a2;
result = (*(__int64 (__fastcall **)(__int64))(a2 + 8))(a1);
}
if ( v6 )
{
if ( v6 != 1 )
return result;
v8 = *(_QWORD *)(a2 + 40);
}
else
{
v8 = *(_QWORD *)(a2 + 32);
}
*(_QWORD *)(a1 + 48) = v8;
return result;
}