Identify the grammatical function of the BOLDED noun clause in this sentence:

Shirley didn't realize THAT THE MECHANIC HAD NO IDEA WHAT HE WAS DOING
A)
subject


B)
direct object


C)
predicate nominative


D)
object of a preposition