A police officer is entitled to search a detainee as an incident to investigative detention if
A. The officer has grounds to believe that his or her own safety, or the safety of others, is at risk.
B. The officer has reasonable grounds to believe that his or her own safety, or the safety of others, is at risk and the search is reasonably necessary in light of the totality of the circumstances.
C. The officer has reasonable grounds to believe that the detainee is carrying contraband.
D. The officer has grounds to believe that the detainee is carrying contraband.