{"type": "func", "start": 6443161232, "end": 6443161568, "name": "cocos2d::CCTMXLayer::updateTileForGID", "pseudocode": "// \n// cocos2d::CCTMXLayer::updateTileForGID from 0x1800ad690 to 0x1800ad7e0 (336 bytes)\n// \n// 3 xrefs:\n// > cocos2d::CCTMXLayer::setTileGID @ 0x1800acfd0\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b828c\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\nstruct cocos2d::CCSprite *__fastcall cocos2d::CCTMXLayer::updateTileForGID(\n        cocos2d::CCTMXLayer *this,\n        int a2,\n        struct cocos2d::CCPoint *a3)\n{\n  cocos2d::CCRect *v6; // rax\n  float v7; // xmm0_4\n  struct cocos2d::CCRect *v8; // rax\n  cocos2d::CCSprite *v9; // rbx\n  _DWORD *v10; // rax\n  const void **v11; // rdx\n  void *v12; // rax\n  __int64 v13; // rdx\n  struct cocos2d::CCRect v15; // [rsp+30h] [rbp-38h] BYREF\n  cocos2d::CCRect v16; // [rsp+40h] [rbp-28h] BYREF\n  int v17; // [rsp+70h] [rbp+8h] BYREF\n  int Key; // [rsp+78h] [rbp+10h] BYREF\n\n  cocos2d::CCTMXTilesetInfo::rectForGID(*((struct cocos2d::CCRect **)this + 48), (unsigned int)&v15);\n  v6 = cocos2d::CCRect::CCRect(\n         &v16,\n         v15.origin.x / *((float *)this + 120),\n         v15.origin.y / *((float *)this + 120),\n         v15.size.width / *((float *)this + 120),\n         v15.size.height / *((float *)this + 120));\n  cocos2d::CCRect::operator=((float *)&v15.origin, (float *)&v6->origin);\n  v7 = (float)(*((float *)this + 90) * a3->y) + a3->x;\n  v8 = cocos2d::CCRect::CCRect(&v16, &v15);\n  v9 = (cocos2d::CCSprite *)cocos2d::CCTMXLayer::reusedTileWithRect(this, v8);\n  v10 = cocos2d::cc_timeval::operator=(&v17, a3);\n  cocos2d::CCTMXLayer::setupTileSprite(this, v9, (struct cocos2d::CCPoint)v10, a2);\n  v11 = *((const void ***)this + 59);\n  Key = (int)v7;\n  v12 = bsearch(&Key, v11[2], *(unsigned int *)v11, 8u, (_CoreCrtNonSecureSearchSortCompareFunction)CompareFunction);\n  LOBYTE(v13) = 1;\n  v9->m_uAtlasIndex = ((unsigned __int64)v12 - *(_QWORD *)(*((_QWORD *)this + 59) + 16LL)) >> 3;\n  ((void (__fastcall *)(cocos2d::CCSprite *, __int64))v9->setDirty)(v9, v13);\n  ((void (__fastcall *)(cocos2d::CCSprite *))v9->updateTransform)(v9);\n  *(_DWORD *)(*((_QWORD *)this + 47) + 4LL * (int)v7) = a2;\n  return v9;\n}", "assembly": "; \n; cocos2d::CCTMXLayer::updateTileForGID from 0x1800ad690 to 0x1800ad7e0 (336 bytes)\n; \n; 3 xrefs:\n; > cocos2d::CCTMXLayer::setTileGID @ 0x1800acfd0\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b828c\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_10], rbx                                              ; +0x0, 0x1800ad690\nmov     [rsp+arg_18], rbp                                              ; +0x5, 0x1800ad695\npush    rsi                                                            ; +0xa, 0x1800ad69a\npush    rdi                                                            ; +0xb, 0x1800ad69b\npush    r14                                                            ; +0xc, 0x1800ad69c\nsub     rsp, 50h                                                       ; +0xe, 0x1800ad69e\nmov     rdi, r8                                                        ; +0x12, 0x1800ad6a2\nmov     r14d, edx                                                      ; +0x15, 0x1800ad6a5\nmov     r8d, edx                                                       ; +0x18, 0x1800ad6a8\nmov     rbp, rcx                                                       ; +0x1b, 0x1800ad6ab\nmov     rcx, [rcx+180h]                                                ; +0x1e, 0x1800ad6ae\nlea     rdx, [rsp+68h+var_38]                                          ; +0x25, 0x1800ad6b5\ncall    ?rectForGID@CCTMXTilesetInfo@cocos2d@@QEAA?AVCCRect@2@I@Z; cocos2d::CCTMXTilesetInfo::rectForGID(uint) ; +0x2a, 0x1800ad6ba\nmovss   xmm0, dword ptr [rbp+1E0h]                                     ; +0x2f, 0x1800ad6bf\nlea     rcx, [rsp+68h+var_28]; this                                    ; +0x37, 0x1800ad6c7\nmovss   xmm4, [rsp+68h+var_2C]                                         ; +0x3c, 0x1800ad6cc\nmovss   xmm3, [rsp+68h+var_30]                                         ; +0x42, 0x1800ad6d2\nmovss   xmm2, [rsp+68h+var_34]                                         ; +0x48, 0x1800ad6d8\nmovss   xmm1, [rsp+68h+var_38]                                         ; +0x4e, 0x1800ad6de\ndivss   xmm4, xmm0                                                     ; +0x54, 0x1800ad6e4\ndivss   xmm3, xmm0; float                                              ; +0x58, 0x1800ad6e8\ndivss   xmm2, xmm0; float                                              ; +0x5c, 0x1800ad6ec\ndivss   xmm1, xmm0; float                                              ; +0x60, 0x1800ad6f0\nmovss   dword ptr [rsp+68h+CompareFunction], xmm4; float               ; +0x64, 0x1800ad6f4\ncall    ??0CCRect@cocos2d@@QEAA@MMMM@Z; cocos2d::CCRect::CCRect(float,float,float,float) ; +0x6a, 0x1800ad6fa\nmov     rdx, rax                                                       ; +0x6f, 0x1800ad6ff\nlea     rcx, [rsp+68h+var_38]                                          ; +0x72, 0x1800ad702\ncall    ??4CCRect@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCRect::operator=(cocos2d::CCRect const &) ; +0x77, 0x1800ad707\nmovss   xmm0, dword ptr [rbp+168h]                                     ; +0x7c, 0x1800ad70c\nlea     rdx, [rsp+68h+var_38]; struct cocos2d::CCRect *                ; +0x84, 0x1800ad714\nmulss   xmm0, dword ptr [rdi+4]                                        ; +0x89, 0x1800ad719\nlea     rcx, [rsp+68h+var_28]; this                                    ; +0x8e, 0x1800ad71e\naddss   xmm0, dword ptr [rdi]                                          ; +0x93, 0x1800ad723\ncvttss2si esi, xmm0                                                    ; +0x97, 0x1800ad727\ncall    ??0CCRect@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCRect::CCRect(cocos2d::CCRect const &) ; +0x9b, 0x1800ad72b\nmov     rdx, rax                                                       ; +0xa0, 0x1800ad730\nmov     rcx, rbp                                                       ; +0xa3, 0x1800ad733\ncall    ?reusedTileWithRect@CCTMXLayer@cocos2d@@AEAAPEAVCCSprite@2@VCCRect@2@@Z; cocos2d::CCTMXLayer::reusedTileWithRect(cocos2d::CCRect) ; +0xa6, 0x1800ad736\nmov     rdx, rdi                                                       ; +0xab, 0x1800ad73b\nlea     rcx, [rsp+68h+arg_0]                                           ; +0xae, 0x1800ad73e\nmov     rbx, rax                                                       ; +0xb3, 0x1800ad743\ncall    ??4cc_timeval@cocos2d@@QEAAAEAU01@$$QEAU01@@Z; cocos2d::cc_timeval::operator=(cocos2d::cc_timeval &&) ; +0xb6, 0x1800ad746\nmov     r8, rax                                                        ; +0xbb, 0x1800ad74b\nmov     r9d, r14d                                                      ; +0xbe, 0x1800ad74e\nmov     rdx, rbx                                                       ; +0xc1, 0x1800ad751\nmov     rcx, rbp                                                       ; +0xc4, 0x1800ad754\ncall    ?setupTileSprite@CCTMXLayer@cocos2d@@AEAAXPEAVCCSprite@2@VCCPoint@2@I@Z; cocos2d::CCTMXLayer::setupTileSprite(cocos2d::CCSprite *,cocos2d::CCPoint,uint) ; +0xc7, 0x1800ad757\nmov     rdx, [rbp+1D8h]                                                ; +0xcc, 0x1800ad75c\nlea     rax, CompareFunction                                           ; +0xd3, 0x1800ad763\nmov     [rsp+68h+Key], esi                                             ; +0xda, 0x1800ad76a\nlea     rcx, [rsp+68h+Key]; Key                                        ; +0xde, 0x1800ad76e\nmov     r9d, 8; SizeOfElements                                         ; +0xe3, 0x1800ad773\nmov     [rsp+68h+CompareFunction], rax; CompareFunction                ; +0xe9, 0x1800ad779\nmov     r8d, [rdx]; NumOfElements                                      ; +0xee, 0x1800ad77e\nmov     rdx, [rdx+10h]; Base                                           ; +0xf1, 0x1800ad781\ncall    cs:bsearch                                                     ; +0xf5, 0x1800ad785\nmov     rcx, [rbp+1D8h]                                                ; +0xfb, 0x1800ad78b\nmov     dl, 1                                                          ; +0x102, 0x1800ad792\nsub     rax, [rcx+10h]                                                 ; +0x104, 0x1800ad794\nmov     rcx, rbx                                                       ; +0x108, 0x1800ad798\nshr     rax, 3                                                         ; +0x10b, 0x1800ad79b\nmov     [rbx+168h], eax                                                ; +0x10f, 0x1800ad79f\nmov     rax, [rbx]                                                     ; +0x115, 0x1800ad7a5\ncall    qword ptr [rax+408h]                                           ; +0x118, 0x1800ad7a8\nmov     rax, [rbx]                                                     ; +0x11e, 0x1800ad7ae\nmov     rcx, rbx                                                       ; +0x121, 0x1800ad7b1\ncall    qword ptr [rax+300h]                                           ; +0x124, 0x1800ad7b4\nmov     rax, [rbp+178h]                                                ; +0x12a, 0x1800ad7ba\nlea     r11, [rsp+68h+var_18]                                          ; +0x131, 0x1800ad7c1\nmov     rbp, [r11+38h]                                                 ; +0x136, 0x1800ad7c6\nmovsxd  rcx, esi                                                       ; +0x13a, 0x1800ad7ca\nmov     [rax+rcx*4], r14d                                              ; +0x13d, 0x1800ad7cd\nmov     rax, rbx                                                       ; +0x141, 0x1800ad7d1\nmov     rbx, [r11+30h]                                                 ; +0x144, 0x1800ad7d4\nmov     rsp, r11                                                       ; +0x148, 0x1800ad7d8\npop     r14                                                            ; +0x14b, 0x1800ad7db\npop     rdi                                                            ; +0x14d, 0x1800ad7dd\npop     rsi                                                            ; +0x14e, 0x1800ad7de\nretn                                                                   ; +0x14f, 0x1800ad7df", "xrefs": ["cocos2d::CCTMXLayer::setTileGID @ 0x1800acfd0", "<???> @ 0x1801438a8", "<???> @ 0x1801b828c"], "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"}