//
// sub_1400CF7C0 from 0x1400cf7c0 to 0x1400cf8b1 (241 bytes)
//
// 11 xrefs:
// > AutoBackupPopup::onToggleRow @ 0x1400cc5a8
// > GameLevelManager::handleIt @ 0x14021a6b7
// > GameLevelManager::handleIt @ 0x14021a79a
// > GameLevelManager::handleIt @ 0x14021a88b
// > GameLevelManager::onUpdateEditorSoundDescriptionCompleted @ 0x1402303ca
// > GameLevelManager::onDeleteServerEditorSoundCompleted @ 0x1402305ae
// > NewsPopup::onBlockClicked @ 0x14049fdf5
// > NewsPopup::newsImageDownloaded @ 0x1404a04ad
// > ??> @ 0x140891640
// > ??> @ 0x140891674
// > ??> @ 0x1409141c8
//
// 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:26:24 +0000
//
__int64 __fastcall sub_1400CF7C0(__int64 *a1, _QWORD *a2)
{
__int64 *v2; // r15
__int64 *v5; // rsi
__int64 *v6; // rbx
__int64 *i; // rdi
_QWORD v9[5]; // [rsp+20h] [rbp-28h] BYREF
v2 = (__int64 *)*a1;
v5 = (__int64 *)*a1;
v6 = *(__int64 **)(*a1 + 8);
for ( i = v6; !*((_BYTE *)i + 25); i = (__int64 *)*i )
{
if ( sub_14003D160(i + 4, a2) >= 0 )
{
if ( *((_BYTE *)v5 + 25) && sub_14003D160(a2, i + 4) < 0 )
v5 = i;
v2 = i;
}
else
{
i += 2;
}
}
if ( !*((_BYTE *)v5 + 25) )
v6 = (__int64 *)*v5;
while ( !*((_BYTE *)v6 + 25) )
{
if ( sub_14003D160(a2, v6 + 4) >= 0 )
{
v6 = (__int64 *)v6[2];
}
else
{
v5 = v6;
v6 = (__int64 *)*v6;
}
}
v9[0] = v2;
v9[1] = v5;
return sub_1400CFF50(a1, v9);
}