That does make me feel like they got the code from a standard C library rather than writing it themselves. The Mark Williams Compiler versions 3 and 4 that I looked at didn't appear to be an exact match, although they do have a lot of those functions, just not all of them in a single module, and some I couldn't find at all. I can't say what the earlier versions of the MWC compiler had though, and there is evidence in floppy disk slack space that they were compiling with a v2.3.8 version of MWC at some point. Maybe that had a closer match.
Also in the floppy disk slack space of some original game disks are fragments of a DOS directory table that includes FILEIO.OBJ (alongside other .OBJ files known to be part of AGI), which initially suggested to me that they compiled it themselves, since I thought that the compiler would have something like that in a .LIB library file. Now that I've said that though, I have noticed that the v3 and v4 versions of MWC that I have both have .OBJ files in their LIB folder, in addition to the .LIB files. Perhaps the older versions of MWC had the FILEIO.OBJ file separate but it was then split up, refactored a bit, and included into a LIB file in the v3/v4 versions.
Interestingly, the FILEIO.OBJ file is immediately followed by VGGRAPHX.OBJ in the directory table fragment. That VGGRAPHX module wasn't added into AGI until the 2.9XX versions of AGI. The decoded timestamp from the directory entry for VGGRAPHX.OBJ is the 03-Sept-1987, and the decoded timestamp for FILEIO.OBJ is 25-Aug-1987. The origin of this directory table fragment must have been a hard disk, which seems to be the case for a lot of the slack space of floppy disks, since the cluster number is way beyond the size of a floppy. As I understand it from reading up on this years ago, the slack space data came from data left over in the buffers that DOS (or the copy tool; can't remember which) used when it copies the files to the floppy. So its an interesting view on what Sierra were using on their development machines. In the example I'm looking at, the original game disk is a 2.0C version of SQ2, and the hard disk appears to have had WHERE.SQ2 on it, immediately alongside these .OBJ files. The WHERE file is used with the test/dev non-production version of the AGI EXE. This would have been a WHERE file for SQ2 then.
This thread has gone way off the topic of the C# version of AGILE, but the main culprit is me. I wonder if we can split the recent unrelated posts off into a thread related to the original AGI interpreter source.