{"type": "func", "start": 4300236128, "end": 4300236457, "name": "GJRateLevelLayer::selectRating", "pseudocode": "// \n// GJRateLevelLayer::selectRating from 0x100506560 to 0x1005066a9 (329 bytes)\n// \n// 2 xrefs:\n// > GJRateLevelLayer::init @ 0x1005063b9\n// > GJRateLevelLayer::init @ 0x100505cfc\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 v2; // eax\n  unsigned int v3; // r14d\n  __int64 v4; // r15\n  ButtonSprite *v5; // r12\n  int m_stars; // r13d\n  const char *v7; // rsi\n  _BOOL8 v8; // r14\n  ButtonSprite *v9; // rax\n  unsigned int v10; // eax\n  int v11; // ecx\n  int v12; // esi\n\n  if ( a2 )\n    v2 = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);\n  else\n    v2 = -1;\n  a1->m_stars = v2;\n  if ( (unsigned int)sub_100720070(a1->m_starButtons) )\n  {\n    v3 = 0;\n    do\n    {\n      v4 = sub_1007200C0(a1->m_starButtons, v3);\n      v5 = (ButtonSprite *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 1056LL))(v4);\n      m_stars = a1->m_stars;\n      v7 = \"GJ_button_04.png\";\n      if ( m_stars == (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v4 + 64LL))(v4) )\n        v7 = \"GJ_button_01.png\";\n      ButtonSprite::updateBGImage(v5, v7);\n      ++v3;\n    }\n    while ( v3 < (unsigned int)sub_100720070(a1->m_starButtons) );\n  }\n  v8 = a1->m_stars != -1;\n  v9 = (ButtonSprite *)((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_submitButton->getNormalImage)(a1->m_submitButton);\n  ButtonSprite::setColor(v9, (cocos2d::ccColor3B)(v8 ? -1 : 0xFFA6A6A6));\n  v10 = a1->m_stars;\n  v11 = 0;\n  if ( (int)v10 >= 2 )\n  {\n    if ( v10 == 2 )\n    {\n      v11 = 1;\n    }\n    else if ( v10 == 3 )\n    {\n      v11 = 2;\n    }\n    else\n    {\n      v11 = 3;\n      if ( v10 >= 6 )\n      {\n        v11 = 4;\n        if ( v10 >= 8 )\n        {\n          v11 = 5;\n          if ( v10 >= 0xA )\n          {\n            v11 = 6;\n            if ( v10 != 10 )\n              v11 = 0;\n          }\n        }\n      }\n    }\n  }\n  v12 = -1;\n  if ( v10 != 1 )\n    v12 = v11;\n  GJDifficultySprite::updateDifficultyFrame(a1->m_difficultySprite, v12, Short);\n}", "assembly": "; \n; GJRateLevelLayer::selectRating from 0x100506560 to 0x1005066a9 (329 bytes)\n; \n; 2 xrefs:\n; > GJRateLevelLayer::init @ 0x1005063b9\n; > GJRateLevelLayer::init @ 0x100505cfc\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\npush    rbp                                                            ; +0x0, 0x100506560\nmov     rbp, rsp                                                       ; +0x1, 0x100506561\npush    r15                                                            ; +0x4, 0x100506564\npush    r14                                                            ; +0x6, 0x100506566\npush    r13                                                            ; +0x8, 0x100506568\npush    r12                                                            ; +0xa, 0x10050656a\npush    rbx                                                            ; +0xc, 0x10050656c\npush    rax                                                            ; +0xd, 0x10050656d\nmov     rbx, rdi                                                       ; +0xe, 0x10050656e\ntest    rsi, rsi                                                       ; +0x11, 0x100506571\njz      short loc_100506581                                            ; +0x14, 0x100506574\nmov     rax, [rsi]                                                     ; +0x16, 0x100506576\nmov     rdi, rsi                                                       ; +0x19, 0x100506579\ncall    qword ptr [rax+40h]                                            ; +0x1c, 0x10050657c\njmp     short loc_100506586                                            ; +0x1f, 0x10050657f\nmov     eax, 0FFFFFFFFh                                                ; +0x21, 0x100506581\nmov     [rbx+3F0h], eax                                                ; +0x26, 0x100506586\nmov     rdi, [rbx+3E8h]                                                ; +0x2c, 0x10050658c\ncall    sub_100720070                                                  ; +0x33, 0x100506593\ntest    eax, eax                                                       ; +0x38, 0x100506598\njz      short loc_100506602                                            ; +0x3a, 0x10050659a\nxor     r14d, r14d                                                     ; +0x3c, 0x10050659c\nnop                                                                    ; +0x3f, 0x10050659f\nmov     rdi, [rbx+3E8h]                                                ; +0x40, 0x1005065a0\nmov     esi, r14d                                                      ; +0x47, 0x1005065a7\ncall    sub_1007200C0                                                  ; +0x4a, 0x1005065aa\nmov     r15, rax                                                       ; +0x4f, 0x1005065af\nmov     rax, [rax]                                                     ; +0x52, 0x1005065b2\nmov     rdi, r15                                                       ; +0x55, 0x1005065b5\ncall    qword ptr [rax+420h]                                           ; +0x58, 0x1005065b8\nmov     r12, rax                                                       ; +0x5e, 0x1005065be\nmov     r13d, [rbx+3F0h]                                               ; +0x61, 0x1005065c1\nmov     rax, [r15]                                                     ; +0x68, 0x1005065c8\nmov     rdi, r15                                                       ; +0x6b, 0x1005065cb\ncall    qword ptr [rax+40h]                                            ; +0x6e, 0x1005065ce\ncmp     r13d, eax                                                      ; +0x71, 0x1005065d1\nlea     rsi, aGjButton04Png; \"GJ_button_04.png\"                        ; +0x74, 0x1005065d4\nlea     rax, aGjButton01Png; \"GJ_button_01.png\"                        ; +0x7b, 0x1005065db\ncmovz   rsi, rax                                                       ; +0x82, 0x1005065e2\nmov     rdi, r12                                                       ; +0x86, 0x1005065e6\ncall    ButtonSprite__updateBGImage                                    ; +0x89, 0x1005065e9\ninc     r14d                                                           ; +0x8e, 0x1005065ee\nmov     rdi, [rbx+3E8h]                                                ; +0x91, 0x1005065f1\ncall    sub_100720070                                                  ; +0x98, 0x1005065f8\ncmp     r14d, eax                                                      ; +0x9d, 0x1005065fd\njb      short loc_1005065A0                                            ; +0xa0, 0x100506600\nxor     r14d, r14d                                                     ; +0xa2, 0x100506602\ncmp     dword ptr [rbx+3F0h], 0FFFFFFFFh                               ; +0xa5, 0x100506605\nsetnz   r14b                                                           ; +0xac, 0x10050660c\nmov     rdi, [rbx+3E0h]                                                ; +0xb0, 0x100506610\nmov     rax, [rdi]                                                     ; +0xb7, 0x100506617\ncall    qword ptr [rax+420h]                                           ; +0xba, 0x10050661a\nneg     r14d                                                           ; +0xc0, 0x100506620\nor      r14d, 0FFA6A6A6h                                               ; +0xc3, 0x100506623\nmov     rdi, rax                                                       ; +0xca, 0x10050662a\nmov     esi, r14d                                                      ; +0xcd, 0x10050662d\ncall    ButtonSprite__setColor                                         ; +0xd0, 0x100506630\nmov     eax, [rbx+3F0h]                                                ; +0xd5, 0x100506635\nxor     ecx, ecx                                                       ; +0xdb, 0x10050663b\ncmp     eax, 2                                                         ; +0xdd, 0x10050663d\njl      short loc_100506682                                            ; +0xe0, 0x100506640\njz      short loc_100506650                                            ; +0xe2, 0x100506642\ncmp     eax, 3                                                         ; +0xe4, 0x100506644\njnz     short loc_100506657                                            ; +0xe7, 0x100506647\nmov     ecx, 2                                                         ; +0xe9, 0x100506649\njmp     short loc_100506682                                            ; +0xee, 0x10050664e\nmov     ecx, 1                                                         ; +0xf0, 0x100506650\njmp     short loc_100506682                                            ; +0xf5, 0x100506655\nmov     ecx, 3                                                         ; +0xf7, 0x100506657\ncmp     eax, 6                                                         ; +0xfc, 0x10050665c\njb      short loc_100506682                                            ; +0xff, 0x10050665f\nmov     ecx, 4                                                         ; +0x101, 0x100506661\ncmp     eax, 8                                                         ; +0x106, 0x100506666\njb      short loc_100506682                                            ; +0x109, 0x100506669\nmov     ecx, 5                                                         ; +0x10b, 0x10050666b\ncmp     eax, 0Ah                                                       ; +0x110, 0x100506670\njb      short loc_100506682                                            ; +0x113, 0x100506673\nxor     edx, edx                                                       ; +0x115, 0x100506675\ncmp     eax, 0Ah                                                       ; +0x117, 0x100506677\nmov     ecx, 6                                                         ; +0x11a, 0x10050667a\ncmovnz  ecx, edx                                                       ; +0x11f, 0x10050667f\ncmp     eax, 1                                                         ; +0x122, 0x100506682\nmov     esi, 0FFFFFFFFh                                                ; +0x125, 0x100506685\ncmovnz  esi, ecx                                                       ; +0x12a, 0x10050668a\nmov     rdi, [rbx+408h]                                                ; +0x12d, 0x10050668d\nxor     edx, edx                                                       ; +0x134, 0x100506694\nadd     rsp, 8                                                         ; +0x136, 0x100506696\npop     rbx                                                            ; +0x13a, 0x10050669a\npop     r12                                                            ; +0x13b, 0x10050669b\npop     r13                                                            ; +0x13d, 0x10050669d\npop     r14                                                            ; +0x13f, 0x10050669f\npop     r15                                                            ; +0x141, 0x1005066a1\npop     rbp                                                            ; +0x143, 0x1005066a3\njmp     GJDifficultySprite__updateDifficultyFrame                      ; +0x144, 0x1005066a4", "xrefs": ["GJRateLevelLayer::init @ 0x1005063b9", "GJRateLevelLayer::init @ 0x100505cfc"], "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"}