1. A method, comprising: generating, by a processor, a first intermediate representation (IR) code of source code for compiling the source code into machine code; identifying a first function and a second function having a first return type in the first IR code, the return type indicating a type of a data structure returned by the first function and the second function when called to be executed; generating, by the processor, a second IR code having a first function including blocks corresponding to the first and second functions from the first IR code that have the first return type; identifying common instructions between the first function and the second function from the first IR code, the common instructions present in both the first function and the second function of the first IR code, the common instructions providing a same functionality in the first function and the second function; generating, by the processor, a common block including the common instructions in the first function of the second IR code; identifying an instruction within the first function of the first IR code representing a function call to the second function of the first IR code; and generating, by the processor, an instruction within the block corresponding to the first function to recursively call the first function of the second IR code and pass a parameter representing that the second block is to be executed based on the identification of the instruction within the first function of the first IR code represents the function call to the second function of the first IR code.