//
// TextGameObject::customObjectSetup from 0x1401a7940 to 0x1401a7b00 (448 bytes)
//
// 2 xrefs:
// > ??> @ 0x14055e018
// > ??> @ 0x1406cc120
//
// 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
//
// Hidden C++ exception states: #wind=3
void TextGameObject::customObjectSetup(TextGameObject *a1, std::vector *a2, std::vector *a3)
{
int v6; // eax
std::_Vector_val>::pointer m_bigStorage; // rcx
__int64 v8; // rax
char v9; // bl
char v10; // bl
void *v11; // rcx
__int128 v12; // [rsp+28h] [rbp-51h] BYREF
__int128 v13; // [rsp+38h] [rbp-41h]
__int128 *v14; // [rsp+48h] [rbp-31h]
_OWORD v15[2]; // [rsp+50h] [rbp-29h] BYREF
void *Block[2]; // [rsp+70h] [rbp-9h] BYREF
__int64 v17; // [rsp+80h] [rbp+7h]
unsigned __int64 v18; // [rsp+88h] [rbp+Fh]
_BYTE v19[32]; // [rsp+90h] [rbp+17h] BYREF
if ( *((_QWORD *)a3->_Mypair._Myval2._Myfirst + 488) )
{
m_bigStorage = a2->_Mypair._Myval2._Myfirst + 488;
if ( a2->_Mypair._Myval2._Myfirst[488].m_data.m_capacity > 0xF )
m_bigStorage = (std::_Vector_val>::pointer)m_bigStorage->m_data.m_bigStorage;
v6 = atoi(m_bigStorage->m_data.m_smallStorage._Elems);
}
else
{
v6 = 0;
}
a1->updateTextKerning(a1, v6);
if ( *((_QWORD *)a3->_Mypair._Myval2._Myfirst + 31) )
{
v8 = sub_14003BDB0((__int64)v19, (__int64)&a2->_Mypair._Myval2._Myfirst[31]);
v9 = 2;
}
else
{
*(_OWORD *)Block = 0;
v17 = 0;
v18 = 15;
LOBYTE(Block[0]) = 0;
v8 = (__int64)Block;
v9 = 1;
}
v12 = 0;
v13 = 0u;
v12 = *(_OWORD *)v8;
v13 = *(_OWORD *)(v8 + 16);
*(_QWORD *)(v8 + 16) = 0;
*(_QWORD *)(v8 + 24) = 15;
*(_BYTE *)v8 = 0;
v14 = &v12;
v10 = v9 | 4;
if ( (_QWORD)v13 )
{
cocos2d::ZipUtils::base64URLDecode(v15, &v12);
}
else
{
v15[0] = v12;
v15[1] = v13;
*(_QWORD *)&v13 = 0;
*((_QWORD *)&v13 + 1) = 15;
LOBYTE(v12) = 0;
}
sub_14003A830((__int64)&v12);
TextGameObject::updateTextObject((__int64 *)a1, (struct cocos2d::CCPoint)v15, 0);
if ( (v10 & 2) != 0 )
{
v10 &= ~2u;
sub_14003A830((__int64)v19);
}
if ( (v10 & 1) != 0 && v18 > 0xF )
{
v11 = Block[0];
if ( v18 + 1 >= 0x1000 )
{
v11 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v11 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v11);
}
}