{"type": "func", "start": 6442599136, "end": 6442599488, "name": "cocos2d::CCFollow::initWithTarget", "pseudocode": "// \n// cocos2d::CCFollow::initWithTarget from 0x1800242e0 to 0x180024440 (352 bytes)\n// \n// 3 xrefs:\n// > cocos2d::CCFollow::create @ 0x180024186\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801af154\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\nbool __fastcall cocos2d::CCFollow::initWithTarget(\n        cocos2d::CCFollow *this,\n        struct cocos2d::CCNode *a2,\n        struct cocos2d::CCRect *a3)\n{\n  cocos2d::CCDirector *v6; // rax\n  float *v7; // rax\n  float v8; // xmm2_4\n  float v9; // xmm4_4\n  float v10; // xmm1_4\n  float v11; // xmm3_4\n  bool result; // al\n  float v13; // [rsp+30h] [rbp+8h]\n  float v14; // [rsp+34h] [rbp+Ch]\n  int v15; // [rsp+38h] [rbp+10h] BYREF\n\n  cocos2d::CCObject::retain(a2);\n  *((_QWORD *)this + 10) = a2;\n  *((_BYTE *)this + 88) = !cocos2d::CCRect::equals(a3, &unk_1801A8370);\n  *((_BYTE *)this + 89) = 0;\n  v6 = cocos2d::CCDirector::sharedDirector();\n  cocos2d::CCDirector::getWinSize(v6);\n  v7 = kmVec2Fill((float *)&v15, v13, v14);\n  cocos2d::CCSize::operator=((_DWORD *)this + 25, v7);\n  cocos2d::CCSize::operator*((float *)this + 25, (float *)&v15, 0.5);\n  cocos2d::CCSize::operator=((_DWORD *)this + 23, &v15);\n  if ( !*((_BYTE *)this + 88) )\n    return 1;\n  v8 = -(float)((float)(a3->size.width + a3->origin.x) - *((float *)this + 25));\n  *((float *)this + 27) = v8;\n  v9 = -a3->origin.x;\n  *((float *)this + 28) = v9;\n  v10 = -a3->origin.y;\n  *((float *)this + 29) = v10;\n  v11 = -(float)((float)(a3->size.height + a3->origin.y) - *((float *)this + 26));\n  *((float *)this + 30) = v11;\n  if ( v8 > v9 )\n  {\n    v8 = (float)(v9 + v8) * 0.5;\n    *((float *)this + 27) = v8;\n    v9 = v8;\n    *((float *)this + 28) = v8;\n  }\n  if ( v11 > v10 )\n  {\n    v10 = (float)(v10 + v11) * 0.5;\n    *((float *)this + 30) = v10;\n    v11 = v10;\n    *((float *)this + 29) = v10;\n  }\n  if ( v10 != v11 )\n    return 1;\n  result = 1;\n  if ( v8 == v9 )\n    *((_BYTE *)this + 89) = 1;\n  return result;\n}", "assembly": "; \n; cocos2d::CCFollow::initWithTarget from 0x1800242e0 to 0x180024440 (352 bytes)\n; \n; 3 xrefs:\n; > cocos2d::CCFollow::create @ 0x180024186\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801af154\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, 0x1800242e0\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x1800242e5\npush    rdi                                                            ; +0xa, 0x1800242ea\nsub     rsp, 20h                                                       ; +0xb, 0x1800242eb\nmov     rdi, rcx                                                       ; +0xf, 0x1800242ef\nmov     rsi, r8                                                        ; +0x12, 0x1800242f2\nmov     rcx, rdx; this                                                 ; +0x15, 0x1800242f5\nmov     rbx, rdx                                                       ; +0x18, 0x1800242f8\ncall    ?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x1b, 0x1800242fb\nlea     rdx, unk_1801A8370; struct cocos2d::CCRect *                   ; +0x20, 0x180024300\nmov     [rdi+50h], rbx                                                 ; +0x27, 0x180024307\nmov     rcx, rsi; this                                                 ; +0x2b, 0x18002430b\ncall    ?equals@CCRect@cocos2d@@QEBA_NAEBV12@@Z; cocos2d::CCRect::equals(cocos2d::CCRect const &) ; +0x2e, 0x18002430e\nxor     al, 1                                                          ; +0x33, 0x180024313\nmov     [rdi+58h], al                                                  ; +0x35, 0x180024315\nmov     byte ptr [rdi+59h], 0                                          ; +0x38, 0x180024318\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x3c, 0x18002431c\nmov     rcx, rax                                                       ; +0x41, 0x180024321\nlea     rdx, [rsp+28h+arg_0]                                           ; +0x44, 0x180024324\ncall    ?getWinSize@CCDirector@cocos2d@@QEAA?AVCCSize@2@XZ; cocos2d::CCDirector::getWinSize(void) ; +0x49, 0x180024329\nmovss   xmm2, [rsp+28h+arg_4]                                          ; +0x4e, 0x18002432e\nlea     rcx, [rsp+28h+arg_8]                                           ; +0x54, 0x180024334\nmovss   xmm1, [rsp+28h+arg_0]                                          ; +0x59, 0x180024339\ncall    kmVec2Fill                                                     ; +0x5f, 0x18002433f\nmov     rdx, rax                                                       ; +0x64, 0x180024344\nlea     rcx, [rdi+64h]                                                 ; +0x67, 0x180024347\ncall    ??4CCSize@cocos2d@@QEAAAEAV01@AEBVCCPoint@1@@Z; cocos2d::CCSize::operator=(cocos2d::CCPoint const &) ; +0x6b, 0x18002434b\nmovss   xmm2, cs:dword_1800E6308                                       ; +0x70, 0x180024350\nlea     rdx, [rsp+28h+arg_8]                                           ; +0x78, 0x180024358\nlea     rcx, [rdi+64h]                                                 ; +0x7d, 0x18002435d\ncall    ??DCCSize@cocos2d@@QEBA?AV01@M@Z; cocos2d::CCSize::operator*(float) ; +0x81, 0x180024361\nlea     rcx, [rdi+5Ch]                                                 ; +0x86, 0x180024366\nlea     rdx, [rsp+28h+arg_8]                                           ; +0x8a, 0x18002436a\ncall    ??4CCSize@cocos2d@@QEAAAEAV01@AEBVCCPoint@1@@Z; cocos2d::CCSize::operator=(cocos2d::CCPoint const &) ; +0x8f, 0x18002436f\ncmp     byte ptr [rdi+58h], 0                                          ; +0x94, 0x180024374\njz      loc_18002442E                                                  ; +0x98, 0x180024378\nmovss   xmm2, dword ptr [rsi+8]                                        ; +0x9e, 0x18002437e\naddss   xmm2, dword ptr [rsi]                                          ; +0xa3, 0x180024383\nmovss   xmm0, dword ptr cs:xmmword_1800E61C0                           ; +0xa7, 0x180024387\nsubss   xmm2, dword ptr [rdi+64h]                                      ; +0xaf, 0x18002438f\nxorps   xmm2, xmm0                                                     ; +0xb4, 0x180024394\nmovss   dword ptr [rdi+6Ch], xmm2                                      ; +0xb7, 0x180024397\nmovss   xmm4, dword ptr [rsi]                                          ; +0xbc, 0x18002439c\nxorps   xmm4, xmm0                                                     ; +0xc0, 0x1800243a0\ncomiss  xmm2, xmm4                                                     ; +0xc3, 0x1800243a3\nmovss   dword ptr [rdi+70h], xmm4                                      ; +0xc6, 0x1800243a6\nmovss   xmm1, dword ptr [rsi+4]                                        ; +0xcb, 0x1800243ab\nxorps   xmm1, xmm0                                                     ; +0xd0, 0x1800243b0\nmovss   dword ptr [rdi+74h], xmm1                                      ; +0xd3, 0x1800243b3\nmovss   xmm3, dword ptr [rsi+0Ch]                                      ; +0xd8, 0x1800243b8\naddss   xmm3, dword ptr [rsi+4]                                        ; +0xdd, 0x1800243bd\nsubss   xmm3, dword ptr [rdi+68h]                                      ; +0xe2, 0x1800243c2\nxorps   xmm3, xmm0                                                     ; +0xe7, 0x1800243c7\nmovss   dword ptr [rdi+78h], xmm3                                      ; +0xea, 0x1800243ca\njbe     short loc_1800243ED                                            ; +0xef, 0x1800243cf\naddss   xmm4, xmm2                                                     ; +0xf1, 0x1800243d1\nmovaps  xmm2, xmm4                                                     ; +0xf5, 0x1800243d5\nmulss   xmm2, cs:dword_1800E6308                                       ; +0xf8, 0x1800243d8\nmovss   dword ptr [rdi+6Ch], xmm2                                      ; +0x100, 0x1800243e0\nmovaps  xmm4, xmm2                                                     ; +0x105, 0x1800243e5\nmovss   dword ptr [rdi+70h], xmm2                                      ; +0x108, 0x1800243e8\ncomiss  xmm3, xmm1                                                     ; +0x10d, 0x1800243ed\njbe     short loc_18002440B                                            ; +0x110, 0x1800243f0\naddss   xmm1, xmm3                                                     ; +0x112, 0x1800243f2\nmulss   xmm1, cs:dword_1800E6308                                       ; +0x116, 0x1800243f6\nmovss   dword ptr [rdi+78h], xmm1                                      ; +0x11e, 0x1800243fe\nmovaps  xmm3, xmm1                                                     ; +0x123, 0x180024403\nmovss   dword ptr [rdi+74h], xmm1                                      ; +0x126, 0x180024406\nucomiss xmm1, xmm3                                                     ; +0x12b, 0x18002440b\njp      short loc_18002442E                                            ; +0x12e, 0x18002440e\njnz     short loc_18002442E                                            ; +0x130, 0x180024410\nucomiss xmm2, xmm4                                                     ; +0x132, 0x180024412\njp      short loc_18002442E                                            ; +0x135, 0x180024415\nmov     al, 1                                                          ; +0x137, 0x180024417\njnz     short loc_180024430                                            ; +0x139, 0x180024419\nmov     [rdi+59h], al                                                  ; +0x13b, 0x18002441b\nmov     rbx, [rsp+28h+arg_10]                                          ; +0x13e, 0x18002441e\nmov     rsi, [rsp+28h+arg_18]                                          ; +0x143, 0x180024423\nadd     rsp, 20h                                                       ; +0x148, 0x180024428\npop     rdi                                                            ; +0x14c, 0x18002442c\nretn                                                                   ; +0x14d, 0x18002442d\nmov     al, 1                                                          ; +0x14e, 0x18002442e\nmov     rbx, [rsp+28h+arg_10]                                          ; +0x150, 0x180024430\nmov     rsi, [rsp+28h+arg_18]                                          ; +0x155, 0x180024435\nadd     rsp, 20h                                                       ; +0x15a, 0x18002443a\npop     rdi                                                            ; +0x15e, 0x18002443e\nretn                                                                   ; +0x15f, 0x18002443f", "xrefs": ["cocos2d::CCFollow::create @ 0x180024186", "<???> @ 0x1801438a8", "<???> @ 0x1801af154"], "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"}