Scott Farquhar, co-founder and co-CEO of the global software company, Atlassian, speaks at the National Maritime Museum in Sydney, April 10, 2018.Scott Farquhar, co-founder and co-CEO of the global software company, Atlassian, speaks at the National Maritime Museum in Sydney, April 10, 2018.

Scott Farquhar has had a difficult year as co-CEO of Atlassian. In 2022, the company's stock price has lost half its value due to rising interest rates and inflationary concerns.

His most difficult moment of the year was not software or the economy.

Farquhar was out with a friend for an evening of good food and entertainment in Las Vegas in April of this year. He flew in from Australia, where he helped start the company.

He saved a man.

CNBC spoke to a person with knowledge of the incident and published a story about it. Farquhar agreed to be interviewed about the story.

Farquhar was in Las Vegas for Team '22, which was described on the website as the ultimate teamwork experience. Employees, customers and partners would show up to hear how the company's software was being deployed and to hear from a range of speakers, including Farquhar.

The event was going to start on April 5. Farquhar was out with a friend who had moved to the U.S.

The two men found a table next to the dance floor at the nightclub after they had dinner. As the night went on, the club was filled but empty.

Farquhar walked across the dance floor to the bathroom. He saw a man on his back. The man looked lifeless to Farquhar. Farquhar went through several first-aid classes while he was a scout in Australia and had some training in what to do in a situation like that.

He touched the man's cheek to make sure he was breathing. The man was not. There was no movement in the chest.

Farquhar was performing cardiopulmonary resuscitation under the strobe lights and loud music when he was stopped by bouncers at the club.

Farquhar replied that he would do it then.

He was told to go ahead. The club doesn't comment on "incidents involving our guests"

Farquhar did chest presses and breathing with cardiopulmonary resuscitation. He only practiced on dolls and never on someone else.

Partiers were watching. The music ceased. Farquhar placed his head down next to the man. People yelled at Farquhar. People were trying to assist. He remembered that it was overwhelming.

There was a man in a shirt and gloves. A medical worker is dancing. He pulled out his tools.

The man on the floor fell asleep. He put his feet on the ground. He had no color in his face or breathing. The man was taken away by medical staff.

Farquhar said that he had never seen a dead person like him.

Farquhar stood up and tried to comprehend what had just happened.

He was told by a bouncer that he saved the man's life.

A bouncer asked for Farquhar's identification. He gave his passport to the bouncer who took Farquhar to a dark loading dock.

The bouncer told them to get Lost.

Farquhar called Las Vegas hospitals to see if any of them had admitted someone he described as the man at the club. He couldn't locate a match. The man's identity has not been determined by CNBC.

The man had a heart attack.

Farquhar's stake in Atlassian is worth over $10 billion.

Farquhar thought he had saved someone's life when he came back with his friend. His friend had no idea what had happened.

He pats on the arm when he does that in the hospital.

Farquhar recalled a conversation with his friend. He didn't want to.

Farquhar takes on the additional job of interim finance chief on Friday. James Beer held the position for the last year and a half.

Michael Turrin is an employee of Wells Fargo.