comefrom: <doocs>0029.Divide Two Integers_1.py
code: def divide( a: int, b: int) -> int:
      INT_MAX = (1 << 31) - 1
      INT_MIN = -(1 << 31)
      sign = -1 if a * b < 0 else 1
      a = abs(a)
      b = abs(b)
      tot = 0
      while a >= b:
          cnt = 0
          while a >= (b << (cnt + 1)):
              cnt += 1
          tot += 1 << cnt
          a -= b << cnt
      return sign * tot if INT_MIN <= sign * tot <= INT_MAX else INT_MAX
masked: def sample_funcname ( var_0 : int , var_2 : int ) -> int :
      var_5 = ( 1 << 31 ) - 1
      var_6 = - ( 1 << 31 )
      var_8 = - 1 if var_0 * var_2 < 0 else 1
      var_0 = abs ( var_0 )
      var_2 = abs ( var_2 )
      var_10 = 0
      while var_0 >= var_2 :
          var_11 = 0
          while var_0 >= ( var_2 << ( var_11 + 1 ) ) :
              var_11 += 1
          var_10 += 1 << var_11
          var_0 -= var_2 << var_11
      return var_8 * var_10 if var_6 <= var_8 * var_10 <= var_5 else var_5
  