1. An information processing apparatus comprising: a memory configured to store a first code; and a processor configured to compile a source file to generate the first code, wherein the first code is an intermediate code generated based on a result of analysis of a source program from the source file, the processor: generates a second code, which is executable by the processor, from the intermediate code; divides the second code into blocks each which has a size equal to or smaller than a given size and includes a reservation region provided at a specific position and at least a part of the second code so as to generate the first code, wherein the given size is a size within a short branch instruction in the block reach one of preceding and succeeding reservation regions; selects one reservation region from a first reservation region and a second reservation region which is nearer a target region in one of the blocks, the first reservation region being included in the one of the blocks and the second reservation region being included in another one of the blocks; writes, in the target region, a first branch instruction to branch a selected reservation region; writes, in the selected reservation region, a second branch instruction to branch another region in a different one the blocks; and store the modified second code in a storage in order to be executed by the processor.