//
// sub_100666A2C from 0x100666a2c to 0x100666aa0 (116 bytes)
//
// 4 xrefs:
// > sub_10064EDE8 @ 0x10064eebc
// > sub_10064EDE8 @ 0x10064ef2c
// > sub_10065BA8C @ 0x10065bb84
// > sub_10065BA8C @ 0x10065bbc4
//
// 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_100666A2C(__int64 *a1, __int64 a2)
{
__int64 v4; // x0
__int64 result; // x0
__int64 v6; // x8
int v7; // w9
v4 = *a1;
if ( v4 )
v4 = sub_100709690(v4);
*a1 = 0;
result = sub_100708F6C(v4);
v6 = 0;
*a1 = result;
if ( !result || a2 && (v7 = sub_100708FB4(result, a2, 0), v6 = *a1, result = *a1, v7 <= 0) )
{
sub_100709690(v6);
*a1 = 0;
return 0;
}
return result;
}