Alright. Error 4013 sounds like a nand issue. Likely cold solder joint. Let's try Mohammadali's approach. You could remove the pentelope screws, carefully remove the home button clasp and cable, then remove the two screws on the battery plate, then disconnect the battery, reconnect and carefully re apply everything. Also, while doing this. Be careful of the display cables at the top. Make sure they are always close, so as not to damage them. Then try putting the phone into dfu mode. Here's a guide for the phone, and I'll post steps to put phone into dfu mode
iPhone 5s 电池更换
Remember, you don't need to take the whole battery out. Just remove cable. Replace cable
Plug your device into your computer with a USB cable.
Turn off the device.
Hold the Power button for 3 seconds.
Hold the Home and Power buttons for 10 seconds.
Release the Power button but keep holding the Home button.
Here's some steps to try to get your phone into dfu mode. Also can you tell us what happened? Why are you trying to restore it? Was there damage? Water?