//
// ThreadViewPopup::threadSendFailed from 0x1400de840 to 0x1400deab2 (626 bytes)
//
// 3 xrefs:
// > ??> @ 0x14072a1d8
// > ??> @ 0x140914a2c
// > ??> @ 0x140914a38
//
// 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 11:26:29 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall ThreadViewPopup::threadSendFailed(__int64 a1)
{
char v2; // si
struct cocos2d::CCObject *v3; // rdx
cocos2d::CCArray *v4; // rcx
__int64 v5; // rax
size_t v6; // rbx
_BYTE *v7; // rax
size_t v8; // r8
char v9; // r14
void *v10; // rcx
_QWORD *v11; // rdx
__int64 *v12; // rdi
__int64 v13; // rbx
__int64 v14; // rdx
__int64 v15; // r8
__int64 v16; // rax
__int128 v17; // [rsp+38h] [rbp-48h] BYREF
__int64 v18; // [rsp+48h] [rbp-38h]
__int64 v19; // [rsp+50h] [rbp-30h]
void *Block[2]; // [rsp+58h] [rbp-28h] BYREF
__int128 v21; // [rsp+68h] [rbp-18h]
v2 = 0;
if ( !*(_BYTE *)(a1 + 110) )
ThreadViewPopup::setSendPending(a1 - 672, 0);
v3 = *(struct cocos2d::CCObject **)(a1 + 368);
if ( v3 )
{
cocos2d::CCArray::removeObject(*(cocos2d::CCArray **)(a1 + 80), v3, 1);
v4 = *(cocos2d::CCArray **)(a1 + 472);
if ( v4 )
cocos2d::CCArray::removeObject(v4, *(struct cocos2d::CCObject **)(a1 + 368), 1);
*(_QWORD *)(a1 + 368) = 0;
ThreadViewPopup::buildRows(a1 - 672, 0);
v5 = *(_QWORD *)(a1 + 248);
v6 = -1;
if ( !v5 )
goto LABEL_11;
v7 = (_BYTE *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(*(_QWORD *)(v5 + 592) + 600LL) + 8LL))(*(_QWORD *)(v5 + 592) + 600LL);
*(_OWORD *)Block = 0;
v21 = 0;
v8 = -1;
do
++v8;
while ( v7[v8] );
sub_14003D230(Block, v7, v8);
v2 = 3;
if ( (_QWORD)v21 )
LABEL_11:
v9 = 0;
else
v9 = 1;
if ( (v2 & 1) != 0 && *((_QWORD *)&v21 + 1) > 0xFu )
{
v10 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v21 + 1) + 1LL) >= 0x1000 )
{
v10 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v10 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v10);
}
if ( v9 )
{
v11 = (_QWORD *)(a1 + 296);
if ( *(_QWORD *)(a1 + 320) > 0xFu )
v11 = (_QWORD *)*v11;
*(_OWORD *)Block = 0;
v21 = 0u;
do
++v6;
while ( *((_BYTE *)v11 + v6) );
sub_14003D230(Block, v11, v6);
CCTextInputNode::setString(*(_QWORD **)(a1 + 248), Block);
}
}
if ( !byte_1409097D9 )
{
v12 = *(__int64 **)(cocos2d::CCDirector::sharedDirector(a1) + 272);
v17 = 0;
v18 = 0;
v19 = 15;
LOBYTE(v17) = 0;
*(_QWORD *)&v21 = 11;
*((_QWORD *)&v21 + 1) = 15;
Block[0] = (void *)0x69616620646E6553LL;
Block[1] = (void *)6579564;
v13 = *v12;
v16 = TextAlertPopup::create(Block, v14, v15, 150, &v17);
(*(void (__fastcall **)(__int64 *, __int64, __int64))(v13 + 456))(v12, v16, 1000);
}
}