<awangdev>7. Reverse Integer_1.java
public int reverse(int x) {
        int result = 0;

        while (x != 0) {
            int tail = x % 10;
            int newResult = result * 10 + tail;
            if ((newResult - tail) / 10 != result) return 0; 
            result = newResult;
            x = x / 10;
        }

        return result;
    }
public int sample_funcname ( int var_0 ) {
  int var_2 = 0 ;
  while ( var_0 != 0 ) {
    int var_4 = var_0 % 10 ;
    int var_5 = var_2 * 10 + var_4 ;
    if ( ( var_5 - var_4 ) / 10 != var_2 ) return 0 ;
    var_2 = var_5 ;
    var_0 = var_0 / 10 ;
  }
  return var_2 ;
}
