//
// sub_1400BD3C0 from 0x1400bd3c0 to 0x1400bd4de (286 bytes)
//
// 53 xrefs:
// > AccountReviewPopup::adminAccountReviewFailed @ 0x1400b0e2c
// > AccountReviewPopup::updateCard @ 0x1400b2c40
// > AccountReviewPopup::updateCard @ 0x1400b2cc7
// > EditorSFXManager::serializeAll @ 0x140188904
// > GameLevelManager::onAdminGetReportedContentCompleted @ 0x14024371f
// > GameLevelManager::onAdminGetReportedContentCompleted @ 0x140243e3f
// > GameLevelManager::onAdminGetAbuseInfoCompleted @ 0x140245fe7
// > GameStatsManager::tryFixPathBug @ 0x1402da954
// > GJBaseGameLayer::collisionCheckObjects @ 0x14031d2ed
// > GJBaseGameLayer::collisionCheckObjects @ 0x14031d334
// > GJBaseGameLayer::addToSection @ 0x14032f492
// > GJBaseGameLayer::addToSection @ 0x14032f760
// > GJBaseGameLayer::addToSection @ 0x14032f96d
// > GJBaseGameLayer::resetAreaObjectValues @ 0x140330ac4
// > GJBaseGameLayer::processAreaActions @ 0x140331d84
// > GJBaseGameLayer::processDynamicObjectActions @ 0x140336f60
// > GJBaseGameLayer::processDynamicObjectActions @ 0x140336ff3
// > GJBaseGameLayer::generateVisibilityGroups @ 0x14033a76c
// > GJBaseGameLayer::preUpdateVisibility @ 0x14033fa15
// > GJBaseGameLayer::preUpdateVisibility @ 0x14033fad1
// > GJBaseGameLayer::preUpdateVisibility @ 0x14033fbc0
// > GJBaseGameLayer::preUpdateVisibility @ 0x14033fd3a
// > GJBaseGameLayer::preUpdateVisibility @ 0x14033fe35
// > GJBaseGameLayer::preUpdateVisibility @ 0x14033fe77
// > GJBaseGameLayer::preUpdateVisibility @ 0x14033ff2d
// > GJBaseGameLayer::processQueuedAudioTriggers @ 0x140345b25
// > GJBaseGameLayer::activateSongTrigger @ 0x14034b827
// > GJBaseGameLayer::activateSongEditTrigger @ 0x14034ba5e
// > GJBaseGameLayer::activateSFXTrigger @ 0x14034be19
// > GJBaseGameLayer::activateSFXEditTrigger @ 0x14034bff0
// > GJEffectManager::createKeyframeCommand @ 0x14036710a
// > GJEffectManager::getMoveCommandNode @ 0x140369901
// > GJEffectManager::registerRotationCommand @ 0x1403699cb
// > GJEffectManager::registerRotationCommand @ 0x1403699dc
// > GJEffectManager::resetTempGroupCommands @ 0x140369a66
// > GJEffectManager::prepareMoveActions @ 0x140369f20
// > GJEffectManager::prepareMoveActions @ 0x140369fd8
// > GJEffectManager::prepareMoveActions @ 0x14036a88c
// > GJEffectManager::prepareMoveActions @ 0x14036a929
// > GJEffectManager::prepareMoveActions @ 0x14036a9f9
// > GJEffectManager::prepareMoveActions @ 0x14036aa19
// > GJKeybindManager::applyMovementOverride @ 0x1403894b5
// > LevelEditorLayer::activateTriggerEffect @ 0x1403fc0ea
// > LevelEditorLayer::updateDisabledObjectsLastPos @ 0x1403fe79d
// > common_expand_argv_wildcards @ 0x140485525
// > PlayLayer::scanDynamicSaveObjects @ 0x140517627
// > PlayLayer::scanDynamicSaveObjects @ 0x140517747
// > PlayLayer::scanDynamicSaveObjects @ 0x14051779c
// > PlayLayer::scanDynamicSaveObjects @ 0x14051780e
// > ??> @ 0x14088fcb8
// > ??> @ 0x14088fd04
// > ??> @ 0x14088fd20
// > ??> @ 0x140913940
//
// 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:17 +0000
//
__int64 __fastcall sub_1400BD3C0(const void **a1, __int64 *a2)
{
char *v4; // rcx
char *v5; // rdi
__int64 result; // rax
__int64 v7; // rsi
unsigned __int64 v8; // rcx
unsigned __int64 v9; // rdx
unsigned __int64 v10; // rbp
_QWORD *v11; // r14
_QWORD *v12; // rcx
char *v13; // r8
_BYTE *v14; // rdx
size_t v15; // r8
v4 = (char *)a1[2];
v5 = (char *)a1[1];
if ( v5 == v4 )
{
v7 = (v5 - (_BYTE *)*a1) >> 3;
if ( v7 == 0x1FFFFFFFFFFFFFFFLL )
sub_14005A170();
v8 = (v4 - (_BYTE *)*a1) >> 3;
v9 = v8 >> 1;
if ( v8 <= 0x1FFFFFFFFFFFFFFFLL - (v8 >> 1) )
{
v10 = v7 + 1;
if ( v9 + v8 >= v7 + 1 )
v10 = v9 + v8;
if ( v10 > 0x1FFFFFFFFFFFFFFFLL )
sub_140009CF0(v8, v9, 0x1FFFFFFFFFFFFFFFLL);
}
else
{
v10 = 0x1FFFFFFFFFFFFFFFLL;
}
v11 = sub_14003D460(8 * v10);
v11[v7] = *a2;
v12 = v11;
v13 = (char *)a1[1];
v14 = *a1;
if ( v5 == v13 )
{
v15 = v13 - v14;
}
else
{
memmove(v11, v14, v5 - v14);
v15 = (_BYTE *)a1[1] - v5;
v12 = &v11[v7 + 1];
v14 = v5;
}
memmove(v12, v14, v15);
return sub_1400BDBE0(a1, v11, v7 + 1, v10);
}
else
{
result = *a2;
*(_QWORD *)v5 = *a2;
a1[1] = (char *)a1[1] + 8;
}
return result;
}