//
// SetTextPopup::onClose from 0xa2c980 to 0xa2cbc4 (580 bytes)
//
// 4 xrefs:
// > SetTextPopup::onCancel @ 0xa2cbd4
// > ??> @ 0xe7130
// > SetTextPopup::init @ 0xa2fc68
// > ??> @ 0x1546f78
//
// This function is hookable on this platform (idp: arm, 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:59:45 +0000
//
__int64 __fastcall SetTextPopup::onClose(SetTextPopup *this, cocos2d::CCObject *a2)
{
int v3; // w1
void (__fastcall *v4)(SetTextPopup *, __int64, __int64); // x23
__int64 v5; // x0
__int64 v6; // x0
void (__fastcall ***v7)(_QWORD, SetTextPopup *, __int64 *); // x21
char v8; // w0
void (__fastcall *v9)(_QWORD, SetTextPopup *, __int64 *); // x23
__int64 v10; // x0
__int64 v11; // x1
__int64 v13[2]; // [xsp+48h] [xbp+48h] BYREF
void *v14; // [xsp+58h] [xbp+58h]
__int64 v15; // [xsp+60h] [xbp+60h] BYREF
__int64 v16; // [xsp+68h] [xbp+68h]
void *v17; // [xsp+70h] [xbp+70h]
if ( *((_BYTE *)this + 681)
|| (v3 = *((_DWORD *)this + 181), v3 <= 0)
|| (int)EmoteSprite::effectiveLength((char *)this + 696, v3) <= *((_DWORD *)this + 180) )
{
v6 = *((_QWORD *)this + 92);
if ( v6 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v6 + 1368LL))(v6, 0);
*(_QWORD *)(*((_QWORD *)this + 84) + 584LL) = 0;
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 84) + 1160LL))(*((_QWORD *)this + 84), 0);
v7 = *((void (__fastcall ****)(_QWORD, SetTextPopup *, __int64 *))this + 93);
if ( v7 && !*((_BYTE *)this + 681) )
{
v8 = *((_BYTE *)this + 696);
v9 = **v7;
v15 = 0;
v16 = 0;
v17 = nullptr;
if ( (v8 & 1) != 0 )
{
std::string::__init(&v15, *((void **)this + 89), *((_QWORD *)this + 88));
}
else
{
v10 = *((_QWORD *)this + 87);
v11 = *((_QWORD *)this + 88);
v17 = *((void **)this + 89);
v15 = v10;
v16 = v11;
}
v9(v7, this, &v15);
if ( (v15 & 1) != 0 )
operator delete(v17);
}
(*(void (__fastcall **)(SetTextPopup *, _QWORD))(*(_QWORD *)this + 1072LL))(this, 0);
(*(void (__fastcall **)(SetTextPopup *, __int64))(*(_QWORD *)this + 528LL))(this, 1);
}
else
{
v4 = *(void (__fastcall **)(SetTextPopup *, __int64, __int64))(*(_QWORD *)this + 464LL);
v13[0] = 0;
v13[1] = 0;
v14 = nullptr;
std::string::__init(v13, "Text too long", 0xDu);
v15 = 0;
v16 = 0;
v17 = nullptr;
std::string::__init(&v15, &byte_11B8890, 0);
v5 = TextAlertPopup::create((char *)v13, 150, (char *)&v15, 0.5, 0.6);
v4(this, v5, 100);
if ( (v15 & 1) != 0 )
operator delete(v17);
if ( (v13[0] & 1) != 0 )
operator delete(v14);
}
return _stack_chk_guard;
}