A compound according to formula (Ib): or a pharmaceutically acceptable salt thereof, wherein each of R 1 and R 2 is, independently, H or optionally substituted C 1-3 alkyl; R 3 and R 4 combine to form -X 1 -X 2 -X 3 -, wherein X 1 is -S-, -O-, -(CR 14 R 15)-, -C(R 16)=, -N(R 9)-, or -N=; X 2 is-(CR 17 R 18) n -, -S-, -O-, -N=, -C(R 19)=, =N-, =C(R 20)-, or =C(R 21)-C(R 22)=; X 3 is -(CR 14 R 15)-, -S-, -O-, -N(R 9)-, =N-, =C(R 23)-; each R 14 and R 15 is, independently, H or optionally substituted C 1-3 alkyl, or R 14 and R 15 combine to form =O or =S; each R 17 and R 18 is, independently, H or optionally substituted C 1-3 alkyl, or R 17 and R 18 combine to form =O or =S; each R 16, R 19, R 20, R 21, R 22, and R 23 is, independently, H, or optionally substituted C 1-3 alkyl; n is 1 or 2; and the chain of atoms -X 1 -X 2 -X 3 - includes no more than one heteroatom, the heteroatom being selected from the group consisting of nitrogen, oxygen, and sulfur; or R 3 is H, halogen, cyano, optionally substituted C 1-6 alkyl, optionally substituted C 1-3 alkoxy, or optionally substituted amino, and R 4 is halogen, cyano, optionally substituted C 1-6 alkyl, optionally substituted C 1-3 alkoxy, optionally substituted amino, optionally substituted C 1-6 thioalkoxy, or optionally substituted C 6-10 aryl; R 5 is halogen, H, optionally substituted C 1-3 alkyl, optionally substituted C 1-3 alkoxy, or CN; R 6 is halogen, H, optionally substituted C 1-3 alkyl, optionally substituted C 1-3 alkoxy, or CN; R 7 and R 8, together with the atoms to which each is attached, join to form an optionally substituted saturated five-membered ring; and R 9 is H, optionally substituted C 1-3 alkyl, optionally substituted C 3-8 cycloalkyl, optionally substituted C 6-10 aryl, optionally substituted C 2-9 heteroaryl, optionally substituted C 2-9 heterocyclyl, optionally substituted C 1-3 alkcycloalkyl, optionally substituted C 1-3 alkheterocyclyl, or optionally substituted C 1-3 alkaryl. each of R 1 and R 2 is, independently, H or optionally substituted C 1-3 alkyl; R 3 and R 4 combine to form -X 1 -X 2 -X 3 -, wherein X 1 is -S-, -O-, -(CR 14 R 15)-, -C(R 16)=, -N(R 9)-, or -N=; X 2 is-(CR 17 R 18) n -, -S-, -O-, -N=, -C(R 19)=, =N-, =C(R 20)-, or =C(R 21)-C(R 22)=; X 3 is -(CR 14 R 15)-, -S-, -O-, -N(R 9)-, =N-, =C(R 23)-; each R 14 and R 15 is, independently, H or optionally substituted C 1-3 alkyl, or R 14 and R 15 combine to form =O or =S; each R 17 and R 18 is, independently, H or optionally substituted C 1-3 alkyl, or R 17 and R 18 combine to form =O or =S; each R 16, R 19, R 20, R 21, R 22, and R 23 is, independently, H, or optionally substituted C 1-3 alkyl; n is 1 or 2; and the chain of atoms -X 1 -X 2 -X 3 - includes no more than one heteroatom, the heteroatom being selected from the group consisting of nitrogen, oxygen, and sulfur; X 1 is -S-, -O-, -(CR 14 R 15)-, -C(R 16)=, -N(R 9)-, or -N=; X 2 is-(CR 17 R 18) n -, -S-, -O-, -N=, -C(R 19)=, =N-, =C(R 20)-, or =C(R 21)-C(R 22)=; X 3 is -(CR 14 R 15)-, -S-, -O-, -N(R 9)-, =N-, =C(R 23)-; each R 14 and R 15 is, independently, H or optionally substituted C 1-3 alkyl, or R 14 and R 15 combine to form =O or =S; each R 17 and R 18 is, independently, H or optionally substituted C 1-3 alkyl, or R 17 and R 18 combine to form =O or =S; each R 16, R 19, R 20, R 21, R 22, and R 23 is, independently, H, or optionally substituted C 1-3 alkyl; n is 1 or 2; and the chain of atoms -X 1 -X 2 -X 3 - includes no more than one heteroatom, the heteroatom being selected from the group consisting of nitrogen, oxygen, and sulfur; or R 3 is H, halogen, cyano, optionally substituted C 1-6 alkyl, optionally substituted C 1-3 alkoxy, or optionally substituted amino, and R 4 is halogen, cyano, optionally substituted C 1-6 alkyl, optionally substituted C 1-3 alkoxy, optionally substituted amino, optionally substituted C 1-6 thioalkoxy, or optionally substituted C 6-10 aryl; R 5 is halogen, H, optionally substituted C 1-3 alkyl, optionally substituted C 1-3 alkoxy, or CN; R 6 is halogen, H, optionally substituted C 1-3 alkyl, optionally substituted C 1-3 alkoxy, or CN; R 7 and R 8, together with the atoms to which each is attached, join to form an optionally substituted saturated five-membered ring; and R 9 is H, optionally substituted C 1-3 alkyl, optionally substituted C 3-8 cycloalkyl, optionally substituted C 6-10 aryl, optionally substituted C 2-9 heteroaryl, optionally substituted C 2-9 heterocyclyl, optionally substituted C 1-3 alkcycloalkyl, optionally substituted C 1-3 alkheterocyclyl, or optionally substituted C 1-3 alkaryl.