//
// sub_100405D0C from 0x100405d0c to 0x100405de4 (216 bytes)
//
// 2 xrefs:
// > sub_100041D6C @ 0x100041d8c
// > EditorUI::onPasteState @ 0x10018afcc
//
// 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:41 +0000
//
__int64 __fastcall sub_100405D0C(__int64 result, __int64 a2, __int64 a3)
{
__int64 v4; // x1
__int64 v6; // x21
__int64 v7; // x0
unsigned int *v8; // x9
__int64 v9; // x8
__int64 *v10; // x23
unsigned __int64 v11; // x24
__int64 v12; // x22
v4 = *(_QWORD *)(result + 14120);
if ( v4 )
{
v6 = result;
if ( a2 )
{
sub_1002FF1C8(a2, v4);
*(_BYTE *)(a2 + 1148) = 1;
}
else if ( a3 )
{
v8 = *(unsigned int **)(a3 + 56);
v9 = *v8;
if ( (_DWORD)v9 )
{
v10 = *((__int64 **)v8 + 2);
v11 = (unsigned __int64)&v10[v9 - 1];
do
{
v12 = *v10;
if ( !*v10 )
break;
sub_1002FF1C8(*v10, *(_QWORD *)(v6 + 14120));
*(_BYTE *)(v12 + 1148) = 1;
++v10;
}
while ( (unsigned __int64)v10 <= v11 );
}
}
v7 = GameManager::sharedState();
result = GameManager::getGameVariable(v7, "0156");
if ( (result & 1) == 0 )
return sub_100405DE4(v6, a2, a3);
}
return result;
}