{"type": "func", "start": 4296742488, "end": 4296742844, "name": "GJRateLevelLayer::selectRating", "pseudocode": "// \n// GJRateLevelLayer::selectRating from 0x1001b1658 to 0x1001b17bc (356 bytes)\n// \n// 2 xrefs:\n// > GJRateLevelLayer::init @ 0x1001b14ac\n// > GJRateLevelLayer::init @ 0x1001b0f0c\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 __fastcall GJRateLevelLayer::selectRating(GJRateLevelLayer *a1, cocos2d::CCObject *a2)\n{\n  int v3; // w0\n  __int64 v4; // x20\n  __int64 v5; // x21\n  ButtonSprite *v6; // x22\n  int m_stars; // w25\n  const char *v8; // x1\n  int v9; // w20\n  ButtonSprite *v10; // x0\n  int v11; // w1\n  unsigned int v12; // w8\n  int v13; // w9\n  int v14; // w12\n  int v15; // w11\n  int v16; // w10\n  int v17; // w1\n\n  if ( a2 )\n    v3 = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);\n  else\n    v3 = -1;\n  a1->m_stars = v3;\n  if ( (unsigned int)sub_10024A36C(a1->m_starButtons) )\n  {\n    v4 = 0;\n    do\n    {\n      v5 = sub_10024A388(a1->m_starButtons, v4);\n      v6 = (ButtonSprite *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 1056LL))(v5);\n      m_stars = a1->m_stars;\n      if ( m_stars == (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v5 + 64LL))(v5) )\n        v8 = \"GJ_button_01.png\";\n      else\n        v8 = \"GJ_button_04.png\";\n      ButtonSprite::updateBGImage(v6, v8);\n      v4 = (unsigned int)(v4 + 1);\n    }\n    while ( (unsigned int)v4 < (unsigned int)sub_10024A36C(a1->m_starButtons) );\n  }\n  v9 = a1->m_stars;\n  v10 = (ButtonSprite *)((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_submitButton->getNormalImage)(a1->m_submitButton);\n  if ( v9 == -1 )\n    v11 = 10921638;\n  else\n    v11 = 0xFFFFFF;\n  ButtonSprite::setColor(v10, (cocos2d::ccColor3B)v11);\n  v12 = a1->m_stars;\n  if ( (int)v12 >= 2 )\n  {\n    if ( v12 == 2 )\n    {\n      v13 = 1;\n    }\n    else if ( v12 == 3 )\n    {\n      v13 = 2;\n    }\n    else\n    {\n      if ( v12 == 10 )\n        v14 = 6;\n      else\n        v14 = 0;\n      if ( v12 >= 0xA )\n        v15 = v14;\n      else\n        v15 = 5;\n      if ( v12 >= 8 )\n        v16 = v15;\n      else\n        v16 = 4;\n      if ( v12 >= 6 )\n        v13 = v16;\n      else\n        v13 = 3;\n    }\n  }\n  else\n  {\n    v13 = 0;\n  }\n  if ( v12 == 1 )\n    v17 = -1;\n  else\n    v17 = v13;\n  GJDifficultySprite::updateDifficultyFrame(a1->m_difficultySprite, v17, Short);\n}", "assembly": "; \n; GJRateLevelLayer::selectRating from 0x1001b1658 to 0x1001b17bc (356 bytes)\n; \n; 2 xrefs:\n; > GJRateLevelLayer::init @ 0x1001b14ac\n; > GJRateLevelLayer::init @ 0x1001b0f0c\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             X26, X25, [SP,#-0x10+var_40]!                          ; +0x0, 0x1001b1658\nSTP             X24, X23, [SP,#0x40+var_30]                            ; +0x4, 0x1001b165c\nSTP             X22, X21, [SP,#0x40+var_20]                            ; +0x8, 0x1001b1660\nSTP             X20, X19, [SP,#0x40+var_10]                            ; +0xc, 0x1001b1664\nSTP             X29, X30, [SP,#0x40+var_s0]                            ; +0x10, 0x1001b1668\nADD             X29, SP, #0x40                                         ; +0x14, 0x1001b166c\nMOV             X19, X0                                                ; +0x18, 0x1001b1670\nCBZ             X1, loc_1001B168C                                      ; +0x1c, 0x1001b1674\nLDR             X8, [X1]                                               ; +0x20, 0x1001b1678\nLDR             X8, [X8,#0x40]                                         ; +0x24, 0x1001b167c\nMOV             X0, X1                                                 ; +0x28, 0x1001b1680\nBLR             X8                                                     ; +0x2c, 0x1001b1684\nB               loc_1001B1690                                          ; +0x30, 0x1001b1688\nMOV             W0, #0xFFFFFFFF                                        ; +0x34, 0x1001b168c\nSTR             W0, [X19,#0x3F0]                                       ; +0x38, 0x1001b1690\nLDR             X0, [X19,#0x3E8]                                       ; +0x3c, 0x1001b1694\nBL              sub_10024A36C                                          ; +0x40, 0x1001b1698\nCBZ             W0, loc_1001B170C                                      ; +0x44, 0x1001b169c\nMOV             W20, #0                                                ; +0x48, 0x1001b16a0\nADRL            X23, aGjButton04Png; \"GJ_button_04.png\"                ; +0x4c, 0x1001b16a4\nADRL            X24, aGjButton01Png; \"GJ_button_01.png\"                ; +0x54, 0x1001b16ac\nLDR             X0, [X19,#0x3E8]                                       ; +0x5c, 0x1001b16b4\nMOV             X1, X20                                                ; +0x60, 0x1001b16b8\nBL              sub_10024A388                                          ; +0x64, 0x1001b16bc\nMOV             X21, X0                                                ; +0x68, 0x1001b16c0\nLDR             X8, [X0]                                               ; +0x6c, 0x1001b16c4\nLDR             X8, [X8,#0x420]                                        ; +0x70, 0x1001b16c8\nBLR             X8                                                     ; +0x74, 0x1001b16cc\nMOV             X22, X0                                                ; +0x78, 0x1001b16d0\nLDR             W25, [X19,#0x3F0]                                      ; +0x7c, 0x1001b16d4\nLDR             X8, [X21]                                              ; +0x80, 0x1001b16d8\nLDR             X8, [X8,#0x40]                                         ; +0x84, 0x1001b16dc\nMOV             X0, X21                                                ; +0x88, 0x1001b16e0\nBLR             X8                                                     ; +0x8c, 0x1001b16e4\nCMP             W25, W0                                                ; +0x90, 0x1001b16e8\nCSEL            X1, X24, X23, EQ                                       ; +0x94, 0x1001b16ec\nMOV             X0, X22                                                ; +0x98, 0x1001b16f0\nBL              ButtonSprite__updateBGImage                            ; +0x9c, 0x1001b16f4\nADD             W20, W20, #1                                           ; +0xa0, 0x1001b16f8\nLDR             X0, [X19,#0x3E8]                                       ; +0xa4, 0x1001b16fc\nBL              sub_10024A36C                                          ; +0xa8, 0x1001b1700\nCMP             W20, W0                                                ; +0xac, 0x1001b1704\nB.CC            loc_1001B16B4                                          ; +0xb0, 0x1001b1708\nLDR             W20, [X19,#0x3F0]                                      ; +0xb4, 0x1001b170c\nLDR             X0, [X19,#0x3E0]                                       ; +0xb8, 0x1001b1710\nLDR             X8, [X0]                                               ; +0xbc, 0x1001b1714\nLDR             X8, [X8,#0x420]                                        ; +0xc0, 0x1001b1718\nBLR             X8                                                     ; +0xc4, 0x1001b171c\nCMN             W20, #1                                                ; +0xc8, 0x1001b1720\nMOV             W8, #0xFFFFFF                                          ; +0xcc, 0x1001b1724\nMOV             W9, #0xA6A6A6                                          ; +0xd0, 0x1001b1728\nCSEL            X1, X9, X8, EQ                                         ; +0xd8, 0x1001b1730\nBL              ButtonSprite__setColor                                 ; +0xdc, 0x1001b1734\nLDR             W8, [X19,#0x3F0]                                       ; +0xe0, 0x1001b1738\nCMP             W8, #2                                                 ; +0xe4, 0x1001b173c\nB.GE            loc_1001B174C                                          ; +0xe8, 0x1001b1740\nMOV             W9, #0                                                 ; +0xec, 0x1001b1744\nB               loc_1001B1794                                          ; +0xf0, 0x1001b1748\nB.EQ            loc_1001B1760                                          ; +0xf4, 0x1001b174c\nCMP             W8, #3                                                 ; +0xf8, 0x1001b1750\nB.NE            loc_1001B1768                                          ; +0xfc, 0x1001b1754\nMOV             W9, #2                                                 ; +0x100, 0x1001b1758\nB               loc_1001B1794                                          ; +0x104, 0x1001b175c\nMOV             W9, #1                                                 ; +0x108, 0x1001b1760\nB               loc_1001B1794                                          ; +0x10c, 0x1001b1764\nMOV             W9, #3                                                 ; +0x110, 0x1001b1768\nMOV             W10, #4                                                ; +0x114, 0x1001b176c\nMOV             W11, #5                                                ; +0x118, 0x1001b1770\nCMP             W8, #0xA                                               ; +0x11c, 0x1001b1774\nMOV             W12, #6                                                ; +0x120, 0x1001b1778\nCSEL            W12, W12, WZR, EQ                                      ; +0x124, 0x1001b177c\nCSEL            W11, W11, W12, CC                                      ; +0x128, 0x1001b1780\nCMP             W8, #8                                                 ; +0x12c, 0x1001b1784\nCSEL            W10, W10, W11, CC                                      ; +0x130, 0x1001b1788\nCMP             W8, #6                                                 ; +0x134, 0x1001b178c\nCSEL            W9, W9, W10, CC                                        ; +0x138, 0x1001b1790\nLDR             X0, [X19,#0x408]                                       ; +0x13c, 0x1001b1794\nCMP             W8, #1                                                 ; +0x140, 0x1001b1798\nCSINV           W1, W9, WZR, NE                                        ; +0x144, 0x1001b179c\nMOV             W2, #0                                                 ; +0x148, 0x1001b17a0\nLDP             X29, X30, [SP,#0x40+var_s0]                            ; +0x14c, 0x1001b17a4\nLDP             X20, X19, [SP,#0x40+var_10]                            ; +0x150, 0x1001b17a8\nLDP             X22, X21, [SP,#0x40+var_20]                            ; +0x154, 0x1001b17ac\nLDP             X24, X23, [SP,#0x40+var_30]                            ; +0x158, 0x1001b17b0\nLDP             X26, X25, [SP+0x40+var_40],#0x50                       ; +0x15c, 0x1001b17b4\nB               GJDifficultySprite__updateDifficultyFrame              ; +0x160, 0x1001b17b8", "xrefs": ["GJRateLevelLayer::init @ 0x1001b14ac", "GJRateLevelLayer::init @ 0x1001b0f0c"], "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"}