{"type": "func", "start": 4297931028, "end": 4297931272, "name": "GJOptionsLayer::nextPosition", "pseudocode": "// \n// GJOptionsLayer::nextPosition from 0x1002d3914 to 0x1002d3a08 (244 bytes)\n// \n// 3 xrefs:\n// > GJOptionsLayer::addToggleInternal @ 0x1002d3608\n// > GameOptionsLayer::setupOptions @ 0x1002e185c\n// > GameOptionsLayer::setupOptions @ 0x1002e19f8\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\ncocos2d::CCPoint __fastcall GJOptionsLayer::nextPosition(GJOptionsLayer *a1, int a2)\n{\n  __int64 v2; // x8\n  __int64 v5; // x19\n  cocos2d::CCDirector *v6; // x0\n  __n128 v7; // q0\n  __n128 v8; // q1\n  __n128 v9; // q0\n  __n128 v10; // q1\n  signed int v11; // w21\n  __int64 *v12; // x1\n  int v15; // [xsp+8h] [xbp-58h] BYREF\n  _DWORD v16[2]; // [xsp+10h] [xbp-50h] BYREF\n  float v17; // [xsp+18h] [xbp-48h]\n  float v18; // [xsp+1Ch] [xbp-44h]\n  cocos2d::CCPoint result; // 0:s0.4,4:s1.4\n\n  v5 = v2;\n  v6 = cocos2d::CCDirector::sharedDirector();\n  cocos2d::CCDirector::getWinSize(v6);\n  v7.n128_f32[0] = (float)(v17 * 0.5) + -160.0;\n  v8.n128_f32[0] = a1->m_offset + (float)((float)(v18 * 0.5) + 80.0);\n  sub_100022980(v7, v8, v16);\n  v9.n128_f32[0] = (float)(v17 * 0.5) + 32.0;\n  v10.n128_u64[0] = v16[1] | 0x4200000000000000LL;\n  sub_100022980(v9, v10, &v15);\n  v11 = GJOptionsLayer::countForPage(a1, a2);\n  if ( (v11 & 1) != 0 )\n    v12 = (__int64 *)&v15;\n  else\n    v12 = (__int64 *)v16;\n  result.x = sub_1000229B8((__int64 *)v5, v12);\n  if ( v11 >= 2 )\n  {\n    result.y = a1->m_gap;\n    result.x = *(float *)(v5 + 4) - (float)((float)(int)floorf(vcvts_n_f32_u32(v11, 1u)) * result.y);\n    *(float *)(v5 + 4) = result.x;\n  }\n  return result;\n}", "assembly": "; \n; GJOptionsLayer::nextPosition from 0x1002d3914 to 0x1002d3a08 (244 bytes)\n; \n; 3 xrefs:\n; > GJOptionsLayer::addToggleInternal @ 0x1002d3608\n; > GameOptionsLayer::setupOptions @ 0x1002e185c\n; > GameOptionsLayer::setupOptions @ 0x1002e19f8\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, #0x70                                          ; +0x0, 0x1002d3914\nSTP             D9, D8, [SP,#0x60+var_40]                              ; +0x4, 0x1002d3918\nSTP             X24, X23, [SP,#0x60+var_30]                            ; +0x8, 0x1002d391c\nSTP             X22, X21, [SP,#0x60+var_20]                            ; +0xc, 0x1002d3920\nSTP             X20, X19, [SP,#0x60+var_10]                            ; +0x10, 0x1002d3924\nSTP             X29, X30, [SP,#0x60+var_s0]                            ; +0x14, 0x1002d3928\nADD             X29, SP, #0x60                                         ; +0x18, 0x1002d392c\nMOV             X21, X1                                                ; +0x1c, 0x1002d3930\nMOV             X20, X0                                                ; +0x20, 0x1002d3934\nMOV             X19, X8                                                ; +0x24, 0x1002d3938\nBL              cocos2d__CCDirector__sharedDirector                    ; +0x28, 0x1002d393c\nADD             X8, SP, #0x60+var_48                                   ; +0x2c, 0x1002d3940\nBL              cocos2d__CCDirector__getWinSize                        ; +0x30, 0x1002d3944\nFMOV            S8, #0.5                                               ; +0x34, 0x1002d3948\nLDP             S0, S1, [SP,#0x60+var_48]                              ; +0x38, 0x1002d394c\nFMUL            S0, S0, S8                                             ; +0x3c, 0x1002d3950\nMOV             W8, #0xC3200000                                        ; +0x40, 0x1002d3954\nFMOV            S2, W8                                                 ; +0x44, 0x1002d3958\nFADD            S0, S0, S2                                             ; +0x48, 0x1002d395c\nFMUL            S1, S1, S8                                             ; +0x4c, 0x1002d3960\nMOV             W8, #0x42A00000                                        ; +0x50, 0x1002d3964\nFMOV            S2, W8                                                 ; +0x54, 0x1002d3968\nFADD            S1, S1, S2                                             ; +0x58, 0x1002d396c\nLDR             S2, [X20,#0x3E8]                                       ; +0x5c, 0x1002d3970\nFADD            S1, S2, S1                                             ; +0x60, 0x1002d3974\nADD             X22, SP, #0x60+var_50                                  ; +0x64, 0x1002d3978\nADD             X0, SP, #0x60+var_50                                   ; +0x68, 0x1002d397c\nBL              sub_100022980                                          ; +0x6c, 0x1002d3980\nLDR             S0, [SP,#0x60+var_48]                                  ; +0x70, 0x1002d3984\nFMUL            S0, S0, S8                                             ; +0x74, 0x1002d3988\nMOVI            V1.2S, #0x42,LSL#24 ; 'B'                              ; +0x78, 0x1002d398c\nFADD            S0, S0, S1                                             ; +0x7c, 0x1002d3990\nLDR             S1, [SP,#0x60+var_4C]                                  ; +0x80, 0x1002d3994\nADD             X23, SP, #0x60+var_58                                  ; +0x84, 0x1002d3998\nADD             X0, SP, #0x60+var_58                                   ; +0x88, 0x1002d399c\nBL              sub_100022980                                          ; +0x8c, 0x1002d39a0\nMOV             X0, X20                                                ; +0x90, 0x1002d39a4\nMOV             X1, X21                                                ; +0x94, 0x1002d39a8\nBL              GJOptionsLayer__countForPage                           ; +0x98, 0x1002d39ac\nMOV             X21, X0                                                ; +0x9c, 0x1002d39b0\nTST             W0, #1                                                 ; +0xa0, 0x1002d39b4\nCSEL            X1, X22, X23, EQ                                       ; +0xa4, 0x1002d39b8\nMOV             X0, X19                                                ; +0xa8, 0x1002d39bc\nBL              sub_1000229B8                                          ; +0xac, 0x1002d39c0\nCMP             W21, #2                                                ; +0xb0, 0x1002d39c4\nB.LT            loc_1002D39EC                                          ; +0xb4, 0x1002d39c8\nUCVTF           S0, W21, #1                                            ; +0xb8, 0x1002d39cc\nFRINTM          S0, S0                                                 ; +0xbc, 0x1002d39d0\nFCVTZS          S0, S0                                                 ; +0xc0, 0x1002d39d4\nSCVTF           S0, S0                                                 ; +0xc4, 0x1002d39d8\nLDR             S1, [X20,#0x3AC]                                       ; +0xc8, 0x1002d39dc\nLDR             S2, [X19,#4]                                           ; +0xcc, 0x1002d39e0\nFMSUB           S0, S0, S1, S2                                         ; +0xd0, 0x1002d39e4\nSTR             S0, [X19,#4]                                           ; +0xd4, 0x1002d39e8\nLDP             X29, X30, [SP,#0x60+var_s0]                            ; +0xd8, 0x1002d39ec\nLDP             X20, X19, [SP,#0x60+var_10]                            ; +0xdc, 0x1002d39f0\nLDP             X22, X21, [SP,#0x60+var_20]                            ; +0xe0, 0x1002d39f4\nLDP             X24, X23, [SP,#0x60+var_30]                            ; +0xe4, 0x1002d39f8\nLDP             D9, D8, [SP,#0x60+var_40]                              ; +0xe8, 0x1002d39fc\nADD             SP, SP, #0x70 ; 'p'                                    ; +0xec, 0x1002d3a00\nRET                                                                    ; +0xf0, 0x1002d3a04", "xrefs": ["GJOptionsLayer::addToggleInternal @ 0x1002d3608", "GameOptionsLayer::setupOptions @ 0x1002e185c", "GameOptionsLayer::setupOptions @ 0x1002e19f8"], "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"}