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