{"type": "func", "start": 5168196, "end": 5168656, "name": "AchievementNotifier::showNextAchievement", "pseudocode": "// \n// AchievementNotifier::showNextAchievement from 0x4edc44 to 0x4ede10 (460 bytes)\n// \n// 3 xrefs:\n// > AchievementNotifier::notifyAchievement @ 0x4ede68\n// > AchievementNotifier::achievementDisplayFinished @ 0x4edeac\n// > <???> @ 0x90b70\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\nvoid AchievementNotifier::showNextAchievement(AchievementNotifier *a1)\n{\n  FMODAudioEngine *v2; // x23\n  void *v3; // x0\n  cocos2d::CCArray *m_achievementBarArray; // x0\n  AchievementBar *v5; // x0\n  cocos2d::CCScene *m_nextScene; // x0\n  unsigned int *v7; // x2\n  int v8; // w1\n  __int64 v9; // [xsp+50h] [xbp+50h] BYREF\n\n  if ( (unsigned int)cocos2d::CCArray::count(a1->m_achievementBarArray) )\n  {\n    v2 = FMODAudioEngine::sharedEngine();\n    sub_D153B8((int)&v9, \"achievement_01.ogg\");\n    FMODAudioEngine::playEffect(v2, (std::string)&v9, (float)((float)dword_12412A8 * 0.05) + 1.0, 0.0, 0.3);\n    v3 = (void *)(v9 - 24);\n    if ( (__int64 *)(v9 - 24) != &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 - 8);\n        *(_DWORD *)(v9 - 8) = v8 - 1;\n      }\n      if ( v8 <= 0 )\n        operator delete(v3);\n    }\n    m_achievementBarArray = a1->m_achievementBarArray;\n    ++dword_12412A8;\n    v5 = (AchievementBar *)cocos2d::CCArray::objectAtIndex(m_achievementBarArray, 0);\n    a1->m_activeAchievementBar = v5;\n    cocos2d::CCObject::retain(v5);\n    cocos2d::CCArray::removeObjectAtIndex(a1->m_achievementBarArray, 0, 1);\n    m_nextScene = a1->m_nextScene;\n    if ( m_nextScene )\n      a1->m_activeAchievementBar->m_nextScene = m_nextScene;\n    AchievementBar::show(a1->m_activeAchievementBar);\n  }\n  else\n  {\n    dword_12412A8 = 0;\n  }\n}", "assembly": "; \n; AchievementNotifier::showNextAchievement from 0x4edc44 to 0x4ede10 (460 bytes)\n; \n; 3 xrefs:\n; > AchievementNotifier::notifyAchievement @ 0x4ede68\n; > AchievementNotifier::achievementDisplayFinished @ 0x4edeac\n; > <???> @ 0x90b70\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_60]!                                ; +0x0, 0x4edc44\nMOV             X29, SP                                                ; +0x4, 0x4edc48\nSTP             X19, X20, [SP,#0x60+var_50]                            ; +0x8, 0x4edc4c\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x4edc50\nMOV             X20, X0                                                ; +0x10, 0x4edc54\nLDR             X0, [X0,#0x148]; this                                  ; +0x14, 0x4edc58\nSTP             X21, X22, [SP,#0x60+var_40]                            ; +0x18, 0x4edc5c\nLDR             X1, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x4edc60\nSTR             X23, [SP,#0x60+var_30]                                 ; +0x20, 0x4edc64\nLDR             X1, [X1]                                               ; +0x24, 0x4edc68\nSTR             X1, [X29,#0x60+var_8]                                  ; +0x28, 0x4edc6c\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x2c, 0x4edc70\nCBNZ            W0, loc_4EDCA8                                         ; +0x30, 0x4edc74\nADRP            X0, #dword_12412A8@PAGE                                ; +0x34, 0x4edc78\nSTR             WZR, [X0,#dword_12412A8@PAGEOFF]                       ; +0x38, 0x4edc7c\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x3c, 0x4edc80\nLDR             X1, [X29,#0x60+var_8]                                  ; +0x40, 0x4edc84\nLDR             X0, [X19]                                              ; +0x44, 0x4edc88\nCMP             X1, X0                                                 ; +0x48, 0x4edc8c\nB.NE            loc_4EDDA4                                             ; +0x4c, 0x4edc90\nLDP             X19, X20, [SP,#0x60+var_50]                            ; +0x50, 0x4edc94\nLDP             X21, X22, [SP,#0x60+var_40]                            ; +0x54, 0x4edc98\nLDR             X23, [SP,#0x60+var_30]                                 ; +0x58, 0x4edc9c\nLDP             X29, X30, [SP+0x60+var_60],#0x60                       ; +0x5c, 0x4edca0\nRET                                                                    ; +0x60, 0x4edca4\nBL              _ZN15FMODAudioEngine12sharedEngineEv; FMODAudioEngine::sharedEngine(void) ; +0x64, 0x4edca8\nADD             X22, X29, #0x60+var_10                                 ; +0x68, 0x4edcac\nADRP            X1, #aAchievement01O@PAGE; \"achievement_01.ogg\"        ; +0x6c, 0x4edcb0\nMOV             X23, X0                                                ; +0x70, 0x4edcb4\nADD             X1, X1, #aAchievement01O@PAGEOFF; \"achievement_01.ogg\" ; +0x74, 0x4edcb8\nMOV             X0, X22; int                                           ; +0x78, 0x4edcbc\nADD             X2, X29, #0x60+var_20                                  ; +0x7c, 0x4edcc0\nADRP            X21, #qword_12412A0@PAGE                               ; +0x80, 0x4edcc4\nBL              sub_D153B8                                             ; +0x84, 0x4edcc8\nADD             X2, X21, #qword_12412A0@PAGEOFF                        ; +0x88, 0x4edccc\nMOV             X0, X23                                                ; +0x8c, 0x4edcd0\nFMOV            S0, #1.0                                               ; +0x90, 0x4edcd4\nMOV             X1, X22                                                ; +0x94, 0x4edcd8\nLDR             S4, =0x3D4CCCCD                                        ; +0x98, 0x4edcdc\nLDR             W2, [X2,#(dword_12412A8 - 0x12412A0)]                  ; +0x9c, 0x4edce0\nFMOV            S1, WZR                                                ; +0xa0, 0x4edce4\nLDR             S2, =0x3E99999A                                        ; +0xa4, 0x4edce8\nSCVTF           S3, W2                                                 ; +0xa8, 0x4edcec\nFMADD           S0, S3, S4, S0                                         ; +0xac, 0x4edcf0\nBL              _ZN15FMODAudioEngine10playEffectESsfff; FMODAudioEngine::playEffect(std::string,float,float,float) ; +0xb0, 0x4edcf4\nADRP            X1, #off_122EFE8@PAGE                                  ; +0xb4, 0x4edcf8\nLDR             X2, [X29,#0x60+var_10]                                 ; +0xb8, 0x4edcfc\nSUB             X0, X2, #0x18; p                                       ; +0xbc, 0x4edd00\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xc0, 0x4edd04\nCMP             X0, X1                                                 ; +0xc4, 0x4edd08\nB.NE            loc_4EDD60                                             ; +0xc8, 0x4edd0c\nADD             X21, X21, #qword_12412A0@PAGEOFF                       ; +0xcc, 0x4edd10\nLDR             X0, [X20,#0x148]; this                                 ; +0xd0, 0x4edd14\nMOV             W1, #0; unsigned int                                   ; +0xd4, 0x4edd18\nLDR             W2, [X21,#(dword_12412A8 - 0x12412A0)]                 ; +0xd8, 0x4edd1c\nADD             W2, W2, #1                                             ; +0xdc, 0x4edd20\nSTR             W2, [X21,#(dword_12412A8 - 0x12412A0)]                 ; +0xe0, 0x4edd24\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0xe4, 0x4edd28\nSTR             X0, [X20,#0x150]                                       ; +0xe8, 0x4edd2c\nBL              _ZN7cocos2d8CCObject6retainEv; cocos2d::CCObject::retain(void) ; +0xec, 0x4edd30\nLDR             X0, [X20,#0x148]; this                                 ; +0xf0, 0x4edd34\nMOV             W1, #0; unsigned int                                   ; +0xf4, 0x4edd38\nMOV             W2, #1; bool                                           ; +0xf8, 0x4edd3c\nBL              _ZN7cocos2d7CCArray19removeObjectAtIndexEjb; cocos2d::CCArray::removeObjectAtIndex(uint,bool) ; +0xfc, 0x4edd40\nLDR             X0, [X20,#0x140]                                       ; +0x100, 0x4edd44\nCBZ             X0, loc_4EDD54                                         ; +0x104, 0x4edd48\nLDR             X1, [X20,#0x150]                                       ; +0x108, 0x4edd4c\nSTR             X0, [X1,#0x168]                                        ; +0x10c, 0x4edd50\nLDR             X0, [X20,#0x150]; this                                 ; +0x110, 0x4edd54\nBL              _ZN14AchievementBar4showEv; AchievementBar::show(void) ; +0x114, 0x4edd58\nB               loc_4EDC80                                             ; +0x118, 0x4edd5c\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x11c, 0x4edd60\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x120, 0x4edd64\nCBZ             X1, loc_4EDD94                                         ; +0x124, 0x4edd68\nSUB             X2, X2, #8                                             ; +0x128, 0x4edd6c\nLDAXR           W1, [X2]                                               ; +0x12c, 0x4edd70\nSUB             W3, W1, #1                                             ; +0x130, 0x4edd74\nSTLXR           W4, W3, [X2]                                           ; +0x134, 0x4edd78\nCBNZ            W4, loc_4EDD70                                         ; +0x138, 0x4edd7c\nCMP             W1, WZR                                                ; +0x13c, 0x4edd80\nB.GT            loc_4EDD10                                             ; +0x140, 0x4edd84\nADD             X1, X29, #0x60+var_18                                  ; +0x144, 0x4edd88\nBL              j__ZdlPv; operator delete(void *)                      ; +0x148, 0x4edd8c\nB               loc_4EDD10                                             ; +0x14c, 0x4edd90\nLDUR            W1, [X2,#-8]                                           ; +0x150, 0x4edd94\nSUB             W3, W1, #1                                             ; +0x154, 0x4edd98\nSTUR            W3, [X2,#-8]                                           ; +0x158, 0x4edd9c\nB               loc_4EDD80                                             ; +0x15c, 0x4edda0\nBL              .__stack_chk_fail                                      ; +0x160, 0x4edda4\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x164, 0x4edda8\nLDR             X2, [X29,#0x60+var_10]                                 ; +0x168, 0x4eddac\nMOV             X19, X0                                                ; +0x16c, 0x4eddb0\nSUB             X0, X2, #0x18; p                                       ; +0x170, 0x4eddb4\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x174, 0x4eddb8\nCMP             X0, X1                                                 ; +0x178, 0x4eddbc\nB.NE            loc_4EDDCC                                             ; +0x17c, 0x4eddc0\nMOV             X0, X19                                                ; +0x180, 0x4eddc4\nBL              _Unwind_Resume                                         ; +0x184, 0x4eddc8\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x188, 0x4eddcc\nADD             X3, X0, #0x10                                          ; +0x18c, 0x4eddd0\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x190, 0x4eddd4\nCBZ             X1, loc_4EDE00                                         ; +0x194, 0x4eddd8\nLDAXR           W1, [X3]                                               ; +0x198, 0x4edddc\nSUB             W2, W1, #1                                             ; +0x19c, 0x4edde0\nSTLXR           W4, W2, [X3]                                           ; +0x1a0, 0x4edde4\nCBNZ            W4, loc_4EDDDC                                         ; +0x1a4, 0x4edde8\nCMP             W1, WZR                                                ; +0x1a8, 0x4eddec\nB.GT            loc_4EDDC4                                             ; +0x1ac, 0x4eddf0\nADD             X1, X29, #0x60+var_18                                  ; +0x1b0, 0x4eddf4\nBL              j__ZdlPv; operator delete(void *)                      ; +0x1b4, 0x4eddf8\nB               loc_4EDDC4                                             ; +0x1b8, 0x4eddfc\nLDUR            W1, [X2,#-8]                                           ; +0x1bc, 0x4ede00\nSUB             W3, W1, #1                                             ; +0x1c0, 0x4ede04\nSTUR            W3, [X2,#-8]                                           ; +0x1c4, 0x4ede08\nB               loc_4EDDEC                                             ; +0x1c8, 0x4ede0c", "xrefs": ["AchievementNotifier::notifyAchievement @ 0x4ede68", "AchievementNotifier::achievementDisplayFinished @ 0x4edeac", "<???> @ 0x90b70"], "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"}