how did dirk end up getting the ghost-imprint of his brain if dave was the one that made it waaaaay back in the story?

Dirk made a captcha of his own brain. The brain Dave made was different.