//
// CustomizeObjectLayer::getButtonByTag from 0x100058f44 to 0x100058fbc (120 bytes)
//
// 3 xrefs:
// > CustomizeObjectLayer::onNextColorChannel @ 0x1000587a4
// > CustomizeObjectLayer::updateCurrentSelection @ 0x1000589c0
// > CustomizeObjectLayer::colorSetupClosed @ 0x100058ce8
//
// 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:57:47 +0000
//
__int64 __fastcall CustomizeObjectLayer::getButtonByTag(__int64 a1, int a2)
{
__int64 v4; // x21
__int64 v5; // x22
if ( !(unsigned int)sub_1002E757C(*(_QWORD *)(a1 + 704)) )
return 0;
v4 = 0;
while ( 1 )
{
v5 = sub_1002E75A0(*(_QWORD *)(a1 + 704), v4);
if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v5 + 64LL))(v5) == a2 )
break;
v4 = (unsigned int)(v4 + 1);
if ( (unsigned int)v4 >= (unsigned int)sub_1002E757C(*(_QWORD *)(a1 + 704)) )
return 0;
}
return v5;
}