//
// SetFolderPopup::valueChanged from 0x1403a6a40 to 0x1403a6ba0 (352 bytes)
//
// 2 xrefs:
// > ??> @ 0x1407799c0
// > ??> @ 0x140923804
//
// 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:31:19 +0000
//
// Hidden C++ exception states: #wind=4
void __fastcall SetFolderPopup::valueChanged(__int64 a1)
{
__int64 v2; // rcx
_QWORD *FolderName; // rax
size_t v4; // r8
void **v5; // rdx
void *v6; // rcx
void *v7; // [rsp+30h] [rbp-58h]
void *Block[2]; // [rsp+38h] [rbp-50h] BYREF
__int64 v9; // [rsp+48h] [rbp-40h]
unsigned __int64 v10; // [rsp+50h] [rbp-38h]
_QWORD v11[4]; // [rsp+58h] [rbp-30h] BYREF
if ( *(_QWORD *)(a1 + 720) )
{
v2 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v7 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v7);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v2 = *(_QWORD *)&qword_14090BFB0;
}
FolderName = GameLevelManager::getFolderName(v2, v11, *(_DWORD *)(a1 + 672), *(_BYTE *)(a1 + 712));
if ( FolderName[3] > 0xFu )
FolderName = (_QWORD *)*FolderName;
*(_OWORD *)Block = 0;
v9 = 0;
v10 = 0;
v4 = -1;
do
++v4;
while ( *((_BYTE *)FolderName + v4) );
sub_14003D230(Block, FolderName, v4);
sub_14003D310((__int64)v11);
v5 = Block;
if ( v10 > 0xF )
v5 = (void **)Block[0];
(**(void (__fastcall ***)(__int64, void **))(*(_QWORD *)(a1 + 720) + 360LL))(*(_QWORD *)(a1 + 720) + 360LL, v5);
if ( v10 > 0xF )
{
v6 = Block[0];
if ( v10 + 1 >= 0x1000 )
{
v6 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v6);
}
}
}