There is no single C instruction that matches the assembly code directly. What's happening is the 32 bit value in r7 gets added to the 64 bit value in r2/r3, with the result written to r4/r5.
You can verify this in a few different cases:
- No overflow in the first instruction, positive number (bit 31 is zero) in
r7. This means the
ADC has nothing to add, and just copies
- First instruction produces overflow, but
r7 is positive anyway. The
ADC adds one (from the carry flag) to account for the overflow.
r7 is negative (bit 31 is 1). The
ASR instruction produces a
-1 (all bits set), since it does an arithmetic shift, not a logical shift. This effectively subtracts 1 from
r3 in the second instruction.
So the original C code probably looked like this:
As i said, the asm code doesn't really match the C code, since C doesn't have any syntax for type extension. (You could use casts in your C, but that wouldn't really make anything clearer).
This is one of the reasons why there is more to reverse engineering that just creating C from assembly; you have to have an understanding on assembly, registers, processor quirks, and compiler shortcuts, to understand what's going on in these cases.