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: sqlite_windows_amd64.go
    path of file: ./repos/sliver/vendor/modernc.org/sqlite/lib
    
    the code of the file until where you have to start completion: // Code generated by 'ccgo -DSQLITE_PRIVATE= -export-defines "" -export-enums "" -export-externs X -export-fields F -export-typedefs "" -ignore-unsupported-alignment -pkgname sqlite3 -volatile=sqlite3_io_error_pending,sqlite3_open_file_count,sqlite3_pager_readdb_count,sqlite3_pager_writedb_count,sqlite3_pager_writej_count,sqlite3_search_count,sqlite3_sort_count,saved_cnt,randomnessPid -o lib/sqlite_windows_amd64.go -trace-translation-units testdata/sqlite-amalgamation-3410200/sqlite3.c -full-path-comments -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_OS_WIN=1 -D_MSC_VER=1900', DO NOT EDIT.

package sqlite3

import (
	"math"
	"reflect"
	"sync/atomic"
	"unsafe"

	"modernc.org/libc"
	"modernc.org/libc/sys/types"
)

var _ = math.Pi
var _ reflect.Kind
var _ atomic.Value
var _ unsafe.Pointer
var _ *libc.TLS
var _ types.Size_t

const (
	ABE_BOTTOM                                                                     = 3
	ABE_LEFT                                                          
    
func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize uintptr) int32 {
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var nPayload int32
	var pSrc uintptr
	var nSrc int32
	var n int32

	var mn int32
	var spaceLeft int32
	var pToRelease uintptr
	var pPrior uintptr
	var pPayload uintptr
	var pBt uintptr

	var nHeader int32

	nHeader = int32((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)
	if (*MemPage)(unsafe.Pointer(pPage)).FintKey != 0 {
		nPayload = (*BtreePayload)(unsafe.Pointer(pX)).FnData + (*BtreePayload)(unsafe.Pointer(pX)).FnZero
		pSrc = (*BtreePayload)(unsafe.Pointer(pX)).FpData
		nSrc = (*BtreePayload)(unsafe.Pointer(pX)).FnData

		nHeader = nHeader + int32(func() uint8 {
			if U32(nPayload) < U32(0x80) {
				return uint8(func() int32 { *(*uint8)(unsafe.Pointer(pCell + uintptr(nHeader))) = uint8(nPayload); return 1 }())
			}
			return uint8(Xsqlite3PutVarint(tls, pCell+uintptr(nHeader), uint64(nPayload)))
		}())
		nHeader = nHeader + Xsqlite3PutVarint(tls, pCell+uintptr(nHeader), *(*U64)(unsafe.Pointer(pX + 8)))
	} else {
		nSrc = libc.AssignInt32(&nPayload, int32((*BtreePayload)(unsafe.Pointer(pX)).FnKey))
		pSrc = (*BtreePayload)(unsafe.Pointer(pX)).FpKey
		nHeader = nHeader + int32(func() uint8 {
			if U32(nPayload) < U32(0x80) {
				return uint8(func() int32 { *(*uint8)(unsafe.Pointer(pCell + uintptr(nHeader))) = uint8(nPayload); return 1 }())
			}
			return uint8(Xsqlite3PutVarint(tls, pCell+uintptr(nHeader), uint64(nPayload)))
		}())
	}

	pPayload = pCell + uintptr(nHeader)
	if nPayload <= int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) {
		n = nHeader + nPayload

		if n < 4 {
			n = 4
		}
		*(*int32)(unsafe.Pointer(pnSize)) = n

		libc.Xmemcpy(tls, pPayload, pSrc, uint64(nSrc))
		libc.Xmemset(tls, pPayload+uintptr(nSrc), 0, uint64(nPayload-nSrc))
		return SQLITE_OK
	}

	mn = int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal)
	n = int32(U32(mn) + U32(nPayload-mn)%((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-U32(4)))

	if n > int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) {
		n = mn
	}
	spaceLeft = n
	*(*int32)(unsafe.Pointer(pnSize)) = n + nHeader + 4
	pPrior = pCell + uintptr(nHeader+n)
	pToRelease = uintptr(0)
	*(*Pgno)(unsafe.Pointer(bp + 8)) = Pgno(0)
	pBt = (*MemPage)(unsafe.Pointer(pPage)).FpBt

	for 1 != 0 {
		n = nPayload
		if n > spaceLeft {
			n = spaceLeft
		}

		if nSrc >= n {
			libc.Xmemcpy(tls, pPayload, pSrc, uint64(n))
		} else if nSrc > 0 {
			n = nSrc
			libc.Xmemcpy(tls, pPayload, pSrc, uint64(n))
		} else {
			libc.Xmemset(tls, pPayload, 0, uint64(n))
		}
		nPayload = nPayload - n
		if nPayload <= 0 {
			break
		}
		pPayload += uintptr(n)
		pSrc += uintptr(n)
		nSrc = nSrc - n
		spaceLeft = spaceLeft - n
		if spaceLeft == 0 {
			*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
			var pgnoPtrmap Pgno = *(*Pgno)(unsafe.Pointer(bp + 8))
			if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 {
				for __ccgo := true; __ccgo; __ccgo = ptrmapPageno(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8))) == *(*Pgno)(unsafe.Pointer(bp + 8)) || *(*Pgno)(unsafe.Pointer(bp + 8)) == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) {
					*(*Pgno)(unsafe.Pointer(bp + 8))++
				}
			}
			*(*int32)(unsafe.Pointer(bp + 12)) = allocateBtreePage(tls, pBt, bp, bp+8, *(*Pgno)(unsafe.Pointer(bp + 8)), uint8(0))

			if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 && *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK {
				var eType U8 = func() uint8 {
					if pgnoPtrmap != 0 {
						return uint8(PTRMAP_OVERFLOW2)
					}
					return uint8(PTRMAP_OVERFLOW1)
				}()
				ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8)), eType, pgnoPtrmap, bp+12)
				if *(*int32)(unsafe.Pointer(bp + 12)) != 0 {
					releasePage(tls, *(*uintptr)(unsafe.Pointer(bp)))
				}
			}
			if *(*int32)(unsafe.Pointer(bp + 12)) != 0 {
				releasePage(tls, pToRelease)
				return *(*int32)(unsafe.Pointer(bp + 12))
			}

			Xsqlite3Put4byte(tls, pPrior, *(*Pgno)(unsafe.Pointer(bp + 8)))
			releasePage(tls, pToRelease)
			pToRelease = *(*uintptr)(unsafe.Pointer(bp))
			pPrior = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData
			Xsqlite3Put4byte(tls, pPrior, uint32(0))
			pPayload = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + 4
			spaceLeft = int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4))
		}
	}
	releasePage(tls, pToRelease)
	return SQLITE_OK
}