To your brain, one sleepless night is the cognitive equivalent of being legally drunk.
Sleeplessness makes you quite productive if you happen to be the brooding male lead in a major movie. Travis Bickle drives the graveyard shift because of chronic insomnia in Taxi Driver. Tony Stark builds a few dozen new Iron Man suits after PTSD throttles him into perpetual wakefulness in Iron Man 3. A corporate drone creates an army, an ideology, and an alternate personality during his restless nights in Fight Club.
But don't let Hollywood fool you: In real life, sleeplessness cripples brainpower. In one study, the loss of a single night's rest had about the same effect as reaching the legal limit of drunkenness when researchers measured performance on cognitive tests. Insomnia impairs one's attention span and short-term memory, and these mental failings get worse the longer one goes without sleep.
Sleeplessness even disrupts the ability to read emotions; subjects in a UC Berkley study who had gone 24 without sleep were more likely to see neutral or friendly facial expressions as threatening.