{"type": "func", "start": 6443170128, "end": 6443170833, "name": "cocos2d::CCTMXLayer::initWithTilesetInfo", "pseudocode": "// \n// cocos2d::CCTMXLayer::initWithTilesetInfo from 0x1800af950 to 0x1800afc11 (705 bytes)\n// \n// 5 xrefs:\n// > cocos2d::CCTMXLayer::create @ 0x1800af90c\n// > <???> @ 0x18014973c\n// > <???> @ 0x18014974c\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801c23ac\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\nchar __fastcall cocos2d::CCTMXLayer::initWithTilesetInfo(\n        void **this,\n        struct cocos2d::CCTMXTilesetInfo *a2,\n        struct cocos2d::CCTMXLayerInfo *a3,\n        struct cocos2d::CCTMXMapInfo *a4)\n{\n  struct cocos2d::CCTexture2D *v8; // rax\n  float v9; // xmm7_4\n  const char *v10; // rbx\n  cocos2d::CCTextureCache *v11; // rax\n  char *v12; // rdx\n  void (__fastcall **v13)(void **, struct cocos2d::CCDictionary *); // rbx\n  struct cocos2d::CCDictionary *v14; // rax\n  struct cocos2d::CCDictionary *v15; // rax\n  cocos2d::CCDirector *v16; // rax\n  void (__fastcall **v17)(void **, float *); // rbx\n  cocos2d::CCDirector *v18; // rax\n  float ContentScaleFactor; // xmm0_4\n  float v20; // xmm6_4\n  cocos2d::CCDirector *v21; // rax\n  float v22; // xmm0_4\n  float *v23; // rax\n  cocos2d::CCDirector *v24; // rax\n  float v25; // xmm0_4\n  float v26; // xmm7_4\n  cocos2d::CCDirector *v27; // rax\n  float v28; // xmm0_4\n  float *v29; // rax\n  void (__fastcall **v30)(void **, float *); // rbx\n  float *v31; // rax\n  float v33; // [rsp+20h] [rbp-68h] BYREF\n  float v34; // [rsp+28h] [rbp-60h] BYREF\n  float v35[4]; // [rsp+30h] [rbp-58h] BYREF\n  float v36; // [rsp+98h] [rbp+10h] BYREF\n  float v37; // [rsp+9Ch] [rbp+14h]\n  float v38; // [rsp+A0h] [rbp+18h] BYREF\n  float v39; // [rsp+A4h] [rbp+1Ch]\n\n  cocos2d::cc_timeval::operator=(&v36, (_DWORD *)a3 + 24);\n  v8 = nullptr;\n  v9 = v37 * v36;\n  if ( a2 )\n  {\n    v10 = (char *)a2 + 112;\n    if ( *((_QWORD *)a2 + 17) > 0xFu )\n      v10 = *(const char **)v10;\n    v11 = cocos2d::CCTextureCache::sharedTextureCache();\n    v8 = cocos2d::CCTextureCache::addImage(v11, v10, 0);\n  }\n  if ( !cocos2d::CCSpriteBatchNode::initWithTexture(\n          (cocos2d::CCSpriteBatchNode *)this,\n          v8,\n          (int)(float)((float)(v9 * 0.34999999) + 1.0)) )\n    return 0;\n  if ( this + 51 != (void **)((char *)a3 + 64) )\n  {\n    v12 = (char *)a3 + 64;\n    if ( *((_QWORD *)a3 + 11) > 0xFu )\n      v12 = *((char **)a3 + 8);\n    sub_1800101E0(this + 51, v12, *((_QWORD *)a3 + 10));\n  }\n  cocos2d::CCSize::operator=((_DWORD *)this + 90, &v36);\n  v13 = (void (__fastcall **)(void **, struct cocos2d::CCDictionary *))*this;\n  *(this + 47) = *((void **)a3 + 13);\n  *((_DWORD *)this + 111) = *((_DWORD *)a3 + 29);\n  *((_DWORD *)this + 112) = *((_DWORD *)a3 + 30);\n  *((_BYTE *)this + 440) = *((_BYTE *)a3 + 113);\n  v14 = (struct cocos2d::CCDictionary *)(*(__int64 (__fastcall **)(struct cocos2d::CCTMXLayerInfo *))(*(_QWORD *)a3 + 72LL))(a3);\n  v15 = cocos2d::CCDictionary::createWithDictionary(v14);\n  v13[114](this, v15);\n  v16 = cocos2d::CCDirector::sharedDirector();\n  *((float *)this + 120) = cocos2d::CCDirector::getContentScaleFactor(v16);\n  *(this + 48) = a2;\n  if ( a2 )\n    cocos2d::CCObject::retain(a2);\n  cocos2d::CCSize::operator=((_DWORD *)this + 92, (_DWORD *)a4 + 19);\n  *((_DWORD *)this + 98) = *((_DWORD *)a4 + 16);\n  cocos2d::CCTMXLayer::calculateLayerOffset((__int64)this, &v38, (float *)a3 + 31);\n  v17 = (void (__fastcall **)(void **, float *))*this;\n  v18 = cocos2d::CCDirector::sharedDirector();\n  ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v18);\n  v20 = v39 / ContentScaleFactor;\n  v21 = cocos2d::CCDirector::sharedDirector();\n  v22 = cocos2d::CCDirector::getContentScaleFactor(v21);\n  v23 = kmVec2Fill(&v33, v38 / v22, v20);\n  v17[23](this, v23);\n  *(this + 59) = sub_1800A1F30((int)v9);\n  v24 = cocos2d::CCDirector::sharedDirector();\n  v25 = cocos2d::CCDirector::getContentScaleFactor(v24);\n  v26 = kmVec2Fill(&v33, *((float *)this + 90) * *((float *)this + 92), *((float *)this + 93) * *((float *)this + 91))[1]\n      / v25;\n  v27 = cocos2d::CCDirector::sharedDirector();\n  v28 = cocos2d::CCDirector::getContentScaleFactor(v27);\n  v29 = kmVec2Fill(&v34, *((float *)this + 90) * *((float *)this + 92), *((float *)this + 93) * *((float *)this + 91));\n  v30 = (void (__fastcall **)(void **, float *))*this;\n  v31 = kmVec2Fill(v35, *v29 / v28, v26);\n  v30[39](this, v31);\n  *((_BYTE *)this + 456) = 0;\n  *((_DWORD *)this + 113) = 0;\n  return 1;\n}", "assembly": "; \n; cocos2d::CCTMXLayer::initWithTilesetInfo from 0x1800af950 to 0x1800afc11 (705 bytes)\n; \n; 5 xrefs:\n; > cocos2d::CCTMXLayer::create @ 0x1800af90c\n; > <???> @ 0x18014973c\n; > <???> @ 0x18014974c\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801c23ac\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; \npush    rbx                                                            ; +0x0, 0x1800af950\npush    rsi                                                            ; +0x2, 0x1800af952\npush    rdi                                                            ; +0x3, 0x1800af953\npush    r14                                                            ; +0x4, 0x1800af954\npush    r15                                                            ; +0x6, 0x1800af956\nsub     rsp, 60h                                                       ; +0x8, 0x1800af958\nmov     rdi, rdx                                                       ; +0xc, 0x1800af95c\nmovaps  [rsp+88h+var_48], xmm7                                         ; +0xf, 0x1800af95f\nmov     rsi, rcx                                                       ; +0x14, 0x1800af964\nlea     rdx, [r8+60h]                                                  ; +0x17, 0x1800af967\nlea     rcx, [rsp+88h+arg_8]                                           ; +0x1b, 0x1800af96b\nmov     r15, r9                                                        ; +0x23, 0x1800af973\nmov     r14, r8                                                        ; +0x26, 0x1800af976\ncall    ??4cc_timeval@cocos2d@@QEAAAEAU01@$$QEAU01@@Z; cocos2d::cc_timeval::operator=(cocos2d::cc_timeval &&) ; +0x29, 0x1800af979\nmovss   xmm7, [rsp+88h+arg_C]                                          ; +0x2e, 0x1800af97e\nxor     eax, eax                                                       ; +0x37, 0x1800af987\nmulss   xmm7, [rsp+88h+arg_8]                                          ; +0x39, 0x1800af989\ntest    rdi, rdi                                                       ; +0x42, 0x1800af992\njz      short loc_1800AF9B8                                            ; +0x45, 0x1800af995\nlea     rbx, [rdi+70h]                                                 ; +0x47, 0x1800af997\ncmp     qword ptr [rbx+18h], 0Fh                                       ; +0x4b, 0x1800af99b\njbe     short loc_1800AF9A5                                            ; +0x50, 0x1800af9a0\nmov     rbx, [rbx]                                                     ; +0x52, 0x1800af9a2\ncall    ?sharedTextureCache@CCTextureCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0x55, 0x1800af9a5\nmov     rcx, rax; this                                                 ; +0x5a, 0x1800af9aa\nxor     r8d, r8d; bool                                                 ; +0x5d, 0x1800af9ad\nmov     rdx, rbx; char *                                               ; +0x60, 0x1800af9b0\ncall    ?addImage@CCTextureCache@cocos2d@@QEAAPEAVCCTexture2D@2@PEBD_N@Z; cocos2d::CCTextureCache::addImage(char const *,bool) ; +0x63, 0x1800af9b3\nmovaps  xmm0, xmm7                                                     ; +0x68, 0x1800af9b8\nmov     rdx, rax; struct cocos2d::CCTexture2D *                        ; +0x6b, 0x1800af9bb\nmulss   xmm0, cs:dword_18010C4B8                                       ; +0x6e, 0x1800af9be\nmov     rcx, rsi; this                                                 ; +0x76, 0x1800af9c6\naddss   xmm0, cs:flt_1800EC208                                         ; +0x79, 0x1800af9c9\ncvttss2si r8, xmm0; unsigned int                                       ; +0x81, 0x1800af9d1\ncall    ?initWithTexture@CCSpriteBatchNode@cocos2d@@QEAA_NPEAVCCTexture2D@2@I@Z; cocos2d::CCSpriteBatchNode::initWithTexture(cocos2d::CCTexture2D *,uint) ; +0x86, 0x1800af9d6\ntest    al, al                                                         ; +0x8b, 0x1800af9db\njz      loc_1800AFBFE                                                  ; +0x8d, 0x1800af9dd\nlea     r8, [r14+40h]                                                  ; +0x93, 0x1800af9e3\nmov     [rsp+88h+arg_0], rbp                                           ; +0x97, 0x1800af9e7\nlea     rcx, [rsi+198h]; void *                                        ; +0x9f, 0x1800af9ef\nmovaps  [rsp+88h+var_38], xmm6                                         ; +0xa6, 0x1800af9f6\ncmp     rcx, r8                                                        ; +0xab, 0x1800af9fb\njz      short loc_1800AFA16                                            ; +0xae, 0x1800af9fe\ncmp     qword ptr [r8+18h], 0Fh                                        ; +0xb0, 0x1800afa00\nmov     rdx, r8                                                        ; +0xb5, 0x1800afa05\njbe     short loc_1800AFA0D                                            ; +0xb8, 0x1800afa08\nmov     rdx, [r8]; Src                                                 ; +0xba, 0x1800afa0a\nmov     r8, [r8+10h]; Size                                             ; +0xbd, 0x1800afa0d\ncall    sub_1800101E0                                                  ; +0xc1, 0x1800afa11\nlea     rdx, [rsp+88h+arg_8]                                           ; +0xc6, 0x1800afa16\nlea     rcx, [rsi+168h]                                                ; +0xce, 0x1800afa1e\ncall    ??4CCSize@cocos2d@@QEAAAEAV01@AEBVCCPoint@1@@Z; cocos2d::CCSize::operator=(cocos2d::CCPoint const &) ; +0xd5, 0x1800afa25\nmov     rax, [r14+68h]                                                 ; +0xda, 0x1800afa2a\nmov     rcx, r14                                                       ; +0xde, 0x1800afa2e\nmov     rbx, [rsi]                                                     ; +0xe1, 0x1800afa31\nmov     [rsi+178h], rax                                                ; +0xe4, 0x1800afa34\nmov     eax, [r14+74h]                                                 ; +0xeb, 0x1800afa3b\nmov     [rsi+1BCh], eax                                                ; +0xef, 0x1800afa3f\nmov     eax, [r14+78h]                                                 ; +0xf5, 0x1800afa45\nmov     [rsi+1C0h], eax                                                ; +0xf9, 0x1800afa49\nmovzx   eax, byte ptr [r14+71h]                                        ; +0xff, 0x1800afa4f\nmov     [rsi+1B8h], al                                                 ; +0x104, 0x1800afa54\nmov     rax, [r14]                                                     ; +0x10a, 0x1800afa5a\ncall    qword ptr [rax+48h]                                            ; +0x10d, 0x1800afa5d\nmov     rcx, rax; struct cocos2d::CCDictionary *                       ; +0x110, 0x1800afa60\ncall    ?createWithDictionary@CCDictionary@cocos2d@@SAPEAV12@PEAV12@@Z; cocos2d::CCDictionary::createWithDictionary(cocos2d::CCDictionary *) ; +0x113, 0x1800afa63\nmov     rdx, rax                                                       ; +0x118, 0x1800afa68\nmov     rcx, rsi                                                       ; +0x11b, 0x1800afa6b\ncall    qword ptr [rbx+390h]                                           ; +0x11e, 0x1800afa6e\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x124, 0x1800afa74\nmov     rcx, rax; this                                                 ; +0x129, 0x1800afa79\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x12c, 0x1800afa7c\nmovss   dword ptr [rsi+1E0h], xmm0                                     ; +0x131, 0x1800afa81\nmov     [rsi+180h], rdi                                                ; +0x139, 0x1800afa89\ntest    rdi, rdi                                                       ; +0x140, 0x1800afa90\njz      short loc_1800AFA9D                                            ; +0x143, 0x1800afa93\nmov     rcx, rdi; this                                                 ; +0x145, 0x1800afa95\ncall    ?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x148, 0x1800afa98\nlea     rdx, [r15+4Ch]                                                 ; +0x14d, 0x1800afa9d\nlea     rcx, [rsi+170h]                                                ; +0x151, 0x1800afaa1\ncall    ??4CCSize@cocos2d@@QEAAAEAV01@AEBVCCPoint@1@@Z; cocos2d::CCSize::operator=(cocos2d::CCPoint const &) ; +0x158, 0x1800afaa8\nmov     eax, [r15+40h]                                                 ; +0x15d, 0x1800afaad\nlea     r8, [r14+7Ch]                                                  ; +0x161, 0x1800afab1\nlea     rdx, [rsp+88h+arg_10]                                          ; +0x165, 0x1800afab5\nmov     [rsi+188h], eax                                                ; +0x16d, 0x1800afabd\nmov     rcx, rsi                                                       ; +0x173, 0x1800afac3\ncall    ?calculateLayerOffset@CCTMXLayer@cocos2d@@AEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCTMXLayer::calculateLayerOffset(cocos2d::CCPoint const &) ; +0x176, 0x1800afac6\nmov     rbx, [rsi]                                                     ; +0x17b, 0x1800afacb\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x17e, 0x1800aface\nmov     rcx, rax; this                                                 ; +0x183, 0x1800afad3\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x186, 0x1800afad6\nmovss   xmm6, [rsp+88h+arg_14]                                         ; +0x18b, 0x1800afadb\ndivss   xmm6, xmm0                                                     ; +0x194, 0x1800afae4\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x198, 0x1800afae8\nmov     rcx, rax; this                                                 ; +0x19d, 0x1800afaed\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x1a0, 0x1800afaf0\nlea     rcx, [rsp+88h+var_68]                                          ; +0x1a5, 0x1800afaf5\nmovss   xmm1, [rsp+88h+arg_10]                                         ; +0x1aa, 0x1800afafa\nmovaps  xmm2, xmm6                                                     ; +0x1b3, 0x1800afb03\ndivss   xmm1, xmm0                                                     ; +0x1b6, 0x1800afb06\ncall    kmVec2Fill                                                     ; +0x1ba, 0x1800afb0a\nmov     rdx, rax                                                       ; +0x1bf, 0x1800afb0f\nmov     rcx, rsi                                                       ; +0x1c2, 0x1800afb12\ncall    qword ptr [rbx+0B8h]                                           ; +0x1c5, 0x1800afb15\ncvttss2si rcx, xmm7                                                    ; +0x1cb, 0x1800afb1b\ncall    sub_1800A1F30                                                  ; +0x1d0, 0x1800afb20\nmov     [rsi+1D8h], rax                                                ; +0x1d5, 0x1800afb25\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x1dc, 0x1800afb2c\nmov     rcx, rax; this                                                 ; +0x1e1, 0x1800afb31\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x1e4, 0x1800afb34\nmovss   xmm2, dword ptr [rsi+174h]                                     ; +0x1e9, 0x1800afb39\nlea     rcx, [rsp+88h+var_68]                                          ; +0x1f1, 0x1800afb41\nmovss   xmm1, dword ptr [rsi+168h]                                     ; +0x1f6, 0x1800afb46\nmovaps  xmm6, xmm0                                                     ; +0x1fe, 0x1800afb4e\nmulss   xmm2, dword ptr [rsi+16Ch]                                     ; +0x201, 0x1800afb51\nmulss   xmm1, dword ptr [rsi+170h]                                     ; +0x209, 0x1800afb59\ncall    kmVec2Fill                                                     ; +0x211, 0x1800afb61\nmovss   xmm7, dword ptr [rax+4]                                        ; +0x216, 0x1800afb66\ndivss   xmm7, xmm6                                                     ; +0x21b, 0x1800afb6b\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x21f, 0x1800afb6f\nmov     rcx, rax; this                                                 ; +0x224, 0x1800afb74\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x227, 0x1800afb77\nlea     rcx, [rsp+88h+var_60]                                          ; +0x22c, 0x1800afb7c\nmovss   xmm2, dword ptr [rsi+174h]                                     ; +0x231, 0x1800afb81\nmovaps  xmm6, xmm0                                                     ; +0x239, 0x1800afb89\nmovss   xmm1, dword ptr [rsi+168h]                                     ; +0x23c, 0x1800afb8c\nmulss   xmm2, dword ptr [rsi+16Ch]                                     ; +0x244, 0x1800afb94\nmulss   xmm1, dword ptr [rsi+170h]                                     ; +0x24c, 0x1800afb9c\ncall    kmVec2Fill                                                     ; +0x254, 0x1800afba4\nmov     rbx, [rsi]                                                     ; +0x259, 0x1800afba9\nlea     rcx, [rsp+88h+var_58]                                          ; +0x25c, 0x1800afbac\nmovaps  xmm2, xmm7                                                     ; +0x261, 0x1800afbb1\nmovss   xmm1, dword ptr [rax]                                          ; +0x264, 0x1800afbb4\ndivss   xmm1, xmm6                                                     ; +0x268, 0x1800afbb8\ncall    kmVec2Fill                                                     ; +0x26c, 0x1800afbbc\nmov     rdx, rax                                                       ; +0x271, 0x1800afbc1\nmov     rcx, rsi                                                       ; +0x274, 0x1800afbc4\ncall    qword ptr [rbx+138h]                                           ; +0x277, 0x1800afbc7\nmovaps  xmm6, [rsp+88h+var_38]                                         ; +0x27d, 0x1800afbcd\nmov     al, 1                                                          ; +0x282, 0x1800afbd2\nmov     rbp, [rsp+88h+arg_0]                                           ; +0x284, 0x1800afbd4\nmov     byte ptr [rsi+1C8h], 0                                         ; +0x28c, 0x1800afbdc\nmov     dword ptr [rsi+1C4h], 0                                        ; +0x293, 0x1800afbe3\nmovaps  xmm7, [rsp+88h+var_48]                                         ; +0x29d, 0x1800afbed\nadd     rsp, 60h                                                       ; +0x2a2, 0x1800afbf2\npop     r15                                                            ; +0x2a6, 0x1800afbf6\npop     r14                                                            ; +0x2a8, 0x1800afbf8\npop     rdi                                                            ; +0x2aa, 0x1800afbfa\npop     rsi                                                            ; +0x2ab, 0x1800afbfb\npop     rbx                                                            ; +0x2ac, 0x1800afbfc\nretn                                                                   ; +0x2ad, 0x1800afbfd\nmovaps  xmm7, [rsp+88h+var_48]                                         ; +0x2ae, 0x1800afbfe\nxor     al, al                                                         ; +0x2b3, 0x1800afc03\nadd     rsp, 60h                                                       ; +0x2b5, 0x1800afc05\npop     r15                                                            ; +0x2b9, 0x1800afc09\npop     r14                                                            ; +0x2bb, 0x1800afc0b\npop     rdi                                                            ; +0x2bd, 0x1800afc0d\npop     rsi                                                            ; +0x2be, 0x1800afc0e\npop     rbx                                                            ; +0x2bf, 0x1800afc0f\nretn                                                                   ; +0x2c0, 0x1800afc10", "xrefs": ["cocos2d::CCTMXLayer::create @ 0x1800af90c", "<???> @ 0x18014973c", "<???> @ 0x18014974c", "<???> @ 0x18014cf68", "<???> @ 0x1801c23ac"], "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"}