{"type": "func", "start": 9280964, "end": 9281204, "name": "GJDifficultySprite::init", "pseudocode": "// \n// GJDifficultySprite::init from 0x8d9dc4 to 0x8d9eb4 (240 bytes)\n// \n// 2 xrefs:\n// > GJDifficultySprite::create @ 0x8d9f0c\n// > <???> @ 0x864a8\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 GJDifficultySprite::init(GJDifficultySprite *a1, int a2, GJDifficultyName a3)\n{\n  bool v4; // w20\n  char *v5; // x0\n  unsigned int *v7; // x2\n  int v8; // w1\n  char *v9; // [xsp+30h] [xbp+30h] BYREF\n\n  GJDifficultySprite::getDifficultyFrame(a2, a3, (__int64)&v9);\n  v4 = cocos2d::CCSprite::initWithSpriteFrameName(a1, v9);\n  v5 = v9 - 24;\n  if ( v9 - 24 != (char *)&qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v7 = (unsigned int *)(v9 - 8);\n      do\n        v8 = __ldaxr(v7);\n      while ( __stlxr(v8 - 1, v7) );\n    }\n    else\n    {\n      v8 = *((_DWORD *)v9 - 2);\n      *((_DWORD *)v9 - 2) = v8 - 1;\n    }\n    if ( v8 <= 0 )\n      operator delete(v5);\n  }\n  return v4;\n}", "assembly": "; \n; GJDifficultySprite::init from 0x8d9dc4 to 0x8d9eb4 (240 bytes)\n; \n; 2 xrefs:\n; > GJDifficultySprite::create @ 0x8d9f0c\n; > <???> @ 0x864a8\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\nSTP             X29, X30, [SP,#var_40]!                                ; +0x0, 0x8d9dc4\nMOV             X29, SP                                                ; +0x4, 0x8d9dc8\nSTP             X19, X20, [SP,#0x40+var_30]                            ; +0x8, 0x8d9dcc\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x8d9dd0\nMOV             X20, X0                                                ; +0x10, 0x8d9dd4\nMOV             W0, W1                                                 ; +0x14, 0x8d9dd8\nMOV             W1, W2                                                 ; +0x18, 0x8d9ddc\nADD             X8, X29, #0x40+var_10                                  ; +0x1c, 0x8d9de0\nLDR             X2, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0x8d9de4\nLDR             X2, [X2]                                               ; +0x24, 0x8d9de8\nSTR             X2, [X29,#0x40+var_8]                                  ; +0x28, 0x8d9dec\nBL              _ZN18GJDifficultySprite18getDifficultyFrameEi16GJDifficultyName; GJDifficultySprite::getDifficultyFrame(int,GJDifficultyName) ; +0x2c, 0x8d9df0\nLDR             X1, [X29,#0x40+var_10]; char *                         ; +0x30, 0x8d9df4\nMOV             X0, X20; this                                          ; +0x34, 0x8d9df8\nBL              _ZN7cocos2d8CCSprite23initWithSpriteFrameNameEPKc; cocos2d::CCSprite::initWithSpriteFrameName(char const*) ; +0x38, 0x8d9dfc\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x3c, 0x8d9e00\nLDR             X2, [X29,#0x40+var_10]                                 ; +0x40, 0x8d9e04\nMOV             W20, W0                                                ; +0x44, 0x8d9e08\nSUB             X0, X2, #0x18; p                                       ; +0x48, 0x8d9e0c\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x4c, 0x8d9e10\nCMP             X0, X1                                                 ; +0x50, 0x8d9e14\nB.NE            loc_8D9E40                                             ; +0x54, 0x8d9e18\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x58, 0x8d9e1c\nMOV             W0, W20                                                ; +0x5c, 0x8d9e20\nLDR             X2, [X29,#0x40+var_8]                                  ; +0x60, 0x8d9e24\nLDR             X1, [X19]                                              ; +0x64, 0x8d9e28\nCMP             X2, X1                                                 ; +0x68, 0x8d9e2c\nB.NE            loc_8D9E84                                             ; +0x6c, 0x8d9e30\nLDP             X19, X20, [SP,#0x40+var_30]                            ; +0x70, 0x8d9e34\nLDP             X29, X30, [SP+0x40+var_40],#0x40                       ; +0x74, 0x8d9e38\nRET                                                                    ; +0x78, 0x8d9e3c\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x7c, 0x8d9e40\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x80, 0x8d9e44\nCBZ             X1, loc_8D9E74                                         ; +0x84, 0x8d9e48\nSUB             X2, X2, #8                                             ; +0x88, 0x8d9e4c\nLDAXR           W1, [X2]                                               ; +0x8c, 0x8d9e50\nSUB             W3, W1, #1                                             ; +0x90, 0x8d9e54\nSTLXR           W4, W3, [X2]                                           ; +0x94, 0x8d9e58\nCBNZ            W4, loc_8D9E50                                         ; +0x98, 0x8d9e5c\nCMP             W1, WZR                                                ; +0x9c, 0x8d9e60\nB.GT            loc_8D9E1C                                             ; +0xa0, 0x8d9e64\nADD             X1, X29, #0x40+var_18                                  ; +0xa4, 0x8d9e68\nBL              j__ZdlPv; operator delete(void *)                      ; +0xa8, 0x8d9e6c\nB               loc_8D9E1C                                             ; +0xac, 0x8d9e70\nLDUR            W1, [X2,#-8]                                           ; +0xb0, 0x8d9e74\nSUB             W3, W1, #1                                             ; +0xb4, 0x8d9e78\nSTUR            W3, [X2,#-8]                                           ; +0xb8, 0x8d9e7c\nB               loc_8D9E60                                             ; +0xbc, 0x8d9e80\nBL              .__stack_chk_fail                                      ; +0xc0, 0x8d9e84\nADRP            X1, #off_122EFE8@PAGE                                  ; +0xc4, 0x8d9e88\nMOV             X19, X0                                                ; +0xc8, 0x8d9e8c\nLDR             X0, [X29,#0x40+var_10]                                 ; +0xcc, 0x8d9e90\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xd0, 0x8d9e94\nSUB             X0, X0, #0x18                                          ; +0xd4, 0x8d9e98\nCMP             X0, X1                                                 ; +0xd8, 0x8d9e9c\nB.EQ            loc_8D9EAC                                             ; +0xdc, 0x8d9ea0\nADD             X1, X29, #0x40+var_18                                  ; +0xe0, 0x8d9ea4\nBL              sub_4DC698                                             ; +0xe4, 0x8d9ea8\nMOV             X0, X19                                                ; +0xe8, 0x8d9eac\nBL              _Unwind_Resume                                         ; +0xec, 0x8d9eb0", "xrefs": ["GJDifficultySprite::create @ 0x8d9f0c", "<???> @ 0x864a8"], "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"}