<s> import os <EOL> import sys <EOL> from barf import BARF <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> try : <EOL> filename = os . path . abspath ( "<STR_LIT>" ) <EOL> barf = BARF ( filename ) <EOL> except Exception as err : <EOL> print err <EOL> print "<STR_LIT>" % filename <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> start_addr = <NUM_LIT> <EOL> end_addr = <NUM_LIT> <EOL> print ( "<STR_LIT>" ) <EOL> for addr , asm_instr , reil_instrs in barf . translate ( start_addr , end_addr ) : <EOL> print ( "<STR_LIT>" . format ( addr , asm_instr ) ) <EOL> for reil_instr in reil_instrs : <EOL> print ( "<STR_LIT>" . format ( "<STR_LIT>" , reil_instr ) ) <EOL> barf . code_analyzer . add_instruction ( reil_instr ) <EOL> print ( "<STR_LIT>" ) <EOL> eax = barf . code_analyzer . get_register_expr ( "<STR_LIT>" , mode = "<STR_LIT>" ) <EOL> ebp = barf . code_analyzer . get_register_expr ( "<STR_LIT>" , mode = "<STR_LIT>" ) <EOL> a = barf . code_analyzer . get_memory_expr ( ebp - <NUM_LIT> , <NUM_LIT:4> ) <EOL> b = barf . code_analyzer . get_memory_expr ( ebp - <NUM_LIT> , <NUM_LIT:4> ) <EOL> c = barf . code_analyzer . get_memory_expr ( ebp - <NUM_LIT> , <NUM_LIT:4> ) <EOL> barf . code_analyzer . set_preconditions ( [ a >= <NUM_LIT:2> , a <= <NUM_LIT:100> ] ) <EOL> barf . code_analyzer . set_preconditions ( [ b >= <NUM_LIT:2> , b <= <NUM_LIT:100> ] ) <EOL> barf . code_analyzer . set_postcondition ( c == <NUM_LIT:15> ) <EOL> print ( "<STR_LIT>" ) <EOL> if barf . code_analyzer . check ( ) == '<STR_LIT>' : <EOL> print ( "<STR_LIT>" ) <EOL> eax_val = barf . code_analyzer . get_expr_value ( eax ) <EOL> a_val = barf . code_analyzer . get_expr_value ( a ) <EOL> b_val = barf . code_analyzer . get_expr_value ( b ) <EOL> c_val = barf . code_analyzer . get_expr_value ( c ) <EOL> print ( "<STR_LIT>" . format ( eax_val ) ) <EOL> print ( "<STR_LIT>" . format ( a_val ) ) <EOL> print ( "<STR_LIT>" . format ( b_val ) ) <EOL> print ( "<STR_LIT>" . format ( c_val ) ) <EOL> assert ( a_val * b_val + <NUM_LIT:5> == c_val ) <EOL> else : <EOL> print ( "<STR_LIT>" ) </s>
