//
// SecretRewardsLayer::showDialogMechanic from 0xa67b50 to 0xa690d4 (5508 bytes)
//
// 2 xrefs:
// > SecretRewardsLayer::onShop @ 0xa69f48
// > ??> @ 0x2ece0
//
// 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::showDialogMechanic(SecretRewardsLayer *a1)
{
cocos2d::CCArray *v2; // x23
GameStatsManager *v3; // x0
int m_mechanicDialogIndex; // w0
int v5; // w2
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::CCObject *v20; // x0
void *v21; // x0
void *v22; // x0
cocos2d::CCObject *v23; // x0
void *v24; // x0
void *v25; // x0
cocos2d::CCString *v26; // x0
char *CString; // x0
cocos2d::CCObject *v28; // x0
void *v29; // x0
void *v30; // x0
cocos2d::CCObject *v31; // x0
void *v32; // x0
void *v33; // x0
GameManager *v34; // x0
cocos2d::CCObject *v35; // x0
void *v36; // x0
void *v37; // x0
cocos2d::CCObject *v38; // x0
void *v39; // x0
__int64 v40; // x1
void *v41; // x0
cocos2d::CCObject *v42; // x0
void *v43; // x0
void *v44; // x0
cocos2d::CCObject *v45; // x0
void *v46; // x0
void *v47; // x0
cocos2d::CCObject *v48; // x0
void *v49; // x0
unsigned int *v50; // x1
int v51; // w2
cocos2d::CCObject *v52; // x0
void *v53; // x0
void *v54; // x0
cocos2d::CCObject *v55; // x0
void *v56; // x0
unsigned int *v57; // x1
cocos2d::CCObject *v58; // x0
void *v59; // x0
void *v60; // x0
cocos2d::CCString *v61; // x0
char *v62; // x0
cocos2d::CCObject *v63; // x0
void *v64; // x0
void *v65; // x0
cocos2d::CCObject *v66; // x0
void *v67; // x0
void *v68; // x0
cocos2d::CCObject *v69; // x0
void *v70; // x0
unsigned int *v71; // x1
unsigned int *v72; // x1
unsigned int *v73; // x1
int v74; // w2
unsigned int *v75; // x1
int v76; // w2
unsigned int *v77; // x1
int v78; // w2
unsigned int *v79; // x1
int v80; // w2
unsigned int *v81; // x1
int v82; // w2
unsigned int *v83; // x1
int v84; // w2
unsigned int *v85; // x1
int v86; // w2
unsigned int *v87; // x1
int v88; // w2
unsigned int *v89; // x1
int v90; // w2
unsigned int *v91; // x1
int v92; // w2
unsigned int *v93; // x1
int v94; // w2
unsigned int *v95; // x1
int v96; // w2
unsigned int *v97; // x1
int v98; // w2
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
char *v141[2]; // [xsp+0h] [xbp+0h] BYREF
char *v142; // [xsp+6Ch] [xbp+6Ch]
__int64 v143; // [xsp+88h] [xbp+88h] BYREF
__int64 v144; // [xsp+90h] [xbp+90h] BYREF
v2 = (cocos2d::CCArray *)cocos2d::CCArray::create(_stack_chk_guard);
v3 = GameStatsManager::sharedState();
LODWORD(v142) = GameStatsManager::getStat(v3, "13");
if ( (int)v142 > 1999 && (v7 = GameManager::sharedState(), GameManager::getUGV(v7, "36")) )
{
sub_D153B8((int)&v143, "The Mechanic");
sub_D153B8((unsigned int)v141 + 144, "Now that's an impressive collection of Diamonds!");
v8 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 39, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v8);
v9 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v73 = (unsigned int *)(v144 - 8);
do
v74 = __ldaxr(v73);
while ( __stlxr(v74 - 1, v73) );
}
else
{
v74 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v74 - 1;
}
if ( v74 <= 0 )
operator delete(v9);
}
v10 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v75 = (unsigned int *)(v143 - 8);
do
v76 = __ldaxr(v75);
while ( __stlxr(v76 - 1, v75) );
}
else
{
v76 = *(_DWORD *)(v143 - 8);
*(_DWORD *)(v143 - 8) = v76 - 1;
}
if ( v76 <= 0 )
operator delete(v10);
}
sub_D153B8((unsigned int)v141 + 136, "The Mechanic");
sub_D153B8((unsigned int)v141 + 144, "If anyone asks I didn't let you in.");
v11 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 37, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v11);
v12 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v77 = (unsigned int *)(v144 - 8);
do
v78 = __ldaxr(v77);
while ( __stlxr(v78 - 1, v77) );
}
else
{
v78 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v78 - 1;
}
if ( v78 <= 0 )
operator delete(v12);
}
v13 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v85 = (unsigned int *)(v143 - 8);
do
v86 = __ldaxr(v85);
while ( __stlxr(v86 - 1, v85) );
}
else
{
v86 = *(_DWORD *)(v143 - 8);
*(_DWORD *)(v143 - 8) = v86 - 1;
}
if ( v86 <= 0 )
operator delete(v13);
}
sub_D153B8((unsigned int)v141 + 136, "The Mechanic");
sub_D153B8((unsigned int)v141 + 144, "Scratch keeps trying to sneak past my security...");
v14 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 50, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v14);
v15 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v81 = (unsigned int *)(v144 - 8);
do
v82 = __ldaxr(v81);
while ( __stlxr(v82 - 1, v81) );
}
else
{
v82 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v82 - 1;
}
if ( v82 <= 0 )
operator delete(v15);
}
v16 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v89 = (unsigned int *)(v143 - 8);
do
v90 = __ldaxr(v89);
while ( __stlxr(v90 - 1, v89) );
}
else
{
v90 = *(_DWORD *)(v143 - 8);
*(_DWORD *)(v143 - 8) = v90 - 1;
}
if ( v90 <= 0 )
operator delete(v16);
}
sub_D153B8((unsigned int)v141 + 136, "The Mechanic");
sub_D153B8((unsigned int)v141 + 144, "I CAN'T SEE!?");
v17 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 44, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v17);
v18 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v79 = (unsigned int *)(v144 - 8);
do
v80 = __ldaxr(v79);
while ( __stlxr(v80 - 1, v79) );
}
else
{
v80 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v80 - 1;
}
if ( v80 <= 0 )
operator delete(v18);
}
v19 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v87 = (unsigned int *)(v143 - 8);
do
v88 = __ldaxr(v87);
while ( __stlxr(v88 - 1, v87) );
}
else
{
v88 = *(_DWORD *)(v143 - 8);
*(_DWORD *)(v143 - 8) = v88 - 1;
}
if ( v88 <= 0 )
operator delete(v19);
}
sub_D153B8((unsigned int)v141 + 136, "The Mechanic");
sub_D153B8((unsigned int)v141 + 144, "Ah sorry, my goggles were off.\nCome in.");
v20 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 51, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v20);
v21 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v83 = (unsigned int *)(v144 - 8);
do
v84 = __ldaxr(v83);
while ( __stlxr(v84 - 1, v83) );
}
else
{
v84 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v84 - 1;
}
if ( v84 <= 0 )
operator delete(v21);
}
v22 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v91 = (unsigned int *)(v143 - 8);
do
v92 = __ldaxr(v91);
while ( __stlxr(v92 - 1, v91) );
}
else
{
v92 = *(_DWORD *)(v143 - 8);
*(_DWORD *)(v143 - 8) = v92 - 1;
}
if ( v92 <= 0 )
operator delete(v22);
}
v6 = DialogLayer::createWithObjects(v2, (int)&byte_4);
a1->addChild_0(a1, v6, 100);
v6->setTag(v6, 4);
v6->m_delegate = &a1->DialogDelegate;
}
else
{
m_mechanicDialogIndex = a1->m_mechanicDialogIndex;
switch ( m_mechanicDialogIndex )
{
case 0:
sub_D153B8((int)&v143, "The Mechanic");
sub_D153B8((int)&v144, "I'm in the middle of a job.\nCome back later.");
v52 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 38, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v52);
v53 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v107 = (unsigned int *)(v144 - 8);
do
v108 = __ldaxr(v107);
while ( __stlxr(v108 - 1, v107) );
}
else
{
v108 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v108 - 1;
}
if ( v108 <= 0 )
operator delete(v53);
}
v54 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v135 = (unsigned int *)(v143 - 8);
do
v136 = __ldaxr(v135);
while ( __stlxr(v136 - 1, v135) );
}
else
{
v136 = *(_DWORD *)(v143 - 8);
*(_DWORD *)(v143 - 8) = v136 - 1;
}
if ( v136 <= 0 )
operator delete(v54);
}
sub_D153B8((int)&v143, "The Mechanic");
sub_D153B8((int)&v144, "Can never get any peace and quiet in this game...");
v55 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 37, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v55);
v56 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v115 = (unsigned int *)(v144 - 8);
do
v116 = __ldaxr(v115);
while ( __stlxr(v116 - 1, v115) );
}
else
{
v116 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v116 - 1;
}
if ( v116 <= 0 )
operator delete(v56);
}
v40 = v143;
v41 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) == &qword_124B6B0 )
goto LABEL_31;
if ( !&pthread_create )
goto LABEL_117;
v57 = (unsigned int *)(v143 - 8);
do
v51 = __ldaxr(v57);
while ( __stlxr(v51 - 1, v57) );
break;
case 1:
sub_D153B8((int)&v143, "The Mechanic");
sub_D153B8((int)&v144, "You again!? What now!?");
v42 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 46, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v42);
v43 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v105 = (unsigned int *)(v144 - 8);
do
v106 = __ldaxr(v105);
while ( __stlxr(v106 - 1, v105) );
}
else
{
v106 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v106 - 1;
}
if ( v106 <= 0 )
operator delete(v43);
}
v44 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v137 = (unsigned int *)(v143 - 8);
do
v138 = __ldaxr(v137);
while ( __stlxr(v138 - 1, v137) );
}
else
{
v138 = *(_DWORD *)(v143 - 8);
*(_DWORD *)(v143 - 8) = v138 - 1;
}
if ( v138 <= 0 )
operator delete(v44);
}
sub_D153B8((int)&v143, "The Mechanic");
sub_D153B8((int)&v144, "I'm busy go bother someone else.");
v45 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 51, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v45);
v46 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v119 = (unsigned int *)(v144 - 8);
do
v120 = __ldaxr(v119);
while ( __stlxr(v120 - 1, v119) );
}
else
{
v120 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v120 - 1;
}
if ( v120 <= 0 )
operator delete(v46);
}
v47 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v131 = (unsigned int *)(v143 - 8);
do
v132 = __ldaxr(v131);
while ( __stlxr(v132 - 1, v131) );
}
else
{
v132 = *(_DWORD *)(v143 - 8);
*(_DWORD *)(v143 - 8) = v132 - 1;
}
if ( v132 <= 0 )
operator delete(v47);
}
sub_D153B8((int)&v143, "The Mechanic");
sub_D153B8((int)&v144, "You take one job then all of a sudden you're bugfixing the whole game.");
v48 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 37, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v48);
v49 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v123 = (unsigned int *)(v144 - 8);
do
v124 = __ldaxr(v123);
while ( __stlxr(v124 - 1, v123) );
}
else
{
v124 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v124 - 1;
}
if ( v124 <= 0 )
operator delete(v49);
}
v40 = v143;
v41 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) == &qword_124B6B0 )
goto LABEL_31;
if ( !&pthread_create )
goto LABEL_117;
v50 = (unsigned int *)(v143 - 8);
do
v51 = __ldaxr(v50);
while ( __stlxr(v51 - 1, v50) );
break;
case 2:
sub_D153B8((int)&v143, "The Mechanic");
sub_D153B8((int)&v144, "Hmm so if I push here... maybe...");
v35 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 45, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v35);
v36 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v125 = (unsigned int *)(v144 - 8);
do
v126 = __ldaxr(v125);
while ( __stlxr(v126 - 1, v125) );
}
else
{
v126 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v126 - 1;
}
if ( v126 <= 0 )
operator delete(v36);
}
v37 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v133 = (unsigned int *)(v143 - 8);
do
v134 = __ldaxr(v133);
while ( __stlxr(v134 - 1, v133) );
}
else
{
v134 = *(_DWORD *)(v143 - 8);
*(_DWORD *)(v143 - 8) = v134 - 1;
}
if ( v134 <= 0 )
operator delete(v37);
}
sub_D153B8((int)&v143, "The Mechanic");
sub_D153B8((int)&v144, "No, still broken...");
v38 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 49, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v38);
v39 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v111 = (unsigned int *)(v144 - 8);
do
v112 = __ldaxr(v111);
while ( __stlxr(v112 - 1, v111) );
}
else
{
v112 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v112 - 1;
}
if ( v112 <= 0 )
operator delete(v39);
}
v40 = v143;
v41 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) == &qword_124B6B0 )
goto LABEL_31;
if ( !&pthread_create )
goto LABEL_117;
v72 = (unsigned int *)(v143 - 8);
do
v51 = __ldaxr(v72);
while ( __stlxr(v51 - 1, v72) );
break;
case 3:
sub_D153B8((int)&v143, "The Mechanic");
sub_D153B8((int)&v144, "I have enough work as it is, can't go around helping everyone.");
v23 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 51, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v23);
v24 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v109 = (unsigned int *)(v144 - 8);
do
v110 = __ldaxr(v109);
while ( __stlxr(v110 - 1, v109) );
}
else
{
v110 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v110 - 1;
}
if ( v110 <= 0 )
operator delete(v24);
}
v25 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v121 = (unsigned int *)(v143 - 8);
do
v122 = __ldaxr(v121);
while ( __stlxr(v122 - 1, v121) );
}
else
{
v122 = *(_DWORD *)(v143 - 8);
*(_DWORD *)(v143 - 8) = v122 - 1;
}
if ( v122 <= 0 )
operator delete(v25);
}
sub_D153B8((int)&v143, "The Mechanic");
v26 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Collect %i Diamonds so I know you're legit, then we can talk.",
(const char *)&elf_hash_bucket[374]);
CString = (char *)cocos2d::CCString::getCString(v26);
sub_D153B8((int)&v144, CString);
v28 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 37, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v28);
v29 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v113 = (unsigned int *)(v144 - 8);
do
v114 = __ldaxr(v113);
while ( __stlxr(v114 - 1, v113) );
}
else
{
v114 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v114 - 1;
}
if ( v114 <= 0 )
operator delete(v29);
}
v30 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v117 = (unsigned int *)(v143 - 8);
do
v118 = __ldaxr(v117);
while ( __stlxr(v118 - 1, v117) );
}
else
{
v118 = *(_DWORD *)(v143 - 8);
*(_DWORD *)(v143 - 8) = v118 - 1;
}
if ( v118 <= 0 )
operator delete(v30);
}
sub_D153B8((int)&v143, "The Mechanic");
sub_D153B8((int)&v144, "Who ordered this thing it doesn't even fit...");
v31 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 49, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v31);
v32 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v101 = (unsigned int *)(v144 - 8);
do
v102 = __ldaxr(v101);
while ( __stlxr(v102 - 1, v101) );
}
else
{
v102 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v102 - 1;
}
if ( v102 <= 0 )
operator delete(v32);
}
v33 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v139 = (unsigned int *)(v143 - 8);
do
v140 = __ldaxr(v139);
while ( __stlxr(v140 - 1, v139) );
}
else
{
v140 = *(_DWORD *)(v143 - 8);
*(_DWORD *)(v143 - 8) = v140 - 1;
}
if ( v140 <= 0 )
operator delete(v33);
}
v34 = GameManager::sharedState();
GameManager::setUGV(v34, "36", 1);
m_mechanicDialogIndex = a1->m_mechanicDialogIndex;
goto LABEL_3;
case 4:
sub_D153B8((int)&v143, "The Mechanic");
sub_D153B8((int)&v144, "Scanning user...");
v58 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 49, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v58);
v59 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v127 = (unsigned int *)(v144 - 8);
do
v128 = __ldaxr(v127);
while ( __stlxr(v128 - 1, v127) );
}
else
{
v128 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v128 - 1;
}
if ( v128 <= 0 )
operator delete(v59);
}
v60 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v99 = (unsigned int *)(v143 - 8);
do
v100 = __ldaxr(v99);
while ( __stlxr(v100 - 1, v99) );
}
else
{
v100 = *(_DWORD *)(v143 - 8);
*(_DWORD *)(v143 - 8) = v100 - 1;
}
if ( v100 <= 0 )
operator delete(v60);
}
sub_D153B8((int)&v143, "The Mechanic");
v61 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Scan complete.\n"
"Diamonds: %i, Required: %i",
(const char *)(unsigned int)v142,
2000);
v62 = (char *)cocos2d::CCString::getCString(v61);
sub_D153B8((int)&v144, v62);
v63 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 45, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v63);
v64 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v97 = (unsigned int *)(v144 - 8);
do
v98 = __ldaxr(v97);
while ( __stlxr(v98 - 1, v97) );
}
else
{
v98 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v98 - 1;
}
if ( v98 <= 0 )
operator delete(v64);
}
v65 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v95 = (unsigned int *)(v143 - 8);
do
v96 = __ldaxr(v95);
while ( __stlxr(v96 - 1, v95) );
}
else
{
v96 = *(_DWORD *)(v143 - 8);
*(_DWORD *)(v143 - 8) = v96 - 1;
}
if ( v96 <= 0 )
operator delete(v65);
}
sub_D153B8((int)&v143, "The Mechanic");
sub_D153B8((int)&v144, "Hey who are you trying to fool?!");
v66 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 46, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v66);
v67 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v93 = (unsigned int *)(v144 - 8);
do
v94 = __ldaxr(v93);
while ( __stlxr(v94 - 1, v93) );
}
else
{
v94 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v94 - 1;
}
if ( v94 <= 0 )
operator delete(v67);
}
v68 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v129 = (unsigned int *)(v143 - 8);
do
v130 = __ldaxr(v129);
while ( __stlxr(v130 - 1, v129) );
}
else
{
v130 = *(_DWORD *)(v143 - 8);
*(_DWORD *)(v143 - 8) = v130 - 1;
}
if ( v130 <= 0 )
operator delete(v68);
}
sub_D153B8((int)&v143, "The Mechanic");
sub_D153B8(
(int)&v144,
"Come back when you have\ncollected more Diamonds...");
v69 = (cocos2d::CCObject *)DialogObject::create(1.0, (__int64)&v143, (__int64)&v144, 50, 0, (int)&unk_FFFFFF);
cocos2d::CCArray::addObject(v2, v69);
v70 = (void *)(v144 - 24);
if ( (__int64 *)(v144 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v103 = (unsigned int *)(v144 - 8);
do
v104 = __ldaxr(v103);
while ( __stlxr(v104 - 1, v103) );
}
else
{
v104 = *(_DWORD *)(v144 - 8);
*(_DWORD *)(v144 - 8) = v104 - 1;
}
if ( v104 <= 0 )
operator delete(v70);
}
v40 = v143;
v41 = (void *)(v143 - 24);
if ( (__int64 *)(v143 - 24) == &qword_124B6B0 )
goto LABEL_31;
if ( &pthread_create )
{
v71 = (unsigned int *)(v143 - 8);
do
v51 = __ldaxr(v71);
while ( __stlxr(v51 - 1, v71) );
}
else
{
LABEL_117:
v51 = *(_DWORD *)(v40 - 8);
*(_DWORD *)(v40 - 8) = v51 - 1;
}
break;
default:
goto LABEL_3;
}
if ( v51 > 0 )
{
LABEL_31:
m_mechanicDialogIndex = a1->m_mechanicDialogIndex;
}
else
{
operator delete(v41);
m_mechanicDialogIndex = a1->m_mechanicDialogIndex;
}
LABEL_3:
v5 = m_mechanicDialogIndex + 1;
if ( m_mechanicDialogIndex + 1 >= 5 )
v5 = 0;
a1->m_mechanicDialogIndex = v5;
v6 = DialogLayer::createWithObjects(v2, (int)&byte_4);
a1->addChild_0(a1, v6, 100);
v6->setTag(v6, 4);
}
DialogLayer::updateChatPlacement(v6, Center);
DialogLayer::animateInRandomSide(v6);
}