#include <stdint.h>

uint16_t diacritic_to_num(uint32_t code)
{
	switch (code) {
	case 0x305:
		return code - 0x305 + 1;
	case 0x30d:
	case 0x30e:
		return code - 0x30d + 2;
	case 0x310:
		return code - 0x310 + 4;
	case 0x312:
		return code - 0x312 + 5;
	case 0x33d:
	case 0x33e:
	case 0x33f:
		return code - 0x33d + 6;
	case 0x346:
		return code - 0x346 + 9;
	case 0x34a:
	case 0x34b:
	case 0x34c:
		return code - 0x34a + 10;
	case 0x350:
	case 0x351:
	case 0x352:
		return code - 0x350 + 13;
	case 0x357:
		return code - 0x357 + 16;
	case 0x35b:
		return code - 0x35b + 17;
	case 0x363:
	case 0x364:
	case 0x365:
	case 0x366:
	case 0x367:
	case 0x368:
	case 0x369:
	case 0x36a:
	case 0x36b:
	case 0x36c:
	case 0x36d:
	case 0x36e:
	case 0x36f:
		return code - 0x363 + 18;
	case 0x483:
	case 0x484:
	case 0x485:
	case 0x486:
	case 0x487:
		return code - 0x483 + 31;
	case 0x592:
	case 0x593:
	case 0x594:
	case 0x595:
		return code - 0x592 + 36;
	case 0x597:
	case 0x598:
	case 0x599:
		return code - 0x597 + 40;
	case 0x59c:
	case 0x59d:
	case 0x59e:
	case 0x59f:
	case 0x5a0:
	case 0x5a1:
		return code - 0x59c + 43;
	case 0x5a8:
	case 0x5a9:
		return code - 0x5a8 + 49;
	case 0x5ab:
	case 0x5ac:
		return code - 0x5ab + 51;
	case 0x5af:
		return code - 0x5af + 53;
	case 0x5c4:
		return code - 0x5c4 + 54;
	case 0x610:
	case 0x611:
	case 0x612:
	case 0x613:
	case 0x614:
	case 0x615:
	case 0x616:
	case 0x617:
		return code - 0x610 + 55;
	case 0x657:
	case 0x658:
	case 0x659:
	case 0x65a:
	case 0x65b:
		return code - 0x657 + 63;
	case 0x65d:
	case 0x65e:
		return code - 0x65d + 68;
	case 0x6d6:
	case 0x6d7:
	case 0x6d8:
	case 0x6d9:
	case 0x6da:
	case 0x6db:
	case 0x6dc:
		return code - 0x6d6 + 70;
	case 0x6df:
	case 0x6e0:
	case 0x6e1:
	case 0x6e2:
		return code - 0x6df + 77;
	case 0x6e4:
		return code - 0x6e4 + 81;
	case 0x6e7:
	case 0x6e8:
		return code - 0x6e7 + 82;
	case 0x6eb:
	case 0x6ec:
		return code - 0x6eb + 84;
	case 0x730:
		return code - 0x730 + 86;
	case 0x732:
	case 0x733:
		return code - 0x732 + 87;
	case 0x735:
	case 0x736:
		return code - 0x735 + 89;
	case 0x73a:
		return code - 0x73a + 91;
	case 0x73d:
		return code - 0x73d + 92;
	case 0x73f:
	case 0x740:
	case 0x741:
		return code - 0x73f + 93;
	case 0x743:
		return code - 0x743 + 96;
	case 0x745:
		return code - 0x745 + 97;
	case 0x747:
		return code - 0x747 + 98;
	case 0x749:
	case 0x74a:
		return code - 0x749 + 99;
	case 0x7eb:
	case 0x7ec:
	case 0x7ed:
	case 0x7ee:
	case 0x7ef:
	case 0x7f0:
	case 0x7f1:
		return code - 0x7eb + 101;
	case 0x7f3:
		return code - 0x7f3 + 108;
	case 0x816:
	case 0x817:
	case 0x818:
	case 0x819:
		return code - 0x816 + 109;
	case 0x81b:
	case 0x81c:
	case 0x81d:
	case 0x81e:
	case 0x81f:
	case 0x820:
	case 0x821:
	case 0x822:
	case 0x823:
		return code - 0x81b + 113;
	case 0x825:
	case 0x826:
	case 0x827:
		return code - 0x825 + 122;
	case 0x829:
	case 0x82a:
	case 0x82b:
	case 0x82c:
	case 0x82d:
		return code - 0x829 + 125;
	case 0x951:
		return code - 0x951 + 130;
	case 0x953:
	case 0x954:
		return code - 0x953 + 131;
	case 0xf82:
	case 0xf83:
		return code - 0xf82 + 133;
	case 0xf86:
	case 0xf87:
		return code - 0xf86 + 135;
	case 0x135d:
	case 0x135e:
	case 0x135f:
		return code - 0x135d + 137;
	case 0x17dd:
		return code - 0x17dd + 140;
	case 0x193a:
		return code - 0x193a + 141;
	case 0x1a17:
		return code - 0x1a17 + 142;
	case 0x1a75:
	case 0x1a76:
	case 0x1a77:
	case 0x1a78:
	case 0x1a79:
	case 0x1a7a:
	case 0x1a7b:
	case 0x1a7c:
		return code - 0x1a75 + 143;
	case 0x1b6b:
		return code - 0x1b6b + 151;
	case 0x1b6d:
	case 0x1b6e:
	case 0x1b6f:
	case 0x1b70:
	case 0x1b71:
	case 0x1b72:
	case 0x1b73:
		return code - 0x1b6d + 152;
	case 0x1cd0:
	case 0x1cd1:
	case 0x1cd2:
		return code - 0x1cd0 + 159;
	case 0x1cda:
	case 0x1cdb:
		return code - 0x1cda + 162;
	case 0x1ce0:
		return code - 0x1ce0 + 164;
	case 0x1dc0:
	case 0x1dc1:
		return code - 0x1dc0 + 165;
	case 0x1dc3:
	case 0x1dc4:
	case 0x1dc5:
	case 0x1dc6:
	case 0x1dc7:
	case 0x1dc8:
	case 0x1dc9:
		return code - 0x1dc3 + 167;
	case 0x1dcb:
	case 0x1dcc:
		return code - 0x1dcb + 174;
	case 0x1dd1:
	case 0x1dd2:
	case 0x1dd3:
	case 0x1dd4:
	case 0x1dd5:
	case 0x1dd6:
	case 0x1dd7:
	case 0x1dd8:
	case 0x1dd9:
	case 0x1dda:
	case 0x1ddb:
	case 0x1ddc:
	case 0x1ddd:
	case 0x1dde:
	case 0x1ddf:
	case 0x1de0:
	case 0x1de1:
	case 0x1de2:
	case 0x1de3:
	case 0x1de4:
	case 0x1de5:
	case 0x1de6:
		return code - 0x1dd1 + 176;
	case 0x1dfe:
		return code - 0x1dfe + 198;
	case 0x20d0:
	case 0x20d1:
		return code - 0x20d0 + 199;
	case 0x20d4:
	case 0x20d5:
	case 0x20d6:
	case 0x20d7:
		return code - 0x20d4 + 201;
	case 0x20db:
	case 0x20dc:
		return code - 0x20db + 205;
	case 0x20e1:
		return code - 0x20e1 + 207;
	case 0x20e7:
		return code - 0x20e7 + 208;
	case 0x20e9:
		return code - 0x20e9 + 209;
	case 0x20f0:
		return code - 0x20f0 + 210;
	case 0x2cef:
	case 0x2cf0:
	case 0x2cf1:
		return code - 0x2cef + 211;
	case 0x2de0:
	case 0x2de1:
	case 0x2de2:
	case 0x2de3:
	case 0x2de4:
	case 0x2de5:
	case 0x2de6:
	case 0x2de7:
	case 0x2de8:
	case 0x2de9:
	case 0x2dea:
	case 0x2deb:
	case 0x2dec:
	case 0x2ded:
	case 0x2dee:
	case 0x2def:
	case 0x2df0:
	case 0x2df1:
	case 0x2df2:
	case 0x2df3:
	case 0x2df4:
	case 0x2df5:
	case 0x2df6:
	case 0x2df7:
	case 0x2df8:
	case 0x2df9:
	case 0x2dfa:
	case 0x2dfb:
	case 0x2dfc:
	case 0x2dfd:
	case 0x2dfe:
	case 0x2dff:
		return code - 0x2de0 + 214;
	case 0xa66f:
		return code - 0xa66f + 246;
	case 0xa67c:
	case 0xa67d:
		return code - 0xa67c + 247;
	case 0xa6f0:
	case 0xa6f1:
		return code - 0xa6f0 + 249;
	case 0xa8e0:
	case 0xa8e1:
	case 0xa8e2:
	case 0xa8e3:
	case 0xa8e4:
	case 0xa8e5:
	case 0xa8e6:
	case 0xa8e7:
	case 0xa8e8:
	case 0xa8e9:
	case 0xa8ea:
	case 0xa8eb:
	case 0xa8ec:
	case 0xa8ed:
	case 0xa8ee:
	case 0xa8ef:
	case 0xa8f0:
	case 0xa8f1:
		return code - 0xa8e0 + 251;
	case 0xaab0:
		return code - 0xaab0 + 269;
	case 0xaab2:
	case 0xaab3:
		return code - 0xaab2 + 270;
	case 0xaab7:
	case 0xaab8:
		return code - 0xaab7 + 272;
	case 0xaabe:
	case 0xaabf:
		return code - 0xaabe + 274;
	case 0xaac1:
		return code - 0xaac1 + 276;
	case 0xfe20:
	case 0xfe21:
	case 0xfe22:
	case 0xfe23:
	case 0xfe24:
	case 0xfe25:
	case 0xfe26:
		return code - 0xfe20 + 277;
	case 0x10a0f:
		return code - 0x10a0f + 284;
	case 0x10a38:
		return code - 0x10a38 + 285;
	case 0x1d185:
	case 0x1d186:
	case 0x1d187:
	case 0x1d188:
	case 0x1d189:
		return code - 0x1d185 + 286;
	case 0x1d1aa:
	case 0x1d1ab:
	case 0x1d1ac:
	case 0x1d1ad:
		return code - 0x1d1aa + 291;
	case 0x1d242:
	case 0x1d243:
	case 0x1d244:
		return code - 0x1d242 + 295;
	}
	return 0;
}
