//
// SecretRewardsLayer::showDialog01 from 0xa6472c to 0xa664c8 (7580 bytes)
//
// 2 xrefs:
// > SecretRewardsLayer::onShop @ 0xa69f10
// > ??> @ 0xa52d0
//
// 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 SecretRewardsLayer::showDialog01(SecretRewardsLayer *a1)
{
cocos2d::CCArray *v2; // x23
GameStatsManager *v3; // x0
int m_scratchDialogIndex; // w19
int v5; // w19
DialogLayer *v6; // x19
GameManager *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
cocos2d::CCString *v20; // x0
char *CString; // x0
cocos2d::CCObject *v22; // x0
void *v23; // x0
void *v24; // x0
cocos2d::CCString *v25; // x0
char *v26; // x0
cocos2d::CCObject *v27; // x0
void *v28; // x0
void *v29; // x0
cocos2d::CCObject *v30; // x0
void *v31; // x0
void *v32; // x0
cocos2d::CCObject *v33; // x0
void *v34; // x0
void *v35; // x0
cocos2d::CCObject *v36; // x0
void *v37; // x0
void *v38; // x0
GameManager *v39; // x0
cocos2d::CCObject *v40; // x0
void *v41; // x0
void *v42; // x0
cocos2d::CCObject *v43; // x0
void *v44; // x0
void *v45; // x0
cocos2d::CCObject *v46; // x0
void *v47; // x0
void *v48; // x0
cocos2d::CCObject *v49; // x0
void *v50; // x0
__int64 v51; // x1
void *v52; // x0
cocos2d::CCObject *v53; // x0
void *v54; // x0
void *v55; // x0
cocos2d::CCObject *v56; // x0
void *v57; // x0
void *v58; // x0
cocos2d::CCObject *v59; // x0
void *v60; // x0
void *v61; // x0
cocos2d::CCObject *v62; // x0
void *v63; // x0
void *v64; // x0
cocos2d::CCObject *v65; // x0
void *v66; // x0
unsigned int *v67; // x1
int v68; // w2
cocos2d::CCObject *v69; // x0
void *v70; // x0
void *v71; // x0
cocos2d::CCObject *v72; // x0
void *v73; // x0
void *v74; // x0
cocos2d::CCObject *v75; // x0
void *v76; // x0
unsigned int *v77; // x1
cocos2d::CCObject *v78; // x0
void *v79; // x0
void *v80; // x0
cocos2d::CCObject *v81; // x0
void *v82; // x0
void *v83; // x0
cocos2d::CCObject *v84; // x0
void *v85; // x0
unsigned int *v86; // x1
cocos2d::CCString *v87; // x0
char *v88; // x0
cocos2d::CCObject *v89; // x0
void *v90; // x0
void *v91; // x0
cocos2d::CCObject *v92; // x0
void *v93; // x0
void *v94; // x0
cocos2d::CCObject *v95; // x0
void *v96; // x0
unsigned int *v97; // x1
unsigned int *v98; // x1
unsigned int *v99; // x1
int v100; // w2
unsigned int *v101; // x1
int v102; // w2
unsigned int *v103; // x1
int v104; // w2
unsigned int *v105; // x1
int v106; // w2
unsigned int *v107; // x1
int v108; // w2
unsigned int *v109; // x1
int v110; // w2
unsigned int *v111; // x1
int v112; // w2
unsigned int *v113; // x1
int v114; // w2
unsigned int *v115; // x1
int v116; // w2
unsigned int *v117; // x1
int v118; // w2
unsigned int *v119; // x1
int v120; // w2
unsigned int *v121; // x1
int v122; // w2
unsigned int *v123; // x1
int v124; // w2
unsigned int *v125; // x1
int v126; // w2
unsigned int *v127; // x1
int v128; // w2
unsigned int *v129; // x1
int v130; // w2
unsigned int *v131; // x1
int v132; // w2
unsigned int *v133; // x1
int v134; // w2
unsigned int *v135; // x1
int v136; // w2
unsigned int *v137; // x1
int v138; // w2
unsigned int *v139; // x1
int v140; // w2
unsigned int *v141; // x1
int v142; // w2
unsigned int *v143; // x1
int v144; // w2
unsigned int *v145; // x1
int v146; // w2
unsigned int *v147; // x1
int v148; // w2
unsigned int *v149; // x1
int v150; // w2
unsigned int *v151; // x1
int v152; // w2
unsigned int *v153; // x1
int v154; // w2
unsigned int *v155; // x1
int v156; // w2
unsigned int *v157; // x1
int v158; // w2
unsigned int *v159; // x1
int v160; // w2
unsigned int *v161; // x1
int v162; // w2
unsigned int *v163; // x1
int v164; // w2
unsigned int *v165; // x1
int v166; // w2
unsigned int *v167; // x1
int v168; // w2
unsigned int *v169; // x1
int v170; // w2
unsigned int *v171; // x1
int v172; // w2
unsigned int *v173; // x1
int v174; // w2
unsigned int *v175; // x1
int v176; // w2
unsigned int *v177; // x1
int v178; // w2
unsigned int *v179; // x1
int v180; // w2
unsigned int *v181; // x1
int v182; // w2
unsigned int *v183; // x1
int v184; // w2
unsigned int *v185; // x1
int v186; // w2
unsigned int *v187; // x1
int v188; // w2
unsigned int *v189; // x1
int v190; // w2
unsigned int *v191; // x1
int v192; // w2
unsigned int *v193; // x1
int v194; // w2
unsigned int *v195; // x1
int v196; // w2
_QWORD v197[2]; // [xsp+0h] [xbp+0h] BYREF
__int64 v198; // [xsp+78h] [xbp+78h] BYREF
__int64 v199; // [xsp+80h] [xbp+80h] BYREF
v2 = (cocos2d::CCArray *)cocos2d::CCArray::create(_stack_chk_guard);
v3 = GameStatsManager::sharedState();
if ( GameStatsManager::getStat(v3, "13") > 499 && (v7 = GameManager::sharedState(), GameManager::getUGV(v7, "10")) )
{
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((unsigned int)v197 + 128, "Oh, the diamonds.\nYou found them.");
v8 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 10, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v8);
v9 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v99 = (unsigned int *)(v199 - 8);
do
v100 = __ldaxr(v99);
while ( __stlxr(v100 - 1, v99) );
}
else
{
v100 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v100 - 1;
}
if ( v100 <= 0 )
operator delete(v9);
}
v10 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v101 = (unsigned int *)(v198 - 8);
do
v102 = __ldaxr(v101);
while ( __stlxr(v102 - 1, v101) );
}
else
{
v102 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v102 - 1;
}
if ( v102 <= 0 )
operator delete(v10);
}
sub_D153B8((unsigned int)v197 + 120, "Scratch");
sub_D153B8((unsigned int)v197 + 128, "Alright come in, quickly before someone sees you.");
v11 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 13, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v11);
v12 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v105 = (unsigned int *)(v199 - 8);
do
v106 = __ldaxr(v105);
while ( __stlxr(v106 - 1, v105) );
}
else
{
v106 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v106 - 1;
}
if ( v106 <= 0 )
operator delete(v12);
}
v13 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v109 = (unsigned int *)(v198 - 8);
do
v110 = __ldaxr(v109);
while ( __stlxr(v110 - 1, v109) );
}
else
{
v110 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v110 - 1;
}
if ( v110 <= 0 )
operator delete(v13);
}
sub_D153B8((unsigned int)v197 + 120, "Scratch");
sub_D153B8((unsigned int)v197 + 128, "You never know who might be watching.");
v14 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 8, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v14);
v15 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v103 = (unsigned int *)(v199 - 8);
do
v104 = __ldaxr(v103);
while ( __stlxr(v104 - 1, v103) );
}
else
{
v104 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v104 - 1;
}
if ( v104 <= 0 )
operator delete(v15);
}
v16 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v111 = (unsigned int *)(v198 - 8);
do
v112 = __ldaxr(v111);
while ( __stlxr(v112 - 1, v111) );
}
else
{
v112 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v112 - 1;
}
if ( v112 <= 0 )
operator delete(v16);
}
sub_D153B8((unsigned int)v197 + 120, "Scratch");
sub_D153B8((unsigned int)v197 + 128, "...");
v17 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 9, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v17);
v18 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v107 = (unsigned int *)(v199 - 8);
do
v108 = __ldaxr(v107);
while ( __stlxr(v108 - 1, v107) );
}
else
{
v108 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v108 - 1;
}
if ( v108 <= 0 )
operator delete(v18);
}
v19 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v113 = (unsigned int *)(v198 - 8);
do
v114 = __ldaxr(v113);
while ( __stlxr(v114 - 1, v113) );
}
else
{
v114 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v114 - 1;
}
if ( v114 <= 0 )
operator delete(v19);
}
v6 = DialogLayer::createWithObjects(v2, (int)&dword_0 + 2);
a1->addChild_0(a1, v6, 100);
v6->setTag(v6, 1);
v6->m_delegate = &a1->DialogDelegate;
}
else
{
m_scratchDialogIndex = a1->m_scratchDialogIndex;
switch ( m_scratchDialogIndex )
{
case 0:
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "Uhm, there is no rope.");
v78 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 8, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v78);
v79 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v151 = (unsigned int *)(v199 - 8);
do
v152 = __ldaxr(v151);
while ( __stlxr(v152 - 1, v151) );
}
else
{
v152 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v152 - 1;
}
if ( v152 <= 0 )
operator delete(v79);
}
v80 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v149 = (unsigned int *)(v198 - 8);
do
v150 = __ldaxr(v149);
while ( __stlxr(v150 - 1, v149) );
}
else
{
v150 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v150 - 1;
}
if ( v150 <= 0 )
operator delete(v80);
}
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "Just... Pretend this never happened.");
v81 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 9, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v81);
v82 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v135 = (unsigned int *)(v199 - 8);
do
v136 = __ldaxr(v135);
while ( __stlxr(v136 - 1, v135) );
}
else
{
v136 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v136 - 1;
}
if ( v136 <= 0 )
operator delete(v82);
}
v83 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v143 = (unsigned int *)(v198 - 8);
do
v144 = __ldaxr(v143);
while ( __stlxr(v144 - 1, v143) );
}
else
{
v144 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v144 - 1;
}
if ( v144 <= 0 )
operator delete(v83);
}
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "...");
v84 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 8, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v84);
v85 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v127 = (unsigned int *)(v199 - 8);
do
v128 = __ldaxr(v127);
while ( __stlxr(v128 - 1, v127) );
}
else
{
v128 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v128 - 1;
}
if ( v128 <= 0 )
operator delete(v85);
}
v51 = v198;
v52 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) == &qword_124B6B0 )
goto LABEL_37;
if ( !&pthread_create )
goto LABEL_127;
v86 = (unsigned int *)(v198 - 8);
do
v68 = __ldaxr(v86);
while ( __stlxr(v68 - 1, v86) );
break;
case 1:
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "I'm gonna need you to stop doing that.");
v69 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 13, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v69);
v70 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v121 = (unsigned int *)(v199 - 8);
do
v122 = __ldaxr(v121);
while ( __stlxr(v122 - 1, v121) );
}
else
{
v122 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v122 - 1;
}
if ( v122 <= 0 )
operator delete(v70);
}
v71 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v137 = (unsigned int *)(v198 - 8);
do
v138 = __ldaxr(v137);
while ( __stlxr(v138 - 1, v137) );
}
else
{
v138 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v138 - 1;
}
if ( v138 <= 0 )
operator delete(v71);
}
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "If RubRub sees this I am in BIG trouble.");
v72 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 8, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v72);
v73 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v129 = (unsigned int *)(v199 - 8);
do
v130 = __ldaxr(v129);
while ( __stlxr(v130 - 1, v129) );
}
else
{
v130 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v130 - 1;
}
if ( v130 <= 0 )
operator delete(v73);
}
v74 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v147 = (unsigned int *)(v198 - 8);
do
v148 = __ldaxr(v147);
while ( __stlxr(v148 - 1, v147) );
}
else
{
v148 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v148 - 1;
}
if ( v148 <= 0 )
operator delete(v74);
}
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "I hate that guy...");
v75 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 12, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v75);
v76 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v131 = (unsigned int *)(v199 - 8);
do
v132 = __ldaxr(v131);
while ( __stlxr(v132 - 1, v131) );
}
else
{
v132 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v132 - 1;
}
if ( v132 <= 0 )
operator delete(v76);
}
v51 = v198;
v52 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) == &qword_124B6B0 )
goto LABEL_37;
if ( !&pthread_create )
goto LABEL_127;
v77 = (unsigned int *)(v198 - 8);
do
v68 = __ldaxr(v77);
while ( __stlxr(v68 - 1, v77) );
break;
case 2:
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "Finally, I thought you wou...");
v53 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 10, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v53);
v54 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v181 = (unsigned int *)(v199 - 8);
do
v182 = __ldaxr(v181);
while ( __stlxr(v182 - 1, v181) );
}
else
{
v182 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v182 - 1;
}
if ( v182 <= 0 )
operator delete(v54);
}
v55 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v193 = (unsigned int *)(v198 - 8);
do
v194 = __ldaxr(v193);
while ( __stlxr(v194 - 1, v193) );
}
else
{
v194 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v194 - 1;
}
if ( v194 <= 0 )
operator delete(v55);
}
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "Wait, You're not the delivery guy.");
v56 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 11, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v56);
v57 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v175 = (unsigned int *)(v199 - 8);
do
v176 = __ldaxr(v175);
while ( __stlxr(v176 - 1, v175) );
}
else
{
v176 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v176 - 1;
}
if ( v176 <= 0 )
operator delete(v57);
}
v58 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v185 = (unsigned int *)(v198 - 8);
do
v186 = __ldaxr(v185);
while ( __stlxr(v186 - 1, v185) );
}
else
{
v186 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v186 - 1;
}
if ( v186 <= 0 )
operator delete(v58);
}
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "How am I supposed to run a shop if I don't have any merchandise?");
v59 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 12, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v59);
v60 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v159 = (unsigned int *)(v199 - 8);
do
v160 = __ldaxr(v159);
while ( __stlxr(v160 - 1, v159) );
}
else
{
v160 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v160 - 1;
}
if ( v160 <= 0 )
operator delete(v60);
}
v61 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v145 = (unsigned int *)(v198 - 8);
do
v146 = __ldaxr(v145);
while ( __stlxr(v146 - 1, v145) );
}
else
{
v146 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v146 - 1;
}
if ( v146 <= 0 )
operator delete(v61);
}
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "I mean, what shop?");
v62 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 13, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v62);
v63 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v133 = (unsigned int *)(v199 - 8);
do
v134 = __ldaxr(v133);
while ( __stlxr(v134 - 1, v133) );
}
else
{
v134 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v134 - 1;
}
if ( v134 <= 0 )
operator delete(v63);
}
v64 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v141 = (unsigned int *)(v198 - 8);
do
v142 = __ldaxr(v141);
while ( __stlxr(v142 - 1, v141) );
}
else
{
v142 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v142 - 1;
}
if ( v142 <= 0 )
operator delete(v64);
}
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "...");
v65 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 8, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v65);
v66 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v125 = (unsigned int *)(v199 - 8);
do
v126 = __ldaxr(v125);
while ( __stlxr(v126 - 1, v125) );
}
else
{
v126 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v126 - 1;
}
if ( v126 <= 0 )
operator delete(v66);
}
v51 = v198;
v52 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) == &qword_124B6B0 )
goto LABEL_37;
if ( !&pthread_create )
goto LABEL_127;
v67 = (unsigned int *)(v198 - 8);
do
v68 = __ldaxr(v67);
while ( __stlxr(v68 - 1, v67) );
break;
case 3:
sub_D153B8((int)&v198, "Scratch");
sub_D153B8(
(int)&v199,
"Look, I can't let you in.\nNot without the... stuff.");
v40 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 8, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v40);
v41 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v163 = (unsigned int *)(v199 - 8);
do
v164 = __ldaxr(v163);
while ( __stlxr(v164 - 1, v163) );
}
else
{
v164 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v164 - 1;
}
if ( v164 <= 0 )
operator delete(v41);
}
v42 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v191 = (unsigned int *)(v198 - 8);
do
v192 = __ldaxr(v191);
while ( __stlxr(v192 - 1, v191) );
}
else
{
v192 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v192 - 1;
}
if ( v192 <= 0 )
operator delete(v42);
}
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "I'm not even supposed to be here.\nI'm just a glitch in the code.");
v43 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 13, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v43);
v44 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v171 = (unsigned int *)(v199 - 8);
do
v172 = __ldaxr(v171);
while ( __stlxr(v172 - 1, v171) );
}
else
{
v172 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v172 - 1;
}
if ( v172 <= 0 )
operator delete(v44);
}
v45 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v183 = (unsigned int *)(v198 - 8);
do
v184 = __ldaxr(v183);
while ( __stlxr(v184 - 1, v183) );
}
else
{
v184 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v184 - 1;
}
if ( v184 <= 0 )
operator delete(v45);
}
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "Did you hear something?");
v46 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 8, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v46);
v47 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v155 = (unsigned int *)(v199 - 8);
do
v156 = __ldaxr(v155);
while ( __stlxr(v156 - 1, v155) );
}
else
{
v156 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v156 - 1;
}
if ( v156 <= 0 )
operator delete(v47);
}
v48 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v189 = (unsigned int *)(v198 - 8);
do
v190 = __ldaxr(v189);
while ( __stlxr(v190 - 1, v189) );
}
else
{
v190 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v190 - 1;
}
if ( v190 <= 0 )
operator delete(v48);
}
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "...");
v49 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 9, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v49);
v50 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v167 = (unsigned int *)(v199 - 8);
do
v168 = __ldaxr(v167);
while ( __stlxr(v168 - 1, v167) );
}
else
{
v168 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v168 - 1;
}
if ( v168 <= 0 )
operator delete(v50);
}
v51 = v198;
v52 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) == &qword_124B6B0 )
goto LABEL_37;
if ( !&pthread_create )
goto LABEL_127;
v98 = (unsigned int *)(v198 - 8);
do
v68 = __ldaxr(v98);
while ( __stlxr(v68 - 1, v98) );
break;
case 4:
sub_D153B8((int)&v198, "Scratch");
v20 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Alright, alright. If you collect\n"
"%i Diamonds I will let you in.",
(const char *)&elf_hash_nchain);
CString = (char *)cocos2d::CCString::getCString(v20);
sub_D153B8((int)&v199, CString);
v22 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 10, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v22);
v23 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v165 = (unsigned int *)(v199 - 8);
do
v166 = __ldaxr(v165);
while ( __stlxr(v166 - 1, v165) );
}
else
{
v166 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v166 - 1;
}
if ( v166 <= 0 )
operator delete(v23);
}
v24 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v173 = (unsigned int *)(v198 - 8);
do
v174 = __ldaxr(v173);
while ( __stlxr(v174 - 1, v173) );
}
else
{
v174 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v174 - 1;
}
if ( v174 <= 0 )
operator delete(v24);
}
sub_D153B8((int)&v198, "Scratch");
v25 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Usually the limit is %i, but you look a bit scary.",
(const char *)&elf_hash_bucket[124]);
v26 = (char *)cocos2d::CCString::getCString(v25);
sub_D153B8((int)&v199, v26);
v27 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 13, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v27);
v28 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v157 = (unsigned int *)(v199 - 8);
do
v158 = __ldaxr(v157);
while ( __stlxr(v158 - 1, v157) );
}
else
{
v158 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v158 - 1;
}
if ( v158 <= 0 )
operator delete(v28);
}
v29 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v177 = (unsigned int *)(v198 - 8);
do
v178 = __ldaxr(v177);
while ( __stlxr(v178 - 1, v177) );
}
else
{
v178 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v178 - 1;
}
if ( v178 <= 0 )
operator delete(v29);
}
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "Just, get out of here before someone sees you.");
v30 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 11, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v30);
v31 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v161 = (unsigned int *)(v199 - 8);
do
v162 = __ldaxr(v161);
while ( __stlxr(v162 - 1, v161) );
}
else
{
v162 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v162 - 1;
}
if ( v162 <= 0 )
operator delete(v31);
}
v32 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v169 = (unsigned int *)(v198 - 8);
do
v170 = __ldaxr(v169);
while ( __stlxr(v170 - 1, v169) );
}
else
{
v170 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v170 - 1;
}
if ( v170 <= 0 )
operator delete(v32);
}
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "Do you smell burning chicken?");
v33 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 8, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v33);
v34 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v153 = (unsigned int *)(v199 - 8);
do
v154 = __ldaxr(v153);
while ( __stlxr(v154 - 1, v153) );
}
else
{
v154 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v154 - 1;
}
if ( v154 <= 0 )
operator delete(v34);
}
v35 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v195 = (unsigned int *)(v198 - 8);
do
v196 = __ldaxr(v195);
while ( __stlxr(v196 - 1, v195) );
}
else
{
v196 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v196 - 1;
}
if ( v196 <= 0 )
operator delete(v35);
}
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "...");
v36 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 9, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v36);
v37 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v179 = (unsigned int *)(v199 - 8);
do
v180 = __ldaxr(v179);
while ( __stlxr(v180 - 1, v179) );
}
else
{
v180 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v180 - 1;
}
if ( v180 <= 0 )
operator delete(v37);
}
v38 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v187 = (unsigned int *)(v198 - 8);
do
v188 = __ldaxr(v187);
while ( __stlxr(v188 - 1, v187) );
}
else
{
v188 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v188 - 1;
}
if ( v188 <= 0 )
operator delete(v38);
}
v39 = GameManager::sharedState();
GameManager::setUGV(v39, "10", 1);
m_scratchDialogIndex = a1->m_scratchDialogIndex;
goto LABEL_3;
case 5:
sub_D153B8((int)&v198, "Scratch");
v87 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Collect %i Diamonds and I will let you in.",
(const char *)&elf_hash_nchain);
v88 = (char *)cocos2d::CCString::getCString(v87);
sub_D153B8((int)&v199, v88);
v89 = (cocos2d::CCObject *)DialogObject::create(0.8, (__int64)&v198, (__int64)&v199, 10, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v89);
v90 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v119 = (unsigned int *)(v199 - 8);
do
v120 = __ldaxr(v119);
while ( __stlxr(v120 - 1, v119) );
}
else
{
v120 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v120 - 1;
}
if ( v120 <= 0 )
operator delete(v90);
}
v91 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v117 = (unsigned int *)(v198 - 8);
do
v118 = __ldaxr(v117);
while ( __stlxr(v118 - 1, v117) );
}
else
{
v118 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v118 - 1;
}
if ( v118 <= 0 )
operator delete(v91);
}
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "Now go away, RubRub might be watching.");
v92 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 8, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v92);
v93 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v115 = (unsigned int *)(v199 - 8);
do
v116 = __ldaxr(v115);
while ( __stlxr(v116 - 1, v115) );
}
else
{
v116 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v116 - 1;
}
if ( v116 <= 0 )
operator delete(v93);
}
v94 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v139 = (unsigned int *)(v198 - 8);
do
v140 = __ldaxr(v139);
while ( __stlxr(v140 - 1, v139) );
}
else
{
v140 = *(_DWORD *)(v198 - 8);
*(_DWORD *)(v198 - 8) = v140 - 1;
}
if ( v140 <= 0 )
operator delete(v94);
}
sub_D153B8((int)&v198, "Scratch");
sub_D153B8((int)&v199, "...");
v95 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v198, (__int64)&v199, 9, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v95);
v96 = (void *)(v199 - 24);
if ( (__int64 *)(v199 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v123 = (unsigned int *)(v199 - 8);
do
v124 = __ldaxr(v123);
while ( __stlxr(v124 - 1, v123) );
}
else
{
v124 = *(_DWORD *)(v199 - 8);
*(_DWORD *)(v199 - 8) = v124 - 1;
}
if ( v124 <= 0 )
operator delete(v96);
}
v51 = v198;
v52 = (void *)(v198 - 24);
if ( (__int64 *)(v198 - 24) == &qword_124B6B0 )
goto LABEL_37;
if ( &pthread_create )
{
v97 = (unsigned int *)(v198 - 8);
do
v68 = __ldaxr(v97);
while ( __stlxr(v68 - 1, v97) );
}
else
{
LABEL_127:
v68 = *(_DWORD *)(v51 - 8);
*(_DWORD *)(v51 - 8) = v68 - 1;
}
break;
default:
goto LABEL_3;
}
if ( v68 > 0 )
{
LABEL_37:
m_scratchDialogIndex = a1->m_scratchDialogIndex;
}
else
{
operator delete(v52);
m_scratchDialogIndex = a1->m_scratchDialogIndex;
}
LABEL_3:
v5 = m_scratchDialogIndex + 1;
if ( v5 >= 6 )
v5 = 0;
a1->m_scratchDialogIndex = v5;
v6 = DialogLayer::createWithObjects(v2, (int)&dword_0 + 2);
a1->addChild_0(a1, v6, 100);
v6->setTag(v6, 1);
}
DialogLayer::updateChatPlacement(v6, Center);
DialogLayer::animateInRandomSide(v6);
}