don't forget that class functions require "this" to be passed, you can try make it a class static function. I've not took a deep look into chip app yet but if you're wanting to use also stack etc then you need to convert everything to 64-bit, this includes the variables also.