{"type": "func", "start": 6443174960, "end": 6443175539, "name": "cocos2d::CCTMXLayer::tileAt", "pseudocode": "// \n// cocos2d::CCTMXLayer::tileAt from 0x1800b0c30 to 0x1800b0e73 (579 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801c2544\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:22:19 +0000\n// \n\n// Hidden C++ exception states: #wind=1\nstruct cocos2d::CCSprite *__fastcall cocos2d::CCTMXLayer::tileAt(\n        cocos2d::CCTMXLayer *this,\n        const struct cocos2d::CCPoint *a2)\n{\n  struct cocos2d::CCSprite *v4; // rsi\n  int v5; // ebp\n  unsigned int v6; // ebx\n  struct cocos2d::CCSprite *result; // rax\n  cocos2d::CCDirector *v8; // rax\n  float ContentScaleFactor; // xmm0_4\n  float v10; // xmm8_4\n  cocos2d::CCDirector *v11; // rax\n  float v12; // xmm0_4\n  float v13; // xmm7_4\n  cocos2d::CCDirector *v14; // rax\n  float v15; // xmm0_4\n  float v16; // xmm6_4\n  cocos2d::CCDirector *v17; // rax\n  float v18; // xmm0_4\n  cocos2d::CCRect *v19; // rax\n  cocos2d::CCSprite *v20; // rax\n  __int64 v21; // rbx\n  __int64 v22; // rax\n  __int64 v23; // rbx\n  __int64 v24; // rax\n  void *v25; // rax\n  float v26[4]; // [rsp+30h] [rbp-68h] BYREF\n  _BYTE v27[16]; // [rsp+40h] [rbp-58h] BYREF\n  cocos2d::CCSprite *Key; // [rsp+A0h] [rbp+8h] BYREF\n\n  v4 = nullptr;\n  v5 = (int)(float)((float)(*((float *)this + 90) * *((float *)a2 + 1)) + *(float *)a2);\n  v6 = *(_DWORD *)(*((_QWORD *)this + 47) + 4LL * v5) & 0x1FFFFFFF;\n  if ( v6 )\n  {\n    result = (struct cocos2d::CCSprite *)(*(__int64 (__fastcall **)(cocos2d::CCTMXLayer *, _QWORD))(*(_QWORD *)this\n                                                                                                  + 472LL))(\n                                           this,\n                                           (unsigned int)v5);\n    if ( result )\n      return result;\n    cocos2d::CCTMXTilesetInfo::rectForGID(*((_QWORD *)this + 48), v26, v6);\n    v8 = cocos2d::CCDirector::sharedDirector();\n    ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v8);\n    v10 = v26[3] / ContentScaleFactor;\n    v11 = cocos2d::CCDirector::sharedDirector();\n    v12 = cocos2d::CCDirector::getContentScaleFactor(v11);\n    v13 = v26[2] / v12;\n    v14 = cocos2d::CCDirector::sharedDirector();\n    v15 = cocos2d::CCDirector::getContentScaleFactor(v14);\n    v16 = v26[1] / v15;\n    v17 = cocos2d::CCDirector::sharedDirector();\n    v18 = cocos2d::CCDirector::getContentScaleFactor(v17);\n    v19 = cocos2d::CCRect::CCRect((cocos2d::CCRect *)v27, v26[0] / v18, v16, v13, v10);\n    cocos2d::CCRect::operator=((__int64)v26, (__int64)v19);\n    v20 = (cocos2d::CCSprite *)sub_1800E4AC0(0x258u);\n    Key = v20;\n    if ( v20 )\n      v4 = cocos2d::CCSprite::CCSprite(v20);\n    v21 = *(_QWORD *)v4;\n    v22 = (*(__int64 (__fastcall **)(char *))(*((_QWORD *)this + 40) + 16LL))((char *)this + 320);\n    (*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64, float *))(v21 + 896))(v4, v22, v26);\n    (*(void (__fastcall **)(struct cocos2d::CCSprite *, cocos2d::CCTMXLayer *))(*(_QWORD *)v4 + 968LL))(v4, this);\n    v23 = *(_QWORD *)v4;\n    v24 = cocos2d::CCTMXLayer::positionAt((__int64)this, (__int64)&Key, (float *)a2);\n    (*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v23 + 184))(v4, v24);\n    cocos2d::CCTMXLayer::vertexZForPos(this, a2);\n    (*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v4 + 104LL))(v4);\n    (*(void (__fastcall **)(struct cocos2d::CCSprite *, _DWORD *))(*(_QWORD *)v4 + 288LL))(v4, dword_1801B3B28);\n    (*(void (__fastcall **)(__int64, _QWORD))(*((_QWORD *)v4 + 40) + 40LL))(\n      (__int64)v4 + 320,\n      *((unsigned __int8 *)this + 440));\n    LODWORD(Key) = v5;\n    v25 = bsearch(\n            &Key,\n            *(const void **)(*((_QWORD *)this + 59) + 16LL),\n            **((unsigned int **)this + 59),\n            8u,\n            (_CoreCrtNonSecureSearchSortCompareFunction)CompareFunction);\n    cocos2d::CCSpriteBatchNode::addSpriteWithoutQuad(\n      this,\n      v4,\n      ((unsigned __int64)v25 - *(_QWORD *)(*((_QWORD *)this + 59) + 16LL)) >> 3,\n      v5);\n    cocos2d::CCObject::release(v4);\n  }\n  return v4;\n}", "assembly": "; \n; cocos2d::CCTMXLayer::tileAt from 0x1800b0c30 to 0x1800b0e73 (579 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801c2544\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:22:19 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x1800b0c30\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x1800b0c35\npush    rsi                                                            ; +0xa, 0x1800b0c3a\npush    rdi                                                            ; +0xb, 0x1800b0c3b\npush    r14                                                            ; +0xc, 0x1800b0c3c\nsub     rsp, 80h                                                       ; +0xe, 0x1800b0c3e\nmovaps  [rsp+98h+var_28], xmm6                                         ; +0x15, 0x1800b0c45\nmovaps  [rsp+98h+var_38], xmm7                                         ; +0x1a, 0x1800b0c4a\nmovaps  [rsp+98h+var_48], xmm8                                         ; +0x1f, 0x1800b0c4f\nmov     r14, rdx                                                       ; +0x25, 0x1800b0c55\nmov     rdi, rcx                                                       ; +0x28, 0x1800b0c58\nxor     esi, esi                                                       ; +0x2b, 0x1800b0c5b\nmovss   xmm0, dword ptr [rcx+168h]                                     ; +0x2d, 0x1800b0c5d\nmulss   xmm0, dword ptr [rdx+4]                                        ; +0x35, 0x1800b0c65\naddss   xmm0, dword ptr [rdx]                                          ; +0x3a, 0x1800b0c6a\ncvttss2si ebp, xmm0                                                    ; +0x3e, 0x1800b0c6e\nmovsxd  r8, ebp                                                        ; +0x42, 0x1800b0c72\nmov     rax, [rcx+178h]                                                ; +0x45, 0x1800b0c75\nmov     ebx, [rax+r8*4]                                                ; +0x4c, 0x1800b0c7c\nand     ebx, 1FFFFFFFh                                                 ; +0x50, 0x1800b0c80\njz      loc_1800B0E49                                                  ; +0x56, 0x1800b0c86\nmov     rax, [rcx]                                                     ; +0x5c, 0x1800b0c8c\nmov     edx, ebp                                                       ; +0x5f, 0x1800b0c8f\ncall    qword ptr [rax+1D8h]                                           ; +0x61, 0x1800b0c91\ntest    rax, rax                                                       ; +0x67, 0x1800b0c97\njnz     loc_1800B0E4C                                                  ; +0x6a, 0x1800b0c9a\nmov     r8d, ebx                                                       ; +0x70, 0x1800b0ca0\nlea     rdx, [rsp+98h+var_68]                                          ; +0x73, 0x1800b0ca3\nmov     rcx, [rdi+180h]                                                ; +0x78, 0x1800b0ca8\ncall    ?rectForGID@CCTMXTilesetInfo@cocos2d@@QEAA?AVCCRect@2@I@Z; cocos2d::CCTMXTilesetInfo::rectForGID(uint) ; +0x7f, 0x1800b0caf\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x84, 0x1800b0cb4\nmov     rcx, rax; this                                                 ; +0x89, 0x1800b0cb9\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x8c, 0x1800b0cbc\nmovss   xmm8, [rsp+98h+var_5C]                                         ; +0x91, 0x1800b0cc1\ndivss   xmm8, xmm0                                                     ; +0x98, 0x1800b0cc8\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x9d, 0x1800b0ccd\nmov     rcx, rax; this                                                 ; +0xa2, 0x1800b0cd2\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0xa5, 0x1800b0cd5\nmovss   xmm7, [rsp+98h+var_60]                                         ; +0xaa, 0x1800b0cda\ndivss   xmm7, xmm0                                                     ; +0xb0, 0x1800b0ce0\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0xb4, 0x1800b0ce4\nmov     rcx, rax; this                                                 ; +0xb9, 0x1800b0ce9\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0xbc, 0x1800b0cec\nmovss   xmm6, [rsp+98h+var_64]                                         ; +0xc1, 0x1800b0cf1\ndivss   xmm6, xmm0                                                     ; +0xc7, 0x1800b0cf7\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0xcb, 0x1800b0cfb\nmov     rcx, rax; this                                                 ; +0xd0, 0x1800b0d00\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0xd3, 0x1800b0d03\nmovss   xmm1, [rsp+98h+var_68]                                         ; +0xd8, 0x1800b0d08\ndivss   xmm1, xmm0; float                                              ; +0xde, 0x1800b0d0e\nmovss   dword ptr [rsp+98h+CompareFunction], xmm8; float               ; +0xe2, 0x1800b0d12\nmovaps  xmm3, xmm7; float                                              ; +0xe9, 0x1800b0d19\nmovaps  xmm2, xmm6; float                                              ; +0xec, 0x1800b0d1c\nlea     rcx, [rsp+98h+var_58]; this                                    ; +0xef, 0x1800b0d1f\ncall    ??0CCRect@cocos2d@@QEAA@MMMM@Z; cocos2d::CCRect::CCRect(float,float,float,float) ; +0xf4, 0x1800b0d24\nmov     rdx, rax                                                       ; +0xf9, 0x1800b0d29\nlea     rcx, [rsp+98h+var_68]                                          ; +0xfc, 0x1800b0d2c\ncall    ??4CCRect@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCRect::operator=(cocos2d::CCRect const &) ; +0x101, 0x1800b0d31\nmov     ecx, 258h; Size                                                ; +0x106, 0x1800b0d36\ncall    sub_1800E4AC0                                                  ; +0x10b, 0x1800b0d3b\nmov     [rsp+98h+Key], rax                                             ; +0x110, 0x1800b0d40\ntest    rax, rax                                                       ; +0x118, 0x1800b0d48\njz      short loc_1800B0D58                                            ; +0x11b, 0x1800b0d4b\nmov     rcx, rax; this                                                 ; +0x11d, 0x1800b0d4d\ncall    ??0CCSprite@cocos2d@@QEAA@XZ; cocos2d::CCSprite::CCSprite(void) ; +0x120, 0x1800b0d50\nmov     rsi, rax                                                       ; +0x125, 0x1800b0d55\nmov     rbx, [rsi]                                                     ; +0x128, 0x1800b0d58\nlea     rcx, [rdi+140h]                                                ; +0x12b, 0x1800b0d5b\nmov     rax, [rcx]                                                     ; +0x132, 0x1800b0d62\ncall    qword ptr [rax+10h]                                            ; +0x135, 0x1800b0d65\nmov     rdx, rax                                                       ; +0x138, 0x1800b0d68\nlea     r8, [rsp+98h+var_68]                                           ; +0x13b, 0x1800b0d6b\nmov     rcx, rsi                                                       ; +0x140, 0x1800b0d70\ncall    qword ptr [rbx+380h]                                           ; +0x143, 0x1800b0d73\nmov     rax, [rsi]                                                     ; +0x149, 0x1800b0d79\nmov     rdx, rdi                                                       ; +0x14c, 0x1800b0d7c\nmov     rcx, rsi                                                       ; +0x14f, 0x1800b0d7f\ncall    qword ptr [rax+3C8h]                                           ; +0x152, 0x1800b0d82\nmov     rbx, [rsi]                                                     ; +0x158, 0x1800b0d88\nmov     r8, r14                                                        ; +0x15b, 0x1800b0d8b\nlea     rdx, [rsp+98h+Key]                                             ; +0x15e, 0x1800b0d8e\nmov     rcx, rdi                                                       ; +0x166, 0x1800b0d96\ncall    ?positionAt@CCTMXLayer@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCTMXLayer::positionAt(cocos2d::CCPoint const &) ; +0x169, 0x1800b0d99\nmov     rdx, rax                                                       ; +0x16e, 0x1800b0d9e\nmov     rcx, rsi                                                       ; +0x171, 0x1800b0da1\ncall    qword ptr [rbx+0B8h]                                           ; +0x174, 0x1800b0da4\nmov     rdx, r14; struct cocos2d::CCPoint *                            ; +0x17a, 0x1800b0daa\nmov     rcx, rdi; this                                                 ; +0x17d, 0x1800b0dad\ncall    ?vertexZForPos@CCTMXLayer@cocos2d@@AEAAHAEBVCCPoint@2@@Z; cocos2d::CCTMXLayer::vertexZForPos(cocos2d::CCPoint const &) ; +0x180, 0x1800b0db0\nmovd    xmm1, eax                                                      ; +0x185, 0x1800b0db5\ncvtdq2ps xmm1, xmm1                                                    ; +0x189, 0x1800b0db9\nmov     rax, [rsi]                                                     ; +0x18c, 0x1800b0dbc\nmov     rcx, rsi                                                       ; +0x18f, 0x1800b0dbf\ncall    qword ptr [rax+68h]                                            ; +0x192, 0x1800b0dc2\nmov     rax, [rsi]                                                     ; +0x195, 0x1800b0dc5\nlea     rdx, dword_1801B3B28                                           ; +0x198, 0x1800b0dc8\nmov     rcx, rsi                                                       ; +0x19f, 0x1800b0dcf\ncall    qword ptr [rax+120h]                                           ; +0x1a2, 0x1800b0dd2\nlea     rcx, [rsi+140h]                                                ; +0x1a8, 0x1800b0dd8\nmov     rax, [rcx]                                                     ; +0x1af, 0x1800b0ddf\nmovzx   edx, byte ptr [rdi+1B8h]                                       ; +0x1b2, 0x1800b0de2\ncall    qword ptr [rax+28h]                                            ; +0x1b9, 0x1800b0de9\nmov     dword ptr [rsp+98h+Key], ebp                                   ; +0x1bc, 0x1800b0dec\nmov     rdx, [rdi+1D8h]                                                ; +0x1c3, 0x1800b0df3\nmov     r8d, [rdx]; NumOfElements                                      ; +0x1ca, 0x1800b0dfa\nlea     rax, CompareFunction                                           ; +0x1cd, 0x1800b0dfd\nmov     [rsp+98h+CompareFunction], rax; CompareFunction                ; +0x1d4, 0x1800b0e04\nmov     r9d, 8; SizeOfElements                                         ; +0x1d9, 0x1800b0e09\nmov     rdx, [rdx+10h]; Base                                           ; +0x1df, 0x1800b0e0f\nlea     rcx, [rsp+98h+Key]; Key                                        ; +0x1e3, 0x1800b0e13\ncall    cs:bsearch                                                     ; +0x1eb, 0x1800b0e1b\nmov     rcx, [rdi+1D8h]                                                ; +0x1f1, 0x1800b0e21\nsub     rax, [rcx+10h]                                                 ; +0x1f8, 0x1800b0e28\nshr     rax, 3                                                         ; +0x1fc, 0x1800b0e2c\nmov     r9d, ebp; int                                                  ; +0x200, 0x1800b0e30\nmov     r8d, eax; unsigned int                                         ; +0x203, 0x1800b0e33\nmov     rdx, rsi; struct cocos2d::CCSprite *                           ; +0x206, 0x1800b0e36\nmov     rcx, rdi; this                                                 ; +0x209, 0x1800b0e39\ncall    ?addSpriteWithoutQuad@CCSpriteBatchNode@cocos2d@@IEAAPEAV12@PEAVCCSprite@2@IH@Z; cocos2d::CCSpriteBatchNode::addSpriteWithoutQuad(cocos2d::CCSprite *,uint,int) ; +0x20c, 0x1800b0e3c\nmov     rcx, rsi; this                                                 ; +0x211, 0x1800b0e41\ncall    ?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0x214, 0x1800b0e44\nmov     rax, rsi                                                       ; +0x219, 0x1800b0e49\nlea     r11, [rsp+98h+var_18]                                          ; +0x21c, 0x1800b0e4c\nmov     rbx, [r11+28h]                                                 ; +0x224, 0x1800b0e54\nmov     rbp, [r11+30h]                                                 ; +0x228, 0x1800b0e58\nmovaps  xmm6, [rsp+98h+var_28]                                         ; +0x22c, 0x1800b0e5c\nmovaps  xmm7, [rsp+98h+var_38]                                         ; +0x231, 0x1800b0e61\nmovaps  xmm8, xmmword ptr [r11-30h]                                    ; +0x236, 0x1800b0e66\nmov     rsp, r11                                                       ; +0x23b, 0x1800b0e6b\npop     r14                                                            ; +0x23e, 0x1800b0e6e\npop     rdi                                                            ; +0x240, 0x1800b0e70\npop     rsi                                                            ; +0x241, 0x1800b0e71\nretn                                                                   ; +0x242, 0x1800b0e72", "xrefs": ["<???> @ 0x18014cf68", "<???> @ 0x1801c2544"], "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"}