//
// sub_100661584 from 0x100661584 to 0x10066164c (200 bytes)
//
// 9 xrefs:
// > ??> @ 0x1009aea78
// > ??> @ 0x1009aeb60
// > ??> @ 0x1009aec48
// > ??> @ 0x1009aed30
// > ??> @ 0x1009aee18
// > ??> @ 0x1009aef00
// > ??> @ 0x1009aefe8
// > ??> @ 0x1009af0d0
// > ??> @ 0x1009af1b8
//
// 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:10:58 +0000
//
__int64 __fastcall sub_100661584(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
__int64 result; // x0
__int64 v9; // x2
__int64 v10; // x4
if ( (sub_100664E84(a1) & 0x3000) == 0 || *(_DWORD *)(a1 + 44) )
goto LABEL_5;
result = (*(__int64 (__fastcall **)(__int64))(a1 + 48))(a1);
if ( (result & 0x80000000) != 0 )
return result;
if ( (_DWORD)result )
{
LABEL_5:
if ( (int)a4 <= 0x4000 )
{
*(_DWORD *)(a1 + 40) = 1;
return sub_1006616B8(a1, a2, a3, a4, 0);
}
v9 = 334;
v10 = 1434;
}
else
{
v9 = 229;
v10 = 1428;
}
sub_100706FB0(20, 268, v9, "d1_pkt.c", v10);
return 0xFFFFFFFFLL;
}