//
// FindBPMLayer::init from 0x10050ebb0 to 0x10050ecd9 (297 bytes)
//
// 1 xrefs:
// > sub_10050EB50 @ 0x10050eb75
//
// 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:35 +0000
//
__int64 __fastcall FindBPMLayer::init(__int64 a1, int a2)
{
__int64 result; // rax
unsigned int v4; // r12d
__int64 v5; // rax
__int64 v6; // rax
__int64 v7; // r14
__int64 v8; // rdi
__int64 v9; // rax
__int64 SongInfoObject; // rax
__int64 v11; // r14
__int64 v12; // rax
__int64 CString; // rax
float v14; // [rsp+0h] [rbp-30h] BYREF
__int64 v15; // [rsp+8h] [rbp-28h] BYREF
result = CreateGuidelinesLayer::init(a1, 0, 1);
if ( (_BYTE)result )
{
v4 = result;
*(_DWORD *)(a1 + 760) = a2;
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v15, v5);
v6 = cocos2d::CCLabelBMFont::create_3("BPM", "bigFont.fnt");
*(_QWORD *)(a1 + 768) = v6;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v6, 1);
v7 = *(_QWORD *)(a1 + 768);
sub_100278250(&v14, *(float *)&v15 * 0.5, 0.5 * *((float *)&v15 + 1));
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v7 + 184LL))(v7, &v14);
v8 = *(_QWORD *)(a1 + 696);
sub_1007FEBF0(v8, *(_QWORD *)(a1 + 768));
v9 = MusicDownloadManager::sharedState(v8);
SongInfoObject = MusicDownloadManager::getSongInfoObject(v9, *(unsigned int *)(a1 + 760));
if ( SongInfoObject )
{
if ( *(int *)(SongInfoObject + 444) > 0 )
{
v11 = *(_QWORD *)(a1 + 704);
v12 = sub_10088E820("BPM: %i", SLOBYTE(v14));
CString = cocos2d::CCString::getCString(v12);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 928LL))(v11, CString);
}
}
CreateGuidelinesLayer::toggleItems(a1, 0);
return v4;
}
return result;
}