//
// LevelInfoLayer::numberInputClosed from 0x6d6840 to 0x6d6a5c (540 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'LevelInfoLayer::numberInputClosed @ 0x6d6a64
// > ??> @ 0x9c8d0
// > ??> @ 0x115b6a0
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void LevelInfoLayer::numberInputClosed(LevelInfoLayer *a1, NumberInputLayer *a2)
{
int v3; // w0
int v4; // w1
FLAlertLayer *v5; // x22
void *v6; // x0
char *v7; // x1
char *v8; // x0
unsigned int *v9; // x1
int v10; // w2
unsigned int *v11; // x1
int v12; // w2
char *v13; // [xsp+48h] [xbp+48h] BYREF
__int64 v14; // [xsp+50h] [xbp+50h] BYREF
sub_D18D28(&v13, &a2->m_inputString);
v3 = atoi(v13);
v4 = a1->m_level->m_password.random - a1->m_level->m_password.seed;
if ( v3 + 1000000 == v4 || v3 + 10000 == v4 )
{
LevelInfoLayer::confirmClone(a1, nullptr);
v7 = v13;
v8 = v13 - 24;
if ( v13 - 24 == (char *)&qword_124B6B0 )
return;
goto LABEL_7;
}
sub_D153B8((int)&v14, "Incorrect password!");
v5 = FLAlertLayer::create(0, (__int64)"Error", (__int64)&v14);
v6 = (void *)(v14 - 24);
if ( (__int64 *)(v14 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v11 = (unsigned int *)(v14 - 8);
do
v12 = __ldaxr(v11);
while ( __stlxr(v12 - 1, v11) );
}
else
{
v12 = *(_DWORD *)(v14 - 8);
*(_DWORD *)(v14 - 8) = v12 - 1;
}
if ( v12 <= 0 )
operator delete(v6);
}
v5->show(v5);
++a1->m_level->m_failedPasswordAttempts;
v7 = v13;
v8 = v13 - 24;
if ( v13 - 24 != (char *)&qword_124B6B0 )
{
LABEL_7:
if ( &pthread_create )
{
v9 = (unsigned int *)(v7 - 8);
do
v10 = __ldaxr(v9);
while ( __stlxr(v10 - 1, v9) );
}
else
{
v10 = *((_DWORD *)v7 - 2);
*((_DWORD *)v7 - 2) = v10 - 1;
}
if ( v10 <= 0 )
operator delete(v8);
}
}