I am assuming this a class assignment, or some sort of training exercise, since, as @rproffitt said, for any sort of work project the logical solution would be to compile the C code.
Now, both for ethical reasons and due to DaniWeb TOS, we cannot just give you the code. Even if this weren't the case, we'd need to know which development target and toolchain you are using, and what restrictions on the solution exist if any, as the obvious answer would involve using pseudo-instructions, which not all assemblers support, and not all professors permit. It might be useful if you can tell us if you need to manually hoist load and branch slots, as well (though since you said MIPS64, and I am pretty sure delay slots don't apply to any 64-bit versions of MIPS, it probably doesn't matter).
We can give you advice on how to write it, however. I would recommend starting by looking at the documentation on the instructions lw, beq, j, and sw, as well as the pseudo-instructions blt, and li. Once you have that, if you still have problems, try posting the code here (with the necessary information about the tools you are using) and we'll see what we can tell you.