{"type": "func", "start": 4296151456, "end": 4296151718, "name": "GJBaseGameLayer::getPortalTarget", "pseudocode": "// \n// GJBaseGameLayer::getPortalTarget from 0x1001211a0 to 0x1001212a6 (262 bytes)\n// \n// 1 xrefs:\n// > GJBaseGameLayer::teleportPlayer @ 0x100120b59\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\nTeleportPortalObject *__fastcall GJBaseGameLayer::getPortalTarget(GJBaseGameLayer *a1, TeleportPortalObject *a2)\n{\n  TeleportPortalObject *result; // rax\n  int m_targetGroupID; // eax\n  intptr_t v4; // r14\n  std::__vector_base<cocos2d::CCArray *>::pointer begin; // rax\n  cocos2d::CCArray *v6; // rbx\n  int v7; // eax\n  __m128 v8; // xmm0\n\n  result = a2->m_orangePortal;\n  if ( result )\n    return result;\n  m_targetGroupID = a2->m_targetGroupID;\n  if ( m_targetGroupID <= 0 )\n    return nullptr;\n  v4 = 9999;\n  if ( (unsigned int)m_targetGroupID < 0x270F )\n    v4 = (unsigned int)m_targetGroupID;\n  begin = a1->m_groups.__begin_;\n  v6 = begin[v4];\n  if ( !v6 )\n  {\n    v6 = (cocos2d::CCArray *)sub_10071F9E0(a1, a2);\n    cocos2d::CCDictionary::setObject(a1->m_groupDict, v6, v4);\n    a1->m_groups.__begin_[v4] = v6;\n    v7 = sub_100720070(v6);\n    if ( v7 > 0 )\n      goto LABEL_7;\n    return nullptr;\n  }\n  v7 = sub_100720070(begin[v4]);\n  if ( v7 <= 0 )\n    return nullptr;\nLABEL_7:\n  v8 = 0;\n  if ( v7 != 1 )\n  {\n    qword_10099F028 = 214013 * qword_10099F028 + 2531011;\n    v8 = 0;\n    v8.f32[0] = (float)(WORD1(qword_10099F028) & 0x7FFF) / 32767.0;\n  }\n  return (TeleportPortalObject *)sub_1007200C0(\n                                   v6,\n                                   (unsigned int)(int)(float)((float)v7\n                                                            * _mm_andnot_ps(_mm_cmpeq_ss((__m128)0x3F800000u, v8), v8).f32[0]));\n}", "assembly": "; \n; GJBaseGameLayer::getPortalTarget from 0x1001211a0 to 0x1001212a6 (262 bytes)\n; \n; 1 xrefs:\n; > GJBaseGameLayer::teleportPlayer @ 0x100120b59\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\npush    rbp                                                            ; +0x0, 0x1001211a0\nmov     rbp, rsp                                                       ; +0x1, 0x1001211a1\npush    r15                                                            ; +0x4, 0x1001211a4\npush    r14                                                            ; +0x6, 0x1001211a6\npush    rbx                                                            ; +0x8, 0x1001211a8\npush    rax                                                            ; +0x9, 0x1001211a9\nmov     rax, [rsi+730h]                                                ; +0xa, 0x1001211aa\ntest    rax, rax                                                       ; +0x11, 0x1001211b1\njnz     loc_10012129B                                                  ; +0x14, 0x1001211b4\nmov     eax, [rsi+5B8h]                                                ; +0x1a, 0x1001211ba\ntest    eax, eax                                                       ; +0x20, 0x1001211c0\njle     loc_100121299                                                  ; +0x22, 0x1001211c2\ncmp     eax, 270Fh                                                     ; +0x28, 0x1001211c8\nmov     r14d, 270Fh                                                    ; +0x2d, 0x1001211cd\ncmovb   r14d, eax                                                      ; +0x33, 0x1001211d3\nmov     rax, [rdi+0E00h]                                               ; +0x37, 0x1001211d7\nmov     rbx, [rax+r14*8]                                               ; +0x3e, 0x1001211de\ntest    rbx, rbx                                                       ; +0x42, 0x1001211e2\njz      short loc_100121261                                            ; +0x45, 0x1001211e5\nmov     rdi, rbx                                                       ; +0x47, 0x1001211e7\ncall    sub_100720070                                                  ; +0x4a, 0x1001211ea\ntest    eax, eax                                                       ; +0x4f, 0x1001211ef\njle     loc_100121299                                                  ; +0x51, 0x1001211f1\nxorps   xmm0, xmm0                                                     ; +0x57, 0x1001211f7\ncmp     eax, 1                                                         ; +0x5a, 0x1001211fa\njz      short loc_100121230                                            ; +0x5d, 0x1001211fd\nimul    rcx, cs:qword_10099F028, 343FDh                                ; +0x5f, 0x1001211ff\nadd     rcx, 269EC3h                                                   ; +0x6a, 0x10012120a\nmov     cs:qword_10099F028, rcx                                        ; +0x71, 0x100121211\nshr     ecx, 10h                                                       ; +0x78, 0x100121218\nand     ecx, 7FFFh                                                     ; +0x7b, 0x10012121b\nxorps   xmm0, xmm0                                                     ; +0x81, 0x100121221\ncvtsi2ss xmm0, ecx                                                     ; +0x84, 0x100121224\ndivss   xmm0, cs:dword_100816868                                       ; +0x88, 0x100121228\nmovss   xmm1, cs:alpha                                                 ; +0x90, 0x100121230\ncmpeqss xmm1, xmm0                                                     ; +0x98, 0x100121238\nandnps  xmm1, xmm0                                                     ; +0x9d, 0x10012123d\nxorps   xmm0, xmm0                                                     ; +0xa0, 0x100121240\ncvtsi2ss xmm0, eax                                                     ; +0xa3, 0x100121243\nmulss   xmm0, xmm1                                                     ; +0xa7, 0x100121247\ncvttss2si esi, xmm0                                                    ; +0xab, 0x10012124b\nmov     rdi, rbx                                                       ; +0xaf, 0x10012124f\nadd     rsp, 8                                                         ; +0xb2, 0x100121252\npop     rbx                                                            ; +0xb6, 0x100121256\npop     r14                                                            ; +0xb7, 0x100121257\npop     r15                                                            ; +0xb9, 0x100121259\npop     rbp                                                            ; +0xbb, 0x10012125b\njmp     sub_1007200C0                                                  ; +0xbc, 0x10012125c\nmov     r15, rdi                                                       ; +0xc1, 0x100121261\ncall    sub_10071F9E0                                                  ; +0xc4, 0x100121264\nmov     rbx, rax                                                       ; +0xc9, 0x100121269\nmov     rdi, [r15+0DE8h]                                               ; +0xcc, 0x10012126c\nmov     rsi, rax                                                       ; +0xd3, 0x100121273\nmov     rdx, r14                                                       ; +0xd6, 0x100121276\ncall    cocos2d__CCDictionary__setObject                               ; +0xd9, 0x100121279\nmov     rax, [r15+0E00h]                                               ; +0xde, 0x10012127e\nmov     [rax+r14*8], rbx                                               ; +0xe5, 0x100121285\nmov     rdi, rbx                                                       ; +0xe9, 0x100121289\ncall    sub_100720070                                                  ; +0xec, 0x10012128c\ntest    eax, eax                                                       ; +0xf1, 0x100121291\njg      loc_1001211F7                                                  ; +0xf3, 0x100121293\nxor     eax, eax                                                       ; +0xf9, 0x100121299\nadd     rsp, 8                                                         ; +0xfb, 0x10012129b\npop     rbx                                                            ; +0xff, 0x10012129f\npop     r14                                                            ; +0x100, 0x1001212a0\npop     r15                                                            ; +0x102, 0x1001212a2\npop     rbp                                                            ; +0x104, 0x1001212a4\nretn                                                                   ; +0x105, 0x1001212a5", "xrefs": ["GJBaseGameLayer::teleportPlayer @ 0x100120b59"], "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"}