#!/usr/bin/env python3

# SPDX-FileCopyrightText: © 2022 Decompollaborate
# SPDX-License-Identifier: MIT

from __future__ import annotations

from .rabbitizer import Instruction
from .LoPairingInfo import LoPairingInfo


class RegistersTracker:
    def __init__(self, other: RegistersTracker|None=None): ...

    def moveRegisters(self, instr: Instruction) -> bool: ...
    def overwriteRegisters(self, instr: Instruction, instructionOffset: int) -> None: ...
    def unsetRegistersAfterFuncCall(self, instr: Instruction, prevInstr: Instruction) -> None: ...
    def getAddressIfCanSetType(self, instr: Instruction, instrOffset: int) -> int|None: ...
    def getJrInfo(self, instr: Instruction) -> tuple[int, int]|None: ...

    def processLui(self, instr: Instruction, instrOffset: int, prevInstr: Instruction|None=None) -> None: ...
    def processGpLoad(self, instr: Instruction, instrOffset: int) -> None: ...
    def getLuiOffsetForConstant(self, instr: Instruction) -> int|None: ...
    def processConstant(self, instr: Instruction, value: int, offset: int) -> None: ...
    def getLuiOffsetForLo(self, instr: Instruction, instrOffset: int) -> tuple[int, bool, bool]: ... #! deprecated
    def preprocessLoAndGetInfo(self, instr: Instruction, instrOffset: int) -> LoPairingInfo: ...
    def processLo(self, instr: Instruction, value: int, offset: int) -> None: ...
    def hasLoButNoHi(self, instr: Instruction) -> bool: ...
