A compound of formula (IVa) wherein L is -(C 4 -C 10 cycloalkyl)- optionally substituted by one to three substituents selected from the group consisting of halogen, cyano, C 1 -C 4 alkyl, hydroxy, and C 1 -C 4 alkoxy; R 1 is hydrogen, C 1 -C 4 alkyl, C 3 -C 6 cycloalkyl, -C R 10a, or 5-6 membered heteroaryl, wherein the C 3 -C 6 cycloalkyl and the 5-6 membered heteroaryl are independently optionally substituted by one or two R 15 groups; R 2 is hydrogen, C 1 -C 4 alkyl, C 3 -C 6 cycloalkyl, -C R 10b, or 5-6 membered heteroaryl, wherein the C 3 -C 6 cycloalkyl and the 5-6 membered heteroaryl are independently optionally substituted by one or two R 15 groups; R 3 and R 4 are each independently hydrogen, halogen, C 1 -C 4 alkyl, C 1 -C 4 alkoxy, or C 3 -C 6 cycloalkyl; R 7 and R 8 are each independently hydrogen, halogen, cyano, C 1 -C 2 alkyl, hydroxy, C 1 -C 2 alkoxy, or -N(R 11)(R 12), wherein the C 1 -C 2 alkyl and the C 1 -C 2 alkoxy are each independently optionally substituted by halogen or hydroxy; R 10a and R 10b are each independently hydrogen, C 1 -C 4 alkyl, -[C(R 13)(R 14) z -(C 4 -C 10 cycloalkyl), -[C(R 13)(R 14)] z -(4-6 membered heterocycloalkyl), -[C(R 13)(R 14)] z -(C 6 -C 10 aryl), or-[C(R 13)(R 14)] z -(5-10 membered heteroaryl), wherein the C 1 -C 4 alkyl, the C 4 -C 10 cycloalkyl, the 4-6 membered heterocycloalkyl, the C 6 -C 10 aryl, and the 5-10 membered heteroaryl in R 10a and R 10b are each independently optionally substituted by one, two or three halogen, cyano, C 1 -C 6 alkyl, hydroxy, C 1 -C 6 alkoxy, -(CH 2) w -N(R 11)(R 12), -(CH 2) w -C N(R 11)(R 12), -C OR 11, -N(R 11)C R 12, -S 2 R 11, or -S N(R 11)(R 12) groups; each R 11, R 12, R 13, R 14 and R 15 is independently hydrogen, C 1 -C 4 alkyl, C 1 -C 4 alkoxy, C 3 -C 6 cycloalkyl, or 3-6 membered heterocycloalkyl, wherein the C 1 -C 4 alkyl, the C 3 -C 6 cycloalkyl, and the 3-6 membered heterocycloalkyl are each independently optionally substituted by one, two or three substituents selected from the group consisting of halogen, cyano, hydroxy, and methoxy; w is 0, 1, 2 or 3; x is 1; and z is 0, 1, 2 or 3; or a pharmaceutically acceptable salt thereof. L is -(C 4 -C 10 cycloalkyl)- optionally substituted by one to three substituents selected from the group consisting of halogen, cyano, C 1 -C 4 alkyl, hydroxy, and C 1 -C 4 alkoxy; R 1 is hydrogen, C 1 -C 4 alkyl, C 3 -C 6 cycloalkyl, -C R 10a, or 5-6 membered heteroaryl, wherein the C 3 -C 6 cycloalkyl and the 5-6 membered heteroaryl are independently optionally substituted by one or two R 15 groups; R 2 is hydrogen, C 1 -C 4 alkyl, C 3 -C 6 cycloalkyl, -C R 10b, or 5-6 membered heteroaryl, wherein the C 3 -C 6 cycloalkyl and the 5-6 membered heteroaryl are independently optionally substituted by one or two R 15 groups; R 3 and R 4 are each independently hydrogen, halogen, C 1 -C 4 alkyl, C 1 -C 4 alkoxy, or C 3 -C 6 cycloalkyl; R 7 and R 8 are each independently hydrogen, halogen, cyano, C 1 -C 2 alkyl, hydroxy, C 1 -C 2 alkoxy, or -N(R 11)(R 12), wherein the C 1 -C 2 alkyl and the C 1 -C 2 alkoxy are each independently optionally substituted by halogen or hydroxy; R 10a and R 10b are each independently hydrogen, C 1 -C 4 alkyl, -[C(R 13)(R 14) z -(C 4 -C 10 cycloalkyl), -[C(R 13)(R 14)] z -(4-6 membered heterocycloalkyl), -[C(R 13)(R 14)] z -(C 6 -C 10 aryl), or-[C(R 13)(R 14)] z -(5-10 membered heteroaryl), wherein the C 1 -C 4 alkyl, the C 4 -C 10 cycloalkyl, the 4-6 membered heterocycloalkyl, the C 6 -C 10 aryl, and the 5-10 membered heteroaryl in R 10a and R 10b are each independently optionally substituted by one, two or three halogen, cyano, C 1 -C 6 alkyl, hydroxy, C 1 -C 6 alkoxy, -(CH 2) w -N(R 11)(R 12), -(CH 2) w -C N(R 11)(R 12), -C OR 11, -N(R 11)C R 12, -S 2 R 11, or -S N(R 11)(R 12) groups; each R 11, R 12, R 13, R 14 and R 15 is independently hydrogen, C 1 -C 4 alkyl, C 1 -C 4 alkoxy, C 3 -C 6 cycloalkyl, or 3-6 membered heterocycloalkyl, wherein the C 1 -C 4 alkyl, the C 3 -C 6 cycloalkyl, and the 3-6 membered heterocycloalkyl are each independently optionally substituted by one, two or three substituents selected from the group consisting of halogen, cyano, hydroxy, and methoxy; w is 0, 1, 2 or 3; x is 1; and z is 0, 1, 2 or 3;