Convert `writeBranch` to Cadence.

See #375.