add type definitions and inline assembly