{"type": "func", "start": 3943012, "end": 3943510, "name": "ButtonSprite::init", "pseudocode": "// \n// ButtonSprite::init from 0x3c2a64 to 0x3c2c56 (498 bytes)\n// \n// 1 xrefs:\n// > ButtonSprite::create @ 0x3c2ca0\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:46:32 +0000\n// \n\nint __fastcall ButtonSprite::init(\n        ButtonSprite *this,\n        cocos2d::CCSprite *a2,\n        int a3,\n        int a4,\n        float a5,\n        float a6,\n        bool a7,\n        cocos2d::CCSprite *a8,\n        bool a9,\n        float a10)\n{\n  int v14; // r7\n  int v15; // r3\n  const char *v16; // r1\n  int v17; // r0\n  int v18; // r8\n  void (__fastcall *v19)(int, _BYTE *); // r10\n  int v20; // r0\n  int v21; // r3\n  float *v22; // r0\n  float v23; // s17\n  float v24; // s17\n  int v25; // r5\n  void (__fastcall *v26)(int, _DWORD); // r8\n  int v27; // r0\n  int v28; // r5\n  void (__fastcall *v29)(int, _DWORD); // r8\n  float v30; // r0\n  float v31; // s15\n  int v33; // r5\n  void (__fastcall *v34)(int, _DWORD); // r8\n  float *v35; // r0\n  _BYTE v36[16]; // [sp+Ch] [bp-14h] BYREF\n\n  v14 = cocos2d::CCSprite::init(this);\n  if ( v14 )\n  {\n    *((_DWORD *)this + 135) = a2;\n    *((_DWORD *)this + 127) = 0;\n    *((float *)this + 130) = a6;\n    *((_BYTE *)this + 532) = a7;\n    *((float *)this + 128) = (float)a3;\n    *((float *)this + 131) = a10;\n    v15 = *(_DWORD *)this;\n    *((float *)this + 129) = (float)a4;\n    (*(void (__fastcall **)(ButtonSprite *, cocos2d::CCSprite *, int))(v15 + 232))(this, a2, 1);\n    if ( a9 )\n    {\n      v20 = cocos2d::CCSprite::create(a8, v16);\n      v21 = *(_DWORD *)this;\n      *((_DWORD *)this + 136) = v20;\n      (*(void (__fastcall **)(ButtonSprite *, int, _DWORD))(v21 + 232))(this, v20, 0);\n    }\n    else\n    {\n      cocos2d::CCRect::CCRect((cocos2d::CCRect *)v36, 0.0, 0.0, 40.0, 40.0);\n      v17 = cocos2d::extension::CCScale9Sprite::create(a8, v36);\n      *((_DWORD *)this + 137) = v17;\n      v18 = v17;\n      v19 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v17 + 160);\n      cocos2d::CCSize::CCSize((cocos2d::CCSize *)v36, 16.0, 16.0);\n      v19(v18, v36);\n      (*(void (__fastcall **)(ButtonSprite *, _DWORD, _DWORD))(*(_DWORD *)this + 232))(this, *((_DWORD *)this + 137), 0);\n    }\n    if ( *((float *)this + 128) > 0.0 )\n    {\n      v22 = (float *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 135) + 164))(*((_DWORD *)this + 135));\n      v23 = *((float *)this + 128);\n      if ( *v22 > v23 )\n      {\n        v33 = *((_DWORD *)this + 135);\n        v34 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v33 + 80);\n        v35 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)v33 + 164))(v33);\n        v34(v33, v23 / *v35);\n      }\n    }\n    if ( a5 > 0.0\n      && *(float *)((*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 135) + 164))(*((_DWORD *)this + 135)) + 4) > a5 )\n    {\n      v24 = a5\n          / *(float *)((*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 135) + 164))(*((_DWORD *)this + 135)) + 4);\n      if ( v24 < (*(float (__fastcall **)(_DWORD))(**((_DWORD **)this + 135) + 84))(*((_DWORD *)this + 135)) )\n      {\n        v25 = *((_DWORD *)this + 135);\n        v26 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v25 + 80);\n        v27 = (*(int (__fastcall **)(int))(*(_DWORD *)v25 + 164))(v25);\n        v26(v25, a5 / *(float *)(v27 + 4));\n      }\n    }\n    v28 = *((_DWORD *)this + 135);\n    v29 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v28 + 80);\n    v30 = (*(float (__fastcall **)(int))(*(_DWORD *)v28 + 84))(v28);\n    v31 = *((float *)this + 130);\n    if ( v30 <= v31 )\n    {\n      v28 = *((_DWORD *)this + 135);\n      v31 = COERCE_FLOAT((*(int (__fastcall **)(int))(*(_DWORD *)v28 + 84))(v28));\n    }\n    v29(v28, LODWORD(v31));\n    ButtonSprite::updateSpriteBGSize(this);\n  }\n  return v14;\n}", "assembly": "; \n; ButtonSprite::init from 0x3c2a64 to 0x3c2c56 (498 bytes)\n; \n; 1 xrefs:\n; > ButtonSprite::create @ 0x3c2ca0\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:46:32 +0000\n; \nPUSH.W          {R4-R10,LR}                                            ; +0x0, 0x3c2a64\nMOV             R4, R0                                                 ; +0x4, 0x3c2a68\nVPUSH           {D8-D9}                                                ; +0x6, 0x3c2a6a\nMOV             R10, R1                                                ; +0xa, 0x3c2a6e\nLDR             R6, =(__stack_chk_guard_ptr - 0x3C2A76)                ; +0xc, 0x3c2a70\nADD             R6, PC; __stack_chk_guard_ptr                          ; +0xe, 0x3c2a72\nLDR             R6, [R6]; __stack_chk_guard                            ; +0x10, 0x3c2a74\nVMOV            S17, R3                                                ; +0x12, 0x3c2a76\nSUB             SP, SP, #0x20                                          ; +0x16, 0x3c2a7a\nVMOV            S18, R2                                                ; +0x18, 0x3c2a7c\nLDR             R3, [R6]                                               ; +0x1c, 0x3c2a80\nVLDR            S16, [SP,#0x20+arg_0]                                  ; +0x1e, 0x3c2a82\nLDR.W           R8, [SP,#0x20+arg_C]                                   ; +0x22, 0x3c2a86\nLDRB.W          R9, [SP,#0x20+arg_10]                                  ; +0x26, 0x3c2a8a\nSTR             R3, [SP,#0x20+var_4]                                   ; +0x2a, 0x3c2a8e\nBL              _ZN7cocos2d8CCSprite4initEv; cocos2d::CCSprite::init(void) ; +0x2c, 0x3c2a90\nMOV             R7, R0                                                 ; +0x30, 0x3c2a94\nCMP             R0, #0                                                 ; +0x32, 0x3c2a96\nBEQ.W           loc_3C2C1A                                             ; +0x34, 0x3c2a98\nLDR             R3, [SP,#0x20+arg_4]                                   ; +0x38, 0x3c2a9c\nVCVT.F32.S32    S18, S18                                               ; +0x3a, 0x3c2a9e\nMOVS            R5, #0                                                 ; +0x3e, 0x3c2aa2\nSTR.W           R10, [R4,#0x21C]                                       ; +0x40, 0x3c2aa4\nSTR.W           R5, [R4,#0x1FC]                                        ; +0x44, 0x3c2aa8\nMOV             R0, R4                                                 ; +0x48, 0x3c2aac\nSTR.W           R3, [R4,#0x208]                                        ; +0x4a, 0x3c2aae\nMOV             R1, R10                                                ; +0x4e, 0x3c2ab2\nLDRB.W          R3, [SP,#0x20+arg_8]                                   ; +0x50, 0x3c2ab4\nMOVS            R2, #1                                                 ; +0x54, 0x3c2ab8\nVCVT.F32.S32    S17, S17                                               ; +0x56, 0x3c2aba\nSTRB.W          R3, [R4,#0x214]                                        ; +0x5a, 0x3c2abe\nLDR             R3, [SP,#0x20+arg_14]                                  ; +0x5e, 0x3c2ac2\nVSTR            S18, [R4,#0x200]                                       ; +0x60, 0x3c2ac4\nSTR.W           R3, [R4,#0x20C]                                        ; +0x64, 0x3c2ac8\nLDR             R3, [R4]                                               ; +0x68, 0x3c2acc\nVSTR            S17, [R4,#0x204]                                       ; +0x6a, 0x3c2ace\nLDR.W           R3, [R3,#0xE8]                                         ; +0x6e, 0x3c2ad2\nBLX             R3                                                     ; +0x72, 0x3c2ad6\nCMP.W           R9, #0                                                 ; +0x74, 0x3c2ad8\nBNE             loc_3C2B24                                             ; +0x78, 0x3c2adc\nLDR             R3, flt_3C2C58; float                                  ; +0x7a, 0x3c2ade\nADD             R5, SP, #0x20+var_14                                   ; +0x7c, 0x3c2ae0\nMOVS            R1, #0; float                                          ; +0x7e, 0x3c2ae2\nMOV             R2, R1; float                                          ; +0x80, 0x3c2ae4\nMOV             R0, R5; this                                           ; +0x82, 0x3c2ae6\nSTR             R3, [SP,#0x20+var_20]; float                           ; +0x84, 0x3c2ae8\nBL              _ZN7cocos2d6CCRectC1Effff; cocos2d::CCRect::CCRect(float,float,float,float) ; +0x86, 0x3c2aea\nMOV             R0, R8                                                 ; +0x8a, 0x3c2aee\nMOV             R1, R5                                                 ; +0x8c, 0x3c2af0\nBL              _ZN7cocos2d9extension14CCScale9Sprite6createEPKcNS_6CCRectE; cocos2d::extension::CCScale9Sprite::create(char const*,cocos2d::CCRect) ; +0x8e, 0x3c2af2\nMOV.W           R1, #0x41800000; float                                 ; +0x92, 0x3c2af6\nMOV             R2, R1; float                                          ; +0x96, 0x3c2afa\nSTR.W           R0, [R4,#0x224]                                        ; +0x98, 0x3c2afc\nMOV             R8, R0                                                 ; +0x9c, 0x3c2b00\nLDR             R3, [R0]                                               ; +0x9e, 0x3c2b02\nMOV             R0, R5; this                                           ; +0xa0, 0x3c2b04\nLDR.W           R10, [R3,#0xA0]                                        ; +0xa2, 0x3c2b06\nBL              _ZN7cocos2d6CCSizeC1Eff; cocos2d::CCSize::CCSize(float,float) ; +0xa6, 0x3c2b0a\nMOV             R0, R8                                                 ; +0xaa, 0x3c2b0e\nMOV             R1, R5                                                 ; +0xac, 0x3c2b10\nBLX             R10                                                    ; +0xae, 0x3c2b12\nLDR             R3, [R4]                                               ; +0xb0, 0x3c2b14\nMOV             R0, R4                                                 ; +0xb2, 0x3c2b16\nLDR.W           R1, [R4,#0x224]                                        ; +0xb4, 0x3c2b18\nMOV             R2, R9                                                 ; +0xb8, 0x3c2b1c\nLDR.W           R3, [R3,#0xE8]                                         ; +0xba, 0x3c2b1e\nB               loc_3C2B3A                                             ; +0xbe, 0x3c2b22\nMOV             R0, R8; this                                           ; +0xc0, 0x3c2b24\nBL              _ZN7cocos2d8CCSprite6createEPKc; cocos2d::CCSprite::create(char const*) ; +0xc2, 0x3c2b26\nLDR             R3, [R4]                                               ; +0xc6, 0x3c2b2a\nMOV             R2, R5                                                 ; +0xc8, 0x3c2b2c\nSTR.W           R0, [R4,#0x220]                                        ; +0xca, 0x3c2b2e\nMOV             R1, R0                                                 ; +0xce, 0x3c2b32\nLDR.W           R3, [R3,#0xE8]                                         ; +0xd0, 0x3c2b34\nMOV             R0, R4                                                 ; +0xd4, 0x3c2b38\nBLX             R3                                                     ; +0xd6, 0x3c2b3a\nVLDR            S15, [R4,#0x200]                                       ; +0xd8, 0x3c2b3c\nVCMPE.F32       S15, #0.0                                              ; +0xdc, 0x3c2b40\nVMRS            APSR_nzcv, FPSCR                                       ; +0xe0, 0x3c2b44\nBLE             loc_3C2B68                                             ; +0xe4, 0x3c2b48\nLDR.W           R0, [R4,#0x21C]                                        ; +0xe6, 0x3c2b4a\nLDR             R3, [R0]                                               ; +0xea, 0x3c2b4e\nLDR.W           R3, [R3,#0xA4]                                         ; +0xec, 0x3c2b50\nBLX             R3                                                     ; +0xf0, 0x3c2b54\nVLDR            S17, [R4,#0x200]                                       ; +0xf2, 0x3c2b56\nVLDR            S15, [R0]                                              ; +0xf6, 0x3c2b5a\nVCMPE.F32       S15, S17                                               ; +0xfa, 0x3c2b5e\nVMRS            APSR_nzcv, FPSCR                                       ; +0xfe, 0x3c2b62\nBGT             loc_3C2C28                                             ; +0x102, 0x3c2b66\nVCMPE.F32       S16, #0.0                                              ; +0x104, 0x3c2b68\nVMRS            APSR_nzcv, FPSCR                                       ; +0x108, 0x3c2b6c\nBLE             loc_3C2BDA                                             ; +0x10c, 0x3c2b70\nLDR.W           R0, [R4,#0x21C]                                        ; +0x10e, 0x3c2b72\nLDR             R3, [R0]                                               ; +0x112, 0x3c2b76\nLDR.W           R3, [R3,#0xA4]                                         ; +0x114, 0x3c2b78\nBLX             R3                                                     ; +0x118, 0x3c2b7c\nVLDR            S15, [R0,#4]                                           ; +0x11a, 0x3c2b7e\nVCMPE.F32       S15, S16                                               ; +0x11e, 0x3c2b82\nVMRS            APSR_nzcv, FPSCR                                       ; +0x122, 0x3c2b86\nBLE             loc_3C2BDA                                             ; +0x126, 0x3c2b8a\nLDR.W           R0, [R4,#0x21C]                                        ; +0x128, 0x3c2b8c\nLDR             R3, [R0]                                               ; +0x12c, 0x3c2b90\nLDR.W           R3, [R3,#0xA4]                                         ; +0x12e, 0x3c2b92\nBLX             R3                                                     ; +0x132, 0x3c2b96\nVLDR            S17, [R0,#4]                                           ; +0x134, 0x3c2b98\nLDR.W           R0, [R4,#0x21C]                                        ; +0x138, 0x3c2b9c\nLDR             R3, [R0]                                               ; +0x13c, 0x3c2ba0\nVDIV.F32        S17, S16, S17                                          ; +0x13e, 0x3c2ba2\nLDR             R3, [R3,#0x54]                                         ; +0x142, 0x3c2ba6\nBLX             R3                                                     ; +0x144, 0x3c2ba8\nVMOV            S15, R0                                                ; +0x146, 0x3c2baa\nVCMPE.F32       S17, S15                                               ; +0x14a, 0x3c2bae\nVMRS            APSR_nzcv, FPSCR                                       ; +0x14e, 0x3c2bb2\nBPL             loc_3C2BDA                                             ; +0x152, 0x3c2bb6\nLDR.W           R5, [R4,#0x21C]                                        ; +0x154, 0x3c2bb8\nLDR             R3, [R5]                                               ; +0x158, 0x3c2bbc\nMOV             R0, R5                                                 ; +0x15a, 0x3c2bbe\nLDR.W           R8, [R3,#0x50]                                         ; +0x15c, 0x3c2bc0\nLDR.W           R3, [R3,#0xA4]                                         ; +0x160, 0x3c2bc4\nBLX             R3                                                     ; +0x164, 0x3c2bc8\nVLDR            S15, [R0,#4]                                           ; +0x166, 0x3c2bca\nMOV             R0, R5                                                 ; +0x16a, 0x3c2bce\nVDIV.F32        S15, S16, S15                                          ; +0x16c, 0x3c2bd0\nVMOV            R1, S15                                                ; +0x170, 0x3c2bd4\nBLX             R8                                                     ; +0x174, 0x3c2bd8\nLDR.W           R5, [R4,#0x21C]                                        ; +0x176, 0x3c2bda\nLDR             R3, [R5]                                               ; +0x17a, 0x3c2bde\nMOV             R0, R5                                                 ; +0x17c, 0x3c2be0\nLDR.W           R8, [R3,#0x50]                                         ; +0x17e, 0x3c2be2\nLDR             R3, [R3,#0x54]                                         ; +0x182, 0x3c2be6\nBLX             R3                                                     ; +0x184, 0x3c2be8\nVLDR            S15, [R4,#0x208]                                       ; +0x186, 0x3c2bea\nVMOV            S14, R0                                                ; +0x18a, 0x3c2bee\nVCMPE.F32       S14, S15                                               ; +0x18e, 0x3c2bf2\nVMRS            APSR_nzcv, FPSCR                                       ; +0x192, 0x3c2bf6\nBGT             loc_3C2C0C                                             ; +0x196, 0x3c2bfa\nLDR.W           R5, [R4,#0x21C]                                        ; +0x198, 0x3c2bfc\nLDR             R3, [R5]                                               ; +0x19c, 0x3c2c00\nMOV             R0, R5                                                 ; +0x19e, 0x3c2c02\nLDR             R3, [R3,#0x54]                                         ; +0x1a0, 0x3c2c04\nBLX             R3                                                     ; +0x1a2, 0x3c2c06\nVMOV            S15, R0                                                ; +0x1a4, 0x3c2c08\nMOV             R0, R5                                                 ; +0x1a8, 0x3c2c0c\nVMOV            R1, S15                                                ; +0x1aa, 0x3c2c0e\nBLX             R8                                                     ; +0x1ae, 0x3c2c12\nMOV             R0, R4; this                                           ; +0x1b0, 0x3c2c14\nBL              _ZN12ButtonSprite18updateSpriteBGSizeEv; ButtonSprite::updateSpriteBGSize(void) ; +0x1b2, 0x3c2c16\nLDR             R2, [SP,#0x20+var_4]                                   ; +0x1b6, 0x3c2c1a\nMOV             R0, R7                                                 ; +0x1b8, 0x3c2c1c\nLDR             R3, [R6]                                               ; +0x1ba, 0x3c2c1e\nCMP             R2, R3                                                 ; +0x1bc, 0x3c2c20\nBEQ             loc_3C2C4C                                             ; +0x1be, 0x3c2c22\nBLX             __stack_chk_fail                                       ; +0x1c0, 0x3c2c24\nLDR.W           R5, [R4,#0x21C]                                        ; +0x1c4, 0x3c2c28\nLDR             R3, [R5]                                               ; +0x1c8, 0x3c2c2c\nMOV             R0, R5                                                 ; +0x1ca, 0x3c2c2e\nLDR.W           R8, [R3,#0x50]                                         ; +0x1cc, 0x3c2c30\nLDR.W           R3, [R3,#0xA4]                                         ; +0x1d0, 0x3c2c34\nBLX             R3                                                     ; +0x1d4, 0x3c2c38\nVLDR            S15, [R0]                                              ; +0x1d6, 0x3c2c3a\nMOV             R0, R5                                                 ; +0x1da, 0x3c2c3e\nVDIV.F32        S15, S17, S15                                          ; +0x1dc, 0x3c2c40\nVMOV            R1, S15                                                ; +0x1e0, 0x3c2c44\nBLX             R8                                                     ; +0x1e4, 0x3c2c48\nB               loc_3C2B68                                             ; +0x1e6, 0x3c2c4a\nADD             SP, SP, #0x20 ; ' '                                    ; +0x1e8, 0x3c2c4c\nVPOP            {D8-D9}                                                ; +0x1ea, 0x3c2c4e\nPOP.W           {R4-R10,PC}                                            ; +0x1ee, 0x3c2c52", "xrefs": ["ButtonSprite::create @ 0x3c2ca0"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}