{"type": "func", "start": 4298793376, "end": 4298793584, "name": "BoomScrollLayer::pageNumberForPosition", "pseudocode": "// \n// BoomScrollLayer::pageNumberForPosition from 0x1003a61a0 to 0x1003a6270 (208 bytes)\n// \n// 0 xrefs:\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\nint __fastcall BoomScrollLayer::pageNumberForPosition(BoomScrollLayer *a1, cocos2d::CCPoint a2)\n{\n  __m128 v2; // xmm1\n  __m128 v3; // xmm0\n  int v4; // r14d\n\n  v2 = _mm_xor_ps(\n         (__m128)*(unsigned int *)((__int64 (__fastcall *)(ExtendedLayer *, double))a1->m_extendedLayer->getPosition)(\n                                    a1->m_extendedLayer,\n                                    *(double *)&a2),\n         (__m128)xmmword_1008150B0);\n  v2.f32[0] = v2.f32[0]\n            / (float)(*(float *)((__int64 (__fastcall *)(BoomScrollLayer *))a1->getContentSize)(a1) - a1->m_pageOffset);\n  v3 = _mm_round_ss((__m128)0LL, v2, 10);\n  v4 = ((float)(_mm_cvtepi32_ps(_mm_cvttps_epi32(v3)).f32[0] - v2.f32[0]) < 0.5) + (int)v3.f32[0] - 1;\n  if ( !a1->m_looped )\n  {\n    if ( v4 <= 0 )\n      v4 = 0;\n    if ( (int)(sub_100720070(*((_QWORD *)&a1->m_dynamicObjects + 4 * !a1->m_dynamic)) - 1) <= v4 )\n      return sub_100720070(*((_QWORD *)&a1->m_dynamicObjects + 4 * !a1->m_dynamic)) - 1;\n  }\n  return v4;\n}", "assembly": "; \n; BoomScrollLayer::pageNumberForPosition from 0x1003a61a0 to 0x1003a6270 (208 bytes)\n; \n; 0 xrefs:\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\npush    rbp                                                            ; +0x0, 0x1003a61a0\nmov     rbp, rsp                                                       ; +0x1, 0x1003a61a1\npush    r14                                                            ; +0x4, 0x1003a61a4\npush    rbx                                                            ; +0x6, 0x1003a61a6\nsub     rsp, 10h                                                       ; +0x7, 0x1003a61a7\nmov     rbx, rdi                                                       ; +0xb, 0x1003a61ab\nmov     rdi, [rdi+1F0h]                                                ; +0xe, 0x1003a61ae\nmov     rax, [rdi]                                                     ; +0x15, 0x1003a61b5\ncall    qword ptr [rax+0C0h]                                           ; +0x18, 0x1003a61b8\nmovss   xmm0, dword ptr [rax]                                          ; +0x1e, 0x1003a61be\nxorps   xmm0, cs:xmmword_1008150B0                                     ; +0x22, 0x1003a61c2\nmovaps  [rbp+var_20], xmm0                                             ; +0x29, 0x1003a61c9\nmov     rax, [rbx]                                                     ; +0x2d, 0x1003a61cd\nmov     rdi, rbx                                                       ; +0x30, 0x1003a61d0\ncall    qword ptr [rax+138h]                                           ; +0x33, 0x1003a61d3\nmovss   xmm0, dword ptr [rax]                                          ; +0x39, 0x1003a61d9\nsubss   xmm0, dword ptr [rbx+248h]                                     ; +0x3d, 0x1003a61dd\nmovaps  xmm1, [rbp+var_20]                                             ; +0x45, 0x1003a61e5\ndivss   xmm1, xmm0                                                     ; +0x49, 0x1003a61e9\nxorps   xmm0, xmm0                                                     ; +0x4d, 0x1003a61ed\nroundss xmm0, xmm1, 0Ah                                                ; +0x50, 0x1003a61f0\ncvttss2si r14d, xmm0                                                   ; +0x56, 0x1003a61f6\ncvttps2dq xmm0, xmm0                                                   ; +0x5b, 0x1003a61fb\ncvtdq2ps xmm0, xmm0                                                    ; +0x5f, 0x1003a61ff\nsubss   xmm0, xmm1                                                     ; +0x62, 0x1003a6202\nucomiss xmm0, cs:dword_100814FA8                                       ; +0x66, 0x1003a6206\nadc     r14d, 0FFFFFFFFh                                               ; +0x6d, 0x1003a620d\ncmp     byte ptr [rbx+1ACh], 0                                         ; +0x71, 0x1003a6211\njnz     short loc_1003A6264                                            ; +0x78, 0x1003a6218\nxor     eax, eax                                                       ; +0x7a, 0x1003a621a\ntest    r14d, r14d                                                     ; +0x7c, 0x1003a621c\ncmovle  r14d, eax                                                      ; +0x7f, 0x1003a621f\nmovzx   eax, byte ptr [rbx+1C0h]                                       ; +0x83, 0x1003a6223\nxor     eax, 1                                                         ; +0x8a, 0x1003a622a\nshl     eax, 5                                                         ; +0x8d, 0x1003a622d\nmov     rdi, [rax+rbx+1B8h]                                            ; +0x90, 0x1003a6230\ncall    sub_100720070                                                  ; +0x98, 0x1003a6238\ndec     eax                                                            ; +0x9d, 0x1003a623d\ncmp     eax, r14d                                                      ; +0x9f, 0x1003a623f\njg      short loc_1003A6264                                            ; +0xa2, 0x1003a6242\nmovzx   eax, byte ptr [rbx+1C0h]                                       ; +0xa4, 0x1003a6244\nxor     eax, 1                                                         ; +0xab, 0x1003a624b\nshl     eax, 5                                                         ; +0xae, 0x1003a624e\nmov     rdi, [rax+rbx+1B8h]                                            ; +0xb1, 0x1003a6251\ncall    sub_100720070                                                  ; +0xb9, 0x1003a6259\nmov     r14d, eax                                                      ; +0xbe, 0x1003a625e\ndec     r14d                                                           ; +0xc1, 0x1003a6261\nmov     eax, r14d                                                      ; +0xc4, 0x1003a6264\nadd     rsp, 10h                                                       ; +0xc7, 0x1003a6267\npop     rbx                                                            ; +0xcb, 0x1003a626b\npop     r14                                                            ; +0xcc, 0x1003a626c\npop     rbp                                                            ; +0xce, 0x1003a626e\nretn                                                                   ; +0xcf, 0x1003a626f", "xrefs": [], "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"}