Limited maximum resolved reference operands to 5 to prevent infinite loop when two instructions are referencing each other.