better cast for aio using intptr