{"type": "func", "start": 5690748, "end": 5690944, "name": "BoomScrollLayer::pageNumberForPosition", "pseudocode": "// \n// BoomScrollLayer::pageNumberForPosition from 0x56d57c to 0x56d640 (196 bytes)\n// \n// 5 xrefs:\n// > BoomScrollLayer::updateDots @ 0x56d75c\n// > BoomScrollLayer::moveToPageEnded @ 0x56d950\n// > BoomScrollLayer::ccTouchEnded @ 0x56e260\n// > BoomScrollLayer::ccTouchMoved @ 0x56e82c\n// > <???> @ 0xb8ea8\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\n// local variable allocation has failed, the output may be wrong!\nint BoomScrollLayer::pageNumberForPosition(BoomScrollLayer *a1, cocos2d::CCPoint a2)\n{\n  float v3; // s8\n  float v4; // s0\n  int v5; // w19\n\n  v3 = *(float *)((__int64 (__fastcall *)(ExtendedLayer *, long double, long double))a1->m_extendedLayer->getPosition)(\n                   a1->m_extendedLayer,\n                   *(long double *)&a2.x,\n                   *(long double *)&a2.y);\n  v4 = (float)-v3 / (float)(a1->getContentSize(a1)->width - a1->m_pageOffset);\n  v5 = vcvtps_s32_f32(v4);\n  if ( (float)((float)v5 - v4) >= 0.5 )\n    --v5;\n  if ( a1->m_looped )\n    return v5;\n  if ( v5 < 0 )\n    v5 = 0;\n  if ( v5 < BoomScrollLayer::getTotalPages(a1) - 1 )\n    return v5;\n  else\n    return BoomScrollLayer::getTotalPages(a1) - 1;\n}", "assembly": "; \n; BoomScrollLayer::pageNumberForPosition from 0x56d57c to 0x56d640 (196 bytes)\n; \n; 5 xrefs:\n; > BoomScrollLayer::updateDots @ 0x56d75c\n; > BoomScrollLayer::moveToPageEnded @ 0x56d950\n; > BoomScrollLayer::ccTouchEnded @ 0x56e260\n; > BoomScrollLayer::ccTouchMoved @ 0x56e82c\n; > <???> @ 0xb8ea8\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_30]!                                ; +0x0, 0x56d57c\nMOV             X29, SP                                                ; +0x4, 0x56d580\nLDR             X1, [X0,#0x1F0]                                        ; +0x8, 0x56d584\nSTP             X19, X20, [SP,#0x30+var_20]                            ; +0xc, 0x56d588\nMOV             X20, X0                                                ; +0x10, 0x56d58c\nMOV             X0, X1                                                 ; +0x14, 0x56d590\nLDR             X1, [X1]                                               ; +0x18, 0x56d594\nSTR             D8, [SP,#0x30+var_10]                                  ; +0x1c, 0x56d598\nLDR             X1, [X1,#0xC0]                                         ; +0x20, 0x56d59c\nBLR             X1                                                     ; +0x24, 0x56d5a0\nLDR             X1, [X20]                                              ; +0x28, 0x56d5a4\nLDR             S8, [X0]                                               ; +0x2c, 0x56d5a8\nMOV             X0, X20                                                ; +0x30, 0x56d5ac\nFNEG            S8, S8                                                 ; +0x34, 0x56d5b0\nLDR             X1, [X1,#0x138]                                        ; +0x38, 0x56d5b4\nBLR             X1                                                     ; +0x3c, 0x56d5b8\nLDR             S1, [X20,#0x248]                                       ; +0x40, 0x56d5bc\nLDRB            W1, [X20,#0x1AC]                                       ; +0x44, 0x56d5c0\nLDR             S0, [X0]                                               ; +0x48, 0x56d5c4\nFSUB            S0, S0, S1                                             ; +0x4c, 0x56d5c8\nFDIV            S0, S8, S0                                             ; +0x50, 0x56d5cc\nFCVTPS          W19, S0                                                ; +0x54, 0x56d5d0\nSCVTF           S1, W19                                                ; +0x58, 0x56d5d4\nSUB             W0, W19, #1                                            ; +0x5c, 0x56d5d8\nFSUB            S0, S1, S0                                             ; +0x60, 0x56d5dc\nFMOV            S1, #0.5                                               ; +0x64, 0x56d5e0\nFCMP            S0, S1                                                 ; +0x68, 0x56d5e4\nCSEL            W19, W19, W0, LT                                       ; +0x6c, 0x56d5e8\nCBZ             W1, loc_56D604                                         ; +0x70, 0x56d5ec\nMOV             W0, W19                                                ; +0x74, 0x56d5f0\nLDP             X19, X20, [SP,#0x30+var_20]                            ; +0x78, 0x56d5f4\nLDR             D8, [SP,#0x30+var_10]                                  ; +0x7c, 0x56d5f8\nLDP             X29, X30, [SP+0x30+var_30],#0x30                       ; +0x80, 0x56d5fc\nRET                                                                    ; +0x84, 0x56d600\nCMP             W19, WZR                                               ; +0x88, 0x56d604\nMOV             X0, X20; this                                          ; +0x8c, 0x56d608\nCSEL            W19, W19, WZR, GE                                      ; +0x90, 0x56d60c\nBL              _ZN15BoomScrollLayer13getTotalPagesEv; BoomScrollLayer::getTotalPages(void) ; +0x94, 0x56d610\nSUB             W0, W0, #1                                             ; +0x98, 0x56d614\nCMP             W19, W0                                                ; +0x9c, 0x56d618\nB.LT            loc_56D5F0                                             ; +0xa0, 0x56d61c\nMOV             X0, X20; this                                          ; +0xa4, 0x56d620\nBL              _ZN15BoomScrollLayer13getTotalPagesEv; BoomScrollLayer::getTotalPages(void) ; +0xa8, 0x56d624\nSUB             W19, W0, #1                                            ; +0xac, 0x56d628\nMOV             W0, W19                                                ; +0xb0, 0x56d62c\nLDP             X19, X20, [SP,#0x30+var_20]                            ; +0xb4, 0x56d630\nLDR             D8, [SP,#0x30+var_10]                                  ; +0xb8, 0x56d634\nLDP             X29, X30, [SP+0x30+var_30],#0x30                       ; +0xbc, 0x56d638\nRET                                                                    ; +0xc0, 0x56d63c", "xrefs": ["BoomScrollLayer::updateDots @ 0x56d75c", "BoomScrollLayer::moveToPageEnded @ 0x56d950", "BoomScrollLayer::ccTouchEnded @ 0x56e260", "BoomScrollLayer::ccTouchMoved @ 0x56e82c", "<???> @ 0xb8ea8"], "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"}