The Relogix translation

Note: This is a 100% automatic translation, with no human intervention or cleaning-up of the code.
Relogix has automatically chosen the function prototypes, has chosen the variable names and types itself, and has placed the assembler
comments in the translated source allowing for the re-arrangement of the code flow.