//
// GJGarageLayer::showUnlockPopup from 0x796368 to 0x796ad4 (1900 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'GJGarageLayer::showUnlockPopup @ 0x796adc
// > ??> @ 0x50790
// > ??> @ 0x1178aa0
//
// 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 GJGarageLayer::showUnlockPopup(GJGarageLayer *a1, int a2, UnlockType a3)
{
cocos2d::CCArray *v4; // x24
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
cocos2d::CCObject *v20; // x0
void *v21; // x0
void *v22; // x0
DialogLayer *v23; // x19
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
unsigned int *v42; // x1
int v43; // w2
unsigned int *v44; // x1
int v45; // w2
unsigned int *v46; // x1
int v47; // w2
_QWORD v48[2]; // [xsp+0h] [xbp+0h] BYREF
__int64 v49; // [xsp+78h] [xbp+78h] BYREF
__int64 v50; // [xsp+80h] [xbp+80h] BYREF
cocos2d::_ccColor3B v51; // 0:w5.3
cocos2d::_ccColor3B v52; // 0:w5.3
cocos2d::_ccColor3B v53; // 0:w5.3
cocos2d::_ccColor3B v54; // 0:w5.3
cocos2d::_ccColor3B v55; // 0:w5.3
cocos2d::_ccColor3B v56; // 0:w5.3
if ( a3 == 1 && a2 == 13 )
{
v4 = (cocos2d::CCArray *)cocos2d::CCArray::create(_stack_chk_guard);
sub_D153B8((int)&v49, "Scratch");
sub_D153B8((unsigned int)v48 + 128, "Hey, over here...");
v5 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v49,
(std::string)&v50,
(std::string)10LL,
0,
0.8,
(bool)&unk_FFFFFF,
v51);
cocos2d::CCArray::addObject(v4, v5);
v6 = (void *)(v50 - 24);
if ( (__int64 *)(v50 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v26 = (unsigned int *)(v50 - 8);
do
v27 = __ldaxr(v26);
while ( __stlxr(v27 - 1, v26) );
}
else
{
v27 = *(_DWORD *)(v50 - 8);
*(_DWORD *)(v50 - 8) = v27 - 1;
}
if ( v27 <= 0 )
operator delete(v6);
}
v7 = (void *)(v49 - 24);
if ( (__int64 *)(v49 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v28 = (unsigned int *)(v49 - 8);
do
v29 = __ldaxr(v28);
while ( __stlxr(v29 - 1, v28) );
}
else
{
v29 = *(_DWORD *)(v49 - 8);
*(_DWORD *)(v49 - 8) = v29 - 1;
}
if ( v29 <= 0 )
operator delete(v7);
}
sub_D153B8((unsigned int)v48 + 120, "Scratch");
sub_D153B8((unsigned int)v48 + 128, "I've been watching you, and you got some skills.");
v8 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v49,
(std::string)&v50,
(std::string)13LL,
0,
1.0,
(bool)&unk_FFFFFF,
v52);
cocos2d::CCArray::addObject(v4, v8);
v9 = (void *)(v50 - 24);
if ( (__int64 *)(v50 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v30 = (unsigned int *)(v50 - 8);
do
v31 = __ldaxr(v30);
while ( __stlxr(v31 - 1, v30) );
}
else
{
v31 = *(_DWORD *)(v50 - 8);
*(_DWORD *)(v50 - 8) = v31 - 1;
}
if ( v31 <= 0 )
operator delete(v9);
}
v10 = (void *)(v49 - 24);
if ( (__int64 *)(v49 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v32 = (unsigned int *)(v49 - 8);
do
v33 = __ldaxr(v32);
while ( __stlxr(v33 - 1, v32) );
}
else
{
v33 = *(_DWORD *)(v49 - 8);
*(_DWORD *)(v49 - 8) = v33 - 1;
}
if ( v33 <= 0 )
operator delete(v10);
}
sub_D153B8((unsigned int)v48 + 120, "Scratch");
sub_D153B8((unsigned int)v48 + 128, "Whatever you need, Scratch's got it.");
v11 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v49,
(std::string)&v50,
(std::string)10LL,
0,
1.0,
(bool)&unk_FFFFFF,
v53);
cocos2d::CCArray::addObject(v4, v11);
v12 = (void *)(v50 - 24);
if ( (__int64 *)(v50 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v34 = (unsigned int *)(v50 - 8);
do
v35 = __ldaxr(v34);
while ( __stlxr(v35 - 1, v34) );
}
else
{
v35 = *(_DWORD *)(v50 - 8);
*(_DWORD *)(v50 - 8) = v35 - 1;
}
if ( v35 <= 0 )
operator delete(v12);
}
v13 = (void *)(v49 - 24);
if ( (__int64 *)(v49 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v36 = (unsigned int *)(v49 - 8);
do
v37 = __ldaxr(v36);
while ( __stlxr(v37 - 1, v36) );
}
else
{
v37 = *(_DWORD *)(v49 - 8);
*(_DWORD *)(v49 - 8) = v37 - 1;
}
if ( v37 <= 0 )
operator delete(v13);
}
sub_D153B8((unsigned int)v48 + 120, "Scratch");
sub_D153B8((unsigned int)v48 + 128, "Here's a free sample. Come find me when you can.");
v14 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v49,
(std::string)&v50,
(std::string)8LL,
0,
1.0,
(bool)&unk_FFFFFF,
v54);
cocos2d::CCArray::addObject(v4, v14);
v15 = (void *)(v50 - 24);
if ( (__int64 *)(v50 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v38 = (unsigned int *)(v50 - 8);
do
v39 = __ldaxr(v38);
while ( __stlxr(v39 - 1, v38) );
}
else
{
v39 = *(_DWORD *)(v50 - 8);
*(_DWORD *)(v50 - 8) = v39 - 1;
}
if ( v39 <= 0 )
operator delete(v15);
}
v16 = (void *)(v49 - 24);
if ( (__int64 *)(v49 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v40 = (unsigned int *)(v49 - 8);
do
v41 = __ldaxr(v40);
while ( __stlxr(v41 - 1, v40) );
}
else
{
v41 = *(_DWORD *)(v49 - 8);
*(_DWORD *)(v49 - 8) = v41 - 1;
}
if ( v41 <= 0 )
operator delete(v16);
}
sub_D153B8((unsigned int)v48 + 120, "Scratch");
sub_D153B8((unsigned int)v48 + 128, "Did you hear something?");
v17 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v49,
(std::string)&v50,
(std::string)9LL,
0,
1.0,
(bool)&unk_FFFFFF,
v55);
cocos2d::CCArray::addObject(v4, v17);
v18 = (void *)(v50 - 24);
if ( (__int64 *)(v50 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v42 = (unsigned int *)(v50 - 8);
do
v43 = __ldaxr(v42);
while ( __stlxr(v43 - 1, v42) );
}
else
{
v43 = *(_DWORD *)(v50 - 8);
*(_DWORD *)(v50 - 8) = v43 - 1;
}
if ( v43 <= 0 )
operator delete(v18);
}
v19 = (void *)(v49 - 24);
if ( (__int64 *)(v49 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v44 = (unsigned int *)(v49 - 8);
do
v45 = __ldaxr(v44);
while ( __stlxr(v45 - 1, v44) );
}
else
{
v45 = *(_DWORD *)(v49 - 8);
*(_DWORD *)(v49 - 8) = v45 - 1;
}
if ( v45 <= 0 )
operator delete(v19);
}
sub_D153B8((unsigned int)v48 + 120, "Scratch");
sub_D153B8((unsigned int)v48 + 128, "...");
v20 = (cocos2d::CCObject *)DialogObject::create(
(DialogObject *)&v49,
(std::string)&v50,
(std::string)8LL,
0,
1.0,
(bool)&unk_FFFFFF,
v56);
cocos2d::CCArray::addObject(v4, v20);
v21 = (void *)(v50 - 24);
if ( (__int64 *)(v50 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v46 = (unsigned int *)(v50 - 8);
do
v47 = __ldaxr(v46);
while ( __stlxr(v47 - 1, v46) );
}
else
{
v47 = *(_DWORD *)(v50 - 8);
*(_DWORD *)(v50 - 8) = v47 - 1;
}
if ( v47 <= 0 )
operator delete(v21);
}
v22 = (void *)(v49 - 24);
if ( (__int64 *)(v49 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v24 = (unsigned int *)(v49 - 8);
do
v25 = __ldaxr(v24);
while ( __stlxr(v25 - 1, v24) );
}
else
{
v25 = *(_DWORD *)(v49 - 8);
*(_DWORD *)(v49 - 8) = v25 - 1;
}
if ( v25 <= 0 )
operator delete(v22);
}
v23 = DialogLayer::createWithObjects(v4, (int)&dword_0 + 2);
a1->addChild_0(a1, v23, 100);
v23->m_delegate = &a1->DialogDelegate;
DialogLayer::updateChatPlacement(v23, Center);
DialogLayer::animateIn(v23, FromLeft);
}
else
{
GJGarageLayer::showUnlockPopupNew(a1, a2, a3);
}
}