Software engineer vs research associate in not-so-related subfield for CS PhD
Lots of trade-offs. I don't think either of these is necessarily better than the other for later admission for theoretical CS. Money is good. Research is good. Quicker entry may be good, though that depends on many other things. 

In a situation like that, I'd guess that "follow your heart" is probably best. You don't seem to suggest that the money is driving you - which is a good attitude for an academic.   

Either would add something, but neither would be determinative, IMO.