cgo: add binary search