غُلَامَ: fronted accusative object and muḍāf governing kam.
كَمْ: interrogative, fixed on sukūn, in the genitive position as muḍāf ilayh.
رَجُلًا: accusative tamyīz.
ضَرَبْتَ: past verb and subject tāʾ.
Kam is genitive here even without a visible preposition, because it is the second element of an iḍāfah.