//
// sub_14041B3F0 from 0x14041b3f0 to 0x14041b5e4 (500 bytes)
//
// 6 xrefs:
// > GJRateLevelLayer::init @ 0x140419f1c
// > GJRateLevelLayer::init @ 0x140419a2a
// > ??> @ 0x1408c8a54
// > ??> @ 0x1408c8a90
// > ??> @ 0x1408c8aa0
// > ??> @ 0x140926660
//
// 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:32:06 +0000
//
void __fastcall sub_14041B3F0(__int64 a1, __int64 a2)
{
int v3; // eax
int v4; // esi
unsigned int i; // r14d
struct cocos2d::CCObject *v6; // rbx
__int64 v7; // rdi
int v8; // eax
const char *v9; // rdx
__int64 v10; // rcx
char v11; // al
_QWORD *v12; // rbx
__int64 v13; // rcx
__int64 v14; // rcx
__int64 v15; // rcx
int v16; // eax
bool v17; // zf
__int16 v18; // [rsp+50h] [rbp+8h] BYREF
char v19; // [rsp+52h] [rbp+Ah]
if ( a2 )
v3 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);
else
v3 = -1;
v4 = 0;
*(_DWORD *)(a1 + 1064) = v3;
for ( i = 0; i < cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 1056)); ++i )
{
v6 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 1056), i);
v7 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v6 + 952LL))(v6);
v8 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v6 + 56LL))(v6);
v9 = "GJ_button_04.png";
if ( *(_DWORD *)(a1 + 1064) == v8 )
v9 = "GJ_button_01.png";
ButtonSprite::updateBGImage(v7, v9);
}
v10 = *(_QWORD *)(a1 + 1048);
if ( *(_DWORD *)(a1 + 1064) == -1 )
{
v18 = -22874;
v11 = -90;
}
else
{
v18 = -1;
v11 = -1;
}
v19 = v11;
v12 = (_QWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v10 + 952LL))(v10);
v13 = v12[79];
if ( v13 )
(**(void (__fastcall ***)(__int64, __int16 *))(v13 + 368))(v13 + 368, &v18);
v14 = v12[80];
if ( v14 )
(**(void (__fastcall ***)(__int64, __int16 *))(v14 + 320))(v14 + 320, &v18);
v15 = v12[82];
if ( v15 || (v15 = v12[81]) != 0 )
(**(void (__fastcall ***)(__int64, __int16 *))(v15 + 320))(v15 + 320, &v18);
v16 = *(_DWORD *)(a1 + 1064);
v17 = v16 == 1;
if ( v16 > 1 )
{
if ( v16 == 2 )
{
v4 = 1;
}
else if ( v16 == 3 )
{
v4 = 2;
}
else if ( v16 > 5 )
{
if ( v16 > 7 )
{
if ( v16 > 9 )
{
if ( v16 == 10 )
v4 = 6;
}
else
{
v4 = 5;
}
}
else
{
v4 = 4;
}
}
else
{
v4 = 3;
}
v17 = v16 == 1;
}
if ( v17 )
v4 = -1;
GJDifficultySprite::updateDifficultyFrame(*(cocos2d::CCArray ***)(a1 + 1088), v4, 0);
}