{"type": "func", "start": 3944860, "end": 3945322, "name": "ButtonSprite::init", "pseudocode": "// \n// ButtonSprite::init from 0x3c319c to 0x3c336a (462 bytes)\n// \n// 1 xrefs:\n// > ButtonSprite::create @ 0x3c33ba\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        char *a2,\n        int a3,\n        int a4,\n        float a5,\n        bool a6,\n        const char *a7,\n        const char *a8,\n        float a9)\n{\n  int v13; // r8\n  size_t v14; // r0\n  int v15; // r2\n  size_t v16; // r3\n  unsigned int v17; // r7\n  char *v18; // r0\n  char *v19; // r1\n  size_t v20; // r2\n  int v21; // r0\n  int v22; // r2\n  const char *v23; // r2\n  int v24; // r0\n  int v25; // r3\n  int v26; // r0\n  int v27; // r6\n  void (__fastcall *v28)(int, _BYTE *); // r7\n  size_t v30; // [sp+14h] [bp-40h]\n  const char *v31; // [sp+14h] [bp-40h]\n  _BYTE v32[4]; // [sp+1Ch] [bp-38h] BYREF\n  float v33; // [sp+20h] [bp-34h]\n  int v34; // [sp+24h] [bp-30h] BYREF\n  size_t v35; // [sp+28h] [bp-2Ch]\n  char *v36; // [sp+2Ch] [bp-28h]\n  int v37; // [sp+30h] [bp-24h] BYREF\n  unsigned int v38; // [sp+34h] [bp-20h]\n  char *v39; // [sp+38h] [bp-1Ch]\n  _BYTE v40[16]; // [sp+3Ch] [bp-18h] BYREF\n\n  v13 = cocos2d::CCSprite::init(this);\n  if ( !v13 )\n    return v13;\n  *((_DWORD *)this + 127) = 1;\n  *((float *)this + 130) = a5;\n  *((_BYTE *)this + 532) = a6;\n  *((float *)this + 128) = (float)a3;\n  *((float *)this + 131) = a9;\n  *((float *)this + 129) = (float)a4;\n  cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v40, 0.0, 2.0);\n  cocos2d::CCPoint::operator=((char *)this + 552, v40);\n  v34 = 0;\n  v35 = 0;\n  v36 = nullptr;\n  v14 = strlen(a7);\n  std::string::__init(&v34, a7, v14);\n  v37 = 0;\n  v38 = 0;\n  v39 = nullptr;\n  std::string::__init(&v37, \"bigFont.fnt\", 0xBu);\n  v15 = v34 & 1;\n  if ( v15 )\n    v16 = v35;\n  else\n    v16 = (int)(unsigned __int8)v34 >> 1;\n  if ( (v37 & 1) == 0 )\n  {\n    v17 = (int)(unsigned __int8)v37 >> 1;\n    if ( !v15 )\n    {\n      v18 = (char *)&v34 + 1;\n      goto LABEL_12;\n    }\nLABEL_9:\n    v18 = v36;\n    if ( (v37 & 1) != 0 )\n      goto LABEL_10;\nLABEL_12:\n    v19 = (char *)&v37 + 1;\n    goto LABEL_13;\n  }\n  v17 = v38;\n  if ( v15 )\n    goto LABEL_9;\n  v18 = (char *)&v34 + 1;\nLABEL_10:\n  v19 = v39;\nLABEL_13:\n  v20 = v17;\n  if ( v17 >= v16 )\n    v20 = v16;\n  if ( !v20 || (v30 = v16, v21 = memcmp(v18, v19, v20), v16 = v30, (v22 = v21) == 0) )\n  {\n    if ( v16 < v17 )\n      v22 = -1;\n    else\n      v22 = v16 > v17;\n  }\n  v31 = (const char *)v22;\n  std::string::~string((int)&v37);\n  std::string::~string((int)&v34);\n  v23 = v31;\n  if ( !v31 )\n  {\n    cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v32, 0.0, 2.0);\n    cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v40, -1.0, v33);\n    cocos2d::CCPoint::operator=((char *)this + 552, v40);\n  }\n  v24 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)&unk_B6B226, a7, v23);\n  v25 = *(_DWORD *)this;\n  *((_DWORD *)this + 134) = v24;\n  (*(void (__fastcall **)(ButtonSprite *, int, int))(v25 + 232))(this, v24, 1);\n  cocos2d::CCRect::CCRect((cocos2d::CCRect *)v40, 0.0, 0.0, 40.0, 40.0);\n  v26 = cocos2d::extension::CCScale9Sprite::create(a8, v40);\n  *((_DWORD *)this + 137) = v26;\n  v27 = v26;\n  v28 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v26 + 160);\n  cocos2d::CCSize::CCSize((cocos2d::CCSize *)v40, 16.0, 16.0);\n  v28(v27, v40);\n  (*(void (__fastcall **)(ButtonSprite *, _DWORD, _DWORD))(*(_DWORD *)this + 232))(this, *((_DWORD *)this + 137), 0);\n  ButtonSprite::setString((int)this, a2);\n  return v13;\n}", "assembly": "; \n; ButtonSprite::init from 0x3c319c to 0x3c336a (462 bytes)\n; \n; 1 xrefs:\n; > ButtonSprite::create @ 0x3c33ba\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-R11,LR}                                            ; +0x0, 0x3c319c\nMOV             R4, R0                                                 ; +0x4, 0x3c31a0\nVPUSH           {D8}                                                   ; +0x6, 0x3c31a2\nMOV             R11, R1                                                ; +0xa, 0x3c31a6\nLDR             R5, =(__stack_chk_guard_ptr - 0x3C31B2)                ; +0xc, 0x3c31a8\nVMOV            S16, R3                                                ; +0xe, 0x3c31aa\nADD             R5, PC; __stack_chk_guard_ptr                          ; +0x12, 0x3c31ae\nLDR             R5, [R5]; __stack_chk_guard                            ; +0x14, 0x3c31b0\nSUB             SP, SP, #0x54                                          ; +0x16, 0x3c31b2\nVMOV            S17, R2                                                ; +0x18, 0x3c31b4\nLDR             R3, [SP,#0x54+arg_C]                                   ; +0x1c, 0x3c31b8\nLDR             R6, [SP,#0x54+arg_8]                                   ; +0x1e, 0x3c31ba\nSTR             R3, [SP,#0x54+var_48]                                  ; +0x20, 0x3c31bc\nLDR             R3, [R5]                                               ; +0x22, 0x3c31be\nSTR             R3, [SP,#0x54+var_8]                                   ; +0x24, 0x3c31c0\nBL              _ZN7cocos2d8CCSprite4initEv; cocos2d::CCSprite::init(void) ; +0x26, 0x3c31c2\nSTR             R5, [SP,#0x54+var_44]                                  ; +0x2a, 0x3c31c6\nMOV             R8, R0                                                 ; +0x2c, 0x3c31c8\nCMP             R0, #0                                                 ; +0x2e, 0x3c31ca\nBEQ.W           loc_3C3346                                             ; +0x30, 0x3c31cc\nMOVS            R3, #1                                                 ; +0x34, 0x3c31d0\nSTR.W           R3, [R4,#0x1FC]                                        ; +0x36, 0x3c31d2\nLDR             R3, [SP,#0x54+arg_0]                                   ; +0x3a, 0x3c31d6\nVCVT.F32.S32    S17, S17                                               ; +0x3c, 0x3c31d8\nADD             R5, SP, #0x54+var_18                                   ; +0x40, 0x3c31dc\nADD.W           R9, R4, #0x228                                         ; +0x42, 0x3c31de\nMOV.W           R2, #0x40000000; float                                 ; +0x46, 0x3c31e2\nMOVS            R1, #0; float                                          ; +0x4a, 0x3c31e6\nSTR.W           R3, [R4,#0x208]                                        ; +0x4c, 0x3c31e8\nMOV             R0, R5; this                                           ; +0x50, 0x3c31ec\nLDRB.W          R3, [SP,#0x54+arg_4]                                   ; +0x52, 0x3c31ee\nMOV.W           R10, #0                                                ; +0x56, 0x3c31f2\nADD             R7, SP, #0x54+var_30                                   ; +0x5a, 0x3c31f6\nVCVT.F32.S32    S16, S16                                               ; +0x5c, 0x3c31f8\nSTRB.W          R3, [R4,#0x214]                                        ; +0x60, 0x3c31fc\nLDR             R3, [SP,#0x54+arg_10]                                  ; +0x64, 0x3c3200\nVSTR            S17, [R4,#0x200]                                       ; +0x66, 0x3c3202\nSTR.W           R3, [R4,#0x20C]                                        ; +0x6a, 0x3c3206\nVSTR            S16, [R4,#0x204]                                       ; +0x6e, 0x3c320a\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x72, 0x3c320e\nMOV             R1, R5                                                 ; +0x76, 0x3c3212\nMOV             R0, R9                                                 ; +0x78, 0x3c3214\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0x7a, 0x3c3216\nMOV             R0, R6; char *                                         ; +0x7e, 0x3c321a\nSTR.W           R10, [SP,#0x54+var_30]                                 ; +0x80, 0x3c321c\nSTR.W           R10, [SP,#0x54+var_2C]                                 ; +0x84, 0x3c3220\nSTR.W           R10, [SP,#0x54+var_28]                                 ; +0x88, 0x3c3224\nBLX             strlen                                                 ; +0x8c, 0x3c3228\nMOV             R1, R6                                                 ; +0x90, 0x3c322c\nMOV             R2, R0                                                 ; +0x92, 0x3c322e\nMOV             R0, R7                                                 ; +0x94, 0x3c3230\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x96, 0x3c3232\nSTR.W           R10, [SP,#0x54+var_24]                                 ; +0x9a, 0x3c3236\nSTR.W           R10, [SP,#0x54+var_20]                                 ; +0x9e, 0x3c323a\nMOVS            R2, #0xB                                               ; +0xa2, 0x3c323e\nSTR.W           R10, [SP,#0x54+var_1C]                                 ; +0xa4, 0x3c3240\nADD.W           R10, SP, #0x54+var_24                                  ; +0xa8, 0x3c3244\nLDR             R1, =(aBigfontFnt - 0x3C3250); \"bigFont.fnt\"           ; +0xac, 0x3c3248\nMOV             R0, R10                                                ; +0xae, 0x3c324a\nADD             R1, PC; \"bigFont.fnt\"                                  ; +0xb0, 0x3c324c\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0xb2, 0x3c324e\nLDRB.W          R3, [SP,#0x54+var_30]                                  ; +0xb6, 0x3c3252\nLDRB.W          R7, [SP,#0x54+var_24]                                  ; +0xba, 0x3c3256\nANDS.W          R2, R3, #1                                             ; +0xbe, 0x3c325a\nITE EQ                                                                 ; +0xc2, 0x3c325e\nASREQ           R3, R3, #1                                             ; +0xc4, 0x3c3260\nLDRNE           R3, [SP,#0x54+var_2C]                                  ; +0xc6, 0x3c3262\nANDS.W          R1, R7, #1                                             ; +0xc8, 0x3c3264\nBEQ             loc_3C3274                                             ; +0xcc, 0x3c3268\nLDR             R7, [SP,#0x54+var_20]                                  ; +0xce, 0x3c326a\nCBNZ            R2, loc_3C3278                                         ; +0xd0, 0x3c326c\nADD.W           R0, SP, #0x54+var_30+1                                 ; +0xd2, 0x3c326e\nB               loc_3C327C                                             ; +0xd6, 0x3c3272\nASRS            R7, R7, #1                                             ; +0xd8, 0x3c3274\nCBZ             R2, loc_3C3280                                         ; +0xda, 0x3c3276\nLDR             R0, [SP,#0x54+var_28]                                  ; +0xdc, 0x3c3278\nCBZ             R1, loc_3C3284                                         ; +0xde, 0x3c327a\nLDR             R1, [SP,#0x54+var_1C]                                  ; +0xe0, 0x3c327c\nB               loc_3C3288                                             ; +0xe2, 0x3c327e\nADD.W           R0, SP, #0x54+var_30+1; void *                         ; +0xe4, 0x3c3280\nADD.W           R1, SP, #0x54+var_24+1; void *                         ; +0xe8, 0x3c3284\nCMP             R7, R3                                                 ; +0xec, 0x3c3288\nMOV             R2, R7                                                 ; +0xee, 0x3c328a\nIT CS                                                                  ; +0xf0, 0x3c328c\nMOVCS           R2, R3; size_t                                         ; +0xf2, 0x3c328e\nCBZ             R2, loc_3C329E                                         ; +0xf4, 0x3c3290\nSTR             R3, [SP,#0x54+var_40]                                  ; +0xf6, 0x3c3292\nBLX             memcmp                                                 ; +0xf8, 0x3c3294\nLDR             R3, [SP,#0x54+var_40]                                  ; +0xfc, 0x3c3298\nMOV             R2, R0                                                 ; +0xfe, 0x3c329a\nCBNZ            R0, loc_3C32AE                                         ; +0x100, 0x3c329c\nCMP             R3, R7                                                 ; +0x102, 0x3c329e\nBCC             loc_3C32AA                                             ; +0x104, 0x3c32a0\nITE HI                                                                 ; +0x106, 0x3c32a2\nMOVHI           R2, #1                                                 ; +0x108, 0x3c32a4\nMOVLS           R2, #0                                                 ; +0x10a, 0x3c32a6\nB               loc_3C32AE                                             ; +0x10c, 0x3c32a8\nMOV.W           R2, #0xFFFFFFFF                                        ; +0x10e, 0x3c32aa\nMOV             R0, R10                                                ; +0x112, 0x3c32ae\nSTR             R2, [SP,#0x54+var_40]                                  ; +0x114, 0x3c32b0\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x116, 0x3c32b2\nADD             R0, SP, #0x54+var_30                                   ; +0x11a, 0x3c32b6\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x11c, 0x3c32b8\nLDR             R2, [SP,#0x54+var_40]                                  ; +0x120, 0x3c32bc\nCBNZ            R2, loc_3C32DE                                         ; +0x122, 0x3c32be\nMOVS            R1, #0; float                                          ; +0x124, 0x3c32c0\nMOV.W           R2, #0x40000000; float                                 ; +0x126, 0x3c32c2\nADD             R0, SP, #0x54+var_38; this                             ; +0x12a, 0x3c32c6\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x12c, 0x3c32c8\nLDR             R1, flt_3C336C; float                                  ; +0x130, 0x3c32cc\nMOV             R0, R5; this                                           ; +0x132, 0x3c32ce\nLDR             R2, [SP,#0x54+var_34]; float                           ; +0x134, 0x3c32d0\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x136, 0x3c32d2\nMOV             R0, R9                                                 ; +0x13a, 0x3c32d6\nMOV             R1, R5                                                 ; +0x13c, 0x3c32d8\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0x13e, 0x3c32da\nLDR             R0, =(unk_B6B226 - 0x3C32E6)                           ; +0x142, 0x3c32de\nMOV             R1, R6; char *                                         ; +0x144, 0x3c32e0\nADD             R0, PC; unk_B6B226 ; this                              ; +0x146, 0x3c32e2\nBL              _ZN7cocos2d13CCLabelBMFont6createEPKcS2_; cocos2d::CCLabelBMFont::create(char const*,char const*) ; +0x148, 0x3c32e4\nLDR             R3, [R4]                                               ; +0x14c, 0x3c32e8\nMOVS            R2, #1                                                 ; +0x14e, 0x3c32ea\nMOV             R1, R0                                                 ; +0x150, 0x3c32ec\nSTR.W           R0, [R4,#0x218]                                        ; +0x152, 0x3c32ee\nMOV             R0, R4                                                 ; +0x156, 0x3c32f2\nLDR.W           R3, [R3,#0xE8]                                         ; +0x158, 0x3c32f4\nBLX             R3                                                     ; +0x15c, 0x3c32f8\nLDR             R3, flt_3C3370; float                                  ; +0x15e, 0x3c32fa\nMOVS            R1, #0; float                                          ; +0x160, 0x3c32fc\nMOV             R0, R5; this                                           ; +0x162, 0x3c32fe\nMOV             R2, R1; float                                          ; +0x164, 0x3c3300\nSTR             R3, [SP,#0x54+var_54]; float                           ; +0x166, 0x3c3302\nBL              _ZN7cocos2d6CCRectC1Effff; cocos2d::CCRect::CCRect(float,float,float,float) ; +0x168, 0x3c3304\nMOV             R1, R5                                                 ; +0x16c, 0x3c3308\nLDR             R0, [SP,#0x54+var_48]                                  ; +0x16e, 0x3c330a\nBL              _ZN7cocos2d9extension14CCScale9Sprite6createEPKcNS_6CCRectE; cocos2d::extension::CCScale9Sprite::create(char const*,cocos2d::CCRect) ; +0x170, 0x3c330c\nMOV.W           R1, #0x41800000; float                                 ; +0x174, 0x3c3310\nMOV             R2, R1; float                                          ; +0x178, 0x3c3314\nSTR.W           R0, [R4,#0x224]                                        ; +0x17a, 0x3c3316\nMOV             R6, R0                                                 ; +0x17e, 0x3c331a\nLDR             R3, [R0]                                               ; +0x180, 0x3c331c\nMOV             R0, R5; this                                           ; +0x182, 0x3c331e\nLDR.W           R7, [R3,#0xA0]                                         ; +0x184, 0x3c3320\nBL              _ZN7cocos2d6CCSizeC1Eff; cocos2d::CCSize::CCSize(float,float) ; +0x188, 0x3c3324\nMOV             R0, R6                                                 ; +0x18c, 0x3c3328\nMOV             R1, R5                                                 ; +0x18e, 0x3c332a\nBLX             R7                                                     ; +0x190, 0x3c332c\nLDR             R3, [R4]                                               ; +0x192, 0x3c332e\nMOV             R0, R4                                                 ; +0x194, 0x3c3330\nLDR.W           R1, [R4,#0x224]                                        ; +0x196, 0x3c3332\nMOVS            R2, #0                                                 ; +0x19a, 0x3c3336\nLDR.W           R3, [R3,#0xE8]                                         ; +0x19c, 0x3c3338\nBLX             R3                                                     ; +0x1a0, 0x3c333c\nMOV             R0, R4; this                                           ; +0x1a2, 0x3c333e\nMOV             R1, R11; char *                                        ; +0x1a4, 0x3c3340\nBL              _ZN12ButtonSprite9setStringEPKc; ButtonSprite::setString(char const*) ; +0x1a6, 0x3c3342\nLDR             R3, [SP,#0x54+var_44]                                  ; +0x1aa, 0x3c3346\nMOV             R0, R8                                                 ; +0x1ac, 0x3c3348\nLDR             R2, [SP,#0x54+var_8]                                   ; +0x1ae, 0x3c334a\nLDR             R3, [R3]                                               ; +0x1b0, 0x3c334c\nCMP             R2, R3                                                 ; +0x1b2, 0x3c334e\nBEQ             loc_3C3360                                             ; +0x1b4, 0x3c3350\nBLX             __stack_chk_fail                                       ; +0x1b6, 0x3c3352\nMOV             R0, R7                                                 ; +0x1ba, 0x3c3356\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x1bc, 0x3c3358\nBL              __cxa_end_cleanup                                      ; +0x1c0, 0x3c335c\nADD             SP, SP, #0x54 ; 'T'                                    ; +0x1c4, 0x3c3360\nVPOP            {D8}                                                   ; +0x1c6, 0x3c3362\nPOP.W           {R4-R11,PC}                                            ; +0x1ca, 0x3c3366", "xrefs": ["ButtonSprite::create @ 0x3c33ba"], "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"}