//
// GameManager::setUGV from 0x14027e830 to 0x14027e9b4 (388 bytes)
//
// 42 xrefs:
// > CreatorLayer::dialogClosed @ 0x140139743
// > GameManager::dataLoaded @ 0x1402848cc
// > GameManager::dataLoaded @ 0x1402848de
// > GameManager::firstLoad @ 0x1402858bb
// > GameManager::applicationWillEnterForeground @ 0x140286c2c
// > GameManager::applicationWillEnterForeground @ 0x140286e0d
// > GameManager::applicationWillEnterForeground @ 0x140286fda
// > GameManager::applicationWillEnterForeground @ 0x1402871a3
// > GameManager::applicationWillEnterForeground @ 0x1402871f8
// > GameManager::applicationWillEnterForeground @ 0x14028724d
// > GameManager::applicationWillEnterForeground @ 0x1402872a2
// > TOSPopup::onClose @ 0x1403a99b1
// > GJShopLayer::showReactMessage @ 0x1403b4905
// > LevelAreaLayer::showDialog @ 0x1403de5dd
// > LevelAreaInnerLayer::showFloor1CompleteDialog @ 0x1403e0967
// > LevelSelectLayer::init @ 0x14044177f
// > LevelPage::onTheTower @ 0x1404457a8
// > LevelPage::onSecretDoor @ 0x140446329
// > LevelPage::dialogClosed @ 0x140446ccf
// > PlayLayer::destroyPlayer @ 0x14051332a
// > SecretRewardsLayer::dialogClosed @ 0x14056c3b6
// > SecretRewardsLayer::dialogClosed @ 0x14056c41b
// > SecretRewardsLayer::dialogClosed @ 0x14056c480
// > SecretRewardsLayer::dialogClosed @ 0x14056c4e6
// > SecretRewardsLayer::showDialog01 @ 0x14056ee9d
// > SecretRewardsLayer::showDialog03 @ 0x14056fba0
// > SecretRewardsLayer::showDialogMechanic @ 0x140571095
// > SecretRewardsLayer::showDialogDiamond @ 0x140571ef9
// > SecretLayer::getThreadMessage @ 0x140576306
// > SecretLayer2::showSecretLevel @ 0x1405793bf
// > SecretLayer2::dialogClosed @ 0x14057a0e5
// > SecretLayer2::getThreadMessage @ 0x14057d3e1
// > SecretLayer3::onClick @ 0x140581f8d
// > SecretLayer3::onClick @ 0x14058231e
// > SecretLayer3::onClick @ 0x140582692
// > SecretLayer3::onClick @ 0x140582c1d
// > SecretLayer3::onClick @ 0x140582c6b
// > SecretLayer3::dialogClosed @ 0x140584b9e
// > SecretLayer3::dialogClosed @ 0x140584dfa
// > SecretLayer4::showFirstDialog @ 0x1405880d1
// > SecretLayer5::showFirstDialog @ 0x14058d237
// > ??> @ 0x14091cfd0
//
// 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:28:59 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall GameManager::setUGV(__int64 a1, _BYTE *a2, unsigned __int8 a3)
{
unsigned int v3; // esi
size_t v5; // rbx
size_t v6; // r8
void **v7; // rdx
__int64 v8; // rbx
struct cocos2d::CCString *v9; // rax
void *v10; // rcx
void *v11; // rcx
void *Src[2]; // [rsp+30h] [rbp-68h] BYREF
__m128i si128; // [rsp+40h] [rbp-58h]
void *Block[2]; // [rsp+50h] [rbp-48h] BYREF
__int128 v15; // [rsp+60h] [rbp-38h]
v3 = a3;
*(_OWORD *)Src = 0;
si128 = _mm_load_si128((const __m128i *)&xmmword_140836550);
strcpy((char *)Src, "ugv_");
v5 = -1;
v6 = -1;
do
++v6;
while ( a2[v6] );
sub_140044D80(Src, a2, v6);
v7 = Src;
if ( si128.m128i_i64[1] > 0xFuLL )
v7 = (void **)Src[0];
*(_OWORD *)Block = 0;
v15 = 0;
do
++v5;
while ( *((_BYTE *)v7 + v5) );
sub_14003D230(Block, v7, v5);
v8 = *(_QWORD *)(a1 + 456);
v9 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, v3);
cocos2d::CCDictionary::setObject(v8, v9, Block);
if ( *((_QWORD *)&v15 + 1) > 0xFu )
{
v10 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v15 + 1) + 1LL) >= 0x1000 )
{
v10 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v10 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v10);
}
if ( si128.m128i_i64[1] > 0xFuLL )
{
v11 = Src[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v11 = *((void **)Src[0] - 1);
if ( (unsigned __int64)((char *)Src[0] - (char *)v11 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v11);
}
}