Here's the relevant bits from the .original dump if (side - 1 <= 1)
Of particular interest is the (side - 1 <= 1) conditional which is implementing this hunk of code from the Trim function: if Side = Right or else Side = Both then I think it's time to hand this one to the Ada guys :-0 I don't. This sounds like fold is merging the two comparisons above incorrectly into the one upper comparison. It can do the merge, but it needs to convert to base types first.