Prefix all register assignments with var, unfortunately I only have real movies, was unable to create test cases :( to verify.
Making (strange) register behavior generate correct code, but still a bit unclear. I was not able to generate bytecode that compiles to this :(.