{"type": "func", "start": 4034868, "end": 4035172, "name": "ButtonPage::init", "pseudocode": "// \n// ButtonPage::init from 0x3d9134 to 0x3d9264 (304 bytes)\n// \n// 1 xrefs:\n// > ButtonPage::create @ 0x3d92da\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 ButtonPage::init(ButtonPage *a1, cocos2d::CCArray *a2, cocos2d::CCPoint a3, int a4, float a5)\n{\n  float y; // r7\n  float x; // r4\n  _BOOL4 v9; // r8\n  cocos2d::CCMenu *v10; // r6\n  float v11; // s16\n  float v12; // s18\n  int v13; // r4\n  float v14; // s16\n  float v15; // s18\n  int v16; // s23\n  float v17; // r0\n  unsigned int v18; // r1\n  int v19; // s20\n  cocos2d::CCNode *v20; // r5\n  void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+4h] [bp-20h]\n  cocos2d::CCPoint v23; // [sp+Ch] [bp-18h] BYREF\n  cocos2d::CCPoint v24; // [sp+14h] [bp-10h] BYREF\n\n  y = a3.y;\n  x = a3.x;\n  v9 = cocos2d::CCLayer::init(a1);\n  if ( v9 )\n  {\n    v10 = cocos2d::CCMenu::create();\n    a1->addChild(a1, v10);\n    v11 = *(float *)LODWORD(x);\n    v12 = *(float *)(LODWORD(x) + 4);\n    v13 = 0;\n    v14 = (float)(v11 - (float)((float)((float)SLODWORD(y) * 0.5) * *(float *)&a4))\n        - (float)((float)((float)(LODWORD(y) - 1) * 0.5) * 4.0);\n    v15 = v12 - (float)(*(float *)&a4 * 0.5);\n    while ( (unsigned int)v13 < cocos2d::CCArray::count(a2) )\n    {\n      v16 = v13 % SLODWORD(y);\n      v17 = floorf((float)v13 / (float)SLODWORD(y));\n      v18 = v13++;\n      v19 = (int)v17;\n      v20 = (cocos2d::CCNode *)cocos2d::CCArray::objectAtIndex(a2, v18);\n      v10->addChild(v10, v20);\n      cocos2d::CCPoint::CCPoint(\n        &v23,\n        (float)(v14 + (float)(*(float *)&a4 * 0.5)) + (float)((float)v16 * (float)(*(float *)&a4 + 4.0)),\n        v15 - (float)((float)v19 * (float)(*(float *)&a4 + 4.0)));\n      setPosition = v20->setPosition;\n      cocos2d::CCNode::convertToNodeSpace(&v24, v10, &v23);\n      setPosition(v20, &v24);\n    }\n  }\n  return v9;\n}", "assembly": "; \n; ButtonPage::init from 0x3d9134 to 0x3d9264 (304 bytes)\n; \n; 1 xrefs:\n; > ButtonPage::create @ 0x3d92da\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.W          {R4-R11,LR}                                            ; +0x0, 0x3d9134\nMOV             R7, R3                                                 ; +0x4, 0x3d9138\nLDR             R5, =(__stack_chk_guard_ptr - 0x3D9148)                ; +0x6, 0x3d913a\nMOV             R10, R0                                                ; +0x8, 0x3d913c\nVPUSH           {D8-D11}                                               ; +0xa, 0x3d913e\nMOV             R9, R1                                                 ; +0xe, 0x3d9142\nADD             R5, PC; __stack_chk_guard_ptr                          ; +0x10, 0x3d9144\nLDR             R5, [R5]; __stack_chk_guard                            ; +0x12, 0x3d9146\nMOV             R4, R2                                                 ; +0x14, 0x3d9148\nLDR             R3, [R5]                                               ; +0x16, 0x3d914a\nSUB             SP, SP, #0x24                                          ; +0x18, 0x3d914c\nVLDR            S19, [SP,#0x24+arg_0]                                  ; +0x1a, 0x3d914e\nSTR             R3, [SP,#0x24+var_8]                                   ; +0x1e, 0x3d9152\nBL              _ZN7cocos2d7CCLayer4initEv; cocos2d::CCLayer::init(void) ; +0x20, 0x3d9154\nSTR             R5, [SP,#0x24+var_24]                                  ; +0x24, 0x3d9158\nMOV             R8, R0                                                 ; +0x26, 0x3d915a\nCMP             R0, #0                                                 ; +0x28, 0x3d915c\nBEQ             loc_3D924A                                             ; +0x2a, 0x3d915e\nBL              _ZN7cocos2d6CCMenu6createEv; cocos2d::CCMenu::create(void) ; +0x2c, 0x3d9160\nLDR.W           R3, [R10]                                              ; +0x30, 0x3d9164\nADD.W           R11, SP, #0x24+var_10                                  ; +0x34, 0x3d9168\nLDR.W           R3, [R3,#0xDC]                                         ; +0x38, 0x3d916c\nMOV             R6, R0                                                 ; +0x3c, 0x3d9170\nMOV             R0, R10                                                ; +0x3e, 0x3d9172\nMOV             R1, R6                                                 ; +0x40, 0x3d9174\nADD.W           R10, SP, #0x24+var_18                                  ; +0x42, 0x3d9176\nBLX             R3                                                     ; +0x46, 0x3d917a\nVMOV.F32        S14, #0.5                                              ; +0x48, 0x3d917c\nVMOV            S15, R7                                                ; +0x4c, 0x3d9180\nSUBS            R3, R7, #1                                             ; +0x50, 0x3d9184\nVLDR            S16, [R4]                                              ; +0x52, 0x3d9186\nVLDR            S18, [R4,#4]                                           ; +0x56, 0x3d918a\nMOVS            R4, #0                                                 ; +0x5a, 0x3d918e\nVCVT.F32.S32    S22, S15                                               ; +0x5c, 0x3d9190\nVMUL.F32        S15, S22, S14                                          ; +0x60, 0x3d9194\nVMLS.F32        S16, S15, S19                                          ; +0x64, 0x3d9198\nVMOV            S15, R3                                                ; +0x68, 0x3d919c\nVCVT.F32.S32    S15, S15                                               ; +0x6c, 0x3d91a0\nVMUL.F32        S15, S15, S14                                          ; +0x70, 0x3d91a4\nVMUL.F32        S21, S19, S14                                          ; +0x74, 0x3d91a8\nVMOV.F32        S14, #4.0                                              ; +0x78, 0x3d91ac\nVMLS.F32        S16, S15, S14                                          ; +0x7c, 0x3d91b0\nVSUB.F32        S18, S18, S21                                          ; +0x80, 0x3d91b4\nVMOV.F32        S17, S14                                               ; +0x84, 0x3d91b8\nMOV             R0, R9; this                                           ; +0x88, 0x3d91bc\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x8a, 0x3d91be\nCMP             R4, R0                                                 ; +0x8e, 0x3d91c2\nBCS             loc_3D924A                                             ; +0x90, 0x3d91c4\nMOV             R0, R4                                                 ; +0x92, 0x3d91c6\nMOV             R1, R7                                                 ; +0x94, 0x3d91c8\nBLX             __aeabi_idivmod                                        ; +0x96, 0x3d91ca\nVMOV            S15, R4                                                ; +0x9a, 0x3d91ce\nVCVT.F32.S32    S15, S15                                               ; +0x9e, 0x3d91d2\nVDIV.F32        S15, S15, S22                                          ; +0xa2, 0x3d91d6\nVMOV            S23, R1                                                ; +0xa6, 0x3d91da\nVMOV            R0, S15; x                                             ; +0xaa, 0x3d91de\nBLX             floorf                                                 ; +0xae, 0x3d91e2\nMOV             R1, R4; unsigned int                                   ; +0xb2, 0x3d91e6\nADDS            R4, #1                                                 ; +0xb4, 0x3d91e8\nVMOV            S15, R0                                                ; +0xb6, 0x3d91ea\nMOV             R0, R9; this                                           ; +0xba, 0x3d91ee\nVCVT.S32.F32    S20, S15                                               ; +0xbc, 0x3d91f0\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0xc0, 0x3d91f4\nLDR             R3, [R6]                                               ; +0xc4, 0x3d91f8\nLDR.W           R3, [R3,#0xDC]                                         ; +0xc6, 0x3d91fa\nMOV             R5, R0                                                 ; +0xca, 0x3d91fe\nMOV             R0, R6                                                 ; +0xcc, 0x3d9200\nMOV             R1, R5                                                 ; +0xce, 0x3d9202\nBLX             R3                                                     ; +0xd0, 0x3d9204\nVADD.F32        S15, S19, S17                                          ; +0xd2, 0x3d9206\nMOV             R0, R10; this                                          ; +0xd6, 0x3d920a\nVADD.F32        S14, S16, S21                                          ; +0xd8, 0x3d920c\nVCVT.F32.S32    S23, S23                                               ; +0xdc, 0x3d9210\nVMLA.F32        S14, S23, S15                                          ; +0xe0, 0x3d9214\nVCVT.F32.S32    S20, S20                                               ; +0xe4, 0x3d9218\nVMOV            R1, S14; float                                         ; +0xe8, 0x3d921c\nVMOV.F32        S14, S18                                               ; +0xec, 0x3d9220\nVMLS.F32        S14, S20, S15                                          ; +0xf0, 0x3d9224\nVMOV            R2, S14; float                                         ; +0xf4, 0x3d9228\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0xf8, 0x3d922c\nLDR             R3, [R5]                                               ; +0xfc, 0x3d9230\nMOV             R0, R11; this                                          ; +0xfe, 0x3d9232\nMOV             R1, R6; cocos2d::CCPoint *                             ; +0x100, 0x3d9234\nMOV             R2, R10                                                ; +0x102, 0x3d9236\nLDR             R3, [R3,#0x5C]                                         ; +0x104, 0x3d9238\nSTR             R3, [SP,#0x24+var_20]                                  ; +0x106, 0x3d923a\nBL              _ZN7cocos2d6CCNode18convertToNodeSpaceERKNS_7CCPointE; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const&) ; +0x108, 0x3d923c\nMOV             R0, R5                                                 ; +0x10c, 0x3d9240\nMOV             R1, R11                                                ; +0x10e, 0x3d9242\nLDR             R3, [SP,#0x24+var_20]                                  ; +0x110, 0x3d9244\nBLX             R3                                                     ; +0x112, 0x3d9246\nB               loc_3D91BC                                             ; +0x114, 0x3d9248\nLDR             R3, [SP,#0x24+var_24]                                  ; +0x116, 0x3d924a\nMOV             R0, R8                                                 ; +0x118, 0x3d924c\nLDR             R2, [SP,#0x24+var_8]                                   ; +0x11a, 0x3d924e\nLDR             R3, [R3]                                               ; +0x11c, 0x3d9250\nCMP             R2, R3                                                 ; +0x11e, 0x3d9252\nBEQ             loc_3D925A                                             ; +0x120, 0x3d9254\nBLX             __stack_chk_fail                                       ; +0x122, 0x3d9256\nADD             SP, SP, #0x24 ; '$'                                    ; +0x126, 0x3d925a\nVPOP            {D8-D11}                                               ; +0x128, 0x3d925c\nPOP.W           {R4-R11,PC}                                            ; +0x12c, 0x3d9260", "xrefs": ["ButtonPage::create @ 0x3d92da"], "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"}