{"type": "func", "start": 4299138684, "end": 4299139084, "name": "LevelEditorLayer::rotationForSlopeNearObject", "pseudocode": "// \n// LevelEditorLayer::rotationForSlopeNearObject from 0x1003fa67c to 0x1003fa80c (400 bytes)\n// \n// 3 xrefs:\n// > EditorUI::getSnapAngle @ 0x10015d810\n// > EditorUI::getSnapAngle @ 0x10015d850\n// > EditorUI::transformObject @ 0x10015e148\n// \n// This function is hookable on this platform (idp: arm, 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:04:35 +0000\n// \n\nfloat __fastcall LevelEditorLayer::rotationForSlopeNearObject(__int64 a1, __int64 a2)\n{\n  double v4; // d0\n  __int64 v5; // x21\n  float v6; // s8\n  unsigned int v7; // w22\n  _BYTE *v8; // x20\n  int v9; // w8\n  signed int v10; // w21\n  _QWORD v12[2]; // [xsp+0h] [xbp-50h] BYREF\n  _QWORD v13[2]; // [xsp+10h] [xbp-40h] BYREF\n\n  GameObject::updateStartPos(a2);\n  (*(void (__fastcall **)(_QWORD *__return_ptr, __int64, float, float))(*(_QWORD *)a2 + 1336LL))(v13, a2, 1.0, 1.0);\n  v4 = sub_1000264D4(v12, (__int64)v13);\n  v5 = LevelEditorLayer::objectsInRect(a1, v12, 1, v4);\n  v6 = -1.0;\n  if ( (unsigned int)sub_1002E757C(v5) )\n  {\n    v7 = 0;\n    while ( 1 )\n    {\n      v8 = (_BYTE *)sub_1002E75A0(v5, v7);\n      if ( (*(unsigned int (__fastcall **)(_BYTE *))(*(_QWORD *)v8 + 1800LL))(v8) == 25 )\n        break;\n      if ( ++v7 >= (unsigned int)sub_1002E757C(v5) )\n        return v6;\n    }\n    GameObject::determineSlopeDirection((__int64)v8);\n    v9 = (int)(float)(sub_1002FA3D4((__int64)v8) * 57.296);\n    if ( v8[1080] )\n      v10 = -v9;\n    else\n      v10 = v9;\n    if ( (unsigned int)sub_1002FE9C0((__int64)v8)\n      && !(*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 1432LL))(a2)\n      || (sub_1002FE9C0((__int64)v8) & 1) == 0 && (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 1432LL))(a2) )\n    {\n      if ( v10 < 1 )\n        return (float)(signed int)(v10 - 180 + 360 * ((180 - v10) / 0x168u));\n      else\n        return (float)((v10 + 180) % 0x168u);\n    }\n    return (float)v10;\n  }\n  return v6;\n}", "assembly": "; \n; LevelEditorLayer::rotationForSlopeNearObject from 0x1003fa67c to 0x1003fa80c (400 bytes)\n; \n; 3 xrefs:\n; > EditorUI::getSnapAngle @ 0x10015d810\n; > EditorUI::getSnapAngle @ 0x10015d850\n; > EditorUI::transformObject @ 0x10015e148\n; \n; This function is hookable on this platform (idp: arm, 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:04:35 +0000\n; \nSUB             SP, SP, #0x60                                          ; +0x0, 0x1003fa67c\nSTP             D9, D8, [SP,#0x50+var_30]                              ; +0x4, 0x1003fa680\nSTP             X22, X21, [SP,#0x50+var_20]                            ; +0x8, 0x1003fa684\nSTP             X20, X19, [SP,#0x50+var_10]                            ; +0xc, 0x1003fa688\nSTP             X29, X30, [SP,#0x50+var_s0]                            ; +0x10, 0x1003fa68c\nADD             X29, SP, #0x50                                         ; +0x14, 0x1003fa690\nMOV             X19, X1                                                ; +0x18, 0x1003fa694\nMOV             X20, X0                                                ; +0x1c, 0x1003fa698\nMOV             X0, X1                                                 ; +0x20, 0x1003fa69c\nBL              GameObject__updateStartPos                             ; +0x24, 0x1003fa6a0\nLDR             X8, [X19]                                              ; +0x28, 0x1003fa6a4\nLDR             X9, [X8,#0x538]                                        ; +0x2c, 0x1003fa6a8\nADD             X8, SP, #0x50+var_40                                   ; +0x30, 0x1003fa6ac\nFMOV            S0, #1.0                                               ; +0x34, 0x1003fa6b0\nFMOV            S1, #1.0                                               ; +0x38, 0x1003fa6b4\nMOV             X0, X19                                                ; +0x3c, 0x1003fa6b8\nBLR             X9                                                     ; +0x40, 0x1003fa6bc\nMOV             X0, SP                                                 ; +0x44, 0x1003fa6c0\nADD             X1, SP, #0x50+var_40                                   ; +0x48, 0x1003fa6c4\nBL              sub_1000264D4                                          ; +0x4c, 0x1003fa6c8\nMOV             X1, SP                                                 ; +0x50, 0x1003fa6cc\nMOV             X0, X20                                                ; +0x54, 0x1003fa6d0\nMOV             W2, #1                                                 ; +0x58, 0x1003fa6d4\nBL              LevelEditorLayer__objectsInRect                        ; +0x5c, 0x1003fa6d8\nMOV             X21, X0                                                ; +0x60, 0x1003fa6dc\nBL              sub_1002E757C                                          ; +0x64, 0x1003fa6e0\nFMOV            S8, #-1.0                                              ; +0x68, 0x1003fa6e4\nCBZ             W0, loc_1003FA7F0                                      ; +0x6c, 0x1003fa6e8\nMOV             W22, #0                                                ; +0x70, 0x1003fa6ec\nMOV             X0, X21                                                ; +0x74, 0x1003fa6f0\nMOV             X1, X22                                                ; +0x78, 0x1003fa6f4\nBL              sub_1002E75A0                                          ; +0x7c, 0x1003fa6f8\nMOV             X20, X0                                                ; +0x80, 0x1003fa6fc\nLDR             X8, [X0]                                               ; +0x84, 0x1003fa700\nLDR             X8, [X8,#0x708]                                        ; +0x88, 0x1003fa704\nBLR             X8                                                     ; +0x8c, 0x1003fa708\nCMP             W0, #0x19                                              ; +0x90, 0x1003fa70c\nB.EQ            loc_1003FA72C                                          ; +0x94, 0x1003fa710\nADD             W22, W22, #1                                           ; +0x98, 0x1003fa714\nMOV             X0, X21                                                ; +0x9c, 0x1003fa718\nBL              sub_1002E757C                                          ; +0xa0, 0x1003fa71c\nCMP             W22, W0                                                ; +0xa4, 0x1003fa720\nB.CC            loc_1003FA6F0                                          ; +0xa8, 0x1003fa724\nB               loc_1003FA7F0                                          ; +0xac, 0x1003fa728\nMOV             X0, X20                                                ; +0xb0, 0x1003fa72c\nBL              GameObject__determineSlopeDirection                    ; +0xb4, 0x1003fa730\nMOV             X0, X20                                                ; +0xb8, 0x1003fa734\nBL              sub_1002FA3D4                                          ; +0xbc, 0x1003fa738\nADRP            X8, #dword_10075E960@PAGE                              ; +0xc0, 0x1003fa73c\nLDR             S1, [X8,#dword_10075E960@PAGEOFF]                      ; +0xc4, 0x1003fa740\nFMUL            S0, S0, S1                                             ; +0xc8, 0x1003fa744\nFCVTZS          W8, S0                                                 ; +0xcc, 0x1003fa748\nLDRB            W9, [X20,#0x438]                                       ; +0xd0, 0x1003fa74c\nCMP             W9, #0                                                 ; +0xd4, 0x1003fa750\nCNEG            W21, W8, NE                                            ; +0xd8, 0x1003fa754\nMOV             X0, X20                                                ; +0xdc, 0x1003fa758\nBL              sub_1002FE9C0                                          ; +0xe0, 0x1003fa75c\nCBZ             W0, loc_1003FA778                                      ; +0xe4, 0x1003fa760\nLDR             X8, [X19]                                              ; +0xe8, 0x1003fa764\nLDR             X8, [X8,#0x598]                                        ; +0xec, 0x1003fa768\nMOV             X0, X19                                                ; +0xf0, 0x1003fa76c\nBLR             X8                                                     ; +0xf4, 0x1003fa770\nCBZ             W0, loc_1003FA798                                      ; +0xf8, 0x1003fa774\nMOV             X0, X20                                                ; +0xfc, 0x1003fa778\nBL              sub_1002FE9C0                                          ; +0x100, 0x1003fa77c\nTBNZ            W0, #0, loc_1003FA7EC                                  ; +0x104, 0x1003fa780\nLDR             X8, [X19]                                              ; +0x108, 0x1003fa784\nLDR             X8, [X8,#0x598]                                        ; +0x10c, 0x1003fa788\nMOV             X0, X19                                                ; +0x110, 0x1003fa78c\nBLR             X8                                                     ; +0x114, 0x1003fa790\nCBZ             W0, loc_1003FA7EC                                      ; +0x118, 0x1003fa794\nCMP             W21, #1                                                ; +0x11c, 0x1003fa798\nB.LT            loc_1003FA7C4                                          ; +0x120, 0x1003fa79c\nADD             W8, W21, #0xB4                                         ; +0x124, 0x1003fa7a0\nLSR             W9, W8, #3                                             ; +0x128, 0x1003fa7a4\nMOV             W10, #0x16C16C17                                       ; +0x12c, 0x1003fa7a8\nUMULL           X9, W9, W10                                            ; +0x134, 0x1003fa7b0\nLSR             X9, X9, #0x22 ; '\"'                                    ; +0x138, 0x1003fa7b4\nMOV             W10, #0x168                                            ; +0x13c, 0x1003fa7b8\nMSUB            W21, W9, W10, W8                                       ; +0x140, 0x1003fa7bc\nB               loc_1003FA7EC                                          ; +0x144, 0x1003fa7c0\nMOV             W8, #0xB4                                              ; +0x148, 0x1003fa7c4\nSUB             W8, W8, W21                                            ; +0x14c, 0x1003fa7c8\nLSR             W9, W8, #3                                             ; +0x150, 0x1003fa7cc\nMOV             W10, #0x16C16C17                                       ; +0x154, 0x1003fa7d0\nUMULL           X9, W9, W10                                            ; +0x15c, 0x1003fa7d8\nLSR             X9, X9, #0x22 ; '\"'                                    ; +0x160, 0x1003fa7dc\nMOV             W10, #0x168                                            ; +0x164, 0x1003fa7e0\nNEG             W8, W8                                                 ; +0x168, 0x1003fa7e4\nMADD            W21, W9, W10, W8                                       ; +0x16c, 0x1003fa7e8\nSCVTF           S8, W21                                                ; +0x170, 0x1003fa7ec\nFMOV            S0, S8                                                 ; +0x174, 0x1003fa7f0\nLDP             X29, X30, [SP,#0x50+var_s0]                            ; +0x178, 0x1003fa7f4\nLDP             X20, X19, [SP,#0x50+var_10]                            ; +0x17c, 0x1003fa7f8\nLDP             X22, X21, [SP,#0x50+var_20]                            ; +0x180, 0x1003fa7fc\nLDP             D9, D8, [SP,#0x50+var_30]                              ; +0x184, 0x1003fa800\nADD             SP, SP, #0x60 ; '`'                                    ; +0x188, 0x1003fa804\nRET                                                                    ; +0x18c, 0x1003fa808", "xrefs": ["EditorUI::getSnapAngle @ 0x10015d810", "EditorUI::getSnapAngle @ 0x10015d850", "EditorUI::transformObject @ 0x10015e148"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "arm", "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"}