note that this code doesn't give you "addresses" (which is what OP is looking for), instead it gives you public keys and that only in uncompressed form which you have to first decide whether you want to use the compressed or uncompressed type then you have to hash them and do the address encoding (base58 or bech32) to get the respective addresses.
If the goal is to only get the address i think OP should take a look to this link about how to generate a bitcoin address step by step, if OP understands the theory about it he will be able to code his own script to get the addys of all those privatekeys.