//
// sub_1004A2828 from 0x1004a2828 to 0x1004a28dc (180 bytes)
//
// 4 xrefs:
// > sub_1004A0E78 @ 0x1004a0ea0
// > sub_1004A1180 @ 0x1004a11d8
// > ColorSelectPopup::textChanged @ 0x1004a27f0
// > ColorSelectPopup::colorSelectClosed @ 0x1004a2a3c
//
// 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:06:03 +0000
//
__int64 __fastcall sub_1004A2828(__int64 a1)
{
__int64 v2; // x0
int v3; // w20
__int64 result; // x0
int v5; // w8
unsigned int v6; // w20
__int64 v7; // x21
int v8; // w22
int v9; // w8
__int64 v10; // x8
int v11; // w9
v2 = *(_QWORD *)(a1 + 680);
if ( v2 )
{
v3 = *(_DWORD *)(a1 + 1176);
result = sub_10042C8B8(v2);
if ( (_DWORD)result == v3 )
v5 = 0;
else
v5 = v3;
*(_DWORD *)(*(_QWORD *)(a1 + 680) + 1628LL) = v5;
}
else
{
result = *(_QWORD *)(a1 + 688);
if ( result )
{
result = sub_1002E757C(result);
if ( (_DWORD)result )
{
v6 = 0;
do
{
v7 = sub_1002E75A0(*(_QWORD *)(a1 + 688), v6);
v8 = *(_DWORD *)(a1 + 1176);
if ( (unsigned int)sub_10042C8B8(v7) == v8 )
v9 = 0;
else
v9 = v8;
*(_DWORD *)(v7 + 1628) = v9;
++v6;
result = sub_1002E757C(*(_QWORD *)(a1 + 688));
}
while ( v6 < (unsigned int)result );
}
}
else
{
v10 = *(_QWORD *)(a1 + 1144);
if ( v10 )
{
v11 = *(_DWORD *)(a1 + 1176);
if ( *(_DWORD *)(v10 + 92) == v11 )
v11 = 0;
*(_DWORD *)(v10 + 120) = v11;
}
}
}
return result;
}