Marc Marquez had a dream MotoGP career, but since 2020 he's been trying to wake from a nightmare

"I had a dream career until 2020," Marc Marquez told ESPN, recalling his decorated time in MotoGP, the two-wheeled equivalent of Formula One. "And then overnight, and for the next two years, it was a nightmare."

Before we get into the nightmare: the dream. Marquez is unquestionably among the three or four most talented riders to ever grace the sport. He is, an argument could be made, the greatest of all time.

By the time he was 19, he'd won two world championships in the series' junior classes. His rookie season in MotoGP, he became its youngest-ever world champion at 20 years and 63 days. From that debut in 2013, Marquez went on to win six of the next seven titles.

When the COVID-delayed 2020 season began in July at Jerez in southern Spain, there was little reason to doubt he'd make it seven championships in eight seasons. That's when the nightmare began.

With four laps to go and fighting with fellow Spaniard Maverick Vinales over second place, Marquez accelerated out of the long left-hand turn three, when his rear tire lost traction, suddenly regained it, and sent the Repsol Honda rider flying high over the handlebars and crashing down onto the pavement at around 100 mph. He rolled, tumbled, and eventually came to rest, where he remained hunched over on his knees in visible discomfort, favoring his right arm. He'd suffered a fractured humerus, the bone between the shoulder and the elbow.

He underwent surgery, a titanium plate affixed to the bone, and was ruled out of the following weekend's Andalusian Grand Prix at the same circuit. Come that Friday's free practice sessions, though, Marquez was back on the bike.

Any optimism for a quicker-than-anticipated recovery rapidly vanished. He'd abandon the event by qualifying on Saturday, and wouldn't take part in another race for nine months.

"The first question after surgery is like, 'When can I compete again?'," Marquez said of his decision to return to action so quickly after undergoing an operation, a practice that is incomprehensibly commonplace in MotoGP. "One of the biggest mistakes in my career was coming back too early from that arm injury, but the doctor allowed me to do it."

Less than a week after pulling out of the Andalusian Grand Prix, Marquez had a second surgery to repair damage done to the titanium plate supporting his humerus. Complications ensued.

In the months that followed, it emerged that not only had the bone not healed, it had become infected. Dr. Joaquin Sanchez-Sotelo of the Mayo Clinic in Minnesota, who was part of Marquez's treatment team, told ESPN that the infection was "a pretty serious complication for this type of injury."

More than four months after suffering the injury, Marquez underwent a third operation in December 2020, a "very, very, very complex" procedure, according to Sanchez-Sotelo. Infections can keep bones from healing, so the goal was to clean out the infection and spur the recovery of the humerus.

From that perspective, the surgery was a success. The infection cleared up and the bone healed.

In April 2021, Marquez returned, finishing seventh in the Portuguese Grand Prix. He took part in 14 races in 2021 and six more to start 2022.

It soon became apparent that there was another problem, though. The bone had healed, but it had done so with malrotation -- his humerus shaft had twisted approximately 30 degrees from normal alignment.

"[As I recovered], [the doctors] continued saying, 'Keep going, keep going. The arm will be better in the future,'" the now-29-year-old said. "But I was pushing it in 2021 ... and when I came back in 2022, I don't know why, but the arm was going in the opposite way. I was training more than ever, spending a lot of time in the gym, and on race day I felt worse and worse and worse."

The limiting factor wasn't necessarily pain, although Marquez has endured more than his fair share throughout this ordeal. It was mobility.

Hold your arms out in front of you, raise your fists so that there is a 90-degree bend in your elbow, and rotate your arms away from your body like you're doing a standing chest fly. Most of us will be able to bring our fists roughly in line with our shoulders. Marquez had half of that range of motion.

"It's pretty limiting," Sanchez-Sotelo said of the humerus shaft malrotation. "Not having the ability to get the hand out [away from the body] makes it difficult to perform some simple activity, for example, to wash your hair."

Because of his right arm's inability to extend outward, Marquez had difficulty controlling the bike in cornering and under heavy braking. He couldn't ride the bike in the manner that had afforded him unprecedented success in the sport.

Before his injury, Marquez had finished on the podium in 72% of the 134 races he'd taken part in throughout his illustrious MotoGP career. In 2021 and the first races of 2022, that number fell to 20%.

"My quality of life, my character, everything changed in the past two years," Marquez said. "When you feel pain in your body, you are different. It's like, when you get up and for some reason you have a headache, you are not the same, you are more serious, maybe you don't want to joke, you don't want to laugh."

No one saw this change in more detail than Marquez's brother, Alex Marquez. Three years Marc's junior, Alex also has championships in the Moto3 and Moto2 support classes, and has stood on the podium twice in his three-year MotoGP career.

The Marquez brothers were teammates at Repsol Honda in 2020, when Marc first suffered the injury. Alex shifted to the LCR Honda team in 2021 and 2022, but riding nearly identical bikes just in different colors, the pair remained incredibly close in the paddock. They trained together, they traveled together, they did practically everything together.

