//
// sub_14007B240 from 0x14007b240 to 0x14007b2af (111 bytes)
//
// 12 xrefs:
// > MultilineBitmapFont::stringWithMaxWidth @ 0x14007b0fc
// > AccountReviewPopup::buildHistoryRows @ 0x1400b78bc
// > GameLevelManager::onGetDeathDataCompleted @ 0x140228a35
// > GameLevelManager::onAdminThreadActionCompleted @ 0x140248467
// > GameLevelManager::onUpdateThreadCompleted @ 0x140253127
// > GJGameLevel::dtAppendOrder @ 0x1402656d1
// > MusicDownloadManager::resolveSFXPlacement @ 0x1404867d4
// > MusicDownloadManager::customSFXPathLeaf @ 0x14048690b
// > MusicDownloadManager::getCustomSFXLocationText @ 0x140487174
// > ??> @ 0x14088a978
// > ??> @ 0x14088a988
// > ??> @ 0x140911d68
//
// 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:25:53 +0000
//
__int64 __fastcall sub_14007B240(__int64 a1, __int64 a2, __int64 a3, unsigned __int8 a4)
{
__int64 v5; // rdx
__int64 v6; // rdi
__int64 v7; // rbx
__int64 v8; // rbx
__int64 v9; // rax
if ( !a2 )
return -1;
v5 = a2 - 1;
v6 = -1;
v7 = -1;
if ( v5 != -1 )
v7 = v5;
v8 = a1 + v7 + 1;
v9 = sub_140677110(a1, v8, a4);
if ( v9 != v8 )
return v9 - a1;
return v6;
}