You are welcome to compare the output .nds and .elf files and compare with the original, but since a lot if this is non-idiomatic Swift (C-Style Swift), it should match the original code.
Not to criticize, but out of curiosity- what would it look like to then port the code to more idiomatic Swift then? I guess we would also assume that the performance gets a bit worse or maybe just different behavior in that case...