//
// NumberInputLayer::deleteLast from 0x824064 to 0x8241b4 (336 bytes)
//
// 2 xrefs:
// > NumberInputLayer::onNumber @ 0x82424c
// > ??> @ 0x746b8
//
// 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::deleteLast(NumberInputLayer *a1)
{
std::string *p_m_inputString; // x22
__int64 v3; // x3
void *v4; // x0
unsigned int *v5; // x2
int v6; // w1
__int64 v7; // [xsp+40h] [xbp+40h] BYREF
p_m_inputString = &a1->m_inputString;
v3 = *((_QWORD *)a1->m_inputString.m_data.m_data - 3);
if ( v3 )
{
sub_D14F84(&v7, p_m_inputString, 0, v3 - 1);
sub_D163D4(p_m_inputString, &v7);
v4 = (void *)(v7 - 24);
if ( (__int64 *)(v7 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v5 = (unsigned int *)(v7 - 8);
do
v6 = __ldaxr(v5);
while ( __stlxr(v6 - 1, v5) );
}
else
{
v6 = *(_DWORD *)(v7 - 8);
*(_DWORD *)(v7 - 8) = v6 - 1;
}
if ( v6 <= 0 )
operator delete(v4);
}
NumberInputLayer::updateNumberState(a1);
}
}