The gritty psychological drama became a cinematic landmark after an unusually fast writing process.