using System.Collections.Generic;

namespace pkNX.Structures;

public static partial class PawnUtil
{
    public static readonly Dictionary<AmxOpCode, AmxOpCodeType> OpCodeTypes = new()
    {
        { AmxOpCode.NONE, AmxOpCodeType.NoParams },
        { AmxOpCode.LOAD_PRI, AmxOpCodeType.OneParam },
        { AmxOpCode.LOAD_ALT, AmxOpCodeType.OneParam },
        { AmxOpCode.LOAD_S_PRI, AmxOpCodeType.OneParam },
        { AmxOpCode.LOAD_S_ALT, AmxOpCodeType.OneParam },
        { AmxOpCode.LREF_PRI, AmxOpCodeType.OneParam },
        { AmxOpCode.LREF_ALT, AmxOpCodeType.OneParam },
        { AmxOpCode.LREF_S_PRI, AmxOpCodeType.OneParam },
        { AmxOpCode.LREF_S_ALT, AmxOpCodeType.OneParam },
        { AmxOpCode.LOAD_I, AmxOpCodeType.NoParams },
        { AmxOpCode.LODB_I, AmxOpCodeType.OneParam },
        { AmxOpCode.CONST_PRI, AmxOpCodeType.OneParam },
        { AmxOpCode.CONST_ALT, AmxOpCodeType.OneParam },
        { AmxOpCode.ADDR_PRI, AmxOpCodeType.OneParam },
        { AmxOpCode.ADDR_ALT, AmxOpCodeType.OneParam },
        { AmxOpCode.STOR_PRI, AmxOpCodeType.OneParam },
        { AmxOpCode.STOR_ALT, AmxOpCodeType.OneParam },
        { AmxOpCode.STOR_S_PRI, AmxOpCodeType.OneParam },
        { AmxOpCode.STOR_S_ALT, AmxOpCodeType.OneParam },
        { AmxOpCode.SREF_PRI, AmxOpCodeType.OneParam },
        { AmxOpCode.SREF_ALT, AmxOpCodeType.OneParam },
        { AmxOpCode.SREF_S_PRI, AmxOpCodeType.OneParam },
        { AmxOpCode.SREF_S_ALT, AmxOpCodeType.OneParam },
        { AmxOpCode.STOR_I, AmxOpCodeType.NoParams },
        { AmxOpCode.STRB_I, AmxOpCodeType.OneParam },
        { AmxOpCode.LIDX, AmxOpCodeType.NoParams },
        { AmxOpCode.LIDX_B, AmxOpCodeType.OneParam },
        { AmxOpCode.IDXADDR, AmxOpCodeType.NoParams },
        { AmxOpCode.IDXADDR_B, AmxOpCodeType.OneParam },
        { AmxOpCode.ALIGN_PRI, AmxOpCodeType.OneParam },
        { AmxOpCode.ALIGN_ALT, AmxOpCodeType.OneParam },
        { AmxOpCode.LCTRL, AmxOpCodeType.OneParam },
        { AmxOpCode.SCTRL, AmxOpCodeType.OneParam },
        { AmxOpCode.MOVE_PRI, AmxOpCodeType.NoParams },
        { AmxOpCode.MOVE_ALT, AmxOpCodeType.NoParams },
        { AmxOpCode.XCHG, AmxOpCodeType.NoParams },
        { AmxOpCode.PUSH_PRI, AmxOpCodeType.NoParams },
        { AmxOpCode.PUSH_ALT, AmxOpCodeType.NoParams },
        { AmxOpCode.PICK, AmxOpCodeType.OneParam },
        { AmxOpCode.PUSH_C, AmxOpCodeType.OneParam },
        { AmxOpCode.PUSH, AmxOpCodeType.OneParam },
        { AmxOpCode.PUSH_S, AmxOpCodeType.OneParam },
        { AmxOpCode.PPRI, AmxOpCodeType.NoParams },
        { AmxOpCode.PALT, AmxOpCodeType.NoParams },
        { AmxOpCode.STACK, AmxOpCodeType.OneParam },
        { AmxOpCode.HEAP, AmxOpCodeType.OneParam },
        { AmxOpCode.PROC, AmxOpCodeType.NoParams },
        { AmxOpCode.RET, AmxOpCodeType.NoParams },
        { AmxOpCode.RETN, AmxOpCodeType.NoParams },
        { AmxOpCode.CALL, AmxOpCodeType.Jump },
        { AmxOpCode.CALL_PRI, AmxOpCodeType.NoParams },
        { AmxOpCode.JUMP, AmxOpCodeType.Jump },
        { AmxOpCode.JREL, AmxOpCodeType.Jump },
        { AmxOpCode.JZER, AmxOpCodeType.Jump },
        { AmxOpCode.JNZ, AmxOpCodeType.Jump },
        { AmxOpCode.JEQ, AmxOpCodeType.Jump },
        { AmxOpCode.JNEQ, AmxOpCodeType.Jump },
        { AmxOpCode.JLESS, AmxOpCodeType.Jump },
        { AmxOpCode.JLEQ, AmxOpCodeType.Jump },
        { AmxOpCode.JGRTR, AmxOpCodeType.Jump },
        { AmxOpCode.JGEQ, AmxOpCodeType.Jump },
        { AmxOpCode.JSLESS, AmxOpCodeType.Jump },
        { AmxOpCode.JSLEQ, AmxOpCodeType.Jump },
        { AmxOpCode.JSGRTR, AmxOpCodeType.Jump },
        { AmxOpCode.JSGEQ, AmxOpCodeType.Jump },
        { AmxOpCode.SHL, AmxOpCodeType.NoParams },
        { AmxOpCode.SHR, AmxOpCodeType.NoParams },
        { AmxOpCode.SSHR, AmxOpCodeType.NoParams },
        { AmxOpCode.SHL_C_PRI, AmxOpCodeType.OneParam },
        { AmxOpCode.SHL_C_ALT, AmxOpCodeType.OneParam },
        { AmxOpCode.SHR_C_PRI, AmxOpCodeType.OneParam },
        { AmxOpCode.SHR_C_ALT, AmxOpCodeType.OneParam },
        { AmxOpCode.SMUL, AmxOpCodeType.NoParams },
        { AmxOpCode.SDIV, AmxOpCodeType.NoParams },
        { AmxOpCode.SDIV_ALT, AmxOpCodeType.NoParams },
        { AmxOpCode.UMUL, AmxOpCodeType.NoParams },
        { AmxOpCode.UDIV, AmxOpCodeType.NoParams },
        { AmxOpCode.UDIV_ALT, AmxOpCodeType.NoParams },
        { AmxOpCode.ADD, AmxOpCodeType.NoParams },
        { AmxOpCode.SUB, AmxOpCodeType.NoParams },
        { AmxOpCode.SUB_ALT, AmxOpCodeType.NoParams },
        { AmxOpCode.AND, AmxOpCodeType.NoParams },
        { AmxOpCode.OR, AmxOpCodeType.NoParams },
        { AmxOpCode.XOR, AmxOpCodeType.NoParams },
        { AmxOpCode.NOT, AmxOpCodeType.NoParams },
        { AmxOpCode.NEG, AmxOpCodeType.NoParams },
        { AmxOpCode.INVERT, AmxOpCodeType.NoParams },
        { AmxOpCode.ADD_C, AmxOpCodeType.OneParam },
        { AmxOpCode.SMUL_C, AmxOpCodeType.OneParam },
        { AmxOpCode.ZERO_PRI, AmxOpCodeType.NoParams },
        { AmxOpCode.ZERO_ALT, AmxOpCodeType.NoParams },
        { AmxOpCode.ZERO, AmxOpCodeType.OneParam },
        { AmxOpCode.ZERO_S, AmxOpCodeType.OneParam },
        { AmxOpCode.SIGN_PRI, AmxOpCodeType.NoParams },
        { AmxOpCode.SIGN_ALT, AmxOpCodeType.NoParams },
        { AmxOpCode.EQ, AmxOpCodeType.NoParams },
        { AmxOpCode.NEQ, AmxOpCodeType.NoParams },
        { AmxOpCode.LESS, AmxOpCodeType.NoParams },
        { AmxOpCode.LEQ, AmxOpCodeType.NoParams },
        { AmxOpCode.GRTR, AmxOpCodeType.NoParams },
        { AmxOpCode.GEQ, AmxOpCodeType.NoParams },
        { AmxOpCode.SLESS, AmxOpCodeType.NoParams },
        { AmxOpCode.SLEQ, AmxOpCodeType.NoParams },
        { AmxOpCode.SGRTR, AmxOpCodeType.NoParams },
        { AmxOpCode.SGEQ, AmxOpCodeType.NoParams },
        { AmxOpCode.EQ_C_PRI, AmxOpCodeType.OneParam },
        { AmxOpCode.EQ_C_ALT, AmxOpCodeType.OneParam },
        { AmxOpCode.INC_PRI, AmxOpCodeType.NoParams },
        { AmxOpCode.INC_ALT, AmxOpCodeType.NoParams },
        { AmxOpCode.INC, AmxOpCodeType.OneParam },
        { AmxOpCode.INC_S, AmxOpCodeType.OneParam },
        { AmxOpCode.INC_I, AmxOpCodeType.NoParams },
        { AmxOpCode.DEC_PRI, AmxOpCodeType.NoParams },
        { AmxOpCode.DEC_ALT, AmxOpCodeType.NoParams },
        { AmxOpCode.DEC, AmxOpCodeType.OneParam },
        { AmxOpCode.DEC_S, AmxOpCodeType.OneParam },
        { AmxOpCode.DEC_I, AmxOpCodeType.NoParams },
        { AmxOpCode.MOVS, AmxOpCodeType.OneParam },
        { AmxOpCode.CMPS, AmxOpCodeType.OneParam },
        { AmxOpCode.FILL, AmxOpCodeType.OneParam },
        { AmxOpCode.HALT, AmxOpCodeType.OneParam },
        { AmxOpCode.BOUNDS, AmxOpCodeType.OneParam },
        { AmxOpCode.SYSREQ_PRI, AmxOpCodeType.NoParams },
        { AmxOpCode.SYSREQ_C, AmxOpCodeType.OneParam },
        { AmxOpCode.FILE, AmxOpCodeType.ThreeParams },
        { AmxOpCode.LINE, AmxOpCodeType.TwoParams },
        { AmxOpCode.SYMBOL, AmxOpCodeType.FourParams },
        { AmxOpCode.SRANGE, AmxOpCodeType.TwoParams },
        { AmxOpCode.JUMP_PRI, AmxOpCodeType.NoParams },
        { AmxOpCode.SWITCH, AmxOpCodeType.Jump },
        { AmxOpCode.CASETBL, AmxOpCodeType.CaseTable },
        { AmxOpCode.SWAP_PRI, AmxOpCodeType.NoParams },
        { AmxOpCode.SWAP_ALT, AmxOpCodeType.NoParams },
        { AmxOpCode.PUSH_ADR, AmxOpCodeType.OneParam },
        { AmxOpCode.NOP, AmxOpCodeType.NoParams },
        { AmxOpCode.SYSREQ_N, AmxOpCodeType.TwoParams },
        { AmxOpCode.SYMTAG, AmxOpCodeType.OneParam },
        { AmxOpCode.BREAK, AmxOpCodeType.NoParams },
        { AmxOpCode.PUSH2_C, AmxOpCodeType.TwoParams },
        { AmxOpCode.PUSH2, AmxOpCodeType.TwoParams },
        { AmxOpCode.PUSH2_S, AmxOpCodeType.TwoParams },
        { AmxOpCode.PUSH2_ADR, AmxOpCodeType.TwoParams },
        { AmxOpCode.PUSH3_C, AmxOpCodeType.ThreeParams },
        { AmxOpCode.PUSH3, AmxOpCodeType.ThreeParams },
        { AmxOpCode.PUSH3_S, AmxOpCodeType.ThreeParams },
        { AmxOpCode.PUSH3_ADR, AmxOpCodeType.ThreeParams },
        { AmxOpCode.PUSH4_C, AmxOpCodeType.FourParams },
        { AmxOpCode.PUSH4, AmxOpCodeType.FourParams },
        { AmxOpCode.PUSH4_S, AmxOpCodeType.FourParams },
        { AmxOpCode.PUSH4_ADR, AmxOpCodeType.FourParams },
        { AmxOpCode.PUSH5_C, AmxOpCodeType.FiveParams },
        { AmxOpCode.PUSH5, AmxOpCodeType.FiveParams },
        { AmxOpCode.PUSH5_S, AmxOpCodeType.FiveParams },
        { AmxOpCode.PUSH5_ADR, AmxOpCodeType.FiveParams },
        { AmxOpCode.LOAD_BOTH, AmxOpCodeType.TwoParams },
        { AmxOpCode.LOAD_S_BOTH, AmxOpCodeType.TwoParams },
        { AmxOpCode.CONST, AmxOpCodeType.TwoParams },
        { AmxOpCode.CONST_S, AmxOpCodeType.TwoParams },
        /* overlay instructions */
        { AmxOpCode.ICALL, AmxOpCodeType.Jump },
        { AmxOpCode.IRETN, AmxOpCodeType.NoParams },
        { AmxOpCode.ISWITCH, AmxOpCodeType.Jump },
        { AmxOpCode.ICASETBL, AmxOpCodeType.CaseTable },
        /* packed instructions */
        { AmxOpCode.LOAD_P_PRI, AmxOpCodeType.Packed },
        { AmxOpCode.LOAD_P_ALT, AmxOpCodeType.Packed },
        { AmxOpCode.LOAD_P_S_PRI, AmxOpCodeType.Packed },
        { AmxOpCode.LOAD_P_S_ALT, AmxOpCodeType.Packed },
        { AmxOpCode.LREF_P_PRI, AmxOpCodeType.Packed },
        { AmxOpCode.LREF_P_ALT, AmxOpCodeType.Packed },
        { AmxOpCode.LREF_P_S_PRI, AmxOpCodeType.Packed },
        { AmxOpCode.LREF_P_S_ALT, AmxOpCodeType.Packed },
        { AmxOpCode.LODB_P_I, AmxOpCodeType.Packed },
        { AmxOpCode.CONST_P_PRI, AmxOpCodeType.Packed },
        { AmxOpCode.CONST_P_ALT, AmxOpCodeType.Packed },
        { AmxOpCode.ADDR_P_PRI, AmxOpCodeType.Packed },
        { AmxOpCode.ADDR_P_ALT, AmxOpCodeType.Packed },
        { AmxOpCode.STOR_P_PRI, AmxOpCodeType.Packed },
        { AmxOpCode.STOR_P_ALT, AmxOpCodeType.Packed },
        { AmxOpCode.STOR_P_S_PRI, AmxOpCodeType.Packed },
        { AmxOpCode.STOR_P_S_ALT, AmxOpCodeType.Packed },
        { AmxOpCode.SREF_P_PRI, AmxOpCodeType.Packed },
        { AmxOpCode.SREF_P_ALT, AmxOpCodeType.Packed },
        { AmxOpCode.SREF_P_S_PRI, AmxOpCodeType.Packed },
        { AmxOpCode.SREF_P_S_ALT, AmxOpCodeType.Packed },
        { AmxOpCode.STRB_P_I, AmxOpCodeType.Packed },
        { AmxOpCode.LIDX_P_B, AmxOpCodeType.Packed },
        { AmxOpCode.IDXADDR_P_B, AmxOpCodeType.Packed },
        { AmxOpCode.ALIGN_P_PRI, AmxOpCodeType.Packed },
        { AmxOpCode.ALIGN_P_ALT, AmxOpCodeType.Packed },
        { AmxOpCode.PUSH_P_C, AmxOpCodeType.Packed },
        { AmxOpCode.PUSH_P, AmxOpCodeType.Packed },
        { AmxOpCode.PUSH_P_S, AmxOpCodeType.Packed },
        { AmxOpCode.STACK_P, AmxOpCodeType.Packed },
        { AmxOpCode.HEAP_P, AmxOpCodeType.Packed },
        { AmxOpCode.SHL_P_C_PRI, AmxOpCodeType.Packed },
        { AmxOpCode.SHL_P_C_ALT, AmxOpCodeType.Packed },
        { AmxOpCode.SHR_P_C_PRI, AmxOpCodeType.Packed },
        { AmxOpCode.SHR_P_C_ALT, AmxOpCodeType.Packed },
        { AmxOpCode.ADD_P_C, AmxOpCodeType.Packed },
        { AmxOpCode.SMUL_P_C, AmxOpCodeType.Packed },
        { AmxOpCode.ZERO_P, AmxOpCodeType.Packed },
        { AmxOpCode.ZERO_P_S, AmxOpCodeType.Packed },
        { AmxOpCode.EQ_P_C_PRI, AmxOpCodeType.Packed },
        { AmxOpCode.EQ_P_C_ALT, AmxOpCodeType.Packed },
        { AmxOpCode.INC_P, AmxOpCodeType.Packed },
        { AmxOpCode.INC_P_S, AmxOpCodeType.Packed },
        { AmxOpCode.DEC_P, AmxOpCodeType.Packed },
        { AmxOpCode.DEC_P_S, AmxOpCodeType.Packed },
        { AmxOpCode.MOVS_P, AmxOpCodeType.Packed },
        { AmxOpCode.CMPS_P, AmxOpCodeType.Packed },
        { AmxOpCode.FILL_P, AmxOpCodeType.Packed },
        { AmxOpCode.HALT_P, AmxOpCodeType.Packed },
        { AmxOpCode.BOUNDS_P, AmxOpCodeType.Packed },
        { AmxOpCode.PUSH_P_ADR, AmxOpCodeType.Packed },

        { AmxOpCode.SYSREQ_D, AmxOpCodeType.OneParam },
        { AmxOpCode.SYSREQ_ND, AmxOpCodeType.TwoParams },
    };
}
