Ohhhhh god I fixed it! The issue was when comparing two registers I always compa...

@lisyarus@mastodon.gamedev.place

Ohhhhh god I fixed it! The issue was when comparing two registers I always compare them as 64-bit, sign/zero extending if needed. For unsigned 32-bit values I don't zero-extend as writing to low 32 bits of a register auto-clears the top 32 bits, but when reading locals I also read them as 64-bit values for simplicity, and the top 32 bits can contain garbage. And that's what happened, cmp compared the top 32 bits with garbage. Inserting other functions apparently just put the garbage on stack 😨