{"type": "func", "start": 4295484224, "end": 4295484424, "name": "FindBPMLayer::registerTouch", "pseudocode": "// \n// FindBPMLayer::registerTouch from 0x10007e340 to 0x10007e408 (200 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0x10077aff0\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\nvoid __fastcall FindBPMLayer::registerTouch(FindBPMLayer *a1)\n{\n  int m_beats; // w8\n  __int64 v2; // x9\n  float m_elapsed; // s0\n  cocos2d::CCLabelBMFont *m_bpmLabel; // x19\n  void **v5; // x1\n  void *__p[2]; // [xsp+8h] [xbp-28h] BYREF\n  char v7; // [xsp+1Fh] [xbp-11h]\n\n  m_beats = a1->m_beats;\n  v2 = (unsigned int)(m_beats + 1);\n  a1->m_beats = v2;\n  m_elapsed = a1->m_elapsed;\n  if ( m_beats <= 0 )\n  {\n    a1->m_startOffset = m_elapsed;\n    ((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))a1->m_bpmLabel->setString)(a1->m_bpmLabel, \"0\");\n  }\n  else\n  {\n    LODWORD(v2) = llroundf(60.0 / (float)((float)(m_elapsed - a1->m_startOffset) / (float)(unsigned int)m_beats));\n    a1->m_beatsPerMinute = v2;\n    m_bpmLabel = a1->m_bpmLabel;\n    GameToolbox::intToString(v2, __p);\n    if ( v7 >= 0 )\n      v5 = __p;\n    else\n      v5 = (void **)__p[0];\n    ((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))m_bpmLabel->setString)(m_bpmLabel, v5);\n    if ( v7 < 0 )\n      operator delete(__p[0]);\n  }\n}", "assembly": "; \n; FindBPMLayer::registerTouch from 0x10007e340 to 0x10007e408 (200 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0x10077aff0\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\nSUB             SP, SP, #0x40                                          ; +0x0, 0x10007e340\nSTP             X20, X19, [SP,#0x30+var_10]                            ; +0x4, 0x10007e344\nSTP             X29, X30, [SP,#0x30+var_s0]                            ; +0x8, 0x10007e348\nADD             X29, SP, #0x30                                         ; +0xc, 0x10007e34c\nLDR             W8, [X0,#0x2EC]                                        ; +0x10, 0x10007e350\nADD             W9, W8, #1                                             ; +0x14, 0x10007e354\nSTR             W9, [X0,#0x2EC]                                        ; +0x18, 0x10007e358\nLDR             S0, [X0,#0x2B0]                                        ; +0x1c, 0x10007e35c\nCMP             W8, #0                                                 ; +0x20, 0x10007e360\nB.LE            loc_10007E3E0                                          ; +0x24, 0x10007e364\nLDR             S1, [X0,#0x2E8]                                        ; +0x28, 0x10007e368\nFSUB            S0, S0, S1                                             ; +0x2c, 0x10007e36c\nUCVTF           S1, W8                                                 ; +0x30, 0x10007e370\nFDIV            S0, S0, S1                                             ; +0x34, 0x10007e374\nMOV             W8, #0x42700000                                        ; +0x38, 0x10007e378\nFMOV            S1, W8                                                 ; +0x3c, 0x10007e37c\nFDIV            S0, S1, S0                                             ; +0x40, 0x10007e380\nFCVTAS          W9, S0                                                 ; +0x44, 0x10007e384\nSTR             W9, [X0,#0x2F0]                                        ; +0x48, 0x10007e388\nLDR             X19, [X0,#0x2E0]                                       ; +0x4c, 0x10007e38c\nADD             X20, SP, #0x30+__p                                     ; +0x50, 0x10007e390\nADD             X8, SP, #0x30+__p                                      ; +0x54, 0x10007e394\nMOV             X0, X9                                                 ; +0x58, 0x10007e398\nBL              GameToolbox__intToString                               ; +0x5c, 0x10007e39c\nLDRSB           W8, [SP,#0x30+var_11]                                  ; +0x60, 0x10007e3a0\nLDR             X9, [SP,#0x30+__p]                                     ; +0x64, 0x10007e3a4\nCMP             W8, #0                                                 ; +0x68, 0x10007e3a8\nCSEL            X1, X9, X20, LT                                        ; +0x6c, 0x10007e3ac\nLDR             X8, [X19]                                              ; +0x70, 0x10007e3b0\nLDR             X8, [X8,#0x390]                                        ; +0x74, 0x10007e3b4\nMOV             X0, X19                                                ; +0x78, 0x10007e3b8\nBLR             X8                                                     ; +0x7c, 0x10007e3bc\nLDRSB           W8, [SP,#0x30+var_11]                                  ; +0x80, 0x10007e3c0\nTBZ             W8, #0x1F, loc_10007E3D0                               ; +0x84, 0x10007e3c4\nLDR             X0, [SP,#0x30+__p]; __p                                ; +0x88, 0x10007e3c8\nBL              __ZdlPv; operator delete(void *)                       ; +0x8c, 0x10007e3cc\nLDP             X29, X30, [SP,#0x30+var_s0]                            ; +0x90, 0x10007e3d0\nLDP             X20, X19, [SP,#0x30+var_10]                            ; +0x94, 0x10007e3d4\nADD             SP, SP, #0x40 ; '@'                                    ; +0x98, 0x10007e3d8\nRET                                                                    ; +0x9c, 0x10007e3dc\nSTR             S0, [X0,#0x2E8]                                        ; +0xa0, 0x10007e3e0\nLDR             X0, [X0,#0x2E0]                                        ; +0xa4, 0x10007e3e4\nLDR             X8, [X0]                                               ; +0xa8, 0x10007e3e8\nLDR             X2, [X8,#0x390]                                        ; +0xac, 0x10007e3ec\nADRL            X1, a0; \"0\"                                            ; +0xb0, 0x10007e3f0\nLDP             X29, X30, [SP,#0x30+var_s0]                            ; +0xb8, 0x10007e3f8\nLDP             X20, X19, [SP,#0x30+var_10]                            ; +0xbc, 0x10007e3fc\nADD             SP, SP, #0x40 ; '@'                                    ; +0xc0, 0x10007e400\nBR              X2                                                     ; +0xc4, 0x10007e404", "xrefs": ["<???> @ 0x10077aff0"], "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"}