//
// CCCountdown::init from 0x1007c6560 to 0x1007c6789 (553 bytes)
//
// 2 xrefs:
// > CCCountdown::create @ 0x1007c651d
// > ??> @ 0x100995e90
//
// 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
//
bool __fastcall CCCountdown::init(CCCountdown *a1)
{
bool result; // al
cocos2d::CCSprite *v3; // rax
cocos2d::CCProgressTimer *v4; // rax
cocos2d::CCProgressTimer *m_progressTimer; // r14
__int64 v6; // rax
cocos2d::CCSprite *m_pSprite; // rdi
cocos2d::CCLabelBMFont *v8; // r14
__int64 v9; // rax
cocos2d::CCLabelBMFont *m_countdownLabel; // r14
cocos2d::CCLabelBMFont *v11; // r14
unsigned __int64 *v12; // r15
unsigned __int64 v13; // [rsp+0h] [rbp-40h] BYREF
double v14; // [rsp+8h] [rbp-38h] BYREF
float v15; // [rsp+10h] [rbp-30h]
bool v16; // [rsp+17h] [rbp-29h]
result = cocos2d::CCSprite::initWithFile_1(a1, "timer_outerCircle.png");
if ( result )
{
v16 = result;
v3 = cocos2d::CCSprite::create_1("timer_innerCircle.png");
v4 = cocos2d::CCProgressTimer::create(v3);
a1->m_progressTimer = v4;
cocos2d::CCProgressTimer::setType(v4, kCCProgressTimerTypeRadial);
((void (__fastcall *)(CCCountdown *, cocos2d::CCProgressTimer *, __int64))a1->addChild_0)(
a1,
a1->m_progressTimer,
0xFFFFFFFFLL);
m_progressTimer = a1->m_progressTimer;
v15 = *(float *)((__int64 (__fastcall *)(CCCountdown *))a1->getContentSize)(a1) * 0.5;
v6 = ((__int64 (__fastcall *)(CCCountdown *))a1->getContentSize)(a1);
sub_10028CBE0((float *)&v14, v15, *(float *)(v6 + 4) * 0.5);
((void (__fastcall *)(cocos2d::CCProgressTimer *, double *))m_progressTimer->setPosition)(m_progressTimer, &v14);
cocos2d::CCProgressTimer::setPercentage(a1->m_progressTimer, 100.0);
m_pSprite = a1->m_progressTimer->m_pSprite;
BYTE2(v14) = 70;
LOWORD(v14) = 10240;
((void (__fastcall *)(cocos2d::CCSprite *, double *))m_pSprite->setColor)(m_pSprite, &v14);
cocos2d::CCProgressTimer::updateColor(a1->m_progressTimer);
a1->m_progressTimer->m_bReverseDirection = 1;
v8 = cocos2d::CCLabelBMFont::create_3("0", "levelFont.fnt");
a1->m_countdownLabel = v8;
v15 = *(float *)((__int64 (__fastcall *)(CCCountdown *))a1->getContentSize)(a1) * 0.5;
v9 = ((__int64 (__fastcall *)(CCCountdown *))a1->getContentSize)(a1);
sub_10028CBE0((float *)&v14, v15, *(float *)(v9 + 4) * 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v8->setPosition)(v8, &v14);
m_countdownLabel = a1->m_countdownLabel;
sub_10028CBE0((float *)&v14, 0.5, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))m_countdownLabel->setAnchorPoint)(m_countdownLabel, &v14);
v11 = a1->m_countdownLabel;
v12 = (unsigned __int64 *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v11->getPosition)(v11);
sub_10028CBE0((float *)&v13, 0.0, -3.0);
sub_10028CCE0(&v14, v12, &v13);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v11->setPosition)(v11, &v14);
((void (__fastcall *)(CCCountdown *, cocos2d::CCLabelBMFont *, __int64))a1->addChild_0)(a1, a1->m_countdownLabel, 1);
return v16;
}
return result;
}