code: func popIfBool(vm *Engine) (bool, error) {
  	// When not in witness execution mode, not executing a v0 witness
  	// program, or the minimal if flag isn't set pop the top stack item as
  	// a normal bool.
  	if !vm.isWitnessVersionActive(0) || !vm.hasFlag(ScriptVerifyMinimalIf) {
  		return vm.dstack.PopBool()
  	}
  
  	// At this point, a v0 witness program is being executed and the minimal
  	// if flag is set, so enforce additional constraints on the top stack
  	// item.
  	so, err := vm.dstack.PopByteArray()
  	if err != nil {
  		return false, err
  	}
  
  	// The top element MUST have a length of at least one.
  	if len(so) > 1 {
  		str := fmt.Sprintf("minimal if is active, top element MUST "+
  			"have a length of at least, instead length is %v",
  			len(so))
  		return false, scriptError(ErrMinimalIf, str)
  	}
  
  	// Additionally, if the length is one, then the value MUST be 0x01.
  	if len(so) == 1 && so[0] != 0x01 {
  		str := fmt.Sprintf("minimal if is active, top stack item MUST "+
  			"be an empty byte array or 0x01, is instead: %v",
  			so[0])
  		return false, scriptError(ErrMinimalIf, str)
  	}
  
  	return asBool(so), nil
  }
docs: // popIfBool enforces the "minimal if" policy during script execution if the
  // particular flag is set.  If so, in order to eliminate an additional source
  // of nuisance malleability, post-segwit for version 0 witness programs, we now
  // require the following: for OP_IF and OP_NOT_IF, the top stack item MUST
  // either be an empty byte slice, or [0x01]. Otherwise, the item at the top of
  // the stack will be popped and interpreted as a boolean.