Hello @tomtom22
G1 and G2 are available on Port A. You are correct, G38 and G39 are not available as general IO on the M5AtomS3. They are used for I2C (and yes. the IMU is already connected to them) but additional I2C devices can be added here. M5AtomS3 documentation can be found here.
Thanks
Felix