Added alloca in flipX and flipY