remove serialno from the getvar result in your post above
i don't know what you want
you need the latest firmware to flash a custom rom or you need to flash the latest stock rom ( by using RUU ) ???
in all cases you need to flash the latest firmware first 6.20.502.5 ( it's the latest firmware for your AT&T device variant )
6.20.502.5 is marshmallow and it's the latest official OS for this device
note :- flashing the signed firmware will wipe your internal storage so make sure to backup your files
flash firmware
1-download this signed firmware
https://mega.nz/#!XV5EjYhS!gNN_rAYovaMQpaeP2OSdkfYAIEAmv6VnB-QlZ1VadMU ( rename it to something short and easy if you like )
2- open a cmd window in the folder where the firmware located
3- relock the bootloader ( if it's unlocked ) by this commands
fastboot oem lock
fastboot reboot-bootloader
3- now start flashing the firmware using this commands and replace firmwarename with the actual firmware name
fastboot oem rebootRUU
fastboot flash zip firmwarename.zip
if you see FAILED (remote: 90 hboot pre-update! please flush image again immediately)
then repeat the flashing command again
fastboot flash zip firmwarename.zip
after it complete type
fastboot reboot-bootloader
flash custom rom
now you have the latest firmware if you want to flash a custom rom unlock the bootloader and flash twrp then flash the desired rom
flash stock rom using RUU.exe
if you want the latest stock rom RUU.exe it's available on htc website here
http://www.htc.com/us/support/htc-one-m8-att/news/
direst link for the RUU
http://dl3.htc.com.s3.amazonaws.com...70_ATT_MR_Cingular_US_6.20.502.5_combined.exe
after flash the firmware and do all the above commands run the RUU as a normal application and follow the setup wizard