With 15 kilometers to go, Robert Heffernan’s mind told him he was going to win the Olympic 50km racewalk.

"I came off the front, and I was like, "fuck yes, I'm going to win! I'm going to win this!" Heffernan said.

But as often happens with racewalkers, the Irishman’s body disagreed.

"And then my legs started cramping up," Heffernan said. "Any movement on my body was cramping. I had to stay conservative."

If you tune into the racewalk for a few seconds, your instinct is probably to laugh. It does look silly. Humans discovered long ago that it is possible to run, which allows you to go faster than walking, and yet here are some dudes in the Olympics walking as fast as they can, butts clenched like they’re on a life-or-death search for the closest bathroom.

But if you tune in for a few hours, you’ll realize the sheer brutality of the event. They walk for 31 miles, five longer than the marathon. There are no breaks, there is no change of scenery. There is nothing but 200-plus minutes of walking up-and-down the unshaded asphalt track under the scorching sun. It is a vicious test of the human body’s endurance.

"There's no question to me that this is the most grueling event in all the Olympics," says American John Nunn. "I would love to debate anyone on that."

Eighty athletes started the race, but only 49 finished. Twelve are disqualified, and a whopping 19 are unable to finish the race. That’s almost a quarter of the competitors whose bodies were not up to the ridiculously difficult task they trained for.

I see Lithuanian walker Artur Mastianica collapse. The organizers scurry over a wheelchair and place his body in it. He is unconscious, his skin a bloodless white, his eyes closed. If it weren’t for the pounds of sweat still pouring off his body, you could’ve convinced me he was dead.

I see Korean walker Hyunsub Kim bow out of the race about 25 feet from me. I could see his body slowing down for several hundred meters, gradually devolving to a pace slower than a normal walk. With his last energy, he sidled over to a curb and sat down, head in his hands, exhausted and devastated. His coaches pour water on him and urge him to lie down on a towel in the shade. When he stands up to move, he teeters and totters: The walker can barely walk.

Here’s the wild thing about Mastianica and Kim’s exits: They occurred with roughly a third of the race still remaining.

"You see these people getting carted off in ambulances," says Irish walker Brendan Boyce. "And you’re like, ‘I’ve still got another two hours.’"

No, they aren’t running, but the physical act of walking as fast as you can is preposterously strenuous. It’s less natural than running. There are two strict rules to racewalking -- one foot must be on the ground at all times, and the supporting leg must be straight — and if a walker breaks those rules, they may be disqualified.

"I don't believe the human body was meant to do what we do to it," says Nunn. You're using hamstrings and shins, which are secondary propulsion muscles, and you're trying to force them to be the primary ones."

Now do that for four hours.

"In a marathon, if you get tired from running, you can walk," says Nunn. "In racewalking, if you slow to a slow walk, you might break the two rules, and you're going to get disqualified. You have no choice but to keep holding that form, and it just keeps ripping the body apart."

Athletes need to be refueling their body constantly. There’s a set of refreshment tables at one end of the track, offering the athletes water — for drinking and pouring on themselves — ice, energy drinks, Gatorade, nutritional gels, pretty much anything that can keep them going. Nunn drank a Five Hour Energy and some Coke in the last half of the race, hoping the caffeine would power him through the finish.

The logistics of that process can be difficult. Canada’s Evan Dunfee tries to take in about 350 calories per hour on the course — that means he’s consuming almost 1,500 calories while competing in an Olympic event.

"Too much, your stomach is going to rebel against you," said Dunfee. Too little, you're going to run out of energy. It's such an intricate balance, and if you get it wrong, it can be disastrous."

Hydrating is also essential. The athletes will lose over 10 pounds in water over the course of the race, so it’s important for them to continue forcing water back into their bodies. One problem though: If you drink several pounds of water over the course of three hours, nature will call.

"I needed to piss for the last 40 kilometers," says Boyce. "I'm dying to go, but you just can't. I thought about stopping a few times, but I knew if I stopped, I wouldn’t be able to get back into a rhythm."

There was a buzz on social media when French walker Yohann Diniz appeared to let loose a little bit of poop during the race. It’s certainly possible he did, although any evidence disappeared as Diniz repeatedly dumped water on his body, as all walkers do.

The finish line is absolute carnage. Many finishers collapse to the ground almost instantly after their race is done. Nearly everybody receives some sort of medical attention, from a ride in a wheelchair to trainers dumping water on their bodies.

We really should be referring to Nunn by his official title, Staff Sergeant John Nunn. He’s been in the Army since 2000, serving as an infantryman and now as a dental hygienist.

He remembers being physically and emotionally broken 16 long years ago in basic training. But basic training is just preparation for the actual rigors of service — and as a member of the Army’s World Class Athlete Program, his service is racewalking.

Nunn didn’t race the race he wanted Friday. He finished 43rd out of 49 finishers, over a half-hour behind gold medalist Matej Toth of Slovakia. But after the race, he starts to cry — not because of his disappointing finish, but because he had the strength to finish at all.

"It's so weird," Nunn says. "I find myself as a grown man finishing, and I have to find a corner at some point and just detox, just cry and get it out. Because you put so much effort in."