I've been around chickens and roosters all my life...Grandma had free range birds with roosters and about a thousand grandkids running around, from toddlers to teens all those years and no one got flogged. Then we had the same at our place(I'm the youngest of nine and many grandkids followed)...roosters in every flock, never even threatened to flog. Then my own kids were raised around chickens with roosters and never once were bothered by a rooster.
Now I am raising my own 2 yr old granddaughter around my rooster and no behaviors noted...she comes in the coop with me, collects eggs, walks through the free range flock without incident, squats up by the coop and shovels in the dirt for hours...nothing. When she is in there messing around while the flock is eating, I watch my good and docile rooster....I watch him for any overt attention towards her and then I step towards him if I see him even stare at her for half a second. He immediately goes back to the business of eating....he's been given the warning. Any rooster can break bad at any given time and who knows the reason...keep your eye on them when you have the little ones around, but don't do it in a fearful way, do it with a "I'm in charge here and she is mine...just so you know" attitude. If you raise them right, that rooster knows you as well as you know him and he isn't about to cross the line.
It can be done, it's been done since time began. Farm kids have always been told "watch out for the rooster"~the same way they are told to watch out for that bull, that billy goat, that dog, that hog, that old sow, etc.~, so are usually wary and give the rooster a wide berth~ or they don't and are confident enough to give the rooster a sense that they are not to be messed with. Either way, it's usually the city kids that come out to the farm that wind up getting flogged or chased by the rooster.
It's all about attitude and I'm not talking about the rooster's. Farm folk generally don't care if the chickens are scared of them, so they don't pussy foot around the flock and especially around the rooster. Roosters are 2 ft. tall if they are lucky and that makes them the bottom of the food chain...you walk through them, not around them, you push them out of the way when they are underfoot, you move them around as you see fit and you don't worry about if they won't be your friend in all of that. Any rooster that dares to flog a human should be given a lesson he never forgets...ever. If you do it right, he will never forget the day he thought he should do that and he will fear any and all humans...and rightly so...he's food and we like the taste of chicken.
I'd take that little girl in one hand, a limber rod in the other and I'd move that rooster where you want him to go, tap him on the head, the back and the bottom until he's running to get away from you both. I'd lie in wait for him and smack him when he least expects it, just enough to make him hop and run in terror. Do it and have fun with it. Don't wait until he's attacking and then go on the defensive...that is playing the game like a subordinate in his world. Go on the offensive and act like he would...no flapping of your arms or shouting needed...he'll get the picture real quick and in a hurry that you are bigger, smarter and faster. It's even more terrifying if you are quiet about it...just go about it like you would any other job, with purpose and a reason. Your goal is to make the rooster more scared and wary of you and yours than you are of him and his.
Roosters are not your friends, not your buddies, not your pet...they are just chickens with a job and they can get confused as to what the job entails. Help them understand it...and good...he will be looking over his shoulder for the humans and will keep a wide berth between himself and any human that arrives in the vicinity, be they tall or short. If you care about him, help him learn the rules of the farmyard.