//
// PauseLayer::onChangeStartpos from 0x1404d93c0 to 0x1404d9520 (352 bytes)
//
// 5 xrefs:
// > PauseLayer::customSetup @ 0x1404d8cab
// > PauseLayer::startPosSelected @ 0x1404d92d0
// > PauseLayer::createStartPosPopupClosed @ 0x1404d93a7
// > PauseLayer::customSetup @ 0x1404d88db
// > ??> @ 0x14092993c
//
// 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 11:33:04 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall PauseLayer::onChangeStartpos(__int64 a1, __int64 a2)
{
int v3; // ebx
signed int v4; // eax
int v5; // edx
__int16 *v6; // rdx
struct cocos2d::CCObject *v7; // rax
__int64 DisplayName; // rax
const char *v9; // r8
__int64 v10; // rdi
void (__fastcall **v11)(__int64, const char *); // rbx
cocos2d::CCString *v12; // rax
const char *CString; // rax
_BYTE v14[32]; // [rsp+20h] [rbp-38h] BYREF
v3 = 0;
if ( a2 )
v3 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);
v4 = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 608));
if ( v3 == -1 )
{
--*(_DWORD *)(a1 + 600);
}
else if ( v3 == 1 )
{
++*(_DWORD *)(a1 + 600);
}
v5 = *(_DWORD *)(a1 + 600);
if ( v5 >= 0 )
{
if ( v5 > v4 )
{
*(_DWORD *)(a1 + 600) = 0;
v6 = (__int16 *)"None";
goto LABEL_18;
}
}
else
{
*(_DWORD *)(a1 + 600) = v4;
v5 = v4;
}
if ( !v5 )
{
v6 = (__int16 *)"None";
LABEL_18:
(**(void (__fastcall ***)(__int64, __int16 *))(*(_QWORD *)(a1 + 592) + 360LL))(*(_QWORD *)(a1 + 592) + 360LL, v6);
goto LABEL_19;
}
v7 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 608), v5 - 1);
if ( !v7 )
{
v6 = &word_14070EC0C;
goto LABEL_18;
}
DisplayName = StartPosObject::getDisplayName(v7, v14);
v9 = (const char *)DisplayName;
if ( *(_QWORD *)(DisplayName + 24) > 0xFu )
v9 = *(const char **)DisplayName;
v10 = *(_QWORD *)(a1 + 592);
v11 = *(void (__fastcall ***)(__int64, const char *))(v10 + 360);
v12 = cocos2d::CCString::createWithFormat("%i: %s", *(_DWORD *)(a1 + 600), v9);
CString = cocos2d::CCString::getCString(v12);
(*v11)(v10 + 360, CString);
sub_14003D310((__int64)v14);
LABEL_19:
cocos2d::CCLabelBMFont::limitLabelWidth(*(cocos2d::CCLabelBMFont **)(a1 + 592), 150.0, 0.5, 0.0);
*(_BYTE *)(a1 + 616) = 1;
}