Please see attached files. Stack pointer is initialized to -1 (stack begins at 0), overlapping register bank. Stack gets corrupted by register activity. Please see file sdccout/Main.mem.
Gzip'd tar file
If you do not provide a function with the name "main" in lower case, you will not get any initialization. C is a case sensitive language.