//
// FindBPMLayer::create from 0x140134e30 to 0x140135093 (611 bytes)
//
// 2 xrefs:
// > SongInfoLayer::onBPM @ 0x1406367d7
// > ??> @ 0x1409170a8
//
// 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:27:04 +0000
//
// Hidden C++ exception states: #wind=2
unsigned int *__fastcall FindBPMLayer::create(unsigned int a1)
{
unsigned int *v2; // rsi
__int64 v3; // rcx
__int64 v4; // rax
struct cocos2d::CCLabelBMFont *v5; // rax
__int64 v6; // rdi
__int64 v7; // rbx
__int64 v8; // rax
__int64 v9; // rcx
__int64 SongInfoObject; // rax
int v11; // edx
void (__fastcall **v12)(__int64, const char *); // rdi
__int64 v13; // rbx
cocos2d::CCString *v14; // rax
const char *CString; // rax
unsigned int *v17; // [rsp+38h] [rbp+10h] BYREF
void *v18; // [rsp+40h] [rbp+18h] BYREF
v2 = (unsigned int *)operator new(0x320u);
v17 = v2;
CreateGuidelinesLayer::CreateGuidelinesLayer((__int64)v2);
*(_QWORD *)v2 = &FindBPMLayer::`vftable';
*((_QWORD *)v2 + 40) = &FindBPMLayer::`vftable';
*((_QWORD *)v2 + 41) = &FindBPMLayer::`vftable';
*((_QWORD *)v2 + 42) = &FindBPMLayer::`vftable';
*((_QWORD *)v2 + 43) = &FindBPMLayer::`vftable';
*((_QWORD *)v2 + 44) = &FindBPMLayer::`vftable';
*((_QWORD *)v2 + 51) = &FindBPMLayer::`vftable';
*((_QWORD *)v2 + 54) = &FindBPMLayer::`vftable';
*((_QWORD *)v2 + 68) = &FindBPMLayer::`vftable';
*((_QWORD *)v2 + 83) = &FindBPMLayer::`vftable';
v2[192] = 0;
*((_QWORD *)v2 + 97) = 0;
*((_QWORD *)v2 + 98) = 0;
v2[198] = 0;
if ( CreateGuidelinesLayer::init((__int64)v2, 0, 1) )
{
v2[192] = a1;
v4 = cocos2d::CCDirector::sharedDirector(v3);
cocos2d::CCDirector::getWinSize(v4, &v17);
v5 = cocos2d::CCLabelBMFont::create("BPM", (const char *)&qword_140704F78);
*((_QWORD *)v2 + 97) = v5;
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *, __int64))(**((_QWORD **)v2 + 73) + 456LL))(
*((_QWORD *)v2 + 73),
v5,
1);
v6 = **((_QWORD **)v2 + 97);
v7 = *((_QWORD *)v2 + 97);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v18, *(float *)&v17 * 0.5, *((float *)&v17 + 1) * 0.5);
(*(void (__fastcall **)(__int64, __int64))(v6 + 184))(v7, v8);
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)v2 + 87), *((struct cocos2d::CCObject **)v2 + 97));
v9 = qword_14090C070;
if ( !qword_14090C070 )
{
v18 = operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v18);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
v9 = qword_14090C070;
}
SongInfoObject = MusicDownloadManager::getSongInfoObject(v9, v2[192]);
if ( SongInfoObject )
{
v11 = *(_DWORD *)(SongInfoObject + 484);
if ( v11 > 0 )
{
v12 = *(void (__fastcall ***)(__int64, const char *))(*((_QWORD *)v2 + 88) + 360LL);
v13 = *((_QWORD *)v2 + 88);
v14 = cocos2d::CCString::createWithFormat("BPM: %i", v11);
CString = cocos2d::CCString::getCString(v14);
(*v12)(v13 + 360, CString);
}
}
CreateGuidelinesLayer::toggleItems((__int64)v2, 0);
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v2);
return v2;
}
else
{
(*(void (__fastcall **)(unsigned int *, __int64))(*(_QWORD *)v2 + 8LL))(v2, 1);
return nullptr;
}
}