{"type": "func", "start": 6442539072, "end": 6442539377, "name": "cocos2d::extension::CCTableView::_addCellIfNecessary", "pseudocode": "// \n// cocos2d::extension::CCTableView::_addCellIfNecessary from 0x180015840 to 0x180015971 (305 bytes)\n// \n// 4 xrefs:\n// > cocos2d::extension::CCTableView::updateCellAtIndex @ 0x18001536d\n// > cocos2d::extension::CCTableView::insertCellAtIndex @ 0x18001552f\n// > <???> @ 0x18002fdf8\n// > <???> @ 0x18004a830\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// Hidden C++ exception states: #wind=1\nvoid __fastcall cocos2d::extension::CCTableView::_addCellIfNecessary(\n        cocos2d::extension::CCTableView *this,\n        struct cocos2d::extension::CCTableViewCell *a2)\n{\n  __int64 v4; // rbx\n  struct cocos2d::extension::CCSortableObject *v5; // rdx\n  unsigned int v6; // ebx\n  _QWORD *v7; // rdi\n  __int64 *v8; // rsi\n  __int64 *v9; // rax\n  __int64 *v10; // rcx\n  _DWORD *v11; // rax\n  __int128 v12; // [rsp+20h] [rbp-38h] BYREF\n  __int128 v13; // [rsp+30h] [rbp-28h]\n\n  v4 = *((_QWORD *)this + 56);\n  if ( (*(__int64 (__fastcall **)(struct cocos2d::extension::CCTableViewCell *))(*(_QWORD *)a2 + 488LL))(a2) != v4 )\n    (*(void (__fastcall **)(_QWORD, struct cocos2d::extension::CCTableViewCell *))(**((_QWORD **)this + 56) + 448LL))(\n      *((_QWORD *)this + 56),\n      a2);\n  v5 = (struct cocos2d::extension::CCTableViewCell *)((char *)a2 + 320);\n  if ( !a2 )\n    v5 = nullptr;\n  cocos2d::extension::CCArrayForObjectSorting::insertSortedObject(\n    *((cocos2d::extension::CCArrayForObjectSorting **)this + 78),\n    v5);\n  v6 = *((_DWORD *)a2 + 82);\n  v7 = *((_QWORD **)this + 74);\n  v8 = (__int64 *)*v7;\n  v9 = *(__int64 **)(*v7 + 8LL);\n  *(_QWORD *)&v13 = v9;\n  DWORD2(v13) = 0;\n  v10 = v8;\n  while ( !*((_BYTE *)v9 + 25) )\n  {\n    *(_QWORD *)&v13 = v9;\n    if ( *((_DWORD *)v9 + 7) >= v6 )\n    {\n      DWORD2(v13) = 1;\n      v10 = v9;\n      v9 = (__int64 *)*v9;\n    }\n    else\n    {\n      DWORD2(v13) = 0;\n      v9 = (__int64 *)v9[2];\n    }\n  }\n  if ( *((_BYTE *)v10 + 25) || v6 < *((_DWORD *)v10 + 7) )\n  {\n    if ( v7[1] == 0x7FFFFFFFFFFFFFFLL )\n      sub_1800054D0();\n    v11 = operator new(0x20u);\n    v11[7] = v6;\n    *(_QWORD *)v11 = v8;\n    *((_QWORD *)v11 + 1) = v8;\n    *((_QWORD *)v11 + 2) = v8;\n    *((_WORD *)v11 + 12) = 0;\n    v12 = v13;\n    sub_180004DA0(v7, (__int64)&v12, (__int64)v11);\n  }\n}", "assembly": "; \n; cocos2d::extension::CCTableView::_addCellIfNecessary from 0x180015840 to 0x180015971 (305 bytes)\n; \n; 4 xrefs:\n; > cocos2d::extension::CCTableView::updateCellAtIndex @ 0x18001536d\n; > cocos2d::extension::CCTableView::insertCellAtIndex @ 0x18001552f\n; > <???> @ 0x18002fdf8\n; > <???> @ 0x18004a830\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\nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x180015840\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x180015845\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x18001584a\npush    rdi                                                            ; +0xf, 0x18001584f\nsub     rsp, 50h                                                       ; +0x10, 0x180015850\nmov     rdi, rdx                                                       ; +0x14, 0x180015854\nmov     rsi, rcx                                                       ; +0x17, 0x180015857\nmov     rbx, [rcx+1C0h]                                                ; +0x1a, 0x18001585a\nmov     rax, [rdx]                                                     ; +0x21, 0x180015861\nmov     rcx, rdx                                                       ; +0x24, 0x180015864\ncall    qword ptr [rax+1E8h]                                           ; +0x27, 0x180015867\ncmp     rax, rbx                                                       ; +0x2d, 0x18001586d\njz      short loc_180015885                                            ; +0x30, 0x180015870\nmov     rcx, [rsi+1C0h]                                                ; +0x32, 0x180015872\nmov     rax, [rcx]                                                     ; +0x39, 0x180015879\nmov     rdx, rdi                                                       ; +0x3c, 0x18001587c\ncall    qword ptr [rax+1C0h]                                           ; +0x3f, 0x18001587f\nlea     rdx, [rdi+140h]                                                ; +0x45, 0x180015885\nxor     ebp, ebp                                                       ; +0x4c, 0x18001588c\ntest    rdi, rdi                                                       ; +0x4e, 0x18001588e\ncmovz   rdx, rbp; struct cocos2d::extension::CCSortableObject *        ; +0x51, 0x180015891\nmov     rcx, [rsi+270h]; this                                          ; +0x55, 0x180015895\ncall    ?insertSortedObject@CCArrayForObjectSorting@extension@cocos2d@@QEAAXPEAVCCSortableObject@23@@Z; cocos2d::extension::CCArrayForObjectSorting::insertSortedObject(cocos2d::extension::CCSortableObject *) ; +0x5c, 0x18001589c\nmov     ebx, [rdi+148h]                                                ; +0x61, 0x1800158a1\nmov     rdi, [rsi+250h]                                                ; +0x67, 0x1800158a7\nmov     rsi, [rdi]                                                     ; +0x6e, 0x1800158ae\nmov     rax, [rsi+8]                                                   ; +0x71, 0x1800158b1\nmov     qword ptr [rsp+58h+var_28], rax                                ; +0x75, 0x1800158b5\nmov     dword ptr [rsp+58h+var_28+8], ebp                              ; +0x7a, 0x1800158ba\nmov     rcx, rsi                                                       ; +0x7e, 0x1800158be\ncmp     [rax+19h], bpl                                                 ; +0x81, 0x1800158c1\njnz     short loc_1800158F8                                            ; +0x85, 0x1800158c5\nnop     word ptr [rax+rax+00000000h]                                   ; +0x87, 0x1800158c7\nmov     qword ptr [rsp+58h+var_28], rax                                ; +0x90, 0x1800158d0\ncmp     [rax+1Ch], ebx                                                 ; +0x95, 0x1800158d5\njnb     short loc_1800158E4                                            ; +0x98, 0x1800158d8\nmov     dword ptr [rsp+58h+var_28+8], ebp                              ; +0x9a, 0x1800158da\nmov     rax, [rax+10h]                                                 ; +0x9e, 0x1800158de\njmp     short loc_1800158F2                                            ; +0xa2, 0x1800158e2\nmov     dword ptr [rsp+58h+var_28+8], 1                                ; +0xa4, 0x1800158e4\nmov     rcx, rax                                                       ; +0xac, 0x1800158ec\nmov     rax, [rax]                                                     ; +0xaf, 0x1800158ef\ncmp     [rax+19h], bpl                                                 ; +0xb2, 0x1800158f2\njz      short loc_1800158D0                                            ; +0xb6, 0x1800158f6\ncmp     [rcx+19h], bpl                                                 ; +0xb8, 0x1800158f8\njnz     short loc_180015903                                            ; +0xbc, 0x1800158fc\ncmp     ebx, [rcx+1Ch]                                                 ; +0xbe, 0x1800158fe\njnb     short loc_180015956                                            ; +0xc1, 0x180015901\nmov     rax, 7FFFFFFFFFFFFFFh                                          ; +0xc3, 0x180015903\ncmp     [rdi+8], rax                                                   ; +0xcd, 0x18001590d\njz      short loc_18001596B                                            ; +0xd1, 0x180015911\nmov     qword ptr [rsp+58h+var_38], rdi                                ; +0xd3, 0x180015913\nmov     qword ptr [rsp+58h+var_38+8], rbp                              ; +0xd8, 0x180015918\nmov     ecx, 20h ; ' '; Size                                           ; +0xdd, 0x18001591d\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xe2, 0x180015922\nnop                                                                    ; +0xe7, 0x180015927\nmov     [rax+1Ch], ebx                                                 ; +0xe8, 0x180015928\nmov     [rax], rsi                                                     ; +0xeb, 0x18001592b\nmov     [rax+8], rsi                                                   ; +0xee, 0x18001592e\nmov     [rax+10h], rsi                                                 ; +0xf2, 0x180015932\nmov     word ptr [rax+18h], 0                                          ; +0xf6, 0x180015936\nmovups  xmm0, [rsp+58h+var_28]                                         ; +0xfc, 0x18001593c\nmovaps  [rsp+58h+var_38], xmm0                                         ; +0x101, 0x180015941\nmov     r8, rax                                                        ; +0x106, 0x180015946\nlea     rdx, [rsp+58h+var_38]                                          ; +0x109, 0x180015949\nmov     rcx, rdi                                                       ; +0x10e, 0x18001594e\ncall    sub_180004DA0                                                  ; +0x111, 0x180015951\nmov     rbx, [rsp+58h+arg_0]                                           ; +0x116, 0x180015956\nmov     rbp, [rsp+58h+arg_8]                                           ; +0x11b, 0x18001595b\nmov     rsi, [rsp+58h+arg_10]                                          ; +0x120, 0x180015960\nadd     rsp, 50h                                                       ; +0x125, 0x180015965\npop     rdi                                                            ; +0x129, 0x180015969\nretn                                                                   ; +0x12a, 0x18001596a\ncall    sub_1800054D0                                                  ; +0x12b, 0x18001596b\ndb 0CCh                                                                ; +0x130, 0x180015970", "xrefs": ["cocos2d::extension::CCTableView::updateCellAtIndex @ 0x18001536d", "cocos2d::extension::CCTableView::insertCellAtIndex @ 0x18001552f", "<???> @ 0x18002fdf8", "<???> @ 0x18004a830"], "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"}