//
// LevelAreaInnerLayer::showFloor1CompleteDialog from 0xa2ddac to 0xa2e410 (1636 bytes)
//
// 3 xrefs:
// > ??> @ 0x54c90
// > LevelAreaInnerLayer::init @ 0xa31060
// > ??> @ 0x122abb0
//
// 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 LevelAreaInnerLayer::showFloor1CompleteDialog(LevelAreaInnerLayer *a1)
{
GameManager *v2; // x0
cocos2d::CCArray *v3; // x0
cocos2d::CCArray *v4; // x22
cocos2d::CCObject *v5; // x0
void *v6; // x0
void *v7; // x0
cocos2d::CCObject *v8; // x0
void *v9; // x0
void *v10; // x0
cocos2d::CCObject *v11; // x0
void *v12; // x0
void *v13; // x0
cocos2d::CCObject *v14; // x0
void *v15; // x0
void *v16; // x0
cocos2d::CCObject *v17; // x0
void *v18; // x0
void *v19; // x0
DialogLayer *v20; // x19
cocos2d::CCDirector *v21; // x0
unsigned int *v22; // x1
int v23; // w2
unsigned int *v24; // x1
int v25; // w2
unsigned int *v26; // x1
int v27; // w2
unsigned int *v28; // x1
int v29; // w2
unsigned int *v30; // x1
int v31; // w2
unsigned int *v32; // x1
int v33; // w2
unsigned int *v34; // x1
int v35; // w2
unsigned int *v36; // x1
int v37; // w2
unsigned int *v38; // x1
int v39; // w2
unsigned int *v40; // x1
int v41; // w2
__int64 v42; // [xsp+78h] [xbp+78h] BYREF
__int64 v43; // [xsp+80h] [xbp+80h] BYREF
v2 = GameManager::sharedState();
GameManager::setUGV(v2, "33", 1);
v4 = (cocos2d::CCArray *)cocos2d::CCArray::create(v3);
sub_D153B8((int)&v42, "Scratch");
sub_D153B8((int)&v43, "Where have you been?!\nI've been looking everywhere for you!");
v5 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v42, (__int64)&v43, 14, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v4, v5);
v6 = (void *)(v43 - 24);
if ( (__int64 *)(v43 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v22 = (unsigned int *)(v43 - 8);
do
v23 = __ldaxr(v22);
while ( __stlxr(v23 - 1, v22) );
}
else
{
v23 = *(_DWORD *)(v43 - 8);
*(_DWORD *)(v43 - 8) = v23 - 1;
}
if ( v23 <= 0 )
operator delete(v6);
}
v7 = (void *)(v42 - 24);
if ( (__int64 *)(v42 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v24 = (unsigned int *)(v42 - 8);
do
v25 = __ldaxr(v24);
while ( __stlxr(v25 - 1, v24) );
}
else
{
v25 = *(_DWORD *)(v42 - 8);
*(_DWORD *)(v42 - 8) = v25 - 1;
}
if ( v25 <= 0 )
operator delete(v7);
}
sub_D153B8((int)&v42, "Scratch");
sub_D153B8((int)&v43, "You really shouldn't be poking around here.");
v8 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v42, (__int64)&v43, 11, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v4, v8);
v9 = (void *)(v43 - 24);
if ( (__int64 *)(v43 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v26 = (unsigned int *)(v43 - 8);
do
v27 = __ldaxr(v26);
while ( __stlxr(v27 - 1, v26) );
}
else
{
v27 = *(_DWORD *)(v43 - 8);
*(_DWORD *)(v43 - 8) = v27 - 1;
}
if ( v27 <= 0 )
operator delete(v9);
}
v10 = (void *)(v42 - 24);
if ( (__int64 *)(v42 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v28 = (unsigned int *)(v42 - 8);
do
v29 = __ldaxr(v28);
while ( __stlxr(v29 - 1, v28) );
}
else
{
v29 = *(_DWORD *)(v42 - 8);
*(_DWORD *)(v42 - 8) = v29 - 1;
}
if ( v29 <= 0 )
operator delete(v10);
}
sub_D153B8((int)&v42, "Scratch");
sub_D153B8((int)&v43, "Never know what you could find.\nOr who...");
v11 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v42, (__int64)&v43, 13, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v4, v11);
v12 = (void *)(v43 - 24);
if ( (__int64 *)(v43 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v30 = (unsigned int *)(v43 - 8);
do
v31 = __ldaxr(v30);
while ( __stlxr(v31 - 1, v30) );
}
else
{
v31 = *(_DWORD *)(v43 - 8);
*(_DWORD *)(v43 - 8) = v31 - 1;
}
if ( v31 <= 0 )
operator delete(v12);
}
v13 = (void *)(v42 - 24);
if ( (__int64 *)(v42 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v32 = (unsigned int *)(v42 - 8);
do
v33 = __ldaxr(v32);
while ( __stlxr(v33 - 1, v32) );
}
else
{
v33 = *(_DWORD *)(v42 - 8);
*(_DWORD *)(v42 - 8) = v33 - 1;
}
if ( v33 <= 0 )
operator delete(v13);
}
sub_D153B8((int)&v42, "Scratch");
sub_D153B8((int)&v43, "... I thought this was a simple cube game.");
v14 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v42, (__int64)&v43, 26, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v4, v14);
v15 = (void *)(v43 - 24);
if ( (__int64 *)(v43 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v34 = (unsigned int *)(v43 - 8);
do
v35 = __ldaxr(v34);
while ( __stlxr(v35 - 1, v34) );
}
else
{
v35 = *(_DWORD *)(v43 - 8);
*(_DWORD *)(v43 - 8) = v35 - 1;
}
if ( v35 <= 0 )
operator delete(v15);
}
v16 = (void *)(v42 - 24);
if ( (__int64 *)(v42 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v36 = (unsigned int *)(v42 - 8);
do
v37 = __ldaxr(v36);
while ( __stlxr(v37 - 1, v36) );
}
else
{
v37 = *(_DWORD *)(v42 - 8);
*(_DWORD *)(v42 - 8) = v37 - 1;
}
if ( v37 <= 0 )
operator delete(v16);
}
sub_D153B8((int)&v42, "Scratch");
sub_D153B8((int)&v43, "...");
v17 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v42, (__int64)&v43, 8, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v4, v17);
v18 = (void *)(v43 - 24);
if ( (__int64 *)(v43 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v38 = (unsigned int *)(v43 - 8);
do
v39 = __ldaxr(v38);
while ( __stlxr(v39 - 1, v38) );
}
else
{
v39 = *(_DWORD *)(v43 - 8);
*(_DWORD *)(v43 - 8) = v39 - 1;
}
if ( v39 <= 0 )
operator delete(v18);
}
v19 = (void *)(v42 - 24);
if ( (__int64 *)(v42 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v40 = (unsigned int *)(v42 - 8);
do
v41 = __ldaxr(v40);
while ( __stlxr(v41 - 1, v40) );
}
else
{
v41 = *(_DWORD *)(v42 - 8);
*(_DWORD *)(v42 - 8) = v41 - 1;
}
if ( v41 <= 0 )
operator delete(v19);
}
v20 = DialogLayer::createWithObjects(v4, (int)&dword_0 + 2);
v21 = cocos2d::CCDirector::sharedDirector();
v21->m_pRunningScene->addChild_0(v21->m_pRunningScene, v20, 1000);
v20->m_delegate = &a1->DialogDelegate;
DialogLayer::updateChatPlacement(v20, Center);
DialogLayer::animateInRandomSide(v20);
}