//
// SecretLayer3::revealStep2 from 0x93b0fc to 0x93b554 (1112 bytes)
//
// 3 xrefs:
// > ??> @ 0x6ee20
// > SecretLayer3::revealStep1 @ 0x9421dc
// > ??> @ 0x122ba30
//
// 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 SecretLayer3::revealStep2(SecretLayer3 *a1)
{
cocos2d::CCArray *v2; // x24
cocos2d::CCObject *v3; // x0
void *v4; // x0
void *v5; // x0
cocos2d::CCObject *v6; // x0
void *v7; // x0
void *v8; // x0
cocos2d::CCObject *v9; // x0
void *v10; // x0
void *v11; // x0
DialogLayer *v12; // x19
unsigned int *v13; // x1
int v14; // w2
unsigned int *v15; // x1
int v16; // w2
unsigned int *v17; // x1
int v18; // w2
unsigned int *v19; // x1
int v20; // w2
unsigned int *v21; // x1
int v22; // w2
unsigned int *v23; // x1
int v24; // w2
_QWORD v25[2]; // [xsp+0h] [xbp+0h] BYREF
__int64 v26; // [xsp+78h] [xbp+78h] BYREF
__int64 v27; // [xsp+80h] [xbp+80h] BYREF
v2 = (cocos2d::CCArray *)cocos2d::CCArray::create(_stack_chk_guard);
sub_D153B8((int)&v26, "...");
sub_D153B8((unsigned int)v25 + 128, "I... I am free...?");
v3 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v26, (__int64)&v27, 15, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v3);
v4 = (void *)(v27 - 24);
if ( (__int64 *)(v27 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v13 = (unsigned int *)(v27 - 8);
do
v14 = __ldaxr(v13);
while ( __stlxr(v14 - 1, v13) );
}
else
{
v14 = *(_DWORD *)(v27 - 8);
*(_DWORD *)(v27 - 8) = v14 - 1;
}
if ( v14 <= 0 )
operator delete(v4);
}
v5 = (void *)(v26 - 24);
if ( (__int64 *)(v26 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v15 = (unsigned int *)(v26 - 8);
do
v16 = __ldaxr(v15);
while ( __stlxr(v16 - 1, v15) );
}
else
{
v16 = *(_DWORD *)(v26 - 8);
*(_DWORD *)(v26 - 8) = v16 - 1;
}
if ( v16 <= 0 )
operator delete(v5);
}
sub_D153B8((int)&v26, "...");
sub_D153B8((unsigned int)v25 + 128, "So many years lost. Locked away in that filthy cage...");
v6 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v26, (__int64)&v27, 15, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v6);
v7 = (void *)(v27 - 24);
if ( (__int64 *)(v27 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v17 = (unsigned int *)(v27 - 8);
do
v18 = __ldaxr(v17);
while ( __stlxr(v18 - 1, v17) );
}
else
{
v18 = *(_DWORD *)(v27 - 8);
*(_DWORD *)(v27 - 8) = v18 - 1;
}
if ( v18 <= 0 )
operator delete(v7);
}
v8 = (void *)(v26 - 24);
if ( (__int64 *)(v26 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v19 = (unsigned int *)(v26 - 8);
do
v20 = __ldaxr(v19);
while ( __stlxr(v20 - 1, v19) );
}
else
{
v20 = *(_DWORD *)(v26 - 8);
*(_DWORD *)(v26 - 8) = v20 - 1;
}
if ( v20 <= 0 )
operator delete(v8);
}
sub_D153B8((int)&v26, "...");
sub_D153B8((unsigned int)v25 + 128, "Now that I have my freedom,\nI must continue where I left off.");
v9 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v26, (__int64)&v27, 15, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v9);
v10 = (void *)(v27 - 24);
if ( (__int64 *)(v27 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v21 = (unsigned int *)(v27 - 8);
do
v22 = __ldaxr(v21);
while ( __stlxr(v22 - 1, v21) );
}
else
{
v22 = *(_DWORD *)(v27 - 8);
*(_DWORD *)(v27 - 8) = v22 - 1;
}
if ( v22 <= 0 )
operator delete(v10);
}
v11 = (void *)(v26 - 24);
if ( (__int64 *)(v26 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v23 = (unsigned int *)(v26 - 8);
do
v24 = __ldaxr(v23);
while ( __stlxr(v24 - 1, v23) );
}
else
{
v24 = *(_DWORD *)(v26 - 8);
*(_DWORD *)(v26 - 8) = v24 - 1;
}
if ( v24 <= 0 )
operator delete(v11);
}
v12 = DialogLayer::createWithObjects(v2, (int)&byte_4);
a1->addChild_0(a1, v12, 100);
v12->m_delegate = &a1->DialogDelegate;
v12->setTag(v12, 3);
DialogLayer::updateChatPlacement(v12, Top);
DialogLayer::animateIn(v12, FromCenter);
}