{"type": "func", "start": 4296246224, "end": 4296246347, "name": "GJBaseGameLayer::convertToClosestDirection", "pseudocode": "// \n// GJBaseGameLayer::convertToClosestDirection from 0x1001383d0 to 0x10013844b (123 bytes)\n// \n// 3 xrefs:\n// > PlayLayer::updateScreenRotation @ 0x1000b5ef9\n// > PlayerObject::redirectDash @ 0x100410b36\n// > PlayerObject::redirectPlayerForce @ 0x10041b230\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\n// local variable allocation has failed, the output may be wrong!\nfloat __fastcall GJBaseGameLayer::convertToClosestDirection(float a1, float a2)\n{\n  __m128 v2; // xmm2\n  __m128 v3; // xmm2\n  __m128 v4; // xmm2\n  __m128 v5; // xmm2\n\n  if ( (float)-a2 <= a1 )\n  {\n    if ( a1 > a2 )\n    {\n      v4 = _mm_and_ps((__m128)xmmword_100815500, *(__m128 *)&a1);\n      v4.f32[0] = v4.f32[0] / a2;\n      v5 = _mm_round_ss(v4, v4, 9);\n      v5.f32[0] = v5.f32[0] * 0.5;\n      return a1 - (float)((float)(a2 + a2) * _mm_round_ss(v5, v5, 10).f32[0]);\n    }\n  }\n  else\n  {\n    v2 = _mm_and_ps((__m128)xmmword_100815500, *(__m128 *)&a1);\n    v2.f32[0] = v2.f32[0] / a2;\n    v3 = _mm_round_ss(v2, v2, 9);\n    v3.f32[0] = v3.f32[0] * 0.5;\n    return (float)((float)(a2 + a2) * _mm_round_ss(v3, v3, 10).f32[0]) + a1;\n  }\n  return a1;\n}", "assembly": "; \n; GJBaseGameLayer::convertToClosestDirection from 0x1001383d0 to 0x10013844b (123 bytes)\n; \n; 3 xrefs:\n; > PlayLayer::updateScreenRotation @ 0x1000b5ef9\n; > PlayerObject::redirectDash @ 0x100410b36\n; > PlayerObject::redirectPlayerForce @ 0x10041b230\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, 0x1001383d0\nmov     rbp, rsp                                                       ; +0x1, 0x1001383d1\nmovaps  xmm2, cs:xmmword_1008150B0                                     ; +0x4, 0x1001383d4\nxorps   xmm2, xmm1                                                     ; +0xb, 0x1001383db\nucomiss xmm2, xmm0                                                     ; +0xe, 0x1001383de\njbe     short loc_100138416                                            ; +0x11, 0x1001383e1\nmovaps  xmm2, cs:xmmword_100815500                                     ; +0x13, 0x1001383e3\nandps   xmm2, xmm0                                                     ; +0x1a, 0x1001383ea\ndivss   xmm2, xmm1                                                     ; +0x1d, 0x1001383ed\nroundss xmm2, xmm2, 9                                                  ; +0x21, 0x1001383f1\nmulss   xmm2, cs:dword_100814FA8                                       ; +0x27, 0x1001383f7\nroundss xmm2, xmm2, 0Ah                                                ; +0x2f, 0x1001383ff\naddss   xmm1, xmm1                                                     ; +0x35, 0x100138405\nmulss   xmm1, xmm2                                                     ; +0x39, 0x100138409\naddss   xmm1, xmm0                                                     ; +0x3d, 0x10013840d\nmovaps  xmm0, xmm1                                                     ; +0x41, 0x100138411\npop     rbp                                                            ; +0x44, 0x100138414\nretn                                                                   ; +0x45, 0x100138415\nucomiss xmm0, xmm1                                                     ; +0x46, 0x100138416\njbe     short loc_100138449                                            ; +0x49, 0x100138419\nmovaps  xmm2, cs:xmmword_100815500                                     ; +0x4b, 0x10013841b\nandps   xmm2, xmm0                                                     ; +0x52, 0x100138422\ndivss   xmm2, xmm1                                                     ; +0x55, 0x100138425\nroundss xmm2, xmm2, 9                                                  ; +0x59, 0x100138429\nmulss   xmm2, cs:dword_100814FA8                                       ; +0x5f, 0x10013842f\nroundss xmm2, xmm2, 0Ah                                                ; +0x67, 0x100138437\naddss   xmm1, xmm1                                                     ; +0x6d, 0x10013843d\nmulss   xmm1, xmm2                                                     ; +0x71, 0x100138441\nsubss   xmm0, xmm1                                                     ; +0x75, 0x100138445\npop     rbp                                                            ; +0x79, 0x100138449\nretn                                                                   ; +0x7a, 0x10013844a", "xrefs": ["PlayLayer::updateScreenRotation @ 0x1000b5ef9", "PlayerObject::redirectDash @ 0x100410b36", "PlayerObject::redirectPlayerForce @ 0x10041b230"], "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"}