subs r2, #0x10
negs r0, r2
adcs r0, r2
Is equivalent to
mov r0, (r2 == #0x10)
The above sequence can be rewritten into
subs r2', r2, #0x10
adds r0, #1, not(r2')
adcs r0, r0, r2'
The final step is effectively “store carry flag to r0″, since x + (-x) = 0. The carry flag is set only when not(r2′) == 0xFFFFFFFF, i.e. r2′ = 0. This happens only when r2 == #0x10.