{"type": "func", "start": 8206620, "end": 8207244, "name": "EndLevelLayer::getCoinString", "pseudocode": "// \n// EndLevelLayer::getCoinString from 0x7d391c to 0x7d3b8c (624 bytes)\n// \n// 2 xrefs:\n// > EndLevelLayer::customSetup @ 0x7d7254\n// > <???> @ 0xb47e0\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\n__int64 __usercall EndLevelLayer::getCoinString@<X0>(EndLevelLayer *this@<X0>, __int64 a2@<X8>)\n{\n  GJGameLevel *m_level; // x0\n  __int64 random; // x3\n  bool v6; // cc\n  __int64 seed; // x5\n  __int64 v8; // x2\n  __int64 v9; // x4\n  int v10; // w1\n  int v11; // w0\n  _BOOL4 v12; // w25\n  _BOOL4 v13; // w24\n  _BOOL4 v14; // w26\n  cocos2d::CCString *v15; // x0\n  char *CString; // x0\n  char *v17; // x0\n  int v19; // w0\n  unsigned int *v20; // x2\n  int v21; // w1\n  char *v22; // [xsp+60h] [xbp+60h] BYREF\n\n  if ( !this->m_playLayer )\n  {\n    sub_D153B8(a2, &byte_F288A0);\n    return a2;\n  }\n  sub_D153B8((int)&v22, \"<cy>all</c> coins\");\n  m_level = this->m_playLayer->m_level;\n  random = (unsigned int)m_level->m_firstCoinVerified.random;\n  v6 = m_level->m_coins <= 1;\n  seed = (unsigned int)m_level->m_firstCoinVerified.seed;\n  v8 = (unsigned int)m_level->m_secondCoinVerified.random;\n  v9 = (unsigned int)m_level->m_secondCoinVerified.seed;\n  v10 = m_level->m_thirdCoinVerified.random;\n  v11 = m_level->m_thirdCoinVerified.seed;\n  if ( !v6 )\n  {\n    random = (unsigned int)(random - seed);\n    v8 = (unsigned int)(v8 - v9);\n    v12 = random == 1;\n    v13 = v8 == 1;\n    v14 = v10 - v11 == 1;\n    if ( v13 || v12 || v10 - v11 == 1 )\n    {\n      sub_D1798C(&v22, \"coin \", 5);\n      if ( v12 )\n      {\n        if ( v13 )\n        {\n          v19 = 1;\n          goto LABEL_11;\n        }\n        sub_D15FD4(&v22, \"<cy>2</c>\", 9);\n      }\n      else\n      {\n        sub_D15FD4(&v22, \"<cy>1</c>\", 9);\n        if ( !v13 )\n        {\n          sub_D15FD4(&v22, \", \", 2);\n          sub_D15FD4(&v22, \"<cy>2</c>\", 9);\n        }\n      }\n      v19 = 0;\nLABEL_11:\n      if ( !v14 && this->m_playLayer->m_level->m_coins > 2 )\n      {\n        if ( !v19 )\n          sub_D15FD4(&v22, \", \", 2);\n        sub_D15FD4(&v22, \"<cy>3</c>\", 9);\n      }\n    }\n  }\n  v15 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(\n                               (cocos2d::CCString *)\"You need to <cg>collect</c> %s to verify the level!\",\n                               v22,\n                               v8,\n                               random,\n                               v9,\n                               seed);\n  CString = (char *)cocos2d::CCString::getCString(v15);\n  sub_D153B8(a2, CString);\n  v17 = v22 - 24;\n  if ( v22 - 24 != (char *)&qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v20 = (unsigned int *)(v22 - 8);\n      do\n        v21 = __ldaxr(v20);\n      while ( __stlxr(v21 - 1, v20) );\n    }\n    else\n    {\n      v21 = *((_DWORD *)v22 - 2);\n      *((_DWORD *)v22 - 2) = v21 - 1;\n    }\n    if ( v21 <= 0 )\n      operator delete(v17);\n  }\n  return a2;\n}", "assembly": "; \n; EndLevelLayer::getCoinString from 0x7d391c to 0x7d3b8c (624 bytes)\n; \n; 2 xrefs:\n; > EndLevelLayer::customSetup @ 0x7d7254\n; > <???> @ 0xb47e0\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_70]!                                ; +0x0, 0x7d391c\nMOV             X29, SP                                                ; +0x4, 0x7d3920\nSTP             X19, X20, [SP,#0x70+var_60]                            ; +0x8, 0x7d3924\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x7d3928\nSTP             X21, X22, [SP,#0x70+var_50]                            ; +0x10, 0x7d392c\nMOV             X21, X0                                                ; +0x14, 0x7d3930\nLDR             X0, [X0,#0x260]                                        ; +0x18, 0x7d3934\nLDR             X1, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x7d3938\nMOV             X22, X8                                                ; +0x20, 0x7d393c\nSTP             X23, X24, [SP,#0x70+var_40]                            ; +0x24, 0x7d3940\nSTP             X25, X26, [SP,#0x70+var_30]                            ; +0x28, 0x7d3944\nLDR             X1, [X1]                                               ; +0x2c, 0x7d3948\nSTR             X1, [X29,#0x70+var_8]                                  ; +0x30, 0x7d394c\nCBZ             X0, loc_7D3B00                                         ; +0x34, 0x7d3950\nADD             X20, X29, #0x70+var_10                                 ; +0x38, 0x7d3954\nADD             X23, X29, #0x70+var_18                                 ; +0x3c, 0x7d3958\nADRP            X1, #aCyAllCCoins@PAGE; \"<cy>all</c> coins\"            ; +0x40, 0x7d395c\nMOV             X0, X20; int                                           ; +0x44, 0x7d3960\nADD             X1, X1, #aCyAllCCoins@PAGEOFF; \"<cy>all</c> coins\"     ; +0x48, 0x7d3964\nMOV             X2, X23                                                ; +0x4c, 0x7d3968\nBL              sub_D153B8                                             ; +0x50, 0x7d396c\nLDR             X0, [X21,#0x260]                                       ; +0x54, 0x7d3970\nLDR             X0, [X0,#0x8A0]                                        ; +0x58, 0x7d3974\nLDR             W1, [X0,#0x2C0]                                        ; +0x5c, 0x7d3978\nLDR             W3, [X0,#0x2EC]                                        ; +0x60, 0x7d397c\nCMP             W1, #1                                                 ; +0x64, 0x7d3980\nLDR             W5, [X0,#0x2F0]                                        ; +0x68, 0x7d3984\nLDR             W2, [X0,#0x2F8]                                        ; +0x6c, 0x7d3988\nLDR             W4, [X0,#0x2FC]                                        ; +0x70, 0x7d398c\nLDR             W1, [X0,#0x304]                                        ; +0x74, 0x7d3990\nLDR             W0, [X0,#0x308]                                        ; +0x78, 0x7d3994\nB.LE            loc_7D39CC                                             ; +0x7c, 0x7d3998\nSUB             W3, W3, W5                                             ; +0x80, 0x7d399c\nSUB             W2, W2, W4                                             ; +0x84, 0x7d39a0\nCMP             W3, #1                                                 ; +0x88, 0x7d39a4\nSUB             W1, W1, W0                                             ; +0x8c, 0x7d39a8\nCSET            W25, EQ                                                ; +0x90, 0x7d39ac\nCMP             W2, #1                                                 ; +0x94, 0x7d39b0\nCSET            W24, EQ                                                ; +0x98, 0x7d39b4\nCMP             W1, #1                                                 ; +0x9c, 0x7d39b8\nORR             W0, W24, W25                                           ; +0xa0, 0x7d39bc\nCSET            W26, EQ                                                ; +0xa4, 0x7d39c0\nCBNZ            W0, loc_7D3A38                                         ; +0xa8, 0x7d39c4\nCBNZ            W26, loc_7D3A38                                        ; +0xac, 0x7d39c8\nADRP            X0, #aYouNeedToCgCol@PAGE; \"You need to <cg>collect</c> %s to verif\"... ; +0xb0, 0x7d39cc\nLDR             X1, [X29,#0x70+var_10]; char *                         ; +0xb4, 0x7d39d0\nADD             X0, X0, #aYouNeedToCgCol@PAGEOFF; \"You need to <cg>collect</c> %s to verif\"... ; +0xb8, 0x7d39d4\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0xbc, 0x7d39d8\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0xc0, 0x7d39dc\nMOV             X1, X0; char *                                         ; +0xc4, 0x7d39e0\nMOV             X2, X23                                                ; +0xc8, 0x7d39e4\nMOV             X0, X22; int                                           ; +0xcc, 0x7d39e8\nBL              sub_D153B8                                             ; +0xd0, 0x7d39ec\nADRP            X1, #off_122EFE8@PAGE                                  ; +0xd4, 0x7d39f0\nLDR             X2, [X29,#0x70+var_10]                                 ; +0xd8, 0x7d39f4\nSUB             X0, X2, #0x18; p                                       ; +0xdc, 0x7d39f8\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xe0, 0x7d39fc\nCMP             X0, X1                                                 ; +0xe4, 0x7d3a00\nB.NE            loc_7D3B18                                             ; +0xe8, 0x7d3a04\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0xec, 0x7d3a08\nMOV             X0, X22                                                ; +0xf0, 0x7d3a0c\nLDR             X2, [X29,#0x70+var_8]                                  ; +0xf4, 0x7d3a10\nLDR             X1, [X19]                                              ; +0xf8, 0x7d3a14\nCMP             X2, X1                                                 ; +0xfc, 0x7d3a18\nB.NE            loc_7D3B5C                                             ; +0x100, 0x7d3a1c\nLDP             X19, X20, [SP,#0x70+var_60]                            ; +0x104, 0x7d3a20\nLDP             X21, X22, [SP,#0x70+var_50]                            ; +0x108, 0x7d3a24\nLDP             X23, X24, [SP,#0x70+var_40]                            ; +0x10c, 0x7d3a28\nLDP             X25, X26, [SP,#0x70+var_30]                            ; +0x110, 0x7d3a2c\nLDP             X29, X30, [SP+0x70+var_70],#0x70                       ; +0x114, 0x7d3a30\nRET                                                                    ; +0x118, 0x7d3a34\nADRP            X1, #aCoin@PAGE; \"coin \"                               ; +0x11c, 0x7d3a38\nMOV             X0, X20                                                ; +0x120, 0x7d3a3c\nADD             X1, X1, #aCoin@PAGEOFF; \"coin \"                        ; +0x124, 0x7d3a40\nMOV             X2, #5                                                 ; +0x128, 0x7d3a44\nBL              sub_D1798C                                             ; +0x12c, 0x7d3a48\nCBZ             W25, loc_7D3ABC                                        ; +0x130, 0x7d3a4c\nCBNZ            W24, loc_7D3AB4                                        ; +0x134, 0x7d3a50\nADRP            X1, #aCy2C@PAGE; \"<cy>2</c>\"                           ; +0x138, 0x7d3a54\nMOV             X0, X20                                                ; +0x13c, 0x7d3a58\nADD             X1, X1, #aCy2C@PAGEOFF; \"<cy>2</c>\"                    ; +0x140, 0x7d3a5c\nMOV             X2, #9                                                 ; +0x144, 0x7d3a60\nBL              sub_D15FD4                                             ; +0x148, 0x7d3a64\nMOV             W0, #0                                                 ; +0x14c, 0x7d3a68\nCBNZ            W26, loc_7D39CC                                        ; +0x150, 0x7d3a6c\nLDR             X1, [X21,#0x260]                                       ; +0x154, 0x7d3a70\nLDR             X1, [X1,#0x8A0]                                        ; +0x158, 0x7d3a74\nLDR             W1, [X1,#0x2C0]                                        ; +0x15c, 0x7d3a78\nCMP             W1, #2                                                 ; +0x160, 0x7d3a7c\nB.LE            loc_7D39CC                                             ; +0x164, 0x7d3a80\nCBNZ            W0, loc_7D3A9C                                         ; +0x168, 0x7d3a84\nADRP            X1, #asc_EC9850@PAGE; \", \"                             ; +0x16c, 0x7d3a88\nMOV             X0, X20                                                ; +0x170, 0x7d3a8c\nADD             X1, X1, #asc_EC9850@PAGEOFF; \", \"                      ; +0x174, 0x7d3a90\nMOV             X2, #2                                                 ; +0x178, 0x7d3a94\nBL              sub_D15FD4                                             ; +0x17c, 0x7d3a98\nADRP            X1, #aCy3C@PAGE; \"<cy>3</c>\"                           ; +0x180, 0x7d3a9c\nMOV             X0, X20                                                ; +0x184, 0x7d3aa0\nADD             X1, X1, #aCy3C@PAGEOFF; \"<cy>3</c>\"                    ; +0x188, 0x7d3aa4\nMOV             X2, #9                                                 ; +0x18c, 0x7d3aa8\nBL              sub_D15FD4                                             ; +0x190, 0x7d3aac\nB               loc_7D39CC                                             ; +0x194, 0x7d3ab0\nMOV             W0, #1                                                 ; +0x198, 0x7d3ab4\nB               loc_7D3A6C                                             ; +0x19c, 0x7d3ab8\nADRP            X1, #aCy1C@PAGE; \"<cy>1</c>\"                           ; +0x1a0, 0x7d3abc\nMOV             X0, X20                                                ; +0x1a4, 0x7d3ac0\nADD             X1, X1, #aCy1C@PAGEOFF; \"<cy>1</c>\"                    ; +0x1a8, 0x7d3ac4\nMOV             X2, #9                                                 ; +0x1ac, 0x7d3ac8\nBL              sub_D15FD4                                             ; +0x1b0, 0x7d3acc\nCBNZ            W24, loc_7D3A68                                        ; +0x1b4, 0x7d3ad0\nADRP            X1, #asc_EC9850@PAGE; \", \"                             ; +0x1b8, 0x7d3ad4\nMOV             X0, X20                                                ; +0x1bc, 0x7d3ad8\nADD             X1, X1, #asc_EC9850@PAGEOFF; \", \"                      ; +0x1c0, 0x7d3adc\nMOV             X2, #2                                                 ; +0x1c4, 0x7d3ae0\nBL              sub_D15FD4                                             ; +0x1c8, 0x7d3ae4\nADRP            X1, #aCy2C@PAGE; \"<cy>2</c>\"                           ; +0x1cc, 0x7d3ae8\nMOV             X0, X20                                                ; +0x1d0, 0x7d3aec\nADD             X1, X1, #aCy2C@PAGEOFF; \"<cy>2</c>\"                    ; +0x1d4, 0x7d3af0\nMOV             X2, #9                                                 ; +0x1d8, 0x7d3af4\nBL              sub_D15FD4                                             ; +0x1dc, 0x7d3af8\nB               loc_7D3A68                                             ; +0x1e0, 0x7d3afc\nADRP            X1, #byte_F288A0@PAGE                                  ; +0x1e4, 0x7d3b00\nMOV             X0, X8; int                                            ; +0x1e8, 0x7d3b04\nADD             X1, X1, #byte_F288A0@PAGEOFF; char *                   ; +0x1ec, 0x7d3b08\nADD             X2, X29, #0x70+var_10                                  ; +0x1f0, 0x7d3b0c\nBL              sub_D153B8                                             ; +0x1f4, 0x7d3b10\nB               loc_7D3A08                                             ; +0x1f8, 0x7d3b14\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x1fc, 0x7d3b18\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x200, 0x7d3b1c\nCBZ             X1, loc_7D3B4C                                         ; +0x204, 0x7d3b20\nSUB             X2, X2, #8                                             ; +0x208, 0x7d3b24\nLDAXR           W1, [X2]                                               ; +0x20c, 0x7d3b28\nSUB             W3, W1, #1                                             ; +0x210, 0x7d3b2c\nSTLXR           W4, W3, [X2]                                           ; +0x214, 0x7d3b30\nCBNZ            W4, loc_7D3B28                                         ; +0x218, 0x7d3b34\nCMP             W1, WZR                                                ; +0x21c, 0x7d3b38\nB.GT            loc_7D3A08                                             ; +0x220, 0x7d3b3c\nMOV             X1, X23                                                ; +0x224, 0x7d3b40\nBL              j__ZdlPv; operator delete(void *)                      ; +0x228, 0x7d3b44\nB               loc_7D3A08                                             ; +0x22c, 0x7d3b48\nLDUR            W1, [X2,#-8]                                           ; +0x230, 0x7d3b4c\nSUB             W3, W1, #1                                             ; +0x234, 0x7d3b50\nSTUR            W3, [X2,#-8]                                           ; +0x238, 0x7d3b54\nB               loc_7D3B38                                             ; +0x23c, 0x7d3b58\nBL              .__stack_chk_fail                                      ; +0x240, 0x7d3b5c\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x244, 0x7d3b60\nMOV             X19, X0                                                ; +0x248, 0x7d3b64\nLDR             X0, [X29,#0x70+var_10]                                 ; +0x24c, 0x7d3b68\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x250, 0x7d3b6c\nSUB             X0, X0, #0x18                                          ; +0x254, 0x7d3b70\nCMP             X0, X1                                                 ; +0x258, 0x7d3b74\nB.EQ            loc_7D3B84                                             ; +0x25c, 0x7d3b78\nMOV             X1, X23                                                ; +0x260, 0x7d3b7c\nBL              sub_4DBDD0                                             ; +0x264, 0x7d3b80\nMOV             X0, X19                                                ; +0x268, 0x7d3b84\nBL              _Unwind_Resume                                         ; +0x26c, 0x7d3b88", "xrefs": ["EndLevelLayer::customSetup @ 0x7d7254", "<???> @ 0xb47e0"], "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"}