{"type": "func", "start": 6443179664, "end": 6443179947, "name": "cocos2d::CCTMXTiledMap::tilesetForLayer", "pseudocode": "// \n// cocos2d::CCTMXTiledMap::tilesetForLayer from 0x1800b1e90 to 0x1800b1fab (283 bytes)\n// \n// 5 xrefs:\n// > cocos2d::CCTMXTiledMap::buildWithMapInfo @ 0x1800b17cf\n// > cocos2d::CCTMXTiledMap::parseLayer @ 0x1800b1d20\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801c2694\n// > <???> @ 0x1801c26a0\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\nstruct cocos2d::CCTMXTilesetInfo *__fastcall cocos2d::CCTMXTiledMap::tilesetForLayer(\n        cocos2d::CCTMXTiledMap *this,\n        struct cocos2d::CCTMXLayerInfo *a2,\n        struct cocos2d::CCTMXMapInfo *a3)\n{\n  cocos2d::CCArray *v5; // rax\n  cocos2d::CCArray *v6; // rbx\n  unsigned int *v7; // rax\n  __int64 v8; // rcx\n  unsigned __int64 v9; // rbx\n  unsigned __int64 v10; // r11\n  int v11; // r9d\n  int v12; // edx\n  float v13; // xmm0_4\n  int v14; // eax\n  float v16; // [rsp+38h] [rbp+10h] BYREF\n  float v17; // [rsp+3Ch] [rbp+14h]\n\n  cocos2d::cc_timeval::operator=(&v16, (_DWORD *)a2 + 24);\n  v5 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(struct cocos2d::CCTMXMapInfo *))(*(_QWORD *)a3 + 88LL))(a3);\n  v6 = v5;\n  if ( v5 )\n  {\n    if ( (unsigned int)cocos2d::CCArray::count(v5) )\n    {\n      v7 = *((unsigned int **)v6 + 7);\n      v8 = *v7;\n      if ( (_DWORD)v8 )\n      {\n        v9 = *((_QWORD *)v7 + 2);\n        v10 = v9 + 8 * (v8 - 1);\n        if ( v10 >= v9 )\n        {\n          while ( *(_QWORD *)v10 )\n          {\n            v11 = 0;\n            if ( v17 > 0.0 )\n            {\n              while ( 1 )\n              {\n                v12 = 0;\n                if ( v16 > 0.0 )\n                  break;\nLABEL_12:\n                if ( v17 <= (float)++v11 )\n                  goto LABEL_13;\n              }\n              v13 = 0.0;\n              while ( 1 )\n              {\n                v14 = *(_DWORD *)(*((_QWORD *)a2 + 13)\n                                + 4LL * (unsigned int)(int)(float)(v13 + (float)((float)v11 * v16)));\n                if ( v14 )\n                {\n                  if ( (v14 & 0x1FFFFFFFu) >= *(_DWORD *)(*(_QWORD *)v10 + 88LL) )\n                    return *(struct cocos2d::CCTMXTilesetInfo **)v10;\n                }\n                v13 = (float)++v12;\n                if ( v16 <= (float)v12 )\n                  goto LABEL_12;\n              }\n            }\nLABEL_13:\n            v10 -= 8LL;\n            if ( v10 < v9 )\n              return nullptr;\n          }\n        }\n      }\n    }\n  }\n  return nullptr;\n}", "assembly": "; \n; cocos2d::CCTMXTiledMap::tilesetForLayer from 0x1800b1e90 to 0x1800b1fab (283 bytes)\n; \n; 5 xrefs:\n; > cocos2d::CCTMXTiledMap::buildWithMapInfo @ 0x1800b17cf\n; > cocos2d::CCTMXTiledMap::parseLayer @ 0x1800b1d20\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801c2694\n; > <???> @ 0x1801c26a0\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_0], rbx                                               ; +0x0, 0x1800b1e90\npush    rdi                                                            ; +0x5, 0x1800b1e95\nsub     rsp, 20h                                                       ; +0x6, 0x1800b1e96\nmov     rdi, rdx                                                       ; +0xa, 0x1800b1e9a\nlea     rcx, [rsp+28h+arg_8]                                           ; +0xd, 0x1800b1e9d\nadd     rdx, 60h ; '`'                                                 ; +0x12, 0x1800b1ea2\nmov     rbx, r8                                                        ; +0x16, 0x1800b1ea6\ncall    ??4cc_timeval@cocos2d@@QEAAAEAU01@$$QEAU01@@Z; cocos2d::cc_timeval::operator=(cocos2d::cc_timeval &&) ; +0x19, 0x1800b1ea9\nmov     rax, [rbx]                                                     ; +0x1e, 0x1800b1eae\nmov     rcx, rbx                                                       ; +0x21, 0x1800b1eb1\ncall    qword ptr [rax+58h]                                            ; +0x24, 0x1800b1eb4\nmov     rbx, rax                                                       ; +0x27, 0x1800b1eb7\ntest    rax, rax                                                       ; +0x2a, 0x1800b1eba\njz      loc_1800B1F90                                                  ; +0x2d, 0x1800b1ebd\nmov     rcx, rax; this                                                 ; +0x33, 0x1800b1ec3\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x36, 0x1800b1ec6\ntest    eax, eax                                                       ; +0x3b, 0x1800b1ecb\njz      loc_1800B1F90                                                  ; +0x3d, 0x1800b1ecd\nmov     rax, [rbx+38h]                                                 ; +0x43, 0x1800b1ed3\nmov     ecx, [rax]                                                     ; +0x47, 0x1800b1ed7\ntest    ecx, ecx                                                       ; +0x49, 0x1800b1ed9\njz      loc_1800B1F90                                                  ; +0x4b, 0x1800b1edb\nmov     rbx, [rax+10h]                                                 ; +0x51, 0x1800b1ee1\nlea     r11, [rcx-1]                                                   ; +0x55, 0x1800b1ee5\nlea     r11, [rbx+r11*8]                                               ; +0x59, 0x1800b1ee9\ncmp     r11, rbx                                                       ; +0x5d, 0x1800b1eed\njb      loc_1800B1F90                                                  ; +0x60, 0x1800b1ef0\nmovss   xmm4, [rsp+28h+arg_C]                                          ; +0x66, 0x1800b1ef6\nxorps   xmm3, xmm3                                                     ; +0x6c, 0x1800b1efc\nmovss   xmm1, [rsp+28h+arg_8]                                          ; +0x6f, 0x1800b1eff\nnop     word ptr [rax+rax+00000000h]                                   ; +0x75, 0x1800b1f05\nmov     r8, [r11]                                                      ; +0x80, 0x1800b1f10\ntest    r8, r8                                                         ; +0x83, 0x1800b1f13\njz      loc_1800B1F90                                                  ; +0x86, 0x1800b1f16\nxor     r9d, r9d                                                       ; +0x8c, 0x1800b1f1c\ncomiss  xmm4, xmm3                                                     ; +0x8f, 0x1800b1f1f\njbe     short loc_1800B1F83                                            ; +0x92, 0x1800b1f22\nxor     edx, edx                                                       ; +0x94, 0x1800b1f24\ncomiss  xmm1, xmm3                                                     ; +0x96, 0x1800b1f26\njbe     short loc_1800B1F70                                            ; +0x99, 0x1800b1f29\nmov     r10, [rdi+68h]                                                 ; +0x9b, 0x1800b1f2b\nxorps   xmm2, xmm2                                                     ; +0x9f, 0x1800b1f2f\nmov     eax, r9d                                                       ; +0xa2, 0x1800b1f32\nmovaps  xmm0, xmm3                                                     ; +0xa5, 0x1800b1f35\ncvtsi2ss xmm2, rax                                                     ; +0xa8, 0x1800b1f38\nmulss   xmm2, xmm1                                                     ; +0xad, 0x1800b1f3d\naddss   xmm0, xmm2                                                     ; +0xb1, 0x1800b1f41\ncvttss2si rcx, xmm0                                                    ; +0xb5, 0x1800b1f45\nmov     ecx, ecx                                                       ; +0xba, 0x1800b1f4a\nmov     eax, [r10+rcx*4]                                               ; +0xbc, 0x1800b1f4c\ntest    eax, eax                                                       ; +0xc0, 0x1800b1f50\njz      short loc_1800B1F5F                                            ; +0xc2, 0x1800b1f52\nand     eax, 1FFFFFFFh                                                 ; +0xc4, 0x1800b1f54\ncmp     eax, [r8+58h]                                                  ; +0xc9, 0x1800b1f59\njnb     short loc_1800B1F9D                                            ; +0xcd, 0x1800b1f5d\ninc     edx                                                            ; +0xcf, 0x1800b1f5f\nxorps   xmm0, xmm0                                                     ; +0xd1, 0x1800b1f61\nmov     eax, edx                                                       ; +0xd4, 0x1800b1f64\ncvtsi2ss xmm0, rax                                                     ; +0xd6, 0x1800b1f66\ncomiss  xmm1, xmm0                                                     ; +0xdb, 0x1800b1f6b\nja      short loc_1800B1F41                                            ; +0xde, 0x1800b1f6e\ninc     r9d                                                            ; +0xe0, 0x1800b1f70\nxorps   xmm0, xmm0                                                     ; +0xe3, 0x1800b1f73\nmov     eax, r9d                                                       ; +0xe6, 0x1800b1f76\ncvtsi2ss xmm0, rax                                                     ; +0xe9, 0x1800b1f79\ncomiss  xmm4, xmm0                                                     ; +0xee, 0x1800b1f7e\nja      short loc_1800B1F24                                            ; +0xf1, 0x1800b1f81\nsub     r11, 8                                                         ; +0xf3, 0x1800b1f83\ncmp     r11, rbx                                                       ; +0xf7, 0x1800b1f87\njnb     loc_1800B1F10                                                  ; +0xfa, 0x1800b1f8a\nxor     eax, eax                                                       ; +0x100, 0x1800b1f90\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x102, 0x1800b1f92\nadd     rsp, 20h                                                       ; +0x107, 0x1800b1f97\npop     rdi                                                            ; +0x10b, 0x1800b1f9b\nretn                                                                   ; +0x10c, 0x1800b1f9c\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x10d, 0x1800b1f9d\nmov     rax, r8                                                        ; +0x112, 0x1800b1fa2\nadd     rsp, 20h                                                       ; +0x115, 0x1800b1fa5\npop     rdi                                                            ; +0x119, 0x1800b1fa9\nretn                                                                   ; +0x11a, 0x1800b1faa", "xrefs": ["cocos2d::CCTMXTiledMap::buildWithMapInfo @ 0x1800b17cf", "cocos2d::CCTMXTiledMap::parseLayer @ 0x1800b1d20", "<???> @ 0x18014cf68", "<???> @ 0x1801c2694", "<???> @ 0x1801c26a0"], "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"}