void SIM_instruction_insert(instruction_id_t parent_ii, instruction_id_t ii);
ii is the instruction to insert and ii_parent is the instruction id of the parent instruction. If zero the instruction will be inserted as child to the last inserted one, or as the root if the the tree is empty.
If the parent instruction already has a child the new instruction will be added as another child, thus creating an alternative execution path for the parent.
Instructions can be inserted in the tree after they are fetched and decoded (using SIM_instruction_proceed or similar), but must be inserted before they are executed. This is useful if different instruction should be inserted at different places. For example the instruction after a delay slot have a different parent depending on whether the delay slot can be annulled or not.
Instructions are automatically removed from the tree when they are committed (SIM_instruction_proceed/SIM_instruction_commit) or squashed (SIM_instruction_squash).