Ding Xinfeng's eyes blinked open. Dawn had yet to break, but inside a 24-hour McDonald's restaurant in central Beijing, more than a dozen homeless people had begun their daily routines.
Mr. Ding lifted his head, revealing a mess of food stains and decorative slogans on the table in front of him. "Wake up every morning with the thought that something wonderful is about to happen," one read.
Mr. Ding could not read the English, but he said he liked the warmth of this table, in this corner, in the peace of McDonald's, the place he had called home for several years.
Every night across East Asia, in major cities like Beijing, Hong Kong and Tokyo, an invisible class of people - shut out of shelter systems, scorned by their families, down on their luck - turn to a beacon of Americana for a warm, dry place to sleep.
Often called McRefugees, they vanish at sunrise, some combing their hair with plastic forks before slinking outside into the masses.
On an austere November morning, as the wind howled outside, Mr. Ding's McDonald's began to fill up with schoolchildren, yam sellers, retirees armed with chess pieces and red-eyed street patrolmen.
He began to circle, making his pitch for donations.
"My family has begged for food since the Ming dynasty," he said. "I'm the 19th generation. There will be no beggars in China after I'm dead."
A man offered a newspaper. A woman gave 50 cents. A young girl extended a French fry.
Mr. Ding returned to his seat, opened the newspaper, and began studying the lottery numbers, searching for patterns.
While other restaurants might kick them out, McDonald's generally embraces wanderers like Mr. Ding, who have flocked to the chain as it has rolled out more 24-hour locations in Asia. More than half of the 2,200 McDonald's restaurants in mainland China are now open 24 hours a day.
McDonald's has spent decades cultivating an image of community here, building bright, stylish restaurants and adjusting menus to local tastes. In addition to the standard burgers and fries, the Beijing outlets serve taro pies and soy milk with fried bread. Many restaurants have become neighborhood institutions, symbols of status and cleanliness, popular spots for study groups, business meetings and leisurely chats.
"McDonald's welcomes everyone to visit our restaurants anytime," said Regina Hui, a spokeswoman for McDonald's in China.
How welcoming is up to each franchise owner, the company says. "We are definitely a welcoming place, but I wouldn't call it a policy," Becca Hary, a spokeswoman at the company's headquarters in Oak Brook, Ill., wrote in an email.
Tension over when that welcome is overstayed has long been an issue for McDonald's around the world. In 2014, a McDonald's in New York City called the police to remove a group of older Korean patrons who had turned the restaurant into a social club, spending more time than money. And a McDonald's in Manchester, England, came under fire last year for refusing to serve a customer who wore dirty clothing, thinking he was homeless.
In Hong Kong, Stevix Ho, a McDonald's manager, said he had to contend with a crowd of heroin addicts and people who appeared to have severe mental illness.
"We can't kick them out," he said. "We can only ask them to go away."
Many homeless people say they have little choice, given a dearth of shelter options and the stigma of sleeping on the street. In mainland China, the government allows homeless people to stay in shelters for a maximum of 10 days.
Yip Hin-ming, 57, arrived in Hong Kong four decades ago, drawn by stories of neon lights and clanking factories. In April, after two decades of working as a painter, he had to quit when the pain of a job-related arm injury became overwhelming. "That was the end," he said. "I was no longer capable."
He packed a bag with a toothbrush and toilet paper, and found a quiet spot under paintings of onions and tomatoes in a McDonald's in Kowloon, Hong Kong.
One day, he said he was startled to learn that a homeless woman at a McDonald's across town had died. She had sat hunched over a table for 24 hours, covered by a gray overcoat, before anyone noticed.
"Nobody knows who we are when we're living, and nobody cares about us when we die," Mr. Yip said. "We're invisible."
Chan Wai-kwan, 63, a former janitor who had been living at McDonald's from 6 p.m. to 6 a.m. every day for three years, said Hong Kong had lost its sense of humanity.
"You'll tell my family if anything happens to me, right?" he asked, turning to Mr. Yip. "You'll make sure they know if I die?"
Mr. Yip nodded, but looked despondent.
"My family doesn't know about my life here, and I wouldn't want to tell them," he said. "It's too miserable."
In addition to the daily quest for food and the requisite but demeaning panhandling, the nighttime residents of McDonald's struggle with perceptions that they are lazy and dishonest.
Restaurant staff members sometimes frown at their behavior.
"They can find jobs. They're just too lazy to look," said a Beijing McDonald's employee, Mrs. Chen, who asked to be identified only by her family name because she was not authorized to speak with the news media. "They're driving away customers because they smell so bad."
Zhang Wei, 56, a vegetable seller who had lost her teeth, said she longed for a normal life but was ostracized by her family.
"How nice it would be to be able to cook and eat at your own home," she said. "You could have your own dumplings and buns and sleep in your own bed. If you don't have money, you can barely sleep."
Mr. Ding had a reputation at McDonald's as a gadfly. He had a habit of offering loud, indelicate social commentary, telling government workers they were corrupt and men in suits they were greedy.
He does work, however. Most days, he leaves McDonald's around 8 a.m. to comb trash cans and bins in back alleys for scraps of copper and steel, which he sells to a friend for 80 cents apiece. He returns by suppertime, waiting for customers to abandon their leftover fries and smoothies.
"This is my work, this is my way of living," he said. "I have no way out."
He joked about selling his eyeballs, or moving to America, where he had heard they treat the homeless better. And he continued to study the lottery, jotting down long strings of numbers. He calculated his odds at 1 in 10 million.
No matter, he said.
"I came into the world naked, and I leave naked," he said. "There's nothing I can take with me when I die."