The ARM architecture reference manual for your CPU will help you.
Here’s what these instructions do.
“tst…”: Check the special exception-return value in the LR to see which stack pointer was active at the time of the exception.
“ite…” Tell the CPU we have an if-then-else coming up using the EQ condition
“mrseq…” Move the main stack pointer into r0 (if the main stack pointer was active)
“mrsne…” Move the process stack pointer into r0 (if the process stack pointer was active)
“ldr r1…” Move a specific 32-bit word** from the exception frame into r1 (**the PC)
“ldr r2…” Put the address of function
prvGetRegistersFromStack into r2
“bx r2” Call
prvGetRegistersFromStack, r0 has the formal parameter
“handler2_…” store the address of
prvGetRegistersFromStack in the object code where “ldr r2…” can get to it (PC-relative addressing).
Interestingly the “ldr r1…” instruction appears to be unnecessary. The
prvGetRetRegistersFromStack function doesn’t have a second formal parameter.