{"type": "func", "start": 5372299536, "end": 5372300140, "name": "GJEffectManager::playerButton", "pseudocode": "// \n// GJEffectManager::playerButton from 0x14036c910 to 0x14036cb6c (604 bytes)\n// \n// 2 xrefs:\n// > GJBaseGameLayer::handleButton @ 0x14033c7b6\n// > <???> @ 0x1409219ec\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:30:58 +0000\n// \n\n// Hidden C++ exception states: #wind=1\nunsigned __int64 __fastcall GJEffectManager::playerButton(__int64 a1, unsigned __int8 a2, char a3)\n{\n  int v6; // r12d\n  __int64 v7; // rsi\n  __int64 v8; // r9\n  unsigned __int64 result; // rax\n  __int64 v10; // r14\n  int v11; // eax\n  int v12; // r8d\n  int v13; // eax\n  __int64 v14; // r9\n  unsigned int v15; // ecx\n  int v16; // eax\n  unsigned __int8 v17; // bl\n  int v18; // ecx\n  int v19; // eax\n  int v20; // eax\n  int *v21; // rdx\n  char v22; // cl\n  int v23; // eax\n  char v24[16]; // [rsp+30h] [rbp-58h] BYREF\n  _QWORD v25[4]; // [rsp+40h] [rbp-48h] BYREF\n  int v26; // [rsp+90h] [rbp+8h] BYREF\n\n  v6 = 0;\n  v7 = *(_QWORD *)(a1 + 496);\n  v8 = *(_QWORD *)(a1 + 504) - v7;\n  result = (unsigned __int64)((unsigned __int128)(v8 * (__int128)0x4924924924924925LL) >> 64) >> 63;\n  if ( v8 / 56 )\n  {\n    v10 = 0;\n    do\n    {\n      if ( !*(_BYTE *)(v10 + v7) && (!*(_BYTE *)(v10 + v7 + 28) || !a3) )\n      {\n        v11 = *(_DWORD *)(v10 + v7 + 16);\n        if ( !v11 )\n          goto LABEL_12;\n        if ( v11 == 1 )\n        {\n          if ( a3 )\n            goto LABEL_12;\n        }\n        else if ( v11 == 2 && !a3 )\n        {\nLABEL_12:\n          if ( a2 || *(_BYTE *)(v10 + v7 + 8) )\n          {\n            v12 = *(_DWORD *)(v10 + v7 + 4);\n            v13 = v12;\n            if ( v12 < 0 )\n              v13 = 0;\n            if ( v13 > 9999 )\n              v13 = 9999;\n            v14 = *(_QWORD *)(a1 + 1280);\n            v15 = v13 & 0x1F;\n            v16 = *(_DWORD *)(v14 + 4 * ((unsigned __int64)v13 >> 5));\n            v17 = !_bittest(&v16, v15);\n            if ( *(_BYTE *)(v10 + v7 + 8) && (v18 = *(_DWORD *)(v10 + v7 + 12)) != 0 )\n            {\n              v17 = a2;\n              if ( v18 != 1 )\n                v17 = a2 ^ 1;\n            }\n            else\n            {\n              v19 = *(_DWORD *)(v10 + v7 + 12);\n              if ( v19 )\n                v17 = v19 == 1;\n            }\n            if ( *(_QWORD *)(a1 + 320) )\n            {\n              sub_14018CFB0(v25, v10 + v7 + 32);\n              (***(void (__fastcall ****)(_QWORD, _QWORD, _QWORD, _QWORD *, _DWORD, _DWORD))(a1 + 320))(\n                *(_QWORD *)(a1 + 320),\n                *(unsigned int *)(v10 + v7 + 4),\n                v17,\n                v25,\n                *(_DWORD *)(v10 + v7 + 20),\n                *(_DWORD *)(v10 + v7 + 24));\n              sub_140069730((__int64)v25);\n            }\n            else\n            {\n              v20 = *(_DWORD *)(v10 + v7 + 4);\n              if ( v12 < 0 )\n                v20 = 0;\n              if ( v20 <= 9999 )\n              {\n                if ( v12 < 0 )\n                  v12 = 0;\n              }\n              else\n              {\n                v12 = 9999;\n              }\n              v26 = v12;\n              v21 = (int *)(v14 + 4 * ((unsigned __int64)v12 >> 5));\n              v22 = v12 & 0x1F;\n              v23 = *v21;\n              if ( v17 )\n              {\n                *v21 = v23 | (1 << v22);\n                sub_140066A60((_QWORD *)(a1 + 1312), (unsigned __int8 *)&v26);\n              }\n              else\n              {\n                *v21 = v23 & ~(1 << v22);\n                sub_140068190(a1 + 1312, (__int64)v24, (unsigned __int8 *)&v26);\n              }\n            }\n          }\n        }\n      }\n      ++v6;\n      v10 += 56;\n      v7 = *(_QWORD *)(a1 + 496);\n      result = v6;\n    }\n    while ( v6 < (unsigned __int64)((*(_QWORD *)(a1 + 504) - v7) / 56) );\n  }\n  return result;\n}", "assembly": "; \n; GJEffectManager::playerButton from 0x14036c910 to 0x14036cb6c (604 bytes)\n; \n; 2 xrefs:\n; > GJBaseGameLayer::handleButton @ 0x14033c7b6\n; > <???> @ 0x1409219ec\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:30:58 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x14036c910\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x14036c915\nmov     [rsp+arg_18], rsi                                              ; +0xa, 0x14036c91a\npush    rdi                                                            ; +0xf, 0x14036c91f\npush    r12                                                            ; +0x10, 0x14036c920\npush    r13                                                            ; +0x12, 0x14036c922\npush    r14                                                            ; +0x14, 0x14036c924\npush    r15                                                            ; +0x16, 0x14036c926\nsub     rsp, 60h                                                       ; +0x18, 0x14036c928\nmovzx   ebp, r8b                                                       ; +0x1c, 0x14036c92c\nmovzx   r15d, dl                                                       ; +0x20, 0x14036c930\nmov     rdi, rcx                                                       ; +0x24, 0x14036c934\nxor     r10d, r10d                                                     ; +0x27, 0x14036c937\nmov     r12d, r10d                                                     ; +0x2a, 0x14036c93a\nmov     rsi, [rcx+1F0h]                                                ; +0x2d, 0x14036c93d\nmov     r9, [rcx+1F8h]                                                 ; +0x34, 0x14036c944\nsub     r9, rsi                                                        ; +0x3b, 0x14036c94b\nmov     rax, 4924924924924925h                                         ; +0x3e, 0x14036c94e\nimul    r9                                                             ; +0x48, 0x14036c958\nsar     rdx, 4                                                         ; +0x4b, 0x14036c95b\nmov     rax, rdx                                                       ; +0x4f, 0x14036c95f\nshr     rax, 3Fh                                                       ; +0x52, 0x14036c962\nadd     rdx, rax                                                       ; +0x56, 0x14036c966\njz      loc_14036CB4E                                                  ; +0x59, 0x14036c969\nmov     r14d, r10d                                                     ; +0x5f, 0x14036c96f\nmov     r13d, 270Fh                                                    ; +0x62, 0x14036c972\nnop     dword ptr [rax+rax+00000000h]                                  ; +0x68, 0x14036c978\ncmp     byte ptr [r14+rsi], 0                                          ; +0x70, 0x14036c980\njnz     loc_14036CB0F                                                  ; +0x75, 0x14036c985\ncmp     byte ptr [r14+rsi+1Ch], 0                                      ; +0x7b, 0x14036c98b\njz      short loc_14036C99C                                            ; +0x81, 0x14036c991\ntest    bpl, bpl                                                       ; +0x83, 0x14036c993\njnz     loc_14036CB0F                                                  ; +0x86, 0x14036c996\nmov     eax, [r14+rsi+10h]                                             ; +0x8c, 0x14036c99c\ntest    eax, eax                                                       ; +0x91, 0x14036c9a1\njz      short loc_14036C9C6                                            ; +0x93, 0x14036c9a3\ncmp     eax, 1                                                         ; +0x95, 0x14036c9a5\njnz     short loc_14036C9B4                                            ; +0x98, 0x14036c9a8\ntest    bpl, bpl                                                       ; +0x9a, 0x14036c9aa\njnz     short loc_14036C9C6                                            ; +0x9d, 0x14036c9ad\njmp     loc_14036CB0F                                                  ; +0x9f, 0x14036c9af\ncmp     eax, 2                                                         ; +0xa4, 0x14036c9b4\njnz     loc_14036CB0F                                                  ; +0xa7, 0x14036c9b7\ntest    bpl, bpl                                                       ; +0xad, 0x14036c9bd\njnz     loc_14036CB0F                                                  ; +0xb0, 0x14036c9c0\ntest    r15b, r15b                                                     ; +0xb6, 0x14036c9c6\njnz     short loc_14036C9D6                                            ; +0xb9, 0x14036c9c9\ncmp     [r14+rsi+8], r15b                                              ; +0xbb, 0x14036c9cb\njz      loc_14036CB0F                                                  ; +0xc0, 0x14036c9d0\nmov     r8d, [r14+rsi+4]                                               ; +0xc6, 0x14036c9d6\nmov     eax, r8d                                                       ; +0xcb, 0x14036c9db\ntest    r8d, r8d                                                       ; +0xce, 0x14036c9de\ncmovs   eax, r10d                                                      ; +0xd1, 0x14036c9e1\ncmp     eax, r13d                                                      ; +0xd5, 0x14036c9e5\ncmovg   eax, r13d                                                      ; +0xd8, 0x14036c9e8\nmov     r9, [rdi+500h]                                                 ; +0xdc, 0x14036c9ec\nmovsxd  rdx, eax                                                       ; +0xe3, 0x14036c9f3\nmovzx   eax, dl                                                        ; +0xe6, 0x14036c9f6\nand     al, 1Fh                                                        ; +0xe9, 0x14036c9f9\nmovzx   ecx, al                                                        ; +0xeb, 0x14036c9fb\nshr     rdx, 5                                                         ; +0xee, 0x14036c9fe\nmov     eax, [r9+rdx*4]                                                ; +0xf2, 0x14036ca02\nbt      eax, ecx                                                       ; +0xf6, 0x14036ca06\nsetnb   bl                                                             ; +0xf9, 0x14036ca09\ncmp     byte ptr [r14+rsi+8], 0                                        ; +0xfc, 0x14036ca0c\njz      short loc_14036CA31                                            ; +0x102, 0x14036ca12\nmov     ecx, [r14+rsi+0Ch]                                             ; +0x104, 0x14036ca14\ntest    ecx, ecx                                                       ; +0x109, 0x14036ca19\njz      short loc_14036CA31                                            ; +0x10b, 0x14036ca1b\nmovzx   eax, r15b                                                      ; +0x10d, 0x14036ca1d\nxor     al, 1                                                          ; +0x111, 0x14036ca21\nmov     ebx, r15d                                                      ; +0x113, 0x14036ca23\nmovzx   eax, al                                                        ; +0x116, 0x14036ca26\ncmp     ecx, 1                                                         ; +0x119, 0x14036ca29\ncmovnz  ebx, eax                                                       ; +0x11c, 0x14036ca2c\njmp     short loc_14036CA40                                            ; +0x11f, 0x14036ca2f\nmov     eax, [r14+rsi+0Ch]                                             ; +0x121, 0x14036ca31\ntest    eax, eax                                                       ; +0x126, 0x14036ca36\njz      short loc_14036CA40                                            ; +0x128, 0x14036ca38\ncmp     eax, 1                                                         ; +0x12a, 0x14036ca3a\nsetz    bl                                                             ; +0x12d, 0x14036ca3d\ncmp     qword ptr [rdi+140h], 0                                        ; +0x130, 0x14036ca40\njz      short loc_14036CA99                                            ; +0x138, 0x14036ca48\nlea     rdx, [rsi+20h]                                                 ; +0x13a, 0x14036ca4a\nadd     rdx, r14                                                       ; +0x13e, 0x14036ca4e\nlea     rcx, [rsp+88h+var_48]                                          ; +0x141, 0x14036ca51\ncall    sub_14018CFB0                                                  ; +0x146, 0x14036ca56\nnop                                                                    ; +0x14b, 0x14036ca5b\nmov     rcx, [rdi+140h]                                                ; +0x14c, 0x14036ca5c\nmov     rax, [rcx]                                                     ; +0x153, 0x14036ca63\nmov     r10, [rax]                                                     ; +0x156, 0x14036ca66\nmov     eax, [r14+rsi+18h]                                             ; +0x159, 0x14036ca69\nmov     [rsp+88h+var_60], eax                                          ; +0x15e, 0x14036ca6e\nmov     eax, [r14+rsi+14h]                                             ; +0x162, 0x14036ca72\nmov     [rsp+88h+var_68], eax                                          ; +0x167, 0x14036ca77\nlea     r9, [rsp+88h+var_48]                                           ; +0x16b, 0x14036ca7b\nmovzx   r8d, bl                                                        ; +0x170, 0x14036ca80\nmov     edx, [r14+rsi+4]                                               ; +0x174, 0x14036ca84\ncall    r10                                                            ; +0x179, 0x14036ca89\nnop                                                                    ; +0x17c, 0x14036ca8c\nlea     rcx, [rsp+88h+var_48]                                          ; +0x17d, 0x14036ca8d\ncall    sub_140069730                                                  ; +0x182, 0x14036ca92\njmp     short loc_14036CB0C                                            ; +0x187, 0x14036ca97\nmov     eax, r8d                                                       ; +0x189, 0x14036ca99\ntest    r8d, r8d                                                       ; +0x18c, 0x14036ca9c\ncmovs   eax, r10d                                                      ; +0x18f, 0x14036ca9f\ncmp     eax, r13d                                                      ; +0x193, 0x14036caa3\njle     short loc_14036CAAD                                            ; +0x196, 0x14036caa6\nmov     r8d, r13d                                                      ; +0x198, 0x14036caa8\njmp     short loc_14036CAB4                                            ; +0x19b, 0x14036caab\ntest    r8d, r8d                                                       ; +0x19d, 0x14036caad\ncmovs   r8d, r10d                                                      ; +0x1a0, 0x14036cab0\nmov     [rsp+88h+arg_0], r8d                                           ; +0x1a4, 0x14036cab4\nmovsxd  rcx, r8d                                                       ; +0x1ac, 0x14036cabc\nmov     rax, rcx                                                       ; +0x1af, 0x14036cabf\nshr     rax, 5                                                         ; +0x1b2, 0x14036cac2\nlea     rdx, [r9+rax*4]                                                ; +0x1b6, 0x14036cac6\nand     ecx, 1Fh                                                       ; +0x1ba, 0x14036caca\nmov     eax, [rdx]                                                     ; +0x1bd, 0x14036cacd\ntest    bl, bl                                                         ; +0x1bf, 0x14036cacf\njz      short loc_14036CAEE                                            ; +0x1c1, 0x14036cad1\nbts     eax, ecx                                                       ; +0x1c3, 0x14036cad3\nmov     [rdx], eax                                                     ; +0x1c6, 0x14036cad6\nlea     rcx, [rdi+520h]                                                ; +0x1c8, 0x14036cad8\nlea     rdx, [rsp+88h+arg_0]                                           ; +0x1cf, 0x14036cadf\ncall    sub_140066A60                                                  ; +0x1d7, 0x14036cae7\njmp     short loc_14036CB0C                                            ; +0x1dc, 0x14036caec\nbtr     eax, ecx                                                       ; +0x1de, 0x14036caee\nmov     [rdx], eax                                                     ; +0x1e1, 0x14036caf1\nlea     rcx, [rdi+520h]                                                ; +0x1e3, 0x14036caf3\nlea     r8, [rsp+88h+arg_0]                                            ; +0x1ea, 0x14036cafa\nlea     rdx, [rsp+88h+var_58]                                          ; +0x1f2, 0x14036cb02\ncall    sub_140068190                                                  ; +0x1f7, 0x14036cb07\nxor     r10d, r10d                                                     ; +0x1fc, 0x14036cb0c\ninc     r12d                                                           ; +0x1ff, 0x14036cb0f\nadd     r14, 38h ; '8'                                                 ; +0x202, 0x14036cb12\nmov     rsi, [rdi+1F0h]                                                ; +0x206, 0x14036cb16\nmov     rcx, [rdi+1F8h]                                                ; +0x20d, 0x14036cb1d\nsub     rcx, rsi                                                       ; +0x214, 0x14036cb24\nmov     rax, 4924924924924925h                                         ; +0x217, 0x14036cb27\nimul    rcx                                                            ; +0x221, 0x14036cb31\nsar     rdx, 4                                                         ; +0x224, 0x14036cb34\nmov     rax, rdx                                                       ; +0x228, 0x14036cb38\nshr     rax, 3Fh                                                       ; +0x22b, 0x14036cb3b\nadd     rdx, rax                                                       ; +0x22f, 0x14036cb3f\nmovsxd  rax, r12d                                                      ; +0x232, 0x14036cb42\ncmp     rax, rdx                                                       ; +0x235, 0x14036cb45\njb      loc_14036C980                                                  ; +0x238, 0x14036cb48\nlea     r11, [rsp+88h+var_28]                                          ; +0x23e, 0x14036cb4e\nmov     rbx, [r11+38h]                                                 ; +0x243, 0x14036cb53\nmov     rbp, [r11+40h]                                                 ; +0x247, 0x14036cb57\nmov     rsi, [r11+48h]                                                 ; +0x24b, 0x14036cb5b\nmov     rsp, r11                                                       ; +0x24f, 0x14036cb5f\npop     r15                                                            ; +0x252, 0x14036cb62\npop     r14                                                            ; +0x254, 0x14036cb64\npop     r13                                                            ; +0x256, 0x14036cb66\npop     r12                                                            ; +0x258, 0x14036cb68\npop     rdi                                                            ; +0x25a, 0x14036cb6a\nretn                                                                   ; +0x25b, 0x14036cb6b", "xrefs": ["GJBaseGameLayer::handleButton @ 0x14033c7b6", "<???> @ 0x1409219ec"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}