//
// sub_10040DD30 from 0x10040dd30 to 0x10040ddb8 (136 bytes)
//
// 3 xrefs:
// > sub_1001F489C @ 0x1001f4ac0
// > sub_1001F4EF8 @ 0x1001f4fb4
// > sub_10021378C @ 0x100213830
//
// 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:04:47 +0000
//
__int64 *__usercall sub_10040DD30@(__int64 a1@, __int64 a2@, unsigned int a3@, _QWORD *a4@)
{
__int64 *result; // x0
__int128 v7; // q0
unsigned __int64 v8; // [xsp+8h] [xbp-18h] BYREF
v8 = a3 | (unsigned __int64)(a2 << 32);
result = sub_1001E728C(a1 + 584, (int *)&v8);
if ( (__int64 *)(a1 + 592) == result )
return sub_100009900(a4, "");
if ( *((char *)result + 63) < 0 )
return (__int64 *)sub_1000097D0(a4, (void *)result[5], result[6]);
v7 = *(_OWORD *)(result + 5);
a4[2] = result[7];
*(_OWORD *)a4 = v7;
return result;
}