//
// GameLevelManager::performNetworkTest from 0x71b9dc to 0x71bcb8 (732 bytes)
//
// 2 xrefs:
// > MenuLayer::firstNetworkTest @ 0x5c1e78
// > ??> @ 0xb61f0
//
// 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 GameLevelManager::performNetworkTest(GameLevelManager *a1)
{
__int64 v2; // x19
__int64 v3; // x2
__int64 v4; // x2
int v5; // w0
cocos2d::extension::CCHttpClient *Instance; // x0
char *v7; // x21
unsigned int *v8; // x19
int v9; // w0
char *v10; // [xsp+68h] [xbp+68h]
char *v11; // [xsp+80h] [xbp+80h] BYREF
if ( !a1->m_testedNetwork )
{
a1->m_testedNetwork = 1;
sub_D153B8((int)&v11, "temp");
v2 = operator new(0xB8u);
cocos2d::CCObject::CCObject((cocos2d::CCObject *)v2);
*(_QWORD *)v2 = &off_115DF30;
*(_QWORD *)(v2 + 72) = 0;
*(_QWORD *)(v2 + 64) = &byte_124B6C8;
*(_QWORD *)(v2 + 80) = 0;
*(_QWORD *)(v2 + 88) = 0;
*(_QWORD *)(v2 + 96) = &byte_124B6C8;
*(_QWORD *)(v2 + 136) = 0;
*(_QWORD *)(v2 + 144) = 0;
*(_QWORD *)(v2 + 152) = 0;
v3 = qword_124B6B0;
*(_DWORD *)(v2 + 56) = 5;
sub_D174B8(v2 + 64, 0, v3, 0);
v4 = *(_QWORD *)(v2 + 96);
*(_QWORD *)(v2 + 80) = *(_QWORD *)(v2 + 72);
sub_D174B8(v2 + 96, 0, *(_QWORD *)(v4 - 24), 0);
*(_QWORD *)(v2 + 104) = 0;
*(_QWORD *)(v2 + 112) = 0;
*(_QWORD *)(v2 + 120) = 0;
*(_QWORD *)(v2 + 128) = 0;
*(_DWORD *)(v2 + 160) = 0;
*(_BYTE *)(v2 + 164) = 0;
*(_DWORD *)(v2 + 168) = 0;
*(_DWORD *)(v2 + 172) = 0;
*(_DWORD *)(v2 + 176) = 0;
sub_D1798C(v2 + 64, "https://www.google.com", 22);
*(_DWORD *)(v2 + 172) = 1;
*(_DWORD *)(v2 + 56) = 1;
*(_QWORD *)(v2 + 104) = a1;
*(_QWORD *)(v2 + 112) = GameLevelManager::onProcessHttpRequestCompleted;
*(_QWORD *)(v2 + 120) = 0;
cocos2d::CCObject::retain(a1);
v10 = v11;
v5 = strlen(v11);
std::vector::_M_assign_aux((void **)(v2 + 72), v10, &v10[v5]);
sub_D1798C(v2 + 96, "tag", 3);
*(_DWORD *)(v2 + 160) = (unsigned int)&word_38;
Instance = cocos2d::extension::CCHttpClient::getInstance();
cocos2d::extension::CCHttpClient::send(Instance, (cocos2d::extension::CCHttpRequest *)v2);
cocos2d::CCObject::release((cocos2d::CCObject *)v2);
v7 = v11 - 24;
if ( v11 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)(v11 - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *((_DWORD *)v11 - 2);
*((_DWORD *)v11 - 2) = v9 - 1;
}
if ( v9 <= 0 )
operator delete(v7);
}
}
}