cgo: add rotate c code