GUANGDONG, China - At first blush, Dongguan appears to be as Dickensian as contemporary Chinese industrial cities come.
The air is acrid with the smell of smoke. Squat factory blocks blight the landscape. Container trucks rumble past.
Perched in the north-eastern Pearl River Delta, Dongguan is, after all, "the world's factory", where its famous "factory girls" toil in grimy conditions, turning out one in 10 pairs of the world's sneakers, one in five sweaters and one in three toys.
It is also China's "sin city" with some 300,000 sex workers in the flesh trade; netizens dub it "the place a good husband doesn't visit".
Strip away the initial impressions and one finds a city trying desperately to shed its sordid image and grappling to make over its economy.
In a sprawling factory in Chang Ping town, thousands of workers work on an assembly line of T-shirts for the popular Japanese brand Uniqlo.
A giant machine stretches out rolls of cotton and slashes the fabric. Individual pieces are pegged onto a mechanised line that moves smoothly from station to station where a worker hems the edges or sews on the label, transforming shapeless pieces of cloth into cute tops destined for Uniqlo shelves worldwide.
From "cut to box", it takes just nine minutes to produce a basic T-shirt, says Mr Dennis Wong, executive director of the Crystal Group, which owns the factory employing 11,000 workers. "It used to take us 17 to 18 minutes. Now we rely on industrial engineering to speed things up."
But the latest game in town is technology in quite a different league: cloud computing.
No plumes of dark smoke here, but virtual clouds of data, at what is pitched as a "high-tech industrial development zone".
Spread out over nearly 700,000 sq m, the Cloud Computing Centre was established two years ago under the Chinese Academy of Sciences, the country's scientific think-tank. Some 500 employees - including 49 with PhDs - work on the fast-growing IT business offering clients storage for computing data ranging from Web-based e-mail to music files so they can be accessed anywhere in the world.
A computer screen is alive with blinking words such as "Diaoyu Dao" - the islands in the middle of a spat between China and Japan.
Is that to help the government monitor chatter on the Internet?
Says deputy director Li Junjie: "We service companies that want to know what the public is saying about them. And yes, we help the government monitor public sentiment too."
Eventually, says its director Ji Tongkai, "we hope to produce a company like Weixin, Taobao or Baidu".
Certainly cutting-edge stuff by the standards of Dongguan, more known for its stolid manufacturing muscle in textile, furniture, food and beverage, toys and paper.
As Guangdong, embattled by rising labour costs and sputtering global demand, searches for a new growth model to replace its traditional export-driven role, Dongguan has become ground zero in the process. It is home to 560,000 companies and eight million migrant workers out of a population of 10 million.
With explosive growth reaching even poorer provinces, cheap, pliant "factory girls" from the countryside are harder to come by.Minimum wage has been rising, reaching 1,310 yuan (S$270) in May.
"Ten, 15 years ago, so long as workers had a job and could send money home, they were happy," says Mr Wong."Now they want a lifestyle. On Sundays, they want to shop so we have five buses to take them downtown. We also installed air-conditioning on the floor three years ago."
With labour now a precious commodity, the way forward, says the local government, is to push factories to "innovate" while pushing the inefficient ones out.
"We are determined to shut down polluting companies and drive out low-end, backward factories," says Mr Yao Kang, deputy secretary of the city's party committee.
But the restructuring process has its own set of problems.
Dongguan has seen an inordinate number of worker disputes within Guangdong, which itself accounted for one-third of the country's total number of worker protests in October, according to statistics from China Labour Bulletin (CLB), a labour rights group.
Just last month alone, there were 18 disputes, and in Dongguan, these ranged from one at a toy factory over wage arrears, to another at a Nokia plant over employment terms. Riot police were called in, and the workers arrested.
Restructuring is a key factor, says CLB spokesman Geoffrey Crothall. "Factories close down and don't pay wages; or they relocate or change management, and workers demand more compensation."
Meanwhile, the city is trying to clean up its sleazy image, with reports of crackdown on brothels and promotional videos of Dongguan as a place that melds modern infrastructure and traditional culture.
An official information booklet waxes lyrical about how Dongguan "is known in China as the home to weightlifting, basketball, dragon boat racing... and other folk arts".
But the world's oldest profession continues unabated.
For now, how Dongguan can make the transition from a city of sex and sweatshops to a high-tech utopia is a yet-unknown tale of two cities.
Get a copy of The Straits Times or go to straitstimes.com for more stories.