//
// OptionsLayer::onSecretVault from 0x10087bb70 to 0x10087bd16 (422 bytes)
//
// 1 xrefs:
// > OptionsLayer::customSetup @ 0x10087b263
//
// 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 12:36:55 +0000
//
void __fastcall OptionsLayer::onSecretVault(_DWORD *a1, __m128 a2)
{
__int64 v3; // rdi
__int64 v4; // rbx
_BYTE *v5; // rax
char *v6; // rax
int v7; // eax
int v8; // eax
__m128 v9; // xmm1
unsigned int v10; // ecx
char *v11; // rax
__int64 v12; // r14
std::string v13; // [rsp+8h] [rbp-58h] BYREF
std::string v14; // [rsp+20h] [rbp-40h] BYREF
std::string v15; // [rsp+38h] [rbp-28h] BYREF
v3 = GameStatsManager::sharedState();
if ( (int)GameStatsManager::getStat(v3, "12", a2) < 10 )
{
v15.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)6;
*(_DWORD *)((char *)&v15.__r_.__value_.__l.0 + 1) = 8026746;
v7 = a1[166];
if ( v7 < 0 )
{
a2.f32[0] = (float)((float)rand() * 4.6566129e-10) * 10.0;
v9 = _mm_or_ps(_mm_and_ps((__m128)xmmword_100A035F0, a2), (__m128)xmmword_100A03600);
v9.f32[0] = v9.f32[0] + a2.f32[0];
v8 = (int)_mm_round_ss((__m128)0LL, v9, 11).f32[0];
}
else
{
v8 = v7 + 1;
}
v10 = 0;
if ( v8 < 11 )
v10 = v8;
a1[166] = v10;
if ( v10 <= 0xA )
std::string::assign(&v15, (const std::string::value_type *)&unk_100A12D4C + *((int *)&unk_100A12D4C + v10));
v13.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)18;
strcpy(v13.__r_.__value_.__s.__data_, "The Guard");
if ( (*(_BYTE *)&v15.__r_.__value_.__s.0 & 1) != 0 )
sub_10001AD30(&v14, v15.__r_.__value_.__l.__data_, v15.__r_.__value_.__l.__size_);
else
v14 = v15;
v11 = DialogObject::create(&v13, &v14, 1, 0, 0xFFFFFF, 1.0);
v12 = DialogLayer::create((__int64)v11, 1u);
if ( (*(_BYTE *)&v14.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v14.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v13.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v13.__r_.__value_.__l.__data_);
(*(void (__fastcall **)(_DWORD *, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v12, 100);
DialogLayer::updateChatPlacement(v12, 0);
DialogLayer::animateInRandomSide(v12);
if ( (*(_BYTE *)&v15.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v15.__r_.__value_.__l.__data_);
}
else
{
v4 = cocos2d::CCDirector::sharedDirector();
v5 = SecretLayer::scene(v3, (__int64)"12");
v6 = cocos2d::CCTransitionFade::create_1((__int64)v5, 0.5);
cocos2d::CCDirector::replaceScene(v4, v6);
}
}