{"type": "func", "start": 4295355528, "end": 4295356124, "name": "ButtonSprite::init", "pseudocode": "// \n// ButtonSprite::init from 0x10005ec88 to 0x10005eedc (596 bytes)\n// \n// 1 xrefs:\n// > ButtonSprite::create @ 0x10005ec2c\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 __fastcall ButtonSprite::init(\n        ButtonSprite *a1,\n        cocos2d::CCSprite *a2,\n        int a3,\n        int a4,\n        float a5,\n        float a6,\n        bool a7,\n        const char *a8,\n        bool a9)\n{\n  _BOOL4 v18; // w20\n  cocos2d::CCSprite *m_BGSprite; // x1\n  cocos2d::extension::CCScale9Sprite *v20; // x21\n  __n128 v21; // q0\n  float m_width; // s9\n  cocos2d::CCSprite *m_subSprite; // x21\n  float *v24; // x0\n  float v25; // s9\n  cocos2d::CCSprite *v26; // x21\n  __int64 v27; // x0\n  cocos2d::CCSprite *v28; // x21\n  float v30[4]; // [xsp+0h] [xbp-60h] BYREF\n  cocos2d::CCRect v31; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4\n\n  v18 = cocos2d::CCSprite::init(a1);\n  if ( v18 )\n  {\n    a1->m_mode = 0;\n    a1->m_width = (float)a3;\n    a1->m_minWidth = (float)a4;\n    a1->m_scale = a6;\n    a1->m_absolute = a7;\n    a1->m_subSprite = a2;\n    ((void (__fastcall *)(ButtonSprite *, cocos2d::CCSprite *, __int64))a1->addChild_0)(a1, a2, 1);\n    if ( a9 )\n    {\n      m_BGSprite = cocos2d::CCSprite::create(a8);\n      a1->m_subBGSprite = m_BGSprite;\n    }\n    else\n    {\n      sub_100022990(v30, 0.0, 0.0, 40.0, 40.0);\n      v20 = cocos2d::extension::CCScale9Sprite::create(a8, v31);\n      a1->m_BGSprite = v20;\n      sub_100022988(v30, 16.0, 16.0);\n      ((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, float *))v20->setContentSize)(v20, v30);\n      m_BGSprite = (cocos2d::CCSprite *)a1->m_BGSprite;\n    }\n    ((void (__fastcall *)(ButtonSprite *, cocos2d::CCSprite *, _QWORD))a1->addChild_0)(a1, m_BGSprite, 0);\n    v21.n128_u32[0] = LODWORD(a1->m_width);\n    if ( v21.n128_f32[0] > 0.0 )\n    {\n      v21.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_subSprite->getContentSize)(a1->m_subSprite);\n      m_width = a1->m_width;\n      if ( v21.n128_f32[0] > m_width )\n      {\n        m_subSprite = a1->m_subSprite;\n        v24 = (float *)((__int64 (__fastcall *)(cocos2d::CCSprite *, float))m_subSprite->getContentSize)(\n                         m_subSprite,\n                         v21.n128_f32[0]);\n        ((void (__fastcall *)(cocos2d::CCSprite *, float))m_subSprite->setScale)(m_subSprite, m_width / *v24);\n      }\n    }\n    if ( a5 > 0.0\n      && *(float *)(((__int64 (__fastcall *)(cocos2d::CCSprite *, __n128))a1->m_subSprite->getContentSize)(\n                      a1->m_subSprite,\n                      v21)\n                  + 4) > a5 )\n    {\n      v25 = a5\n          / *(float *)(((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_subSprite->getContentSize)(a1->m_subSprite)\n                     + 4);\n      if ( v25 < ((float (__fastcall *)(cocos2d::CCSprite *))a1->m_subSprite->getScale)(a1->m_subSprite) )\n      {\n        v26 = a1->m_subSprite;\n        v27 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v26->getContentSize)(v26);\n        ((void (__fastcall *)(cocos2d::CCSprite *, float))v26->setScale)(v26, a5 / *(float *)(v27 + 4));\n      }\n    }\n    v28 = a1->m_subSprite;\n    if ( ((float (__fastcall *)(cocos2d::CCSprite *))v28->getScale)(v28) <= a1->m_scale )\n      ((void (__fastcall *)(cocos2d::CCSprite *))a1->m_subSprite->getScale)(a1->m_subSprite);\n    ((void (__fastcall *)(cocos2d::CCSprite *))v28->setScale)(v28);\n    ButtonSprite::updateSpriteBGSize(a1);\n  }\n  return v18;\n}", "assembly": "; \n; ButtonSprite::init from 0x10005ec88 to 0x10005eedc (596 bytes)\n; \n; 1 xrefs:\n; > ButtonSprite::create @ 0x10005ec2c\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, 0x10005ec88\nSTP             D9, D8, [SP,#0x60+var_50]                              ; +0x4, 0x10005ec8c\nSTP             X26, X25, [SP,#0x60+var_40]                            ; +0x8, 0x10005ec90\nSTP             X24, X23, [SP,#0x60+var_30]                            ; +0xc, 0x10005ec94\nSTP             X22, X21, [SP,#0x60+var_20]                            ; +0x10, 0x10005ec98\nSTP             X20, X19, [SP,#0x60+var_10]                            ; +0x14, 0x10005ec9c\nSTP             X29, X30, [SP,#0x60+var_s0]                            ; +0x18, 0x10005eca0\nADD             X29, SP, #0x60                                         ; +0x1c, 0x10005eca4\nMOV             X22, X6                                                ; +0x20, 0x10005eca8\nMOV             X21, X5                                                ; +0x24, 0x10005ecac\nMOV             X24, X4                                                ; +0x28, 0x10005ecb0\nFMOV            S9, S1                                                 ; +0x2c, 0x10005ecb4\nFMOV            S8, S0                                                 ; +0x30, 0x10005ecb8\nMOV             X25, X3                                                ; +0x34, 0x10005ecbc\nMOV             X26, X2                                                ; +0x38, 0x10005ecc0\nMOV             X23, X1                                                ; +0x3c, 0x10005ecc4\nMOV             X19, X0                                                ; +0x40, 0x10005ecc8\nBL              cocos2d__CCSprite__init                                ; +0x44, 0x10005eccc\nMOV             X20, X0                                                ; +0x48, 0x10005ecd0\nCBZ             W0, loc_10005EEB8                                      ; +0x4c, 0x10005ecd4\nSTR             WZR, [X19,#0x254]                                      ; +0x50, 0x10005ecd8\nSCVTF           S0, W26                                                ; +0x54, 0x10005ecdc\nSTR             S0, [X19,#0x258]                                       ; +0x58, 0x10005ece0\nSCVTF           S0, W25                                                ; +0x5c, 0x10005ece4\nSTR             S0, [X19,#0x25C]                                       ; +0x60, 0x10005ece8\nSTR             S9, [X19,#0x260]                                       ; +0x64, 0x10005ecec\nSTRB            W24, [X19,#0x268]                                      ; +0x68, 0x10005ecf0\nSTR             X23, [X19,#0x278]                                      ; +0x6c, 0x10005ecf4\nLDR             X8, [X19]                                              ; +0x70, 0x10005ecf8\nLDR             X8, [X8,#0x1C0]                                        ; +0x74, 0x10005ecfc\nMOV             X0, X19                                                ; +0x78, 0x10005ed00\nMOV             X1, X23                                                ; +0x7c, 0x10005ed04\nMOV             W2, #1                                                 ; +0x80, 0x10005ed08\nBLR             X8                                                     ; +0x84, 0x10005ed0c\nTBZ             W22, #0, loc_10005ED28                                 ; +0x88, 0x10005ed10\nMOV             X0, X21                                                ; +0x8c, 0x10005ed14\nBL              cocos2d__CCSprite__create                              ; +0x90, 0x10005ed18\nMOV             X1, X0                                                 ; +0x94, 0x10005ed1c\nSTR             X0, [X19,#0x280]                                       ; +0x98, 0x10005ed20\nB               loc_10005ED80                                          ; +0x9c, 0x10005ed24\nMOV             W8, #0x42200000                                        ; +0xa0, 0x10005ed28\nFMOV            S2, W8                                                 ; +0xa4, 0x10005ed2c\nMOV             X0, SP                                                 ; +0xa8, 0x10005ed30\nFMOV            S0, WZR                                                ; +0xac, 0x10005ed34\nFMOV            S1, WZR                                                ; +0xb0, 0x10005ed38\nFMOV            S3, S2                                                 ; +0xb4, 0x10005ed3c\nBL              sub_100022990                                          ; +0xb8, 0x10005ed40\nMOV             X1, SP                                                 ; +0xbc, 0x10005ed44\nMOV             X0, X21                                                ; +0xc0, 0x10005ed48\nBL              cocos2d__extension__CCScale9Sprite__create             ; +0xc4, 0x10005ed4c\nMOV             X21, X0                                                ; +0xc8, 0x10005ed50\nSTR             X0, [X19,#0x288]                                       ; +0xcc, 0x10005ed54\nMOV             X0, SP                                                 ; +0xd0, 0x10005ed58\nFMOV            S0, #16.0                                              ; +0xd4, 0x10005ed5c\nFMOV            S1, #16.0                                              ; +0xd8, 0x10005ed60\nBL              sub_100022988                                          ; +0xdc, 0x10005ed64\nLDR             X8, [X21]                                              ; +0xe0, 0x10005ed68\nLDR             X8, [X8,#0x130]                                        ; +0xe4, 0x10005ed6c\nMOV             X1, SP                                                 ; +0xe8, 0x10005ed70\nMOV             X0, X21                                                ; +0xec, 0x10005ed74\nBLR             X8                                                     ; +0xf0, 0x10005ed78\nLDR             X1, [X19,#0x288]                                       ; +0xf4, 0x10005ed7c\nLDR             X8, [X19]                                              ; +0xf8, 0x10005ed80\nLDR             X8, [X8,#0x1C0]                                        ; +0xfc, 0x10005ed84\nMOV             X0, X19                                                ; +0x100, 0x10005ed88\nMOV             W2, #0                                                 ; +0x104, 0x10005ed8c\nBLR             X8                                                     ; +0x108, 0x10005ed90\nLDR             S0, [X19,#0x258]                                       ; +0x10c, 0x10005ed94\nFCMP            S0, #0.0                                               ; +0x110, 0x10005ed98\nB.LE            loc_10005EDEC                                          ; +0x114, 0x10005ed9c\nLDR             X0, [X19,#0x278]                                       ; +0x118, 0x10005eda0\nLDR             X8, [X0]                                               ; +0x11c, 0x10005eda4\nLDR             X8, [X8,#0x138]                                        ; +0x120, 0x10005eda8\nBLR             X8                                                     ; +0x124, 0x10005edac\nLDR             S0, [X0]                                               ; +0x128, 0x10005edb0\nLDR             S9, [X19,#0x258]                                       ; +0x12c, 0x10005edb4\nFCMP            S0, S9                                                 ; +0x130, 0x10005edb8\nB.LE            loc_10005EDEC                                          ; +0x134, 0x10005edbc\nLDR             X21, [X19,#0x278]                                      ; +0x138, 0x10005edc0\nLDR             X8, [X21]                                              ; +0x13c, 0x10005edc4\nLDR             X8, [X8,#0x138]                                        ; +0x140, 0x10005edc8\nMOV             X0, X21                                                ; +0x144, 0x10005edcc\nBLR             X8                                                     ; +0x148, 0x10005edd0\nLDR             S0, [X0]                                               ; +0x14c, 0x10005edd4\nLDR             X8, [X21]                                              ; +0x150, 0x10005edd8\nLDR             X8, [X8,#0xA0]                                         ; +0x154, 0x10005eddc\nFDIV            S0, S9, S0                                             ; +0x158, 0x10005ede0\nMOV             X0, X21                                                ; +0x15c, 0x10005ede4\nBLR             X8                                                     ; +0x160, 0x10005ede8\nFCMP            S8, #0.0                                               ; +0x164, 0x10005edec\nB.LE            loc_10005EE6C                                          ; +0x168, 0x10005edf0\nLDR             X0, [X19,#0x278]                                       ; +0x16c, 0x10005edf4\nLDR             X8, [X0]                                               ; +0x170, 0x10005edf8\nLDR             X8, [X8,#0x138]                                        ; +0x174, 0x10005edfc\nBLR             X8                                                     ; +0x178, 0x10005ee00\nLDR             S0, [X0,#4]                                            ; +0x17c, 0x10005ee04\nFCMP            S0, S8                                                 ; +0x180, 0x10005ee08\nB.LE            loc_10005EE6C                                          ; +0x184, 0x10005ee0c\nLDR             X0, [X19,#0x278]                                       ; +0x188, 0x10005ee10\nLDR             X8, [X0]                                               ; +0x18c, 0x10005ee14\nLDR             X8, [X8,#0x138]                                        ; +0x190, 0x10005ee18\nBLR             X8                                                     ; +0x194, 0x10005ee1c\nLDR             S0, [X0,#4]                                            ; +0x198, 0x10005ee20\nFDIV            S9, S8, S0                                             ; +0x19c, 0x10005ee24\nLDR             X0, [X19,#0x278]                                       ; +0x1a0, 0x10005ee28\nLDR             X8, [X0]                                               ; +0x1a4, 0x10005ee2c\nLDR             X8, [X8,#0xA8]                                         ; +0x1a8, 0x10005ee30\nBLR             X8                                                     ; +0x1ac, 0x10005ee34\nFCMP            S9, S0                                                 ; +0x1b0, 0x10005ee38\nB.PL            loc_10005EE6C                                          ; +0x1b4, 0x10005ee3c\nLDR             X21, [X19,#0x278]                                      ; +0x1b8, 0x10005ee40\nLDR             X8, [X21]                                              ; +0x1bc, 0x10005ee44\nLDR             X8, [X8,#0x138]                                        ; +0x1c0, 0x10005ee48\nMOV             X0, X21                                                ; +0x1c4, 0x10005ee4c\nBLR             X8                                                     ; +0x1c8, 0x10005ee50\nLDR             S0, [X0,#4]                                            ; +0x1cc, 0x10005ee54\nLDR             X8, [X21]                                              ; +0x1d0, 0x10005ee58\nLDR             X8, [X8,#0xA0]                                         ; +0x1d4, 0x10005ee5c\nFDIV            S0, S8, S0                                             ; +0x1d8, 0x10005ee60\nMOV             X0, X21                                                ; +0x1dc, 0x10005ee64\nBLR             X8                                                     ; +0x1e0, 0x10005ee68\nLDR             X21, [X19,#0x278]                                      ; +0x1e4, 0x10005ee6c\nLDR             X8, [X21]                                              ; +0x1e8, 0x10005ee70\nLDR             X8, [X8,#0xA8]                                         ; +0x1ec, 0x10005ee74\nMOV             X0, X21                                                ; +0x1f0, 0x10005ee78\nBLR             X8                                                     ; +0x1f4, 0x10005ee7c\nFMOV            S1, S0                                                 ; +0x1f8, 0x10005ee80\nLDR             S0, [X19,#0x260]                                       ; +0x1fc, 0x10005ee84\nFCMP            S1, S0                                                 ; +0x200, 0x10005ee88\nB.GT            loc_10005EEA0                                          ; +0x204, 0x10005ee8c\nLDR             X0, [X19,#0x278]                                       ; +0x208, 0x10005ee90\nLDR             X8, [X0]                                               ; +0x20c, 0x10005ee94\nLDR             X8, [X8,#0xA8]                                         ; +0x210, 0x10005ee98\nBLR             X8                                                     ; +0x214, 0x10005ee9c\nLDR             X8, [X21]                                              ; +0x218, 0x10005eea0\nLDR             X8, [X8,#0xA0]                                         ; +0x21c, 0x10005eea4\nMOV             X0, X21                                                ; +0x220, 0x10005eea8\nBLR             X8                                                     ; +0x224, 0x10005eeac\nMOV             X0, X19                                                ; +0x228, 0x10005eeb0\nBL              ButtonSprite__updateSpriteBGSize                       ; +0x22c, 0x10005eeb4\nMOV             X0, X20                                                ; +0x230, 0x10005eeb8\nLDP             X29, X30, [SP,#0x60+var_s0]                            ; +0x234, 0x10005eebc\nLDP             X20, X19, [SP,#0x60+var_10]                            ; +0x238, 0x10005eec0\nLDP             X22, X21, [SP,#0x60+var_20]                            ; +0x23c, 0x10005eec4\nLDP             X24, X23, [SP,#0x60+var_30]                            ; +0x240, 0x10005eec8\nLDP             X26, X25, [SP,#0x60+var_40]                            ; +0x244, 0x10005eecc\nLDP             D9, D8, [SP,#0x60+var_50]                              ; +0x248, 0x10005eed0\nADD             SP, SP, #0x70 ; 'p'                                    ; +0x24c, 0x10005eed4\nRET                                                                    ; +0x250, 0x10005eed8", "xrefs": ["ButtonSprite::create @ 0x10005ec2c"], "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"}