//
// UILayer::updateCheckState from 0x140670870 to 0x140670a67 (503 bytes)
//
// 3 xrefs:
// > UIPOptionsLayer::onClose @ 0x1403abfe4
// > UILayer::init @ 0x14067083a
// > ??> @ 0x140932294
//
// 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:54 +0000
//
// Hidden C++ exception states: #wind=2
unsigned int __fastcall UILayer::updateCheckState(__int64 a1)
{
__int64 v2; // rax
__int64 v3; // rdx
__int64 v4; // rcx
cocos2d::CCDirector *v5; // rax
float v6; // xmm0_4
__int64 v7; // rax
__int64 v8; // rax
float v9; // xmm6_4
unsigned int v10; // ebx
unsigned int result; // eax
struct cocos2d::CCObject *v12; // rsi
__int64 v13; // rax
__int64 v14; // rcx
__int64 v15; // rax
float v16; // [rsp+60h] [rbp+8h] BYREF
float v17; // [rsp+64h] [rbp+Ch]
float v18; // [rsp+68h] [rbp+10h] BYREF
void *v19; // [rsp+70h] [rbp+18h] BYREF
v2 = cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v2, &v18);
v3 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v19 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v19);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v3 = qword_14090BFD0;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v16, (const struct cocos2d::CCPoint *)(v3 + 1752));
if ( v16 == 0.0 && v17 == 0.0 )
{
v5 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v4);
v6 = cocos2d::CCDirector::getScreenBottom(v5) + 40.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v19, v18 * 0.5, v6);
cocos2d::CCPoint::operator=(&v16, v7);
}
(*(void (__fastcall **)(_QWORD, float *))(**(_QWORD **)(a1 + 560) + 184LL))(*(_QWORD *)(a1 + 560), &v16);
v8 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v19 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v19);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v8 = qword_14090BFD0;
}
v9 = *(float *)(v8 + 1760) * 255.0;
v10 = 0;
result = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 632));
if ( result )
{
while ( 1 )
{
v12 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 632), v10);
v13 = _RTDynamicCast(
v12,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&cocos2d::CCSprite `RTTI Type Descriptor',
0);
if ( v13 )
break;
v15 = _RTDynamicCast(
v12,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&cocos2d::CCLabelBMFont `RTTI Type Descriptor',
0);
if ( v15 )
{
v14 = v15 + 368;
goto LABEL_13;
}
LABEL_14:
++v10;
result = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 632));
if ( v10 >= result )
return result;
}
v14 = v13 + 320;
LABEL_13:
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v14 + 40LL))(v14, (unsigned int)(int)v9);
goto LABEL_14;
}
return result;
}