A function file which doesn't get overwritten while updating theme?

I have written some functions at the theme’s functions.php. But I guess I have to rewrite it with every theme updates.

Can you add an option to have another function file which doesn’t get overwritten with theme updates?

The solution to this is to use a child theme. Your child theme’s function file will not be overwritten every time the theme is updated.

So basically just create a child theme with a functions.php with the custom functions you want and you won’t lose them when the theme is updated.