//
// sub_100374C1C from 0x100374c1c to 0x100374ce0 (196 bytes)
//
// 4 xrefs:
// > GJAccountSettingsLayer::init @ 0x10037467c
// > GJAccountSettingsLayer::init @ 0x100373f68
// > GJAccountSettingsLayer::init @ 0x100374008
// > GJAccountSettingsLayer::init @ 0x10037409c
//
// 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:03:24 +0000
//
__int64 __fastcall sub_100374C1C(__int64 result, __int64 a2)
{
__int64 v2; // x19
int v3; // w9
int v4; // w8
int v5; // w20
__int64 v6; // x8
unsigned int *v7; // x9
__int64 v8; // x8
__int64 *v9; // x21
unsigned __int64 v10; // x22
__int64 v11; // x19
_BOOL8 v12; // x1
v2 = result;
if ( a2 )
{
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
if ( (_DWORD)result == 2 )
v3 = 2;
else
v3 = 1;
*(_DWORD *)(v2 + 676) = v3;
if ( (_DWORD)result == 3 )
v4 = 1;
else
v4 = 2;
*(_DWORD *)(v2 + 680) = v4;
if ( (_DWORD)result == 3 )
goto LABEL_9;
LABEL_11:
v5 = *(_DWORD *)(v2 + 676);
goto LABEL_12;
}
if ( *(_DWORD *)(result + 680) != 1 )
goto LABEL_11;
LABEL_9:
v5 = 3;
LABEL_12:
v6 = *(_QWORD *)(v2 + 744);
if ( v6 )
{
v7 = *(unsigned int **)(v6 + 56);
v8 = *v7;
if ( (_DWORD)v8 )
{
v9 = *((__int64 **)v7 + 2);
v10 = (unsigned __int64)&v9[v8 - 1];
do
{
v11 = *v9;
if ( !*v9 )
break;
v12 = (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v11 + 64LL))(*v9) != v5;
result = CCMenuItemToggler::toggle(v11, v12);
++v9;
}
while ( (unsigned __int64)v9 <= v10 );
}
}
return result;
}