//
// MPLobbyLayer::joinLobbyFinished from 0x10048b0e0 to 0x10048b3cd (749 bytes)
//
// 2 xrefs:
// > sub_10048B420 @ 0x10048b42c
// > ??> @ 0x100b4e050
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:30:44 +0000
//
__int64 __fastcall MPLobbyLayer::joinLobbyFinished(__int64 a1, int a2)
{
__int64 v2; // r13
__int64 v3; // rax
__int64 v4; // rax
__int64 v5; // r14
__int64 v6; // rax
const char *v7; // r15
size_t v8; // rax
std::string::size_type v9; // rbx
char *data; // r12
__int64 v11; // r14
__int64 v12; // rax
__int64 CString; // rax
size_t v14; // r13
unsigned int i; // r12d
__int64 v16; // r15
__int64 v17; // rax
const std::string::value_type *v18; // rax
__int64 v19; // rdi
__m128 v20; // xmm0
_OWORD *v21; // rbx
__int64 v22; // rax
__int64 v23; // rax
timeb v25; // [rsp+0h] [rbp-80h] BYREF
__int64 v26; // [rsp+10h] [rbp-70h]
std::string::pointer v27; // [rsp+18h] [rbp-68h]
__int128 v28; // [rsp+20h] [rbp-60h] BYREF
void *__p; // [rsp+30h] [rbp-50h]
int v30; // [rsp+3Ch] [rbp-44h]
std::string __dst[2]; // [rsp+40h] [rbp-40h] BYREF
v2 = a1;
*(_DWORD *)(a1 + 448) = a2;
v3 = GJMultiplayerManager::sharedState(a1);
v4 = cocos2d::CCDictionary::objectForKey_1(*(_QWORD *)(v3 + 336), *(int *)(a1 + 448));
if ( !v4 )
{
v11 = *(_QWORD *)(a1 + 456);
v12 = sub_10088E820("MPLobbyLayer::joinLobbyFinished: %i", v25.time);
CString = cocos2d::CCString::getCString(v12);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 928LL))(v11, CString);
goto LABEL_23;
}
v5 = v4;
v6 = sub_10088E820("Game: %i", v25.time);
v7 = (const char *)cocos2d::CCString::getCString(v6);
v8 = strlen(v7);
if ( v8 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v9 = v8;
v26 = v5;
if ( v8 >= 0x17 )
{
v14 = 26;
if ( (v8 | 7) != 0x17 )
v14 = (v8 | 7) + 1;
data = (char *)operator new(v14);
__dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst[0].__r_.__value_.__r.__words[0] = v14 + 1;
v2 = a1;
v5 = v26;
__dst[0].__r_.__value_.__l.__size_ = v9;
goto LABEL_10;
}
__dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v8);
data = __dst[0].__r_.__value_.__s.__data_;
if ( v8 )
LABEL_10:
memmove(data, v7, v9);
v27 = __dst[0].__r_.__value_.__s.__data_;
data[v9] = 0;
for ( i = 0; i < (unsigned int)sub_1007FEF90(v5); ++i )
{
v16 = sub_1007FEFE0(v5, i);
v30 = *(_DWORD *)(v16 + 376);
if ( (*(_BYTE *)(v16 + 320) & 1) != 0 )
{
sub_10001AD30(&v28, *(const void **)(v16 + 336), *(_QWORD *)(v16 + 328));
}
else
{
__p = *(void **)(v16 + 336);
v28 = *(_OWORD *)(v16 + 320);
}
ftime(&v25);
v17 = sub_10088E820("\n%i: %s - Last Action: %f", v25.time);
v18 = (const std::string::value_type *)cocos2d::CCString::getCString(v17);
std::string::append(__dst, v18);
if ( (v28 & 1) != 0 )
operator delete(__p);
v5 = v26;
}
v19 = *(_QWORD *)(v2 + 456);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
v27 = __dst[0].__r_.__value_.__l.__data_;
(*(void (__fastcall **)(__int64, std::string::pointer))(*(_QWORD *)v19 + 928LL))(v19, v27);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst[0].__r_.__value_.__l.__data_);
LABEL_23:
*(_BYTE *)(v2 + 492) = 0;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v2 + 1168LL))(v2);
if ( *(_BYTE *)(v2 + 492) )
{
v20 = (__m128)0x40000000u;
}
else
{
v20 = (__m128)0x41200000u;
v20.f32[0] = fminf(10.0, *(float *)(v2 + 488) + 0.5);
}
*(_DWORD *)(v2 + 488) = v20.i32[0];
v21 = cocos2d::CCDelayTime::create(v20);
v22 = cocos2d::CCCallFunc::create(v2, MPLobbyLayer::onUpdateLobby, 0);
v23 = sub_10039EB60((__int64)v21, v22, 0);
return cocos2d::CCNode::runAction(v2, v23);
}