//
// sub_1400699B0 from 0x1400699b0 to 0x140069b22 (370 bytes)
//
// 66 xrefs:
// > FMODAudioEngine::channelStopped @ 0x140060dcb
// > FMODAudioEngine::unloadAllEffects @ 0x14006282c
// > FMODAudioEngine::updateTemporaryEffects @ 0x140064165
// > FMODAudioEngine::stopAndRemoveMusic @ 0x140065af3
// > GameToolbox::keepLastPathSegments @ 0x140070657
// > AccountReviewPopup::buildReportedRows @ 0x1400b4471
// > AccountReviewPopup::buildFilterRows @ 0x1400b5cb2
// > ReportPopup::buildReasonRows @ 0x1400bee11
// > AutoBackupPopup::init @ 0x1400ca05c
// > AutoBackupPopup::buildRows @ 0x1400cb19e
// > MessageThreadsPage::init @ 0x1400d591e
// > MessageThreadsPage::init @ 0x1400d597f
// > DeathTrackerPopup::init @ 0x140104f18
// > DeathTrackerPopup::init @ 0x140104f3e
// > DeathTrackerPopup::init @ 0x140104f64
// > DeathTrackerPopup::init @ 0x140104f8f
// > DeathTrackerPopup::init @ 0x140104fba
// > DeathTrackerPopup::init @ 0x1401059bd
// > DropdownListPopup::buildRows @ 0x140122056
// > DropdownListPopup::buildRows @ 0x140122269
// > sub_14019A630 @ 0x14019a649
// > GJRotationControl::init @ 0x1401a2289
// > GJRotationControl::init @ 0x1401a2587
// > GJScaleControl::init @ 0x1401a2fe8
// > GJScaleControl::init @ 0x1401a328d
// > GJTransformControl::init @ 0x1401a51aa
// > FRequestProfilePage::init @ 0x14020fd5f
// > FRequestProfilePage::init @ 0x14020fdc1
// > GameLevelManager::levelControlInstances @ 0x14025a87e
// > GameLevelManager::levelControlInstances @ 0x14025a8b3
// > GameLevelManager::levelControlInstances @ 0x14025a91d
// > GameLevelManager::levelControlInstances @ 0x14025a98c
// > GJBaseGameLayer::sortGroups @ 0x14032c0d1
// > GJBaseGameLayer::addUIObject @ 0x14032ed7c
// > GJBaseGameLayer::addToSection @ 0x14032f528
// > GJBaseGameLayer::addToSection @ 0x14032f6e2
// > GJEffectManager::getMoveCommandNode @ 0x1403698df
// > GJEffectManager::prepareMoveActions @ 0x14036a0ed
// > GJEffectManager::prepareMoveActions @ 0x14036a267
// > sub_14036ADE0 @ 0x14036aef6
// > LevelBrowserLayer::init @ 0x1403e2e5f
// > LevelBrowserLayer::init @ 0x1403e2ebf
// > LevelEditorLayer::init @ 0x1403eec71
// > LevelEditorLayer::updateGameObjects @ 0x1403fb265
// > LevelEditorLayer::updateGameObjects @ 0x1403fb3d4
// > LevelEditorLayer::addDelayedSpawn @ 0x1403fc2bb
// > LevelEditorLayer::stopTriggersInGroup @ 0x1403fc97d
// > LevelEditorLayer::recreateGroups @ 0x1403fd8ef
// > sub_140403620 @ 0x140403eba
// > sub_140403620 @ 0x140403fbe
// > sub_140405690 @ 0x140405fca
// > ControllerInputNode::init @ 0x140447f99
// > TouchControlEditLayer::buildNodes @ 0x1404529e2
// > TouchControlEditLayer::buildNodes @ 0x140452a6a
// > TouchControlEditLayer::buildNodes @ 0x140452ac9
// > TouchControlEditLayer::buildNodes @ 0x140452b28
// > TouchControlEditLayer::buildNodes @ 0x140452b87
// > PlayLayer::setupHasCompleted @ 0x14050481c
// > PlayLayer::setupHasCompleted @ 0x14050485a
// > PlayLayer::addObject @ 0x14050c843
// > CreateParticlePopup::init @ 0x1405c5b46
// > ??> @ 0x140888fbc
// > ??> @ 0x140889024
// > ??> @ 0x140889034
// > ??> @ 0x140889048
// > ??> @ 0x1409111f8
//
// 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:47 +0000
//
_QWORD *__fastcall sub_1400699B0(_QWORD *a1, _BYTE *a2, _QWORD *a3)
{
__int64 v5; // rbp
__int64 v6; // rax
unsigned __int64 v8; // rcx
unsigned __int64 v9; // r15
unsigned __int64 v10; // rcx
__int64 v11; // r12
_QWORD *v12; // rdi
_QWORD *v13; // rcx
_BYTE *v14; // r8
_QWORD *v15; // rdx
size_t v16; // r8
unsigned __int64 v17; // rax
_QWORD *v18; // rcx
v5 = (__int64)&a2[-*a1] >> 3;
v6 = (__int64)(a1[1] - *a1) >> 3;
if ( v6 == 0x1FFFFFFFFFFFFFFFLL )
sub_14005A170();
v8 = (__int64)(a1[2] - *a1) >> 3;
v9 = v6 + 1;
if ( v8 <= 0x1FFFFFFFFFFFFFFFLL - (v8 >> 1) )
{
v17 = (v8 >> 1) + v8;
v10 = v9;
if ( v17 >= v9 )
v10 = v17;
if ( v10 > 0x1FFFFFFFFFFFFFFFLL )
sub_140009CF0();
}
else
{
v10 = 0x1FFFFFFFFFFFFFFFLL;
}
v11 = v10;
v12 = sub_14003D460(8 * v10);
v12[v5] = *a3;
v13 = v12;
v14 = (_BYTE *)a1[1];
v15 = (_QWORD *)*a1;
if ( a2 == v14 )
{
v16 = v14 - (_BYTE *)v15;
}
else
{
memmove(v12, v15, a2 - (_BYTE *)v15);
v13 = &v12[v5 + 1];
v16 = a1[1] - (_QWORD)a2;
v15 = a2;
}
memmove(v13, v15, v16);
v18 = (_QWORD *)*a1;
if ( *a1 )
{
if ( ((a1[2] - (_QWORD)v18) & 0xFFFFFFFFFFFFFFF8uLL) >= 0x1000 )
{
if ( (unsigned __int64)v18 - *(v18 - 1) - 8 > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
v18 = (_QWORD *)*(v18 - 1);
}
j_j_free(v18);
}
*a1 = v12;
a1[1] = &v12[v9];
a1[2] = &v12[v11];
return &v12[v5];
}