Post History
C (gcc), 43 38 bytes f(i){return i>1?f(i%2?3*i+1:i/2)+1:0;} Attempt This Online! Credits to @Moshi for shortening the code.
Answer
#2: Post edited
# [C (gcc)](https://gcc.gnu.org), 43 bytes- ``` C
f(x,_){return x==1?_:f(x%2?3*x+1:x/2,++_);}- ```
[Attempt This Online!](https://ato.pxeger.com/run?1=LYxNCsIwFITXzSkelUJiUm3rRvp7CndCkaTRB5pKbSUgnsRNN72At_E2RuxmPviGmdck66OU43uBRp4H1UB-6xW2q1M5Db0Otx-uqRU1e3RNP3QGbFHEVZ06GSTVZml5nNp1IjivWfacJzs0PVwOaOi9RcXIg3i67YD-NEIBceaQO0YZcI6MeN61c6WmfqAgLCFQe-MLQAGauogYy8h8Po5_fgE)
- # [C (gcc)](https://gcc.gnu.org), <s>43</s> 38 bytes
- ``` C
- f(i){return i>1?f(i%2?3*i+1:i/2)+1:0;}
- ```
- [Attempt This Online!](https://ato.pxeger.com/run?1=m700OT49OXnBJuXMvOSc0pRUBZvikpTMfL0Mu6WlJWm6FjfV0jQyNauLUktKi_IUMu0M7YF8VSN7Y61MbUOrTH0jTSBlYF0LVR2UmVeikJuYmadRlp-ZoslVzcWZll-koAESzlSwVTC0BlI2QNrAWkFbO1OTi5OzoAgomaahpJqioGunoJoSk6eko5CpowCyV9OaC2ryggUQGgA)
- Credits to [@Moshi](https://codegolf.codidact.com/users/53196) for shortening the code.
#1: Initial revision
# [C (gcc)](https://gcc.gnu.org), 43 bytes ``` C f(x,_){return x==1?_:f(x%2?3*x+1:x/2,++_);} ``` [Attempt This Online!](https://ato.pxeger.com/run?1=LYxNCsIwFITXzSkelUJiUm3rRvp7CndCkaTRB5pKbSUgnsRNN72At_E2RuxmPviGmdck66OU43uBRp4H1UB-6xW2q1M5Db0Otx-uqRU1e3RNP3QGbFHEVZ06GSTVZml5nNp1IjivWfacJzs0PVwOaOi9RcXIg3i67YD-NEIBceaQO0YZcI6MeN61c6WmfqAgLCFQe-MLQAGauogYy8h8Po5_fgE)