<s> import cffi <EOL> ffi = cffi . FFI ( ) <EOL> ffi . cdef ( """<STR_LIT>""" ) <EOL> ffi . set_source ( "<STR_LIT>" , """<STR_LIT>""" ) <EOL> ffi . compile ( ) <EOL> from _extern_python_cffi import ffi , lib <EOL> @ ffi . def_extern ( ) <EOL> def f ( n , va ) : <EOL> if n == <NUM_LIT:3> : <EOL> x = lib . fetch_int ( va ) <EOL> y = lib . fetch_int ( va ) <EOL> z = lib . fetch_int ( va ) <EOL> print ( x , y , z ) <EOL> elif n == <NUM_LIT:1> : <EOL> ptr = lib . fetch_ptr ( va ) <EOL> print '<STR_LIT>' , ffi . cast ( "<STR_LIT>" , ptr ) [ <NUM_LIT:0> ] <EOL> elif n == <NUM_LIT:2> : <EOL> x = lib . fetch_double ( va ) <EOL> y = lib . fetch_double ( va ) <EOL> print ( x , y ) <EOL> else : <EOL> raise AssertionError ( n ) <EOL> return <NUM_LIT> <EOL> print lib . my_algo ( <NUM_LIT:10> ) </s>
