#include <inline/stub.h>
#ifndef BASE_EXT_DECL
#define BASE_EXT_DECL extern struct Device * ConsoleDevice;
#endif
#ifndef BASE_PAR_DECL
#define BASE_PAR_DECL
#define BASE_PAR_DECL0
#endif
#ifndef BASE_NAME
#define BASE_NAME ConsoleDevice
#endif
__inline static struct InputEvent * CDInputHandler(BASE_PAR_DECL struct InputEvent* events, struct Device* device)
{
	BASE_EXT_DECL
	register struct InputEvent * res __asm("d0");
	register void *a6 __asm ("a6");
	register struct InputEvent* a0 __asm("a0");
	register struct Device* a1 __asm("a1");

	a6 = BASE_NAME;
	a0 = events;
	a1 = device;
	__asm volatile ("
	jsr a6@(-0x2a)"
	: "=r" (res)
	: "r" (a6), "r" (a0), "r" (a1)
	: "d0", "d1", "a0", "a1");
	*a0=*a0;*a1=*a1;
	return res;
}
__inline static long RawKeyConvert(BASE_PAR_DECL const struct InputEvent* events, char* buffer, long length, const struct KeyMap* keyMap)
{
	BASE_EXT_DECL
	register long res __asm("d0");
	register void *a6 __asm ("a6");
	register const struct InputEvent* a0 __asm("a0");
	register char* a1 __asm("a1");
	register long d1 __asm("d1");
	register const struct KeyMap* a2 __asm("a2");

	a6 = BASE_NAME;
	a0 = events;
	a1 = buffer;
	d1 = length;
	a2 = keyMap;
	__asm volatile ("
	jsr a6@(-0x30)"
	: "=r" (res)
	: "r" (a6), "r" (a0), "r" (a1), "r" (d1), "r" (a2)
	: "d0", "d1", "a0", "a1", "a2");
	*a1=*a1;
	return res;
}
#undef BASE_EXT_DECL
#undef BASE_PAR_DECL
#undef BASE_PAR_DECL0
#undef BASE_NAME
