//
// sub_1003E1B18 from 0x1003e1b18 to 0x1003e1c10 (248 bytes)
//
// 2 xrefs:
// > sub_1003E0E90 @ 0x1003e12cc
// > SetupGradientPopup::updateToggleItem @ 0x1003e1f74
//
// 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:23 +0000
//
__int64 __fastcall sub_1003E1B18(__int64 a1, int a2)
{
__int64 result; // x0
signed int v5; // w20
bool v6; // zf
const char *v7; // x21
const char *v8; // x22
const char *v9; // x23
const char *v10; // x24
__int64 v11; // x0
const char *v12; // x1
result = sub_1002E757C(*(_QWORD *)(a1 + 1048));
if ( (_DWORD)result )
{
v5 = 0;
v6 = a2 == 0;
if ( a2 )
v7 = "TR:";
else
v7 = "R:";
if ( v6 )
v8 = "L:";
else
v8 = "TL:";
if ( v6 )
v9 = "D:";
else
v9 = "BR:";
if ( v6 )
v10 = "U:";
else
v10 = "BL:";
while ( 1 )
{
v11 = sub_1002E75A0(*(_QWORD *)(a1 + 1048), v5);
if ( v5 <= 1 )
break;
v12 = v8;
if ( v5 == 2 )
goto LABEL_21;
if ( v5 == 3 )
{
v12 = v7;
LABEL_21:
(*(void (__fastcall **)(__int64, const char *))(*(_QWORD *)v11 + 928LL))(v11, v12);
}
LABEL_22:
++v5;
result = sub_1002E757C(*(_QWORD *)(a1 + 1048));
if ( v5 >= (unsigned int)result )
return result;
}
v12 = v10;
if ( v5 )
{
v12 = v9;
if ( v5 != 1 )
goto LABEL_22;
}
goto LABEL_21;
}
return result;
}