{"type": "func", "start": 5372624944, "end": 5372625610, "name": "GJSmartBlockPreview::addTemplateGuide", "pseudocode": "// \n// GJSmartBlockPreview::addTemplateGuide from 0x1403bc030 to 0x1403bc2ca (666 bytes)\n// \n// 4 xrefs:\n// > BrowseSmartKeyLayer::init @ 0x1405f1343\n// > BrowseSmartKeyLayer::init @ 0x1405f1410\n// > <???> @ 0x140923e1c\n// > <???> @ 0x140923e28\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:31:26 +0000\n// \n\n// Hidden C++ exception states: #wind=4\nvoid __fastcall GJSmartBlockPreview::addTemplateGuide(__int64 a1, __int128 *a2, int a3)\n{\n  __int64 v4; // r14\n  unsigned int v6; // edi\n  void *v7; // rdx\n  cocos2d::CCArray *v8; // rax\n  cocos2d::CCArray *v9; // rsi\n  struct cocos2d::CCObject *v10; // rbx\n  int v11; // eax\n  __int64 v12; // rdx\n  struct cocos2d::CCObject *v13; // rbx\n  int v14; // eax\n  int v15; // eax\n  __int64 v16; // rdx\n  __int64 v17; // [rsp+28h] [rbp-91h] BYREF\n  _BYTE v18[32]; // [rsp+30h] [rbp-89h] BYREF\n  _BYTE v19[32]; // [rsp+50h] [rbp-69h] BYREF\n  int v20; // [rsp+70h] [rbp-49h]\n  char v21; // [rsp+74h] [rbp-45h]\n  int v22; // [rsp+78h] [rbp-41h]\n  __int16 v23; // [rsp+7Ch] [rbp-3Dh]\n  char v24; // [rsp+7Eh] [rbp-3Bh]\n  __int128 *v25; // [rsp+80h] [rbp-39h]\n  __int64 v26; // [rsp+90h] [rbp-29h]\n  __int128 v27; // [rsp+98h] [rbp-21h] BYREF\n  __int64 v28; // [rsp+A8h] [rbp-11h]\n  __int64 v29; // [rsp+B0h] [rbp-9h]\n  __int128 v30; // [rsp+B8h] [rbp-1h] BYREF\n  __int64 v31; // [rsp+C8h] [rbp+Fh]\n  __int64 v32; // [rsp+D0h] [rbp+17h]\n  int v33; // [rsp+D8h] [rbp+1Fh]\n  char v34; // [rsp+DCh] [rbp+23h]\n  int v35; // [rsp+E0h] [rbp+27h]\n  __int16 v36; // [rsp+E4h] [rbp+2Bh]\n  char v37; // [rsp+E6h] [rbp+2Dh]\n\n  v4 = (__int64)a2;\n  v25 = a2;\n  v6 = 0;\n  v26 = 0;\n  v27 = 0;\n  v28 = 0;\n  v29 = 15;\n  LOBYTE(v27) = 0;\n  v30 = 0;\n  v31 = 0;\n  v32 = 15;\n  LOBYTE(v30) = 0;\n  v33 = 0;\n  v34 = 0;\n  v35 = 0;\n  v36 = 0;\n  v37 = 0;\n  if ( &v27 != a2 )\n  {\n    if ( *((_QWORD *)a2 + 3) > 0xFu )\n      a2 = *(__int128 **)a2;\n    sub_1400405A0((void **)&v27, a2, *(_QWORD *)(v4 + 16));\n  }\n  if ( &v30 != (__int128 *)v4 )\n  {\n    v7 = (void *)v4;\n    if ( *(_QWORD *)(v4 + 24) > 0xFu )\n      v7 = *(void **)v4;\n    sub_1400405A0((void **)&v30, v7, *(_QWORD *)(v4 + 16));\n  }\n  v17 = v26;\n  sub_14003F4F0((__int64)v18, (__int64)&v27);\n  sub_14003F4F0((__int64)v19, (__int64)&v30);\n  v20 = v33;\n  v21 = v34;\n  v22 = v35;\n  v23 = v36;\n  v24 = v37;\n  v8 = (cocos2d::CCArray *)GJSmartBlockPreview::addTemplateGuide_1(a1, &v17);\n  v9 = v8;\n  if ( a3 != 1 )\n  {\n    if ( a3 != 2 || !cocos2d::CCArray::count(v8) )\n      goto LABEL_26;\n    while ( 1 )\n    {\n      v13 = cocos2d::CCArray::objectAtIndex(v9, v6);\n      v14 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v13 + 56LL))(v13);\n      if ( !v14 )\n      {\n        (**((void (__fastcall ***)(__int64, __int16 *))v13 + 40))((__int64)v13 + 320, &word_1407034C0);\n        LOBYTE(v16) = -1;\n        goto LABEL_24;\n      }\n      v15 = v14 - 1;\n      if ( !v15 )\n        break;\n      if ( v15 == 1 )\n      {\n        (**((void (__fastcall ***)(__int64, void *))v13 + 40))((__int64)v13 + 320, &unk_1407034BC);\n        LOBYTE(v16) = 100;\nLABEL_24:\n        (*(void (__fastcall **)(__int64, __int64))(*((_QWORD *)v13 + 40) + 40LL))((__int64)v13 + 320, v16);\n      }\n      if ( ++v6 >= cocos2d::CCArray::count(v9) )\n        goto LABEL_26;\n    }\n    (**((void (__fastcall ***)(__int64, __int16 *))v13 + 40))((__int64)v13 + 320, &word_1407034C0);\n    LOBYTE(v16) = -56;\n    goto LABEL_24;\n  }\n  if ( cocos2d::CCArray::count(v8) )\n  {\n    do\n    {\n      v10 = cocos2d::CCArray::objectAtIndex(v9, v6);\n      v11 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v10 + 56LL))(v10);\n      if ( !v11 || (unsigned int)(v11 - 1) <= 1 )\n      {\n        LOBYTE(v12) = 50;\n        (*(void (__fastcall **)(__int64, __int64))(*((_QWORD *)v10 + 40) + 40LL))((__int64)v10 + 320, v12);\n      }\n      (**((void (__fastcall ***)(__int64, void *))v10 + 40))((__int64)v10 + 320, &unk_1407034BC);\n      ++v6;\n    }\n    while ( v6 < cocos2d::CCArray::count(v9) );\n  }\nLABEL_26:\n  sub_14003D310((__int64)&v30);\n  sub_14003D310((__int64)&v27);\n  sub_14003D310(v4);\n}", "assembly": "; \n; GJSmartBlockPreview::addTemplateGuide from 0x1403bc030 to 0x1403bc2ca (666 bytes)\n; \n; 4 xrefs:\n; > BrowseSmartKeyLayer::init @ 0x1405f1343\n; > BrowseSmartKeyLayer::init @ 0x1405f1410\n; > <???> @ 0x140923e1c\n; > <???> @ 0x140923e28\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:31:26 +0000\n; \nmov     [rsp-8+arg_10], rbx                                            ; +0x0, 0x1403bc030\nmov     [rsp-8+arg_18], rsi                                            ; +0x5, 0x1403bc035\npush    rbp                                                            ; +0xa, 0x1403bc03a\npush    rdi                                                            ; +0xb, 0x1403bc03b\npush    r14                                                            ; +0xc, 0x1403bc03c\nlea     rbp, [rsp-47h]                                                 ; +0xe, 0x1403bc03e\nsub     rsp, 100h                                                      ; +0x13, 0x1403bc043\nmov     rax, cs:__security_cookie                                      ; +0x1a, 0x1403bc04a\nxor     rax, rsp                                                       ; +0x21, 0x1403bc051\nmov     [rbp+57h+var_20], rax                                          ; +0x24, 0x1403bc054\nmov     ebx, r8d                                                       ; +0x28, 0x1403bc058\nmov     r14, rdx                                                       ; +0x2b, 0x1403bc05b\nmov     rsi, rcx                                                       ; +0x2e, 0x1403bc05e\nmov     [rbp+57h+var_90], rdx                                          ; +0x31, 0x1403bc061\nxor     edi, edi                                                       ; +0x35, 0x1403bc065\nmov     [rbp+57h+var_80], rdi                                          ; +0x37, 0x1403bc067\nxorps   xmm0, xmm0                                                     ; +0x3b, 0x1403bc06b\nmovups  [rbp+57h+var_78], xmm0                                         ; +0x3e, 0x1403bc06e\nmov     [rbp+57h+var_68], rdi                                          ; +0x42, 0x1403bc072\nmov     [rbp+57h+var_60], 0Fh                                          ; +0x46, 0x1403bc076\nmov     byte ptr [rbp+57h+var_78], dil                                 ; +0x4e, 0x1403bc07e\nmovups  [rbp+57h+var_58], xmm0                                         ; +0x52, 0x1403bc082\nmov     [rbp+57h+var_48], rdi                                          ; +0x56, 0x1403bc086\nmov     [rbp+57h+var_40], 0Fh                                          ; +0x5a, 0x1403bc08a\nmov     byte ptr [rbp+57h+var_58], dil                                 ; +0x62, 0x1403bc092\nmov     [rbp+57h+var_38], edi                                          ; +0x66, 0x1403bc096\nmov     [rbp+57h+var_34], dil                                          ; +0x69, 0x1403bc099\nmov     [rbp+57h+var_30], edi                                          ; +0x6d, 0x1403bc09d\nmov     [rbp+57h+var_2C], di                                           ; +0x70, 0x1403bc0a0\nmov     [rbp+57h+var_2A], dil                                          ; +0x74, 0x1403bc0a4\nlea     rax, [rbp+57h+var_78]                                          ; +0x78, 0x1403bc0a8\ncmp     rax, rdx                                                       ; +0x7c, 0x1403bc0ac\njz      short loc_1403BC0C8                                            ; +0x7f, 0x1403bc0af\ncmp     qword ptr [rdx+18h], 0Fh                                       ; +0x81, 0x1403bc0b1\njbe     short loc_1403BC0BB                                            ; +0x86, 0x1403bc0b6\nmov     rdx, [rdx]; Src                                                ; +0x88, 0x1403bc0b8\nmov     r8, [r14+10h]; Size                                            ; +0x8b, 0x1403bc0bb\nlea     rcx, [rbp+57h+var_78]; void *                                  ; +0x8f, 0x1403bc0bf\ncall    sub_1400405A0                                                  ; +0x93, 0x1403bc0c3\nlea     rax, [rbp+57h+var_58]                                          ; +0x98, 0x1403bc0c8\ncmp     rax, r14                                                       ; +0x9c, 0x1403bc0cc\njz      short loc_1403BC0EB                                            ; +0x9f, 0x1403bc0cf\nmov     rdx, r14                                                       ; +0xa1, 0x1403bc0d1\ncmp     qword ptr [r14+18h], 0Fh                                       ; +0xa4, 0x1403bc0d4\njbe     short loc_1403BC0DE                                            ; +0xa9, 0x1403bc0d9\nmov     rdx, [r14]; Src                                                ; +0xab, 0x1403bc0db\nmov     r8, [r14+10h]; Size                                            ; +0xae, 0x1403bc0de\nlea     rcx, [rbp+57h+var_58]; void *                                  ; +0xb2, 0x1403bc0e2\ncall    sub_1400405A0                                                  ; +0xb6, 0x1403bc0e6\nlea     rax, [rsp+110h+var_E8]                                         ; +0xbb, 0x1403bc0eb\nmov     [rsp+110h+var_F0], rax                                         ; +0xc0, 0x1403bc0f0\nmov     rax, [rbp+57h+var_80]                                          ; +0xc5, 0x1403bc0f5\nmov     [rsp+110h+var_E8], rax                                         ; +0xc9, 0x1403bc0f9\nlea     rdx, [rbp+57h+var_78]                                          ; +0xce, 0x1403bc0fe\nlea     rcx, [rsp+110h+var_E0]                                         ; +0xd2, 0x1403bc102\ncall    sub_14003F4F0                                                  ; +0xd7, 0x1403bc107\nnop                                                                    ; +0xdc, 0x1403bc10c\nlea     rdx, [rbp+57h+var_58]                                          ; +0xdd, 0x1403bc10d\nlea     rcx, [rbp+57h+var_C0]                                          ; +0xe1, 0x1403bc111\ncall    sub_14003F4F0                                                  ; +0xe5, 0x1403bc115\nmov     eax, [rbp+57h+var_38]                                          ; +0xea, 0x1403bc11a\nmov     [rbp+57h+var_A0], eax                                          ; +0xed, 0x1403bc11d\nmovzx   eax, [rbp+57h+var_34]                                          ; +0xf0, 0x1403bc120\nmov     [rbp+57h+var_9C], al                                           ; +0xf4, 0x1403bc124\nmov     eax, [rbp+57h+var_30]                                          ; +0xf7, 0x1403bc127\nmov     [rbp+57h+var_98], eax                                          ; +0xfa, 0x1403bc12a\nmovzx   eax, byte ptr [rbp+57h+var_2C]                                 ; +0xfd, 0x1403bc12d\nmov     byte ptr [rbp+57h+var_94], al                                  ; +0x101, 0x1403bc131\nmovzx   eax, byte ptr [rbp+57h+var_2C+1]                               ; +0x104, 0x1403bc134\nmov     byte ptr [rbp+57h+var_94+1], al                                ; +0x108, 0x1403bc138\nmovzx   eax, [rbp+57h+var_2A]                                          ; +0x10b, 0x1403bc13b\nmov     [rbp+57h+var_92], al                                           ; +0x10f, 0x1403bc13f\nmovss   xmm2, cs:flt_140835080                                         ; +0x112, 0x1403bc142\nlea     rdx, [rsp+110h+var_E8]                                         ; +0x11a, 0x1403bc14a\nmov     rcx, rsi                                                       ; +0x11f, 0x1403bc14f\ncall    GJSmartBlockPreview__addTemplateGuide_1                        ; +0x122, 0x1403bc152\nmov     rsi, rax                                                       ; +0x127, 0x1403bc157\ncmp     ebx, 1                                                         ; +0x12a, 0x1403bc15a\njnz     short loc_1403BC1CE                                            ; +0x12d, 0x1403bc15d\nmov     rcx, rax                                                       ; +0x12f, 0x1403bc15f\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x132, 0x1403bc162\ntest    eax, eax                                                       ; +0x138, 0x1403bc168\njz      loc_1403BC28B                                                  ; +0x13a, 0x1403bc16a\nmov     edx, edi                                                       ; +0x140, 0x1403bc170\nmov     rcx, rsi                                                       ; +0x142, 0x1403bc172\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x145, 0x1403bc175\nmov     rbx, rax                                                       ; +0x14b, 0x1403bc17b\nmov     rcx, [rax]                                                     ; +0x14e, 0x1403bc17e\nmov     rdx, [rcx+38h]                                                 ; +0x151, 0x1403bc181\nmov     rcx, rax                                                       ; +0x155, 0x1403bc185\ncall    rdx                                                            ; +0x158, 0x1403bc188\ntest    eax, eax                                                       ; +0x15a, 0x1403bc18a\njz      short loc_1403BC198                                            ; +0x15c, 0x1403bc18c\nsub     eax, 1                                                         ; +0x15e, 0x1403bc18e\njz      short loc_1403BC198                                            ; +0x161, 0x1403bc191\ncmp     eax, 1                                                         ; +0x163, 0x1403bc193\njnz     short loc_1403BC1A7                                            ; +0x166, 0x1403bc196\nlea     rcx, [rbx+140h]                                                ; +0x168, 0x1403bc198\nmov     rax, [rcx]                                                     ; +0x16f, 0x1403bc19f\nmov     dl, 32h ; '2'                                                  ; +0x172, 0x1403bc1a2\ncall    qword ptr [rax+28h]                                            ; +0x174, 0x1403bc1a4\nlea     rcx, [rbx+140h]                                                ; +0x177, 0x1403bc1a7\nmov     rax, [rcx]                                                     ; +0x17e, 0x1403bc1ae\nlea     rdx, unk_1407034BC                                             ; +0x181, 0x1403bc1b1\ncall    qword ptr [rax]                                                ; +0x188, 0x1403bc1b8\ninc     edi                                                            ; +0x18a, 0x1403bc1ba\nmov     rcx, rsi                                                       ; +0x18c, 0x1403bc1bc\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x18f, 0x1403bc1bf\ncmp     edi, eax                                                       ; +0x195, 0x1403bc1c5\njb      short loc_1403BC170                                            ; +0x197, 0x1403bc1c7\njmp     loc_1403BC28B                                                  ; +0x199, 0x1403bc1c9\ncmp     ebx, 2                                                         ; +0x19e, 0x1403bc1ce\njnz     loc_1403BC28B                                                  ; +0x1a1, 0x1403bc1d1\nmov     rcx, rsi                                                       ; +0x1a7, 0x1403bc1d7\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x1aa, 0x1403bc1da\ntest    eax, eax                                                       ; +0x1b0, 0x1403bc1e0\njz      loc_1403BC28B                                                  ; +0x1b2, 0x1403bc1e2\nnop     dword ptr [rax+rax+00000000h]                                  ; +0x1b8, 0x1403bc1e8\nmov     edx, edi                                                       ; +0x1c0, 0x1403bc1f0\nmov     rcx, rsi                                                       ; +0x1c2, 0x1403bc1f2\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x1c5, 0x1403bc1f5\nmov     rbx, rax                                                       ; +0x1cb, 0x1403bc1fb\nmov     rcx, [rax]                                                     ; +0x1ce, 0x1403bc1fe\nmov     rdx, [rcx+38h]                                                 ; +0x1d1, 0x1403bc201\nmov     rcx, rax                                                       ; +0x1d5, 0x1403bc205\ncall    rdx                                                            ; +0x1d8, 0x1403bc208\ntest    eax, eax                                                       ; +0x1da, 0x1403bc20a\njz      short loc_1403BC24E                                            ; +0x1dc, 0x1403bc20c\nsub     eax, 1                                                         ; +0x1de, 0x1403bc20e\njz      short loc_1403BC233                                            ; +0x1e1, 0x1403bc211\ncmp     eax, 1                                                         ; +0x1e3, 0x1403bc213\njnz     short loc_1403BC278                                            ; +0x1e6, 0x1403bc216\nmov     rax, [rbx+140h]                                                ; +0x1e8, 0x1403bc218\nlea     rdx, unk_1407034BC                                             ; +0x1ef, 0x1403bc21f\nlea     rcx, [rbx+140h]                                                ; +0x1f6, 0x1403bc226\ncall    qword ptr [rax]                                                ; +0x1fd, 0x1403bc22d\nmov     dl, 64h ; 'd'                                                  ; +0x1ff, 0x1403bc22f\njmp     short loc_1403BC267                                            ; +0x201, 0x1403bc231\nmov     rax, [rbx+140h]                                                ; +0x203, 0x1403bc233\nlea     rdx, word_1407034C0                                            ; +0x20a, 0x1403bc23a\nlea     rcx, [rbx+140h]                                                ; +0x211, 0x1403bc241\ncall    qword ptr [rax]                                                ; +0x218, 0x1403bc248\nmov     dl, 0C8h                                                       ; +0x21a, 0x1403bc24a\njmp     short loc_1403BC267                                            ; +0x21c, 0x1403bc24c\nmov     rax, [rbx+140h]                                                ; +0x21e, 0x1403bc24e\nlea     rdx, word_1407034C0                                            ; +0x225, 0x1403bc255\nlea     rcx, [rbx+140h]                                                ; +0x22c, 0x1403bc25c\ncall    qword ptr [rax]                                                ; +0x233, 0x1403bc263\nmov     dl, 0FFh                                                       ; +0x235, 0x1403bc265\nmov     rax, [rbx+140h]                                                ; +0x237, 0x1403bc267\nlea     rcx, [rbx+140h]                                                ; +0x23e, 0x1403bc26e\ncall    qword ptr [rax+28h]                                            ; +0x245, 0x1403bc275\ninc     edi                                                            ; +0x248, 0x1403bc278\nmov     rcx, rsi                                                       ; +0x24a, 0x1403bc27a\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x24d, 0x1403bc27d\ncmp     edi, eax                                                       ; +0x253, 0x1403bc283\njb      loc_1403BC1F0                                                  ; +0x255, 0x1403bc285\nlea     rcx, [rbp+57h+var_58]                                          ; +0x25b, 0x1403bc28b\ncall    sub_14003D310                                                  ; +0x25f, 0x1403bc28f\nlea     rcx, [rbp+57h+var_78]                                          ; +0x264, 0x1403bc294\ncall    sub_14003D310                                                  ; +0x268, 0x1403bc298\nnop                                                                    ; +0x26d, 0x1403bc29d\nmov     rcx, r14                                                       ; +0x26e, 0x1403bc29e\ncall    sub_14003D310                                                  ; +0x271, 0x1403bc2a1\nmov     rcx, [rbp+57h+var_20]                                          ; +0x276, 0x1403bc2a6\nxor     rcx, rsp; StackCookie                                          ; +0x27a, 0x1403bc2aa\ncall    __security_check_cookie                                        ; +0x27d, 0x1403bc2ad\nlea     r11, [rsp+110h+var_10]                                         ; +0x282, 0x1403bc2b2\nmov     rbx, [r11+30h]                                                 ; +0x28a, 0x1403bc2ba\nmov     rsi, [r11+38h]                                                 ; +0x28e, 0x1403bc2be\nmov     rsp, r11                                                       ; +0x292, 0x1403bc2c2\npop     r14                                                            ; +0x295, 0x1403bc2c5\npop     rdi                                                            ; +0x297, 0x1403bc2c7\npop     rbp                                                            ; +0x298, 0x1403bc2c8\nretn                                                                   ; +0x299, 0x1403bc2c9", "xrefs": ["BrowseSmartKeyLayer::init @ 0x1405f1343", "BrowseSmartKeyLayer::init @ 0x1405f1410", "<???> @ 0x140923e1c", "<???> @ 0x140923e28"], "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"}