This was another reason I went the x86->6502 route instead of just a 6502 backend for llvm - it could plausibly work with any code. Let me know what you find.
Functional calls are not handled, which is part of the problem. There are several working examples in the x86-to-6502 repository. Please add more examples and help with additional translation.
I was unable to get any of the existing 3 llvm 6502 backends to produce reasonable code. Which is why I went this route. I meant to mention that in the video...