Transform pointer arithmetic.
Rule for converting integer arithmetic to pointer arithmetic. A string of INT_ADDs is converted into PTRADDs and PTRSUBs.
Basic algorithm: Starting with a varnode of known pointer type (with known size):
- Generate list of terms added to pointer
- Find all terms that are multiples of pointer size
- Find all terms that are smaller than pointer size
- Find sum of constants smaller than pointer size
- Multiples get converted to PTRADD
- Constant gets converted to nearest subfield offset
- Everything else is just added back on
We need to be wary of most things being in the units of the space being pointed at. Type calculations are always in bytes so we need to convert between space units and bytes.