//
// EditLevelLayer::verifyLevelName from 0x14017cfa0 to 0x14017d27d (733 bytes)
//
// 5 xrefs:
// > EditLevelLayer::onPlay @ 0x14017b3e0
// > EditLevelLayer::onEdit @ 0x14017b898
// > EditLevelLayer::FLAlert_Clicked @ 0x14017c346
// > EditLevelLayer::onBack @ 0x14017ce2b
// > ??> @ 0x1409187f4
//
// This function is hookable on this platform (idp: pc, 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:27:35 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall EditLevelLayer::verifyLevelName(__int64 a1)
{
int v2; // r14d
__int64 v3; // rbx
__int64 v4; // rbx
void **v5; // rcx
void **v6; // rdx
void **v7; // rcx
void **v8; // rcx
int v9; // ebx
__int64 v10; // rcx
__int64 v11; // r13
__int64 v12; // rcx
cocos2d::CCArray *v13; // rsi
unsigned int i; // edi
struct cocos2d::CCObject *v15; // r15
int v16; // ebx
unsigned int j; // edi
int v18; // ebx
char v19[8]; // [rsp+28h] [rbp-61h] BYREF
__int64 v20; // [rsp+30h] [rbp-59h]
__int64 v21; // [rsp+38h] [rbp-51h]
__int64 v22; // [rsp+40h] [rbp-49h]
void *Src[5]; // [rsp+48h] [rbp-41h] BYREF
_QWORD Buf1[2]; // [rsp+70h] [rbp-19h] BYREF
__int64 v25; // [rsp+80h] [rbp-9h]
_QWORD v26[4]; // [rsp+90h] [rbp+7h] BYREF
v2 = 0;
sub_14003F4F0((__int64)Buf1, *(_QWORD *)(a1 + 472) + 344LL);
v3 = v25;
sub_14003D310((__int64)Buf1);
if ( !v3 )
{
sub_14003F4F0((__int64)Buf1, *(_QWORD *)(a1 + 472) + 1232LL);
v4 = v25;
sub_14003D310((__int64)Buf1);
if ( v4 )
{
sub_14003F4F0((__int64)Src, *(_QWORD *)(a1 + 472) + 1232LL);
v5 = (void **)(*(_QWORD *)(a1 + 472) + 344LL);
if ( v5 != Src )
{
v6 = Src;
if ( Src[3] > (void *)0xF )
v6 = (void **)Src[0];
sub_1400405A0(v5, v6, (size_t)Src[2]);
}
v7 = Src;
}
else
{
v20 = 0;
v21 = 7;
v22 = 15;
strcpy(v19, "Unknown");
v8 = (void **)(*(_QWORD *)(a1 + 472) + 344LL);
if ( v8 != (void **)v19 )
sub_1400405A0(v8, v19, 7u);
v7 = (void **)v19;
}
sub_14003D310((__int64)v7);
}
sub_14003F4F0((__int64)Buf1, *(_QWORD *)(a1 + 472) + 344LL);
v9 = sub_14003D160(Buf1, (_QWORD *)(a1 + 504));
sub_14003D310((__int64)Buf1);
if ( v9 )
{
*(_DWORD *)(*(_QWORD *)(a1 + 472) + 684LL) = 0;
sub_14003F4F0((__int64)Buf1, *(_QWORD *)(a1 + 472) + 344LL);
Src[4] = Buf1;
v11 = LocalLevelManager::sharedState(v10);
v13 = (cocos2d::CCArray *)cocos2d::CCArray::create(v12);
for ( i = 0; i < cocos2d::CCArray::count(*(cocos2d::CCArray **)(v11 + 368)); ++i )
{
v15 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(v11 + 368), i);
sub_14003F4F0((__int64)v26, (__int64)v15 + 344);
v16 = sub_14003D160(v26, Buf1);
sub_14003D310((__int64)v26);
if ( !v16 )
cocos2d::CCArray::addObject(v13, v15);
}
sub_14003D310((__int64)Buf1);
if ( cocos2d::CCArray::count(v13) > 1 )
{
for ( j = 0; j < cocos2d::CCArray::count(v13); v2 = v18 )
{
v18 = *((_DWORD *)cocos2d::CCArray::objectAtIndex(v13, j) + 171);
if ( v2 > v18 )
v18 = v2;
++j;
}
*(_DWORD *)(*(_QWORD *)(a1 + 472) + 684LL) = v2 + 1;
}
}
}