//
// GameManager::setUGV from 0x100383f40 to 0x10038405e (286 bytes)
//
// 40 xrefs:
// > PlayLayer::destroyPlayer @ 0x1000ba666
// > LevelAreaLayer::showDialog @ 0x1002795d2
// > LevelAreaInnerLayer::showFloor1CompleteDialog @ 0x10027b417
// > CreatorLayer::dialogClosed @ 0x100299876
// > TOSPopup::onClose @ 0x1002b047d
// > GJShopLayer::showReactMessage @ 0x100326c62
// > GameManager::dataLoaded @ 0x10038a3fc
// > GameManager::dataLoaded @ 0x10038a40d
// > GameManager::firstLoad @ 0x10038ae81
// > GameManager::applicationWillEnterForeground @ 0x10038bc44
// > GameManager::applicationWillEnterForeground @ 0x10038bce5
// > GameManager::applicationWillEnterForeground @ 0x10038bd86
// > GameManager::applicationWillEnterForeground @ 0x10038be23
// > GameManager::applicationWillEnterForeground @ 0x10038be75
// > GameManager::applicationWillEnterForeground @ 0x10038bec7
// > SecretLayer4::showFirstDialog @ 0x1003b1909
// > WorldSelectLayer::showCompleteDialog @ 0x1003c2cf0
// > LevelSelectLayer::init @ 0x100431c56
// > LevelPage::onTheTower @ 0x100436411
// > LevelPage::onSecretDoor @ 0x100436c4a
// > LevelPage::dialogClosed @ 0x1004373bf
// > sub_100437420 @ 0x10043744f
// > SecretLayer5::showFirstDialog @ 0x10047ba37
// > SecretLayer2::showSecretLevel @ 0x1004a0b31
// > SecretLayer2::dialogClosed @ 0x1004a0c5d
// > sub_1004A0CB0 @ 0x1004a0ccd
// > SecretLayer2::getThreadMessage @ 0x1004a2f2d
// > SecretLayer3::onClick @ 0x1004a4df9
// > SecretLayer3::onClick @ 0x1004a4e93
// > SecretLayer3::onClick @ 0x1004a57d7
// > SecretLayer3::dialogClosed @ 0x1004a8303
// > SecretLayer::getThreadMessage @ 0x1005fe2fa
// > SecretRewardsLayer::showDialog01 @ 0x100636235
// > SecretRewardsLayer::showDialog03 @ 0x100637963
// > SecretRewardsLayer::showDialogMechanic @ 0x100638ef7
// > SecretRewardsLayer::showDialogDiamond @ 0x100639dfa
// > SecretRewardsLayer::dialogClosed @ 0x10063a19f
// > SecretRewardsLayer::dialogClosed @ 0x10063a1d8
// > SecretRewardsLayer::dialogClosed @ 0x10063a20e
// > SecretRewardsLayer::dialogClosed @ 0x10063a244
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GameManager::setUGV(GameManager *a1, const char *a2, bool a3)
{
double v3; // xmm0_8
cocos2d::CCDictionary *m_unlockValueKeeper; // rbx
cocos2d::CCObject *v5; // r14
const char *data; // r15
size_t v7; // rax
size_t v8; // r12
char *v9; // r13
cocos2d::CCDictionary *v10; // r14
size_t v11; // rbx
char v12; // [rsp+0h] [rbp-60h]
cocos2d::CCObject *v13; // [rsp+0h] [rbp-60h]
_QWORD __dst[2]; // [rsp+8h] [rbp-58h] BYREF
void *__p; // [rsp+18h] [rbp-48h]
std::string v16; // [rsp+20h] [rbp-40h] BYREF
v16.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)8;
strcpy(v16.__r_.__value_.__s.__data_, "ugv_");
std::string::append(&v16, a2);
m_unlockValueKeeper = a1->m_unlockValueKeeper;
v5 = (cocos2d::CCObject *)sub_1007AB580("%i", v12);
if ( (*(_BYTE *)&v16.__r_.__value_.__s.0 & 1) != 0 )
data = v16.__r_.__value_.__l.__data_;
else
data = v16.__r_.__value_.__s.__data_;
v7 = strlen(data);
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v3);
v8 = v7;
if ( v7 >= 0x17 )
{
v13 = v5;
v10 = m_unlockValueKeeper;
v11 = 26;
if ( (v7 | 7) != 0x17 )
v11 = (v7 | 7) + 1;
v9 = (char *)operator new(v11);
__p = v9;
__dst[0] = v11 | 1;
__dst[1] = v8;
m_unlockValueKeeper = v10;
v5 = v13;
goto LABEL_11;
}
LOBYTE(__dst[0]) = 2 * v7;
v9 = (char *)__dst + 1;
if ( v7 )
LABEL_11:
memmove(v9, data, v8);
v9[v8] = 0;
cocos2d::CCDictionary::setObject_1((__int64)m_unlockValueKeeper, v5, (char *)__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
if ( (*(_BYTE *)&v16.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v16.__r_.__value_.__l.__data_);
}