1. A device, comprising: memory; and one or more processors, in communication with the memory, executing instructions to: receive information that identifies a model of a finite state machine, the model including information that identifies a plurality of leaf states, the plurality of leaf states including states of the model that have no child states; determine, based on the information that identifies the model, one or more variables for storing information that identifies an active state of the model; determine a numbering scheme for encoding the plurality of leaf states, the numbering scheme being based on the one or more variables; and encode the plurality of leaf states based on the numbering scheme, wherein encoding the plurality of leaf states comprises generating and storing information indicating an association between a leaf state and a value.