"Sometimes it was difficult not just for him, but all the people who were around him," Alex Marquez told ESPN. "But then you put yourself in his situation: he was not where he wanted to be, he was working with pain all day everyday."

The start of the 2022 season was particularly disheartening for Marc Marquez. By the eighth round of the season, his average finishing position was worse than sixth. That's when he pressed pause on his career.

"I said when I went to the doctors, 'Let me know if we have a solution. If not, I will retire,' because it was getting worse and worse," Marquez said. "And then I said, 'OK, maybe my arm is like this now and will be like this all my life.' I stopped in the middle of the season because I was not meant to continue competing like this, because I know myself and I know that I will injure another part of my body, because I will push and I will crash some more times."

There were times when Alex Marquez believed his brother would retire.

"I tried not to think about [the prospect of Marc Marquez retiring], but of course, sometimes it creeps into your mind," Marquez's chief mechanic Santi Hernandez told ESPN. "When you see he needs another operation and what kind of operation, it's normal to have these doubts."

Marquez was desperate. His only hope of continuing in the sport was a fourth surgery, one that would treat the malrotation of his humerus shaft.

"At the beginning I told him, I would try to compete the way you are first, because your next surgery is very risky," Sanchez-Sotelo said. "So my worry before doing his surgery is that I knew that the chance of anything going wrong was very high."

There were five elements of a fourth surgery that concerned Sanchez-Sotelo.

One, the humerus would need to be cut in order to reset it in the correct alignment. It may heal from that cut, but it may not.

Two, cutting of the bone would increase the chances of another infection. Once there is an infection in the bone, if a cut is made or a fracture occurs in the same area that was once infected, it can become reactivated.

Three, the titanium plates already affixed to Marquez's humerus would complicate attempts to cut it and reset it. Four, there are several nerves that wrap around the humerus, complicating the procedure and increasing the risk of nerve damage.

And five, it is incredibly difficult to accurately understand exactly how many degrees of rotation are needed for the bone to set correctly. Sanchez-Sotelo and the Mayo Clinic had a solution for that, though.

They took CT scans of both of Marquez's arms and created 3D-printed models of each. Human bones are symmetrical, so they also 3D printed a mirrored model of his healthy left arm. This allowed them to determine exactly how much his injured right humerus shaft would need to be rotated, and Sanchez-Sotelo could then practice precisely that in virtual reality as part of Mayo's Simulation Center.

The surgery was completed in June of last year, just shy of two years since Marquez initially suffered the injury. He knew, almost instantly, that it was a success. His pain subsided and his mobility returned.

"One of the things I did [right after the fourth surgery] was say sorry to all my friends, the people around me, because they suffered more than me," Marquez said. "I was suffering, but sometimes I was quite aggressive with them. I try to always be nice to my people, but my reactions sometimes were not so good.

"My brother is, I would say, the most important person in my life. I feel really lucky because he's my brother, he is my best friend, and he is the biggest help I have to keep going and to have this ambition because we are living this life together.

"When I started to be more or less OK, I was training with him. When you are injured, sometimes you are lazier, you feel pain. But if somebody's training, you'll follow him, and he pushed me out of bed and off the sofa."

By September 2022, he was back on track at the Aragon Grand Prix in northeastern Spain. He crashed out of two of the final six races of the season, but in the four he finished, his average position was up to fourth.

Marquez -- whose "All In" documentary series detailing his recovery premieres on Amazon Prime on Feb. 20 -- may have finally found full fitness, but he faced a new setback: in the two years when his seat time was limited, his Honda RC213V had gone from a title-contending machine to the back of the field. He took part in just 12 of 20 races in the 2022 season, and he was still the Japanese manufacturer's best-placed rider in the championship standings, in 13th -- with more than double the points of his closest colleague. Honda finished dead last in the constructors' championship.

"[Marc] put a lot of weight on his shoulders, like, 'I'm not on the level I was before,'" Alex Marquez said. "I said, 'OK, mate, I'm riding the same bike as you and I'm not able to do what I did in 2020 with the bike that you crashed.' That was a really good bike at that point."

MotoGP held a test after the season finale at Valencia in November. Marquez was only 13th fastest and publicly voiced his disappointment with the early returns from the 2023 prototype. Preseason testing began in earnest on Friday at Sepang, outside of Kuala Lumpur in Malaysia, the three days of lapping serving as the first real opportunity to glean whether Honda has made up the gap to its rivals over the course of the offseason.

He finished day one with the 12th-fastest time. Reading the tea leaves of the time sheets may be a fool's errand, but Marquez told members of the media that "we are still far from the top riders."

Regardless of whether his bike is up to the task, Marquez is, and those around him believe that he'll be better than ever in 2023.

"I don't think we'll see the Marc from 2020, I think we'll see a better Marc, honestly: more complete, more realistic about some conditions, about some situations, and who will compete," Alex Marquez said. "As an opponent, I'm more worried about him now than before."

For someone as decorated, as legendary, as Marc Marquez is, that should worry every other rider on the MotoGP grid -- and delight fans across motorsport.