gemu-test - refactor without changing output (except few encoding dropped)