There are two things to unpack here. First, if the phone got stuck in a boot loop suddenly, what happened before that. Was the phone dropped, repaired or came into contact with water recently? Secondly, are you attempting a full DFU Restore or Update?
iTunes Error 4013 is usually NAND related. Seeing as how this happened after an attempted Restore/Update, there is a strong possibility that the memory was corrupted. Was the device pretty much at it’s memory capacity