//
// LevelBrowserLayer::onGoToPage from 0x6e73a0 to 0x6e75a4 (516 bytes)
//
// 3 xrefs:
// > ??> @ 0x8ac48
// > LevelBrowserLayer::init @ 0x6eaf98
// > ??> @ 0x122cb90
//
// 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 LevelBrowserLayer::onGoToPage(LevelBrowserLayer *a1, cocos2d::CCObject *a2)
{
GJSearchObject *m_searchObject; // x0
unsigned int v4; // w20
_QWORD *v5; // x20
void *v6; // x0
void *v7; // x0
unsigned int *v8; // x1
int v9; // w2
unsigned int *v10; // x1
int v11; // w2
__int64 v12; // [xsp+68h] [xbp+58h] BYREF
__int64 v13; // [xsp+70h] [xbp+60h] BYREF
m_searchObject = a1->m_searchObject;
if ( m_searchObject )
{
v4 = m_searchObject->m_page + 1;
sub_D153B8((int)&v12, "Go to Page");
sub_D153B8((int)&v13, "Go");
v5 = (_QWORD *)SetIDPopup::create(
(SetIDPopup *)v4,
1,
1000,
(int)&v12,
(std::string)&v13,
(std::string)1LL,
1,
0,
60.0,
0);
v6 = (void *)(v13 - 24);
if ( (__int64 *)(v13 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)(v13 - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *(_DWORD *)(v13 - 8);
*(_DWORD *)(v13 - 8) = v9 - 1;
}
if ( v9 <= 0 )
operator delete(v6);
}
v7 = (void *)(v12 - 24);
if ( (__int64 *)(v12 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v10 = (unsigned int *)(v12 - 8);
do
v11 = __ldaxr(v10);
while ( __stlxr(v11 - 1, v10) );
}
else
{
v11 = *(_DWORD *)(v12 - 8);
*(_DWORD *)(v12 - 8) = v11 - 1;
}
if ( v11 <= 0 )
operator delete(v7);
}
(*(void (__fastcall **)(_QWORD *, __int64))(*v5 + 72LL))(v5, 3);
v5[84] = &a1->SetIDPopupDelegate;
(*(void (__fastcall **)(_QWORD *))(*v5 + 1288LL))(v5);
}
}