libcgc: Varying write

While we're at it, restructure the output so the destination
register is written first.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>