//
// sub_1001231E8 from 0x1001231e8 to 0x1001232a8 (192 bytes)
//
// 20 xrefs:
// > CustomSongWidget::updateWithMultiAssets @ 0x100121f70
// > CustomSongWidget::updateWithMultiAssets @ 0x100122018
// > CustomSongWidget::downloadAssetFinished @ 0x100122c90
// > sub_1001953C0 @ 0x100195504
// > SetupTriggerPopup::valueChanged @ 0x1001ae4c0
// > SetupTriggerPopup::triggerArrowChanged @ 0x1001aeacc
// > SetupTriggerPopup::triggerArrowChanged @ 0x1001aeafc
// > SetupTriggerPopup::triggerArrowChanged @ 0x1001aeb48
// > SetupTriggerPopup::triggerArrowChanged @ 0x1001aeb7c
// > sub_1001AEBDC @ 0x1001aec14
// > sub_1001B17E0 @ 0x1001b1818
// > sub_1002C49D8 @ 0x1002c4a34
// > sub_1002C49D8 @ 0x1002c4a64
// > PlayerObject::pushButton @ 0x1002c4b58
// > PlayerObject::releaseButton @ 0x1002c59f8
// > PlayerObject::enablePlayerControls @ 0x1002c96b0
// > PlayerObject::enablePlayerControls @ 0x1002c96e0
// > PlayerObject::enablePlayerControls @ 0x1002c9724
// > sub_1002CB2F0 @ 0x1002cb3b0
// > sub_1002CB2F0 @ 0x1002cb3d8
//
// 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 10:59:16 +0000
//
_DWORD *__fastcall sub_1001231E8(__int64 a1, int *a2, __int64 a3, _DWORD **a4)
{
__int64 v6; // x9
_QWORD *v7; // x22
int v8; // w8
_QWORD *v9; // x20
int v10; // w9
_DWORD *v11; // x23
v7 = (_QWORD *)(a1 + 8);
v6 = *(_QWORD *)(a1 + 8);
if ( v6 )
{
v8 = *a2;
while ( 1 )
{
while ( 1 )
{
v9 = (_QWORD *)v6;
v10 = *(_DWORD *)(v6 + 28);
if ( v8 >= v10 )
break;
v6 = *v9;
v7 = v9;
if ( !*v9 )
goto LABEL_10;
}
if ( v10 >= v8 )
break;
v6 = v9[1];
if ( !v6 )
{
v7 = v9 + 1;
goto LABEL_10;
}
}
}
else
{
v9 = (_QWORD *)(a1 + 8);
LABEL_10:
v11 = operator new(0x28u);
v11[7] = **a4;
*((_BYTE *)v11 + 32) = 0;
sub_10000A0F0((__int64 **)a1, (__int64)v9, v7, v11);
return v11;
}
return v9;
}