The correct option is D frantically
The part of a sentence excluding the subject is the predicate. The verb
in the predicate is often modified by an adverb or its equivalent, known
as the adverbial qualification in that predicate.
In the sentence, "frantically" is an adverb of manner, it qualifies the verb "wagged". Hence it is the adverbial qualification and option D is correct. "As" is a conjunction, it is used in complex sentences, like the one given. "The soldier" is a subject and "wagged" is a verb that is being modified. Hence options A, B and C are incorrect.