A dedicated instruction for a common job
Plenty of processors negate a number by subtracting it from zero, which means first getting a zero into a register. Thumb skips that with neg rD, rS, computing rD = -rS in one instruction and never materialising the zero.
Here is a function that returns the negation of its second argument:
0 neg r0, r1
2 bx lr
rS is r1, the second argument, and the flipped result lands in r0 ready to return. Notice this one is a three-operand-style form even though it only has two operands — neg always names its source and destination separately, so it can read one register and write another.
You will meet this habit throughout the course: where a dedicated instruction exists, the compiler reaches for it instead of assembling the operation out of smaller pieces. Learning to recognise those one-instruction idioms on sight is most of the work of reading Thumb.
Run rD = -rS against your target and the C falls out.
Your task
Write negate, taking an s32 x, to reproduce the target assembly.