//
// sub_100505220 from 0x100505220 to 0x100505369 (329 bytes)
//
// 2 xrefs:
// > GJRateLevelLayer::init @ 0x100505082
// > GJRateLevelLayer::init @ 0x100504b9c
//
// 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:31:31 +0000
//
void __fastcall sub_100505220(__int64 a1, __int64 a2, double a3)
{
int v3; // eax
unsigned int v4; // r14d
__int64 v5; // r15
__int64 v6; // r12
int v7; // r13d
const char *v8; // rsi
int v9; // r14d
_QWORD *v10; // rax
unsigned int v11; // eax
int v12; // ecx
int v13; // esi
if ( a2 )
v3 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
else
v3 = -1;
*(_DWORD *)(a1 + 1080) = v3;
if ( (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 1072)) )
{
v4 = 0;
do
{
v5 = sub_1007FEFE0(*(_QWORD *)(a1 + 1072), v4);
v6 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 1072LL))(v5);
v7 = *(_DWORD *)(a1 + 1080);
v8 = "GJ_button_04.png";
if ( v7 == (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v5 + 64LL))(v5) )
v8 = "GJ_button_01.png";
ButtonSprite::updateBGImage(v6, (__int64)v8);
++v4;
}
while ( v4 < (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 1072)) );
}
v9 = *(_DWORD *)(a1 + 1080) != -1;
v10 = (_QWORD *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1064) + 1072LL))(*(_QWORD *)(a1 + 1064));
ButtonSprite::setColor(v10, -v9 | 0xFFA6A6A6);
v11 = *(_DWORD *)(a1 + 1080);
v12 = 0;
if ( (int)v11 >= 2 )
{
if ( v11 == 2 )
{
v12 = 1;
}
else if ( v11 == 3 )
{
v12 = 2;
}
else
{
v12 = 3;
if ( v11 >= 6 )
{
v12 = 4;
if ( v11 >= 8 )
{
v12 = 5;
if ( v11 >= 0xA )
{
v12 = 6;
if ( v11 != 10 )
v12 = 0;
}
}
}
}
}
v13 = -1;
if ( v11 != 1 )
v13 = v12;
GJDifficultySprite::updateDifficultyFrame(*(_QWORD **)(a1 + 1104), v13, 0, a3);
}