//
// ControlSlotsPopup::onSave from 0x10097c130 to 0x10097c275 (325 bytes)
//
// 1 xrefs:
// > ControlSlotsPopup::init @ 0x10097beb7
//
// 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 12:38:57 +0000
//
void __fastcall ControlSlotsPopup::onSave(__int64 a1, __int64 a2)
{
unsigned int v3; // r14d
__int64 v4; // rdi
__int64 v5; // rax
char *v6; // rax
const char *CString; // r15
size_t v8; // rax
size_t v9; // r14
char *v10; // r12
size_t v11; // r13
char *v12; // rax
__int128 v13; // [rsp+8h] [rbp-58h] BYREF
void *__p; // [rsp+18h] [rbp-48h]
__int128 __dst; // [rsp+20h] [rbp-40h] BYREF
void *v16; // [rsp+30h] [rbp-30h]
v3 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
v4 = *(_QWORD *)(a1 + 1016);
if ( v4 )
TouchControlEditLayer::saveTarget(v4);
v5 = GameManager::sharedState();
GameManager::saveDPadLayout(v5, v3, *(unsigned __int8 *)(a1 + 1024));
v6 = sub_10088E820("Slot %i saved", v3);
CString = (const char *)cocos2d::CCString::getCString((__int64)v6);
v8 = strlen(CString);
if ( v8 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v9 = v8;
if ( v8 >= 0x17 )
{
v11 = 26;
if ( (v8 | 7) != 0x17 )
v11 = (v8 | 7) + 1;
v10 = (char *)operator new(v11);
v16 = v10;
*(_QWORD *)&__dst = v11 + 1;
*((_QWORD *)&__dst + 1) = v9;
goto LABEL_10;
}
LOBYTE(__dst) = 2 * v8;
v10 = (char *)&__dst + 1;
if ( v8 )
LABEL_10:
memmove(v10, CString, v9);
v10[v9] = 0;
LOWORD(v13) = 0;
v12 = TextAlertPopup::create(&__dst, 0x96u, &v13, 0.5, 0.60000002);
(*(void (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v12, 100);
if ( (v13 & 1) != 0 )
operator delete(__p);
if ( (__dst & 1) != 0 )
operator delete(v16);
}