You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: compare.go
    path of file: ./repos/buildkit/vendor/github.com/gogo/protobuf/plugin/compare
    
    the code of the file until where you have to start completion: // Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2013, The GoGo Authors. All rights reserved.
// http://github.com/gogo/protobuf
//
// Redistribution and use in source and binary forms, with or without

    
func (p *plugin) generateMsgNullAndTypeCheck(ccTypeName string) {
	p.P(`if that == nil {`)
	p.In()
	p.P(`if this == nil {`)
	p.In()
	p.P(`return 0`)
	p.Out()
	p.P(`}`)
	p.P(`return 1`)
	p.Out()
	p.P(`}`)
	p.P(``)
	p.P(`that1, ok := that.(*`, ccTypeName, `)`)
	p.P(`if !ok {`)
	p.In()
	p.P(`that2, ok := that.(`, ccTypeName, `)`)
	p.P(`if ok {`)
	p.In()
	p.P(`that1 = &that2`)
	p.Out()
	p.P(`} else {`)
	p.In()
	p.P(`return 1`)
	p.Out()
	p.P(`}`)
	p.Out()
	p.P(`}`)
	p.P(`if that1 == nil {`)
	p.In()
	p.P(`if this == nil {`)
	p.In()
	p.P(`return 0`)
	p.Out()
	p.P(`}`)
	p.P(`return 1`)
	p.Out()
	p.P(`} else if this == nil {`)
	p.In()
	p.P(`return -1`)
	p.Out()
	p.P(`}`)
}