//
// NumberInputLayer::onNumber from 0x1403489b0 to 0x140348b34 (388 bytes)
//
// 4 xrefs:
// > NumberInputLayer::init @ 0x1403486c0
// > ??> @ 0x140696100
// > ??> @ 0x140696110
// > ??> @ 0x1406d5a08
//
// 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
//
void NumberInputLayer::onNumber(NumberInputLayer *a1, cocos2d::CCObject *a2)
{
int v3; // edx
std::size_t m_size; // rax
std::size_t v5; // r8
bool v6; // cf
std::string *p_m_inputString; // rdx
bool v8; // cc
void *v9; // rcx
NumberInputDelegate *m_delegate; // rcx
_BOOL8 v11; // rdx
cocos2d::CCString *v12; // rax
char *CString; // rax
size_t v14; // r8
void *Block[2]; // [rsp+28h] [rbp-30h] BYREF
__int128 v16; // [rsp+38h] [rbp-20h]
v3 = a2->getTag(a2);
if ( v3 == 10 )
{
m_size = a1->m_inputString.m_data.m_size;
if ( !m_size )
return;
v5 = m_size - 1;
v6 = a1->m_inputString.m_data.m_size == 0;
*(_OWORD *)Block = 0;
if ( v6 )
v5 = a1->m_inputString.m_data.m_size;
p_m_inputString = &a1->m_inputString;
v8 = a1->m_inputString.m_data.m_capacity <= 0xF;
v16 = 0;
if ( !v8 )
p_m_inputString = (std::string *)a1->m_inputString.m_data.m_bigStorage;
sub_14003A930(Block, p_m_inputString, v5);
sub_140051590((__int64)&a1->m_inputString, (__int64)Block);
if ( *((_QWORD *)&v16 + 1) > 0xFu )
{
v9 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v16 + 1) + 1LL) >= 0x1000 )
{
v9 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v9 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v9);
}
LABEL_20:
NumberInputLayer::updateNumberState(a1);
return;
}
if ( v3 != 12 )
{
if ( a1->m_inputString.m_data.m_size >= a1->m_maximum )
return;
v12 = cocos2d::CCString::createWithFormat("%i", v3);
CString = (char *)cocos2d::CCString::getCString(v12);
v14 = -1;
do
++v14;
while ( CString[v14] );
sub_140041270(&a1->m_inputString.m_data.m_bigStorage, CString, v14);
goto LABEL_20;
}
m_delegate = a1->m_delegate;
if ( m_delegate )
m_delegate->numberInputClosed(m_delegate, a1);
a1->setKeypadEnabled(a1, 0);
LOBYTE(v11) = 1;
a1->removeFromParentAndCleanup(a1, v11);
}