{"type": "func", "start": 4300988544, "end": 4300989085, "name": "GameObject::determineSlopeDirection", "pseudocode": "// \n// GameObject::determineSlopeDirection from 0x1005be080 to 0x1005be29d (541 bytes)\n// \n// 13 xrefs:\n// > EditorUI::addObjectsToSmartTemplate @ 0x1000413c5\n// > EditorUI::createSmartObjectsFromTemplate @ 0x100042b0a\n// > EditorUI::createSmartObjectsFromTemplate @ 0x100042c7c\n// > PlayLayer::addObject @ 0x1000b1fd4\n// > LevelEditorLayer::addSpecial @ 0x1000e0063\n// > LevelEditorLayer::rotationForSlopeNearObject @ 0x1000e0baf\n// > LevelEditorLayer::onPlaytest @ 0x1000f2483\n// > GJBaseGameLayer::updateDebugDraw @ 0x100121cb6\n// > RotateGameplayGameObject::updateGameplayRotation @ 0x1001f3939\n// > RotateGameplayGameObject::updateStartValues @ 0x1001f3991\n// > PlayerObject::rotateGameplayObject @ 0x100406ed9\n// > PlayerObject::unrotateGameplayObject @ 0x10040b5d7\n// > GameObject::getObjectDirection @ 0x1005be2e9\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\nvoid __fastcall GameObject::determineSlopeDirection(GameObject *a1)\n{\n  unsigned __int8 v2; // r14\n  unsigned __int8 v3; // r15\n  int v4; // eax\n  int v5; // ecx\n  float v6; // xmm0_4\n  unsigned __int8 v7; // r9\n  char v8; // di\n  unsigned __int8 v9; // r10\n  char v10; // dl\n  char v11; // si\n  char v12; // r14\n\n  v2 = ((__int64 (__fastcall *)(GameObject *))a1->isFlipX)(a1);\n  v3 = ((__int64 (__fastcall *)(GameObject *))a1->isFlipY)(a1);\n  v4 = (int)((float (__fastcall *)(GameObject *))a1->getObjectRotation)(a1) % 360;\n  a1->m_slopeUphill = 0;\n  v5 = 0;\n  if ( !v2 && !(v3 | (v4 != 0)) )\n    goto LABEL_5;\n  v6 = fabs((float)v4);\n  v7 = v2 ^ 1;\n  v8 = v3 ^ 1 | v2 ^ 1;\n  if ( (v8 & 1) == 0 && v6 == 180.0 )\n    goto LABEL_5;\n  v9 = v3 & (v4 == 0);\n  v5 = 1;\n  if ( (v9 & v7) != 0 )\n    goto LABEL_6;\n  v10 = v3 | v7;\n  if ( ((v3 | v7) & 1) == 0 && v6 == 180.0 )\n    goto LABEL_6;\n  v5 = 2;\n  if ( !(v3 & 1 | (v4 != 0) | v7 & 1) )\n    goto LABEL_6;\n  v11 = v2 | v3 ^ 1;\n  if ( (v11 & 1) == 0 && v6 == 180.0 )\n    goto LABEL_6;\n  v5 = 3;\n  if ( (v9 & v2) != 0 )\n    goto LABEL_5;\n  v12 = v3 | v2;\n  if ( (v12 & 1) == 0 && v6 == 180.0 )\n    goto LABEL_5;\n  if ( (v12 & 1) == 0 )\n  {\n    v5 = 4;\n    if ( v4 == -270 || v4 == 90 )\n      goto LABEL_6;\n  }\n  if ( (v8 & 1) == 0 )\n  {\n    v5 = 4;\n    if ( v4 == -90 || v4 == 270 )\n      goto LABEL_6;\n  }\n  if ( (v12 & 1) == 0 )\n  {\n    v5 = 5;\n    if ( v4 == -90 || v4 == 270 )\n      goto LABEL_6;\n  }\n  if ( (v8 & 1) == 0 )\n  {\n    v5 = 5;\n    if ( v4 == -270 || v4 == 90 )\n      goto LABEL_6;\n  }\n  if ( (v10 & 1) == 0 )\n  {\n    v5 = 6;\n    if ( v4 == -270 || v4 == 90 )\n      goto LABEL_5;\n  }\n  if ( (v11 & 1) == 0 )\n  {\n    v5 = 6;\n    if ( v4 > 89 )\n    {\n      if ( v4 != 90 )\n      {\n        if ( v4 != 270 )\n          goto LABEL_33;\n        goto LABEL_5;\n      }\n    }\n    else if ( v4 != -270 )\n    {\n      if ( v4 != -90 )\n        goto LABEL_33;\nLABEL_5:\n      a1->m_slopeUphill = 1;\nLABEL_6:\n      a1->m_slopeDirection = v5;\n      return;\n    }\nLABEL_44:\n    v5 = 7;\n    goto LABEL_5;\n  }\nLABEL_33:\n  if ( (v10 & 1) == 0 && (v4 == 270 || v4 == -90) )\n    goto LABEL_44;\n}", "assembly": "; \n; GameObject::determineSlopeDirection from 0x1005be080 to 0x1005be29d (541 bytes)\n; \n; 13 xrefs:\n; > EditorUI::addObjectsToSmartTemplate @ 0x1000413c5\n; > EditorUI::createSmartObjectsFromTemplate @ 0x100042b0a\n; > EditorUI::createSmartObjectsFromTemplate @ 0x100042c7c\n; > PlayLayer::addObject @ 0x1000b1fd4\n; > LevelEditorLayer::addSpecial @ 0x1000e0063\n; > LevelEditorLayer::rotationForSlopeNearObject @ 0x1000e0baf\n; > LevelEditorLayer::onPlaytest @ 0x1000f2483\n; > GJBaseGameLayer::updateDebugDraw @ 0x100121cb6\n; > RotateGameplayGameObject::updateGameplayRotation @ 0x1001f3939\n; > RotateGameplayGameObject::updateStartValues @ 0x1001f3991\n; > PlayerObject::rotateGameplayObject @ 0x100406ed9\n; > PlayerObject::unrotateGameplayObject @ 0x10040b5d7\n; > GameObject::getObjectDirection @ 0x1005be2e9\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, 0x1005be080\nmov     rbp, rsp                                                       ; +0x1, 0x1005be081\npush    r15                                                            ; +0x4, 0x1005be084\npush    r14                                                            ; +0x6, 0x1005be086\npush    rbx                                                            ; +0x8, 0x1005be088\npush    rax                                                            ; +0x9, 0x1005be089\nmov     rbx, rdi                                                       ; +0xa, 0x1005be08a\nmov     rax, [rdi]                                                     ; +0xd, 0x1005be08d\ncall    qword ptr [rax+580h]                                           ; +0x10, 0x1005be090\nmov     r14d, eax                                                      ; +0x16, 0x1005be096\nmov     rax, [rbx]                                                     ; +0x19, 0x1005be099\nmov     rdi, rbx                                                       ; +0x1c, 0x1005be09c\ncall    qword ptr [rax+588h]                                           ; +0x1f, 0x1005be09f\nmov     r15d, eax                                                      ; +0x25, 0x1005be0a5\nmov     rax, [rbx]                                                     ; +0x28, 0x1005be0a8\nmov     rdi, rbx                                                       ; +0x2b, 0x1005be0ab\ncall    qword ptr [rax+618h]                                           ; +0x2e, 0x1005be0ae\ncvttss2si eax, xmm0                                                    ; +0x34, 0x1005be0b4\ncdqe                                                                   ; +0x38, 0x1005be0b8\nimul    rcx, rax, 0FFFFFFFFB60B60B7h                                   ; +0x3a, 0x1005be0ba\nshr     rcx, 20h                                                       ; +0x41, 0x1005be0c1\nadd     ecx, eax                                                       ; +0x45, 0x1005be0c5\nmov     edx, ecx                                                       ; +0x47, 0x1005be0c7\nshr     edx, 1Fh                                                       ; +0x49, 0x1005be0c9\nsar     ecx, 8                                                         ; +0x4c, 0x1005be0cc\nadd     ecx, edx                                                       ; +0x4f, 0x1005be0cf\nimul    ecx, 168h                                                      ; +0x51, 0x1005be0d1\nsub     eax, ecx                                                       ; +0x57, 0x1005be0d7\nmov     byte ptr [rbx+438h], 0                                         ; +0x59, 0x1005be0d9\nsetnz   r8b                                                            ; +0x60, 0x1005be0e0\nor      r8b, r15b                                                      ; +0x64, 0x1005be0e4\nxor     ecx, ecx                                                       ; +0x67, 0x1005be0e7\ntest    r14b, r14b                                                     ; +0x69, 0x1005be0e9\njnz     short loc_1005BE0F3                                            ; +0x6c, 0x1005be0ec\ntest    r8b, r8b                                                       ; +0x6e, 0x1005be0ee\njz      short loc_1005BE126                                            ; +0x71, 0x1005be0f1\nxorps   xmm0, xmm0                                                     ; +0x73, 0x1005be0f3\ncvtsi2ss xmm0, eax                                                     ; +0x76, 0x1005be0f6\nandps   xmm0, cs:xmmword_100815500                                     ; +0x7a, 0x1005be0fa\nmov     r9d, r14d                                                      ; +0x81, 0x1005be101\nxor     r9b, 1                                                         ; +0x84, 0x1005be104\nmov     esi, r15d                                                      ; +0x88, 0x1005be108\nxor     sil, 1                                                         ; +0x8b, 0x1005be10b\nmov     edi, r9d                                                       ; +0x8f, 0x1005be10f\nor      dil, sil                                                       ; +0x92, 0x1005be112\ntest    dil, 1                                                         ; +0x95, 0x1005be115\njnz     short loc_1005BE13E                                            ; +0x99, 0x1005be119\nucomiss xmm0, cs:dword_100815738                                       ; +0x9b, 0x1005be11b\njnz     short loc_1005BE13E                                            ; +0xa2, 0x1005be122\njp      short loc_1005BE13E                                            ; +0xa4, 0x1005be124\nmov     byte ptr [rbx+438h], 1                                         ; +0xa6, 0x1005be126\nmov     [rbx+43Ch], ecx                                                ; +0xad, 0x1005be12d\nadd     rsp, 8                                                         ; +0xb3, 0x1005be133\npop     rbx                                                            ; +0xb7, 0x1005be137\npop     r14                                                            ; +0xb8, 0x1005be138\npop     r15                                                            ; +0xba, 0x1005be13a\npop     rbp                                                            ; +0xbc, 0x1005be13c\nretn                                                                   ; +0xbd, 0x1005be13d\ntest    eax, eax                                                       ; +0xbe, 0x1005be13e\nsetz    r10b                                                           ; +0xc0, 0x1005be140\nand     r10b, r15b                                                     ; +0xc4, 0x1005be144\nmov     ecx, 1                                                         ; +0xc7, 0x1005be147\ntest    r9b, r10b                                                      ; +0xcc, 0x1005be14c\njnz     short loc_1005BE12D                                            ; +0xcf, 0x1005be14f\nmov     edx, r9d                                                       ; +0xd1, 0x1005be151\nor      dl, r15b                                                       ; +0xd4, 0x1005be154\ntest    dl, 1                                                          ; +0xd7, 0x1005be157\njnz     short loc_1005BE167                                            ; +0xda, 0x1005be15a\nucomiss xmm0, cs:dword_100815738                                       ; +0xdc, 0x1005be15c\njnz     short loc_1005BE167                                            ; +0xe3, 0x1005be163\njnp     short loc_1005BE12D                                            ; +0xe5, 0x1005be165\nor      r9b, r8b                                                       ; +0xe7, 0x1005be167\nmov     ecx, 2                                                         ; +0xea, 0x1005be16a\ntest    r9b, 1                                                         ; +0xef, 0x1005be16f\njz      short loc_1005BE12D                                            ; +0xf3, 0x1005be173\nor      sil, r14b                                                      ; +0xf5, 0x1005be175\ntest    sil, 1                                                         ; +0xf8, 0x1005be178\njnz     short loc_1005BE189                                            ; +0xfc, 0x1005be17c\nucomiss xmm0, cs:dword_100815738                                       ; +0xfe, 0x1005be17e\njnz     short loc_1005BE189                                            ; +0x105, 0x1005be185\njnp     short loc_1005BE12D                                            ; +0x107, 0x1005be187\nmov     ecx, 3                                                         ; +0x109, 0x1005be189\ntest    r14b, r10b                                                     ; +0x10e, 0x1005be18e\njnz     short loc_1005BE126                                            ; +0x111, 0x1005be191\nor      r14b, r15b                                                     ; +0x113, 0x1005be193\ntest    r14b, 1                                                        ; +0x116, 0x1005be196\njnz     short loc_1005BE1AB                                            ; +0x11a, 0x1005be19a\nucomiss xmm0, cs:dword_100815738                                       ; +0x11c, 0x1005be19c\njnz     short loc_1005BE1AB                                            ; +0x123, 0x1005be1a3\njnp     loc_1005BE126                                                  ; +0x125, 0x1005be1a5\ntest    r14b, 1                                                        ; +0x12b, 0x1005be1ab\njnz     short loc_1005BE1CA                                            ; +0x12f, 0x1005be1af\nmov     ecx, 4                                                         ; +0x131, 0x1005be1b1\ncmp     eax, 0FFFFFEF2h                                                ; +0x136, 0x1005be1b6\njz      loc_1005BE12D                                                  ; +0x13b, 0x1005be1bb\ncmp     eax, 5Ah ; 'Z'                                                 ; +0x141, 0x1005be1c1\njz      loc_1005BE12D                                                  ; +0x144, 0x1005be1c4\ntest    dil, 1                                                         ; +0x14a, 0x1005be1ca\njnz     short loc_1005BE1E9                                            ; +0x14e, 0x1005be1ce\nmov     ecx, 4                                                         ; +0x150, 0x1005be1d0\ncmp     eax, 0FFFFFFA6h                                                ; +0x155, 0x1005be1d5\njz      loc_1005BE12D                                                  ; +0x158, 0x1005be1d8\ncmp     eax, 10Eh                                                      ; +0x15e, 0x1005be1de\njz      loc_1005BE12D                                                  ; +0x163, 0x1005be1e3\ntest    r14b, 1                                                        ; +0x169, 0x1005be1e9\njnz     short loc_1005BE208                                            ; +0x16d, 0x1005be1ed\nmov     ecx, 5                                                         ; +0x16f, 0x1005be1ef\ncmp     eax, 0FFFFFFA6h                                                ; +0x174, 0x1005be1f4\njz      loc_1005BE12D                                                  ; +0x177, 0x1005be1f7\ncmp     eax, 10Eh                                                      ; +0x17d, 0x1005be1fd\njz      loc_1005BE12D                                                  ; +0x182, 0x1005be202\ntest    dil, 1                                                         ; +0x188, 0x1005be208\njnz     short loc_1005BE227                                            ; +0x18c, 0x1005be20c\nmov     ecx, 5                                                         ; +0x18e, 0x1005be20e\ncmp     eax, 0FFFFFEF2h                                                ; +0x193, 0x1005be213\njz      loc_1005BE12D                                                  ; +0x198, 0x1005be218\ncmp     eax, 5Ah ; 'Z'                                                 ; +0x19e, 0x1005be21e\njz      loc_1005BE12D                                                  ; +0x1a1, 0x1005be221\ntest    dl, 1                                                          ; +0x1a7, 0x1005be227\njnz     short loc_1005BE245                                            ; +0x1aa, 0x1005be22a\nmov     ecx, 6                                                         ; +0x1ac, 0x1005be22c\ncmp     eax, 0FFFFFEF2h                                                ; +0x1b1, 0x1005be231\njz      loc_1005BE126                                                  ; +0x1b6, 0x1005be236\ncmp     eax, 5Ah ; 'Z'                                                 ; +0x1bc, 0x1005be23c\njz      loc_1005BE126                                                  ; +0x1bf, 0x1005be23f\ntest    sil, 1                                                         ; +0x1c5, 0x1005be245\njz      short loc_1005BE265                                            ; +0x1c9, 0x1005be249\ntest    dl, 1                                                          ; +0x1cb, 0x1005be24b\njnz     loc_1005BE133                                                  ; +0x1ce, 0x1005be24e\ncmp     eax, 10Eh                                                      ; +0x1d4, 0x1005be254\njz      short loc_1005BE293                                            ; +0x1d9, 0x1005be259\ncmp     eax, 0FFFFFFA6h                                                ; +0x1db, 0x1005be25b\njz      short loc_1005BE293                                            ; +0x1de, 0x1005be25e\njmp     loc_1005BE133                                                  ; +0x1e0, 0x1005be260\nmov     ecx, 6                                                         ; +0x1e5, 0x1005be265\ncmp     eax, 59h ; 'Y'                                                 ; +0x1ea, 0x1005be26a\njg      short loc_1005BE281                                            ; +0x1ed, 0x1005be26d\ncmp     eax, 0FFFFFEF2h                                                ; +0x1ef, 0x1005be26f\njz      short loc_1005BE293                                            ; +0x1f4, 0x1005be274\ncmp     eax, 0FFFFFFA6h                                                ; +0x1f6, 0x1005be276\njz      loc_1005BE126                                                  ; +0x1f9, 0x1005be279\njmp     short loc_1005BE24B                                            ; +0x1ff, 0x1005be27f\ncmp     eax, 5Ah ; 'Z'                                                 ; +0x201, 0x1005be281\njz      short loc_1005BE293                                            ; +0x204, 0x1005be284\ncmp     eax, 10Eh                                                      ; +0x206, 0x1005be286\njz      loc_1005BE126                                                  ; +0x20b, 0x1005be28b\njmp     short loc_1005BE24B                                            ; +0x211, 0x1005be291\nmov     ecx, 7                                                         ; +0x213, 0x1005be293\njmp     loc_1005BE126                                                  ; +0x218, 0x1005be298", "xrefs": ["EditorUI::addObjectsToSmartTemplate @ 0x1000413c5", "EditorUI::createSmartObjectsFromTemplate @ 0x100042b0a", "EditorUI::createSmartObjectsFromTemplate @ 0x100042c7c", "PlayLayer::addObject @ 0x1000b1fd4", "LevelEditorLayer::addSpecial @ 0x1000e0063", "LevelEditorLayer::rotationForSlopeNearObject @ 0x1000e0baf", "LevelEditorLayer::onPlaytest @ 0x1000f2483", "GJBaseGameLayer::updateDebugDraw @ 0x100121cb6", "RotateGameplayGameObject::updateGameplayRotation @ 0x1001f3939", "RotateGameplayGameObject::updateStartValues @ 0x1001f3991", "PlayerObject::rotateGameplayObject @ 0x100406ed9", "PlayerObject::unrotateGameplayObject @ 0x10040b5d7", "GameObject::getObjectDirection @ 0x1005be2e9"], "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"}