Please include comments in your assembly code
1) What are the input arguments to each method or routine
2) What is each register mapping
3) Include some C code to indicate what you are expecting the code to be doing
A figure would be helpful
That said --------------------------------------------------
Seems like you are violating the calling convention. t registers are caller save
Seems like you are using t registers in matmul for loop index. You also seem to be using t registers in dot.
Once the first call to dot happens, when it returns your matmul loop variables are in bad state.
Two options
1) Use s registers for loop variables. save and restore within dot
OR 2) save and restore t registers across the call to dot on line 68: