//
// sub_1001E1B7C from 0x1001e1b7c to 0x1001e1c2c (176 bytes)
//
// 3 xrefs:
// > sub_1001E1830 @ 0x1001e1958
// > sub_1001E1830 @ 0x1001e1a4c
// > sub_1001E1830 @ 0x1001e1a74
//
// 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:00:30 +0000
//
__int64 __fastcall sub_1001E1B7C(__int64 a1, __int64 a2)
{
__int64 result; // x0
__int64 v5; // x21
__int64 v6; // x22
void *__p[2]; // [xsp+0h] [xbp-40h] BYREF
__int64 v8; // [xsp+10h] [xbp-30h]
result = sub_1002E757C(*(_QWORD *)(a1 + 336));
if ( (_DWORD)result )
{
v5 = 0;
do
{
v6 = *(_QWORD *)(sub_1002E75A0(*(_QWORD *)(a1 + 336), v5) + 320);
if ( *(char *)(a2 + 23) < 0 )
{
sub_1000097D0(__p, *(void **)a2, *(_QWORD *)(a2 + 8));
}
else
{
*(_OWORD *)__p = *(_OWORD *)a2;
v8 = *(_QWORD *)(a2 + 16);
}
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v6 + 88LL))(v6, __p);
if ( SHIBYTE(v8) < 0 )
operator delete(__p[0]);
v5 = (unsigned int)(v5 + 1);
result = sub_1002E757C(*(_QWORD *)(a1 + 336));
}
while ( (unsigned int)v5 < (unsigned int)result );
}
return result;
}