A compound of formula or a pharmaceutically acceptable salt thereof, wherein p is 1 or 2; ----- is a single or double bond; m is 0, 1, or 2; R 1 is selected from and wherein R 1 is attached to the parent molecular moiety through any substitutable carbon atom in the group; n is 0, 1, 2, 3, 4, 5, or 6; o is 0, 1, 2, 3, 4, or 5; q is 0, 1, 2, 3, or 4; X 0 is selected from CH and N; X 1 is selected from CH and N; X 2 and X 3 are independently selected from CH, C(R a) and N; provided that at least one of X 1, X 2, and X 3 is other than N; X 4 is selected from CH and CR a; one of X 5, X 6, X 7, and X 8 is N and the others are selected from CH and CR a; X 9 is selected from CR a, CH, and N; each R a is independently selected from alkenyloxy, alkoxy, alkoxyalkoxy, alkoxycarbonyl, alkyl, benzodioxanyl, carboxamido, carboxy, carboxyalkoxy, cyano, cycloalkyl, cycloalkylalkoxy, cycloalkyloxy, deuteroalkoxy, dialkylamino, halo, haloalkyl, haloalkoxy, haloalkoxycarbonyl, hydroxy, imidazolyl, morpholinyl, oxazolyl, phenyl, piperazinyl, pyrazolyl, pyridinyl, pyrrolidinyl, thiazolyl, and-NR q R q', wherein the imidazolyl, the morpholinyl, the oxazolyl, the phenyl, the piperazinyl, the pyridinyl, the pyrrolidinyl, and the thiazolyl are optionally substituted with one or two groups independently selected from alkoxy, alkyl, alkylsulfonyl, halo, haloalkoxy, haloalkyl, and morpholinyl; and wherein two adjacent R a groups, together with the carbon atoms to which they are attached, can optionally form a ring selected from dioxanyl, dioxolanyl, furanyl, morpholinyl, pyranyl, and phenyl, wherein the ring is optionally substituted with one or two groups independently selected from alkyl and halo; R b is alkyl; R x is selected from hydrogen and methyl; R 2 is selected from hydrogen, alkyl, deuteroalkyl, halo, haloalkoxy, haloalkyl, and hydroxyalkyl; R 3 is selected from hydrogen, alkoxyalkoxycarbonyl, alkoxycarbonyl, alkylaminocarbonyl, alkylcarbonyl, cycloalkylalkoxycarbonyl, cycloalkylcarbonyl, cycloalkyloxycarbonyl, deuteroalkoxycarbonyl, deuterohaloalkoxycarbonyl, dialkylaminocarbonyl, dialkylaminocarbonylcarbonyl, haloalkoxycarbonyl, haloalkylaminocarbonyl, haloalkylcarbonyl, heterocyclylcarbonyl, heterocyclyloxycarbonyl, phenylcarbonyl, and phenyloxycarbonyl, wherein the cycloalkyl part of the cycloalkylalkoxycarbonyl, the cycloalkylcarbonyl, and the cycloalkyloxycarbonyl, the heterocyclyl part of the heterocyclylcarbonyl and the heterocyclyloxycarbonyl, and the phenyl part of the phenylcarbonyl and the phenyloxycarbonyl, is optionally substituted with one, two, or three groups independently selected from alkyl, alkylamino, alkylcarbonyl, cycloalkyl, dialkylamino, halo, haloalkoxy, and haloalkyl; and one of R q and R q' is selected from hydrogen and alkyl and the other is selected from alkylcarbonyl and phenylcarbonyl. p is 1 or 2; ----- is a single or double bond; m is 0, 1, or 2; R 1 is selected from and wherein R 1 is attached to the parent molecular moiety through any substitutable carbon atom in the group; n is 0, 1, 2, 3, 4, 5, or 6; o is 0, 1, 2, 3, 4, or 5; q is 0, 1, 2, 3, or 4; X 0 is selected from CH and N; X 1 is selected from CH and N; X 2 and X 3 are independently selected from CH, C(R a) and N; provided that at least one of X 1, X 2, and X 3 is other than N; X 4 is selected from CH and CR a; one of X 5, X 6, X 7, and X 8 is N and the others are selected from CH and CR a; X 9 is selected from CR a, CH, and N; each R a is independently selected from alkenyloxy, alkoxy, alkoxyalkoxy, alkoxycarbonyl, alkyl, benzodioxanyl, carboxamido, carboxy, carboxyalkoxy, cyano, cycloalkyl, cycloalkylalkoxy, cycloalkyloxy, deuteroalkoxy, dialkylamino, halo, haloalkyl, haloalkoxy, haloalkoxycarbonyl, hydroxy, imidazolyl, morpholinyl, oxazolyl, phenyl, piperazinyl, pyrazolyl, pyridinyl, pyrrolidinyl, thiazolyl, and-NR q R q', wherein the imidazolyl, the morpholinyl, the oxazolyl, the phenyl, the piperazinyl, the pyridinyl, the pyrrolidinyl, and the thiazolyl are optionally substituted with one or two groups independently selected from alkoxy, alkyl, alkylsulfonyl, halo, haloalkoxy, haloalkyl, and morpholinyl; and wherein two adjacent R a groups, together with the carbon atoms to which they are attached, can optionally form a ring selected from dioxanyl, dioxolanyl, furanyl, morpholinyl, pyranyl, and phenyl, wherein the ring is optionally substituted with one or two groups independently selected from alkyl and halo; R b is alkyl; R x is selected from hydrogen and methyl; R 2 is selected from hydrogen, alkyl, deuteroalkyl, halo, haloalkoxy, haloalkyl, and hydroxyalkyl; R 3 is selected from hydrogen, alkoxyalkoxycarbonyl, alkoxycarbonyl, alkylaminocarbonyl, alkylcarbonyl, cycloalkylalkoxycarbonyl, cycloalkylcarbonyl, cycloalkyloxycarbonyl, deuteroalkoxycarbonyl, deuterohaloalkoxycarbonyl, dialkylaminocarbonyl, dialkylaminocarbonylcarbonyl, haloalkoxycarbonyl, haloalkylaminocarbonyl, haloalkylcarbonyl, heterocyclylcarbonyl, heterocyclyloxycarbonyl, phenylcarbonyl, and phenyloxycarbonyl, wherein the cycloalkyl part of the cycloalkylalkoxycarbonyl, the cycloalkylcarbonyl, and the cycloalkyloxycarbonyl, the heterocyclyl part of the heterocyclylcarbonyl and the heterocyclyloxycarbonyl, and the phenyl part of the phenylcarbonyl and the phenyloxycarbonyl, is optionally substituted with one, two, or three groups independently selected from alkyl, alkylamino, alkylcarbonyl, cycloalkyl, dialkylamino, halo, haloalkoxy, and haloalkyl; and one of R q and R q' is selected from hydrogen and alkyl and the other is selected from alkylcarbonyl and phenylcarbonyl.