I'm curious about your program, and not having an R3000 handy, I tried
running it on a 4 GHz 64-bit x86 Linux system. What I get is:
$ gcc -o prog prog.c
$ time ./prog >output
real 0m0.056s
user 0m0.052s
sys 0m0.003s
And an output file that is 250000 lines of identical text, all
"32767". I assume that's not the correct output.
Eric