Spencer B. answered 07/22/23
Computer Science and Cybersecurity Researcher
The image you seem to have intended to attach doesn't seem to have loaded, but I should be able to equip you to answer this question without it.
The RISC-V calling convention dictates that integer registers t0-t6 and FP registers ft0-ft11 are "scratch" registers and must be saved by the caller if the values are needed later.
Additionally, if the original value of a0 is needed after calling G, it must also be saved since it will be overwritten with the return value of G.