

def check_operands_size(instr, arch_size):
    if (instr.mnemonic in [ReilMnemonic.ADD, ReilMnemonic.SUB, ReilMnemonic.MUL, ReilMnemonic.DIV, ReilMnemonic.MOD, ReilMnemonic.BSH, ReilMnemonic.AND, ReilMnemonic.OR, ReilMnemonic.XOR]):
        assert (instr.operands[0].size == instr.operands[1].size), ('Invalid operands size: %s' % instr)
    elif (instr.mnemonic in [ReilMnemonic.LDM]):
        assert (instr.operands[0].size == arch_size), ('Invalid operands size: %s' % instr)
    elif (instr.mnemonic in [ReilMnemonic.STM]):
        assert (instr.operands[2].size == arch_size), ('Invalid operands size: %s' % instr)
    elif (instr.mnemonic in [ReilMnemonic.STR]):
        pass
    elif (instr.mnemonic in [ReilMnemonic.BISZ]):
        pass
    elif (instr.mnemonic in [ReilMnemonic.JCC]):
        assert (instr.operands[2].size == (arch_size + 8)), ('Invalid operands size: %s' % instr)
        pass
    elif (instr.mnemonic in [ReilMnemonic.UNKN]):
        pass
    elif (instr.mnemonic in [ReilMnemonic.UNDEF]):
        pass
    elif (instr.mnemonic in [ReilMnemonic.NOP]):
        pass
    elif (instr.mnemonic in [ReilMnemonic.SEXT]):
        assert (instr.operands[0].size <= instr.operands[2].size), ('Invalid operands size: %s' % instr)

dataset/ETHPy150Open programa-stic/barf-project/barf/barf/arch/x86/x86translator.py check_operands_size/original