buf_comparison: copy the code from smatch_constraints.c