Rating:
Looking through ghridra:
It seems that it reads in a positive integer below 129. So instinctively I tried 128 which got me the flag. However, what it does is that it reads the stack based of the input number and it just so happened that the flag buffer was in the 128th position.
Flag: `tjctf{chop-c4st-7bndbji}`