Reverse Engineering Stack Exchange is a question and answer site for researchers and developers who explore the principles of a system through analysis of its structure, function, and operation. It only takes a minute to sign up.

Now it looks like by the naming that stored is hardcoded in the binary. I considered MGNCHXWIZDJAOKPELYSFUTV to be as is and the target output to be MNGHCWZIJDXOPKLESUVTFYA.

By the function it looks like that it takes the first char of input, splits stored at the location of that char and then recursively calls itself on the two parts made. I made a tree to follow that.

The graph is such that taking one char from input TFSLPOJZCGMNHWXIDAKEYUV and position nodes/chars which are at the right/left appropriately(V is right to T in the graph as it is right to T in the stored). In this graph the output is post order traversal of the graph and the input is pre order traversal.

Similar graph can be constructed from the targetMNGHCWZIJDXOPKLESUVTFYA. Only the reverse such that post order is given and construct the graph.

Now pre order traverse this graph and you'll have your input AXCGMNHDIWZJYEKOPLFSTUV.