//
// TimeSpeedControl::init from 0x14066d790 to 0x14066dc41 (1201 bytes)
//
// 2 xrefs:
// > TimeSpeedControl::create @ 0x14066d73b
// > ??> @ 0x1409321bc
//
// 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:35:53 +0000
//
// Hidden C++ exception states: #wind=1
bool __fastcall TimeSpeedControl::init(cocos2d::CCNode *a1, __int64 a2)
{
bool result; // al
__int64 v5; // rax
__int64 *v6; // rdi
__int64 v7; // rbx
__int64 v8; // rax
__int64 v9; // rbx
__int64 v10; // rax
struct cocos2d::CCLabelBMFont *v11; // rdi
__int64 v12; // rbx
__int64 v13; // rax
__int64 v14; // r8
cocos2d::CCLayer *v15; // rax
__int64 v16; // rdx
__int64 v17; // rax
__int64 *v18; // rcx
__int64 v19; // rbx
float v20; // xmm1_4
struct cocos2d::CCLabelBMFont *v21; // rax
__int64 v22; // rdi
__int64 v23; // rbx
__int64 v24; // rax
void (__fastcall **v25)(__int64, const char *); // rdi
__int64 v26; // rbx
cocos2d::CCString *v27; // rax
const char *CString; // rax
__int64 v29; // rcx
__int64 v30; // r15
__int64 v31; // rcx
bool GameVariable; // si
struct cocos2d::CCSprite *v33; // rdi
struct cocos2d::CCSprite *v34; // rbx
cocos2d::CCMenuItem *v35; // rax
__int64 v36; // rdi
__int64 v37; // rax
__int64 v38; // rbx
__int64 v39; // rax
_BYTE v40[16]; // [rsp+40h] [rbp-38h] BYREF
void *v41; // [rsp+90h] [rbp+18h] BYREF
result = cocos2d::CCNode::init(a1);
if ( result )
{
*((_QWORD *)a1 + 40) = a2;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v40, 0.0, 0.0, 80.0, 80.0);
v6 = (__int64 *)cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v5);
v7 = *v6;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v41, 36.0, 148.0);
(*(void (__fastcall **)(__int64 *, __int64))(v7 + 312))(v6, v8);
(*(void (__fastcall **)(cocos2d::CCNode *, __int64 *))(*(_QWORD *)a1 + 464LL))(a1, v6);
v9 = *v6;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v41, 0.0, -14.0);
(*(void (__fastcall **)(__int64 *, __int64))(v9 + 184))(v6, v10);
v11 = cocos2d::CCLabelBMFont::create("Time", "goldFont.fnt");
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v11 + 160LL))(v11);
(*(void (__fastcall **)(cocos2d::CCNode *, struct cocos2d::CCLabelBMFont *, __int64))(*(_QWORD *)a1 + 456LL))(
a1,
v11,
1);
v12 = *(_QWORD *)v11;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v41, 0.0, 47.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v12 + 184))(v11, v13);
v15 = Slider::create(
(__int64)a1,
(__int64)TimeSpeedControl::timeSliderChanged,
v14,
"slidergroove.png",
(__int64)"sliderthumb.png",
(__int64)"sliderthumbsel.png",
0.5);
*((_QWORD *)a1 + 41) = v15;
Slider::setRotated((__int64)v15);
LOBYTE(v16) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(*((_QWORD *)a1 + 41) + 416LL) + 336LL))(
*(_QWORD *)(*((_QWORD *)a1 + 41) + 416LL),
v16);
v17 = *(_QWORD *)(*(_QWORD *)(*((_QWORD *)a1 + 41) + 408LL) + 456LL);
*(_DWORD *)(v17 + 408) = 1056081596;
*(_DWORD *)(v17 + 412) = 1022739087;
Slider::setMaxOffset(*((_QWORD *)a1 + 41), 140.0);
v18 = *(__int64 **)(*((_QWORD *)a1 + 41) + 424LL);
v19 = *v18;
(*(void (__fastcall **)(__int64 *))(*v18 + 128))(v18);
(*(void (__fastcall **)(_QWORD))(v19 + 120))(*(_QWORD *)(*((_QWORD *)a1 + 41) + 424LL));
(*(void (__fastcall **)(cocos2d::CCNode *, _QWORD, __int64))(*(_QWORD *)a1 + 456LL))(a1, *((_QWORD *)a1 + 41), 1);
v20 = fminf(1.0, (float)(*(float *)(*((_QWORD *)a1 + 40) + 13664LL) - 0.1) / 1.9);
if ( v20 < 0.0 )
v20 = 0.0;
Slider::setValue(*((_QWORD *)a1 + 41), v20);
v21 = cocos2d::CCLabelBMFont::create("1.0x", &qword_140704F78);
*((_QWORD *)a1 + 42) = v21;
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v21 + 160LL))(v21);
(*(void (__fastcall **)(cocos2d::CCNode *, _QWORD, __int64))(*(_QWORD *)a1 + 456LL))(a1, *((_QWORD *)a1 + 42), 1);
v22 = **((_QWORD **)a1 + 42);
v23 = *((_QWORD *)a1 + 42);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v41, 0.0, -48.0);
(*(void (__fastcall **)(__int64, __int64))(v22 + 184))(v23, v24);
v25 = *(void (__fastcall ***)(__int64, const char *))(*((_QWORD *)a1 + 42) + 360LL);
v26 = *((_QWORD *)a1 + 42);
v27 = cocos2d::CCString::createWithFormat("%.01fx", *(float *)(*((_QWORD *)a1 + 40) + 13664LL));
CString = cocos2d::CCString::getCString(v27);
(*v25)(v26 + 360, CString);
v30 = cocos2d::CCMenu::create(v29);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v30 + 184LL))(v30, &unk_14090BE58);
(*(void (__fastcall **)(cocos2d::CCNode *, __int64, __int64))(*(_QWORD *)a1 + 456LL))(a1, v30, 1);
v31 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v41 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v41);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v31 = qword_14090BFD0;
}
GameVariable = GameManager::getGameVariable(v31, "0183");
v33 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_musicOnBtn_001.png");
v34 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_musicOffBtn_001.png");
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v33 + 160LL))(v33);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v34 + 160LL))(v34);
v35 = CCMenuItemToggler::create((int)v34, (int)v33, (__int64)a1, (__int64)TimeSpeedControl::onAudioTimeSpeedToggle);
*((_QWORD *)a1 + 43) = v35;
CCMenuItemToggler::toggle((__int64)v35, !GameVariable);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v30 + 464LL))(v30, *((_QWORD *)a1 + 43));
v36 = **((_QWORD **)a1 + 43);
v37 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)a1 + 42) + 200LL))(*((_QWORD *)a1 + 42));
v38 = *((_QWORD *)a1 + 43);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v41, 0.0, *(float *)(v37 + 4) - 20.0);
(*(void (__fastcall **)(__int64, __int64))(v36 + 184))(v38, v39);
return 1;
}
return result;
}