//
// sub_100953660 from 0x100953660 to 0x1009537bf (351 bytes)
//
// 2 xrefs:
// > ThreadDescPopup::threadUpdateFinished @ 0x100953900
// > ThreadDescPopup::threadUpdateFinished @ 0x100953926
//
// 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:38:39 +0000
//
__int64 __fastcall sub_100953660(__int64 a1, const char *a2)
{
__int64 v2; // r14
size_t v3; // rax
size_t v4; // r12
char *v5; // r13
size_t v6; // r14
char *v7; // rax
__int64 v8; // rax
__int64 v9; // rcx
__int64 v10; // rdx
__int128 v12; // [rsp+0h] [rbp-60h] BYREF
void *__p; // [rsp+10h] [rbp-50h]
__int64 v14; // [rsp+18h] [rbp-48h]
__int128 __dst; // [rsp+20h] [rbp-40h] BYREF
void *v16; // [rsp+30h] [rbp-30h]
*(_BYTE *)(a1 + 1113) = 0;
v2 = *(_QWORD *)(cocos2d::CCDirector::sharedDirector() + 272);
v3 = strlen(a2);
if ( v3 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v4 = v3;
if ( v3 >= 0x17 )
{
v14 = v2;
v6 = 26;
if ( (v3 | 7) != 0x17 )
v6 = (v3 | 7) + 1;
v5 = (char *)operator new(v6);
v16 = v5;
*(_QWORD *)&__dst = v6 + 1;
v2 = v14;
*((_QWORD *)&__dst + 1) = v4;
goto LABEL_8;
}
LOBYTE(__dst) = 2 * v3;
v5 = (char *)&__dst + 1;
if ( v3 )
LABEL_8:
memcpy(v5, a2, v4);
v5[v4] = 0;
LOWORD(v12) = 0;
v7 = TextAlertPopup::create(&__dst, 0x96u, &v12, 0.5, 0.60000002);
(*(void (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)v2 + 464LL))(v2, v7, 1000);
if ( (v12 & 1) != 0 )
{
operator delete(__p);
if ( (__dst & 1) == 0 )
{
LABEL_11:
if ( !*(_QWORD *)(a1 + 1040) )
return (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1368LL))(a1, 0);
goto LABEL_12;
}
}
else if ( (__dst & 1) == 0 )
{
goto LABEL_11;
}
operator delete(v16);
if ( !*(_QWORD *)(a1 + 1040) )
return (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1368LL))(a1, 0);
LABEL_12:
v8 = GameLevelManager::sharedState();
v9 = *(_QWORD *)(a1 + 1040);
v10 = v9 + 672;
if ( !v9 )
v10 = 0;
*(_QWORD *)(v8 + 1264) = v10;
return (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1368LL))(a1, 0);
}