{"type": "func", "start": 6036016, "end": 6036356, "name": "FindBPMLayer::init", "pseudocode": "// \n// FindBPMLayer::init from 0x5c1a30 to 0x5c1b84 (340 bytes)\n// \n// 2 xrefs:\n// > FindBPMLayer::create @ 0x5c1c74\n// > <???> @ 0x44c10\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nbool FindBPMLayer::init(FindBPMLayer *a1, int a2)\n{\n  bool v4; // w21\n  cocos2d::CCDirector *v6; // x0\n  cocos2d::CCLabelBMFont *v7; // x0\n  cocos2d::CCLayer *m_mainLayer; // x3\n  cocos2d::CCLabelBMFont *m_bpmLabel; // x23\n  void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x22\n  MusicDownloadManager *v11; // x0\n  SongInfoObject *SongInfoObject; // x0\n  const char *m_BPM; // x1\n  cocos2d::CCLabelBMFont *m_infoLabel; // x22\n  void (__fastcall *setString)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // x23\n  cocos2d::CCString *v16; // x0\n  const char *CString; // x0\n  float v18; // [xsp+58h] [xbp+58h]\n  float v19; // [xsp+5Ch] [xbp+5Ch]\n  cocos2d::CCPoint v20; // [xsp+60h] [xbp+60h] BYREF\n\n  v4 = CreateGuidelinesLayer::init(a1, nullptr, BPMFinder);\n  if ( v4 )\n  {\n    a1->m_songID = a2;\n    v6 = cocos2d::CCDirector::sharedDirector();\n    cocos2d::CCDirector::getWinSize(v6);\n    v7 = cocos2d::CCLabelBMFont::create();\n    m_mainLayer = a1->m_mainLayer;\n    a1->m_bpmLabel = v7;\n    m_mainLayer->addChild_0(m_mainLayer, v7, 1);\n    m_bpmLabel = a1->m_bpmLabel;\n    setPosition = m_bpmLabel->setPosition;\n    cocos2d::CCPoint::CCPoint(&v20, v18 * 0.5, v19 * 0.5);\n    setPosition(m_bpmLabel, &v20);\n    cocos2d::CCArray::addObject(a1->m_recordingObjects, a1->m_bpmLabel);\n    v11 = MusicDownloadManager::sharedState();\n    SongInfoObject = MusicDownloadManager::getSongInfoObject(v11, a1->m_songID);\n    if ( SongInfoObject )\n    {\n      m_BPM = (const char *)(unsigned int)SongInfoObject->m_BPM;\n      if ( (int)m_BPM > 0 )\n      {\n        m_infoLabel = a1->m_infoLabel;\n        setString = m_infoLabel->setString;\n        v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)\"BPM: %i\", m_BPM);\n        CString = cocos2d::CCString::getCString(v16);\n        setString(m_infoLabel, (const unsigned __int8 *)CString);\n      }\n    }\n    CreateGuidelinesLayer::toggleItems(a1, 0);\n  }\n  return v4;\n}", "assembly": "; \n; FindBPMLayer::init from 0x5c1a30 to 0x5c1b84 (340 bytes)\n; \n; 2 xrefs:\n; > FindBPMLayer::create @ 0x5c1c74\n; > <???> @ 0x44c10\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nSTP             X29, X30, [SP,#var_70]!                                ; +0x0, 0x5c1a30\nMOV             W2, #1                                                 ; +0x4, 0x5c1a34\nMOV             X29, SP                                                ; +0x8, 0x5c1a38\nSTP             X19, X20, [SP,#0x70+var_60]                            ; +0xc, 0x5c1a3c\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0x10, 0x5c1a40\nSTR             X23, [SP,#0x70+var_40]                                 ; +0x14, 0x5c1a44\nSTP             X21, X22, [SP,#0x70+var_50]                            ; +0x18, 0x5c1a48\nMOV             W22, W1                                                ; +0x1c, 0x5c1a4c\nMOV             X1, #0                                                 ; +0x20, 0x5c1a50\nLDR             X3, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x24, 0x5c1a54\nMOV             X20, X0                                                ; +0x28, 0x5c1a58\nLDR             X3, [X3]                                               ; +0x2c, 0x5c1a5c\nSTR             X3, [X29,#0x70+var_8]                                  ; +0x30, 0x5c1a60\nBL              _ZN21CreateGuidelinesLayer4initEP18CustomSongDelegate19AudioGuidelinesType; CreateGuidelinesLayer::init(CustomSongDelegate *,AudioGuidelinesType) ; +0x34, 0x5c1a64\nUXTB            W0, W0; this                                           ; +0x38, 0x5c1a68\nMOV             W21, W0                                                ; +0x3c, 0x5c1a6c\nCBNZ            W0, loc_5C1AA0                                         ; +0x40, 0x5c1a70\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x44, 0x5c1a74\nMOV             W0, W21                                                ; +0x48, 0x5c1a78\nLDR             X2, [X29,#0x70+var_8]                                  ; +0x4c, 0x5c1a7c\nLDR             X1, [X19]                                              ; +0x50, 0x5c1a80\nCMP             X2, X1                                                 ; +0x54, 0x5c1a84\nB.NE            loc_5C1B80                                             ; +0x58, 0x5c1a88\nLDP             X19, X20, [SP,#0x70+var_60]                            ; +0x5c, 0x5c1a8c\nLDP             X21, X22, [SP,#0x70+var_50]                            ; +0x60, 0x5c1a90\nLDR             X23, [SP,#0x70+var_40]                                 ; +0x64, 0x5c1a94\nLDP             X29, X30, [SP+0x70+var_70],#0x70                       ; +0x68, 0x5c1a98\nRET                                                                    ; +0x6c, 0x5c1a9c\nSTR             W22, [X20,#0x2C8]                                      ; +0x70, 0x5c1aa0\nADD             X22, X29, #0x70+var_10                                 ; +0x74, 0x5c1aa4\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x78, 0x5c1aa8\nADD             X8, X29, #0x70+var_18                                  ; +0x7c, 0x5c1aac\nBL              _ZN7cocos2d10CCDirector10getWinSizeEv; cocos2d::CCDirector::getWinSize(void) ; +0x80, 0x5c1ab0\nADRP            X0, #aBpm@PAGE; \"BPM\"                                  ; +0x84, 0x5c1ab4\nADRL            X1, aBigfontFnt; \"bigFont.fnt\"                         ; +0x88, 0x5c1ab8\nADD             X0, X0, #aBpm@PAGEOFF; \"BPM\"                           ; +0x90, 0x5c1ac0\nBL              _ZN7cocos2d13CCLabelBMFont6createEPKcS2_; cocos2d::CCLabelBMFont::create(char const*,char const*) ; +0x94, 0x5c1ac4\nMOV             X1, X0                                                 ; +0x98, 0x5c1ac8\nLDR             X3, [X20,#0x240]                                       ; +0x9c, 0x5c1acc\nMOV             W2, #1                                                 ; +0xa0, 0x5c1ad0\nSTR             X0, [X20,#0x2D0]                                       ; +0xa4, 0x5c1ad4\nMOV             X0, X3                                                 ; +0xa8, 0x5c1ad8\nLDR             X3, [X3]                                               ; +0xac, 0x5c1adc\nLDR             X3, [X3,#0x1C0]                                        ; +0xb0, 0x5c1ae0\nBLR             X3                                                     ; +0xb4, 0x5c1ae4\nLDR             X23, [X20,#0x2D0]                                      ; +0xb8, 0x5c1ae8\nLDR             S2, [X29,#0x70+var_14]                                 ; +0xbc, 0x5c1aec\nMOV             X0, X22; this                                          ; +0xc0, 0x5c1af0\nFMOV            S1, #0.5                                               ; +0xc4, 0x5c1af4\nSTR             X22, [X29,#0x70+var_28]                                ; +0xc8, 0x5c1af8\nLDR             S0, [X29,#0x70+var_18]                                 ; +0xcc, 0x5c1afc\nLDR             X2, [X23]                                              ; +0xd0, 0x5c1b00\nFMUL            S0, S0, S1; float                                      ; +0xd4, 0x5c1b04\nFMUL            S1, S2, S1; float                                      ; +0xd8, 0x5c1b08\nLDR             X22, [X2,#0xB8]                                        ; +0xdc, 0x5c1b0c\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0xe0, 0x5c1b10\nLDR             X1, [X29,#0x70+var_28]                                 ; +0xe4, 0x5c1b14\nMOV             X0, X23                                                ; +0xe8, 0x5c1b18\nBLR             X22                                                    ; +0xec, 0x5c1b1c\nLDR             X1, [X20,#0x2D0]; cocos2d::CCObject *                  ; +0xf0, 0x5c1b20\nLDR             X0, [X20,#0x298]; this                                 ; +0xf4, 0x5c1b24\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0xf8, 0x5c1b28\nBL              _ZN20MusicDownloadManager11sharedStateEv; MusicDownloadManager::sharedState(void) ; +0xfc, 0x5c1b2c\nLDR             W1, [X20,#0x2C8]; int                                  ; +0x100, 0x5c1b30\nBL              _ZN20MusicDownloadManager17getSongInfoObjectEi; MusicDownloadManager::getSongInfoObject(int) ; +0x104, 0x5c1b34\nCBZ             X0, loc_5C1B70                                         ; +0x108, 0x5c1b38\nLDR             W1, [X0,#0x194]; char *                                ; +0x10c, 0x5c1b3c\nCMP             W1, WZR                                                ; +0x110, 0x5c1b40\nB.LE            loc_5C1B70                                             ; +0x114, 0x5c1b44\nLDR             X22, [X20,#0x2A0]                                      ; +0x118, 0x5c1b48\nADRL            X0, aBpmI; \"BPM: %i\"                                   ; +0x11c, 0x5c1b4c\nLDR             X2, [X22]                                              ; +0x124, 0x5c1b54\nLDR             X23, [X2,#0x390]                                       ; +0x128, 0x5c1b58\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x12c, 0x5c1b5c\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x130, 0x5c1b60\nMOV             X1, X0                                                 ; +0x134, 0x5c1b64\nMOV             X0, X22                                                ; +0x138, 0x5c1b68\nBLR             X23                                                    ; +0x13c, 0x5c1b6c\nMOV             X0, X20; this                                          ; +0x140, 0x5c1b70\nMOV             W1, #0; bool                                           ; +0x144, 0x5c1b74\nBL              _ZN21CreateGuidelinesLayer11toggleItemsEb; CreateGuidelinesLayer::toggleItems(bool) ; +0x148, 0x5c1b78\nB               loc_5C1A74                                             ; +0x14c, 0x5c1b7c\nBL              .__stack_chk_fail                                      ; +0x150, 0x5c1b80", "xrefs": ["FindBPMLayer::create @ 0x5c1c74", "<???> @ 0x44c10"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}