C (gcc), 33 29 2928 bytes
Saved a byte thanks to ceilingcat!!!
x;f(n){for(x=0;++x!=n;n-n;n/=x);} How
Uses the gcc C extension: ++<var1>! = <var2> as ++x!=n which increments x until x! is equal to n. ¯\(ツ)/¯Try it online!