Using the Stockfish move generator in a home chess engine Basically, I’m creating a chess AI and I want to focus on the search algorithm rather than the most complete way or fastest move generation portions. So, for now, I was thinking I could use a prebuilt move generator from a tested and well-known source such as Stockfish.

But I'm having trouble understanding how Stockfish represents the current gamestate and how I can read it, how I can get Stockfish to essentially loop through all of the possible nodes, and how I can check if a given node is a leaf. If someone could point me to a resource or knows how Stockfish does this it would be greatly appreciated.
For the fastest move generation I suggest the below code.

https://github.com/Mk-Chan/WyldChess/blob/master/src/magicmoves.c

It’s not the Stockfish source code, but I was able to use it for my own hobby engine and I can tell you that it’s very fast. If you have a lot of trouble I can write a post about how I did it.