int namegen_offsets(int n, const short **offsets) {
  static const short offsets_table[] = {
      0x0000, 0x0002, 0x0005, 0x0008, 0x000a, 0x000d, 0x0011, 0x0014, 0x0017,
      0x0019, 0x001c, 0x001e, 0x0020, 0x0022, 0x0024, 0x0026, 0x0028, 0x002b,
      0x002d, 0x002f, 0x0031, 0x0034, 0x0037, 0x0039, 0x003c, 0x003e, 0x0042,
      0x0045, 0x0048, 0x004b, 0x004e, 0x0051, 0x0055, 0x0058, 0x005a, 0x005d,
      0x0061, 0x0064, 0x0066, 0x0068, 0x006b, 0x006d, 0x006f, 0x0072, 0x0074,
      0x0076, 0x0079, 0x007c, 0x007e, 0x0080, 0x0082, 0x0085, 0x0087, 0x0089,
      0x008b, 0x008e, 0x0091, 0x0094, 0x0096, 0x0098, 0x009b, 0x009e, 0x00a1,
      0x00a3, 0x00a6, 0x00a8, 0x00aa, 0x00ad, 0x00b0, 0x00b3, 0x00b5, 0x00b8,
      0x00bb, 0x00be, 0x00c0, 0x00c3, 0x00c5, 0x00c7, 0x00c9, 0x00cb, 0x00cd,
      0x00d0, 0x00d3, 0x00d6, 0x00d8, 0x00da, 0x00dd, 0x00e0, 0x00e2, 0x00e5,
      0x00e8, 0x00eb, 0x00ed, 0x00ef, 0x00f1, 0x00f4, 0x00f6, 0x00f8, 0x00fa,
      0x00fd, 0x00ff, 0x0103, 0x0109, 0x010f, 0x0114, 0x011a, 0x011f, 0x0127,
      0x0130, 0x013a, 0x013f, 0x0144, 0x0148, 0x014d, 0x0151, 0x0156, 0x015b,
      0x0160, 0x0165, 0x0169, 0x016d, 0x0172, 0x0177, 0x017c, 0x017e, 0x0180,
      0x0182, 0x0184, 0x0186, 0x0188, 0x018b, 0x018e, 0x0191, 0x0194, 0x0197,
      0x019a, 0x019d, 0x01a0, 0x01a3, 0x01a6, 0x01a9, 0x01ac, 0x01af, 0x01b2,
      0x01b5, 0x01b8, 0x01ba, 0x01bc, 0x01be, 0x01c0, 0x01c2, 0x01c4, 0x01c6,
      0x01c8, 0x01ca, 0x01cc, 0x01ce, 0x01d0, 0x01d2, 0x01d4, 0x01d6, 0x01d8,
      0x01da, 0x01dc, 0x01de, 0x01e0, 0x01e2, 0x01e7, 0x01ed, 0x01f0, 0x01f3,
      0x01f6, 0x01fb, 0x01ff, 0x0204, 0x0208, 0x020c, 0x020f, 0x0213, 0x0217,
      0x021b, 0x021f, 0x0223, 0x0227, 0x022b, 0x022f, 0x0234, 0x0237, 0x023b,
      0x023e, 0x0242, 0x0246, 0x0249, 0x024d, 0x0251, 0x0256, 0x0259, 0x025d,
      0x0261, 0x0265, 0x026a, 0x026e, 0x0272, 0x0276, 0x027c, 0x0281, 0x0286,
      0x028b, 0x028f, 0x0296, 0x029b, 0x02a2, 0x02a7, 0x02ac, 0x02b2, 0x02b7,
      0x02bb, 0x02c0, 0x02c5, 0x02ca, 0x02cf, 0x02d4, 0x02db, 0x02e0, 0x02e7,
      0x02ec, 0x02f4, 0x02f9, 0x02ff, 0x0307, 0x030f, 0x0314, 0x0319, 0x031e,
      0x0323, 0x0328, 0x032e, 0x0332, 0x0337, 0x033b, 0x0340, 0x0346, 0x034c,
      0x0353, 0x035b, 0x0361, 0x0366, 0x036a, 0x036f, 0x0374, 0x0379, 0x0380,
      0x0387, 0x038e, 0x0395, 0x039b, 0x03a2, 0x03a9, 0x03b0, 0x03b6, 0x03bd,
      0x03c3, 0x03c9, 0x03d0, 0x03d8, 0x03df, 0x03e7, 0x03ee, 0x03f6, 0x03fb,
      0x0402, 0x0409, 0x0413, 0x041d, 0x0427, 0x0431, 0x0438, 0x0441, 0x0448,
      0x0450, 0x0457, 0x045f, 0x0467, 0x046e, 0x0476, 0x047d, 0x0483, 0x048a,
      0x0491, 0x0498, 0x049f, 0x04a5, 0x04ab, 0x04af, 0x04b3, 0x04b6, 0x04ba,
      0x04be, 0x04c2, 0x04c5, 0x04c9, 0x04cc, 0x04d0, 0x04d3, 0x04d7, 0x04da,
      0x04de, 0x04e3, 0x04e6, 0x04ea, 0x04ee, 0x04f2, 0x04f6, 0x04fa, 0x04fe,
      0x0502, 0x0506, 0x050a, 0x050e, 0x0512, 0x0516, 0x051a, 0x051e, 0x0522,
      0x0525, 0x0528, 0x052c, 0x0530, 0x0535, 0x0538, 0x053c, 0x0540, 0x0543,
      0x0547, 0x054b, 0x054f, 0x0553, 0x0557, 0x055a, 0x055f, 0x0563, 0x0566,
      0x056a, 0x056e, 0x0572, 0x0575, 0x0578, 0x057c, 0x057f, 0x0583, 0x0587,
      0x058b, 0x058f, 0x0593, 0x0597, 0x059b, 0x059f, 0x05a3, 0x05a7, 0x05aa,
      0x05ae, 0x05b2, 0x05b5, 0x05b8, 0x05bb, 0x05bf, 0x05c2, 0x05c7, 0x05cb,
      0x05cf, 0x05d3, 0x05d7, 0x05db, 0x05df, 0x05e3, 0x05e7, 0x05eb, 0x05ef,
      0x05f3, 0x05f8, 0x05fc, 0x0600, 0x0604, 0x0608, 0x060c, 0x0611, 0x0615,
      0x0619, 0x061d, 0x0621, 0x0626, 0x062a, 0x062e, 0x0632, 0x0636, 0x063a,
      0x063d, 0x0641, 0x0645, 0x0649, 0x064d, 0x0651, 0x0655, 0x0659, 0x065d,
      0x0661, 0x0665, 0x0669, 0x066b, 0x066d, 0x066f, 0x0671, 0x0673};
  static const short off_len[] = {
      0x0000, 0x002b, 0x002b, 0x0024, 0x004f, 0x0015, 0x0064, 0x0017,
      0x007b, 0x0016, 0x0091, 0x0015, 0x00a6, 0x0024, 0x00ca, 0x002f,
      0x00f9, 0x002b, 0x0124, 0x0073, 0x0197, 0x0006};
  *offsets = offsets_table + off_len[n * 2 + 0];
  return off_len[n * 2 + 1];
}


x86 assembly (clang, -O0):
<namegen_offsets>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x0,%eax
movslq %eax,%rcx
lea    0x1222(%rip),%rax
movswl (%rax,%rcx,2),%eax
cltq
lea    0xed5(%rip),%rcx
shl    $0x1,%rax
add    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    0x11f4(%rip),%rax
movswl (%rax,%rcx,2),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<namegen_offsets>:
lea    (%rdi,%rdi,1),%eax
cltq
lea    0x1234(%rip),%rcx
movswq (%rcx,%rax,2),%rax
lea    0xee8(%rip),%rdx
lea    (%rdx,%rax,2),%rax
mov    %rax,(%rsi)
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
cltq
movswl (%rcx,%rax,2),%eax
ret

LLVM IR (-O0):
@namegen_offsets.offsets_table = internal constant [413 x i16] [i16 0, i16 2, i16 5, i16 8, i16 10, i16 13, i16 17, i16 20, i16 23, i16 25, i16 28, i16 30, i16 32, i16 34, i16 36, i16 38, i16 40, i16 43, i16 45, i16 47, i16 49, i16 52, i16 55, i16 57, i16 60, i16 62, i16 66, i16 69, i16 72, i16 75, i16 78, i16 81, i16 85, i16 88, i16 90, i16 93, i16 97, i16 100, i16 102, i16 104, i16 107, i16 109, i16 111, i16 114, i16 116, i16 118, i16 121, i16 124, i16 126, i16 128, i16 130, i16 133, i16 135, i16 137, i16 139, i16 142, i16 145, i16 148, i16 150, i16 152, i16 155, i16 158, i16 161, i16 163, i16 166, i16 168, i16 170, i16 173, i16 176, i16 179, i16 181, i16 184, i16 187, i16 190, i16 192, i16 195, i16 197, i16 199, i16 201, i16 203, i16 205, i16 208, i16 211, i16 214, i16 216, i16 218, i16 221, i16 224, i16 226, i16 229, i16 232, i16 235, i16 237, i16 239, i16 241, i16 244, i16 246, i16 248, i16 250, i16 253, i16 255, i16 259, i16 265, i16 271, i16 276, i16 282, i16 287, i16 295, i16 304, i16 314, i16 319, i16 324, i16 328, i16 333, i16 337, i16 342, i16 347, i16 352, i16 357, i16 361, i16 365, i16 370, i16 375, i16 380, i16 382, i16 384, i16 386, i16 388, i16 390, i16 392, i16 395, i16 398, i16 401, i16 404, i16 407, i16 410, i16 413, i16 416, i16 419, i16 422, i16 425, i16 428, i16 431, i16 434, i16 437, i16 440, i16 442, i16 444, i16 446, i16 448, i16 450, i16 452, i16 454, i16 456, i16 458, i16 460, i16 462, i16 464, i16 466, i16 468, i16 470, i16 472, i16 474, i16 476, i16 478, i16 480, i16 482, i16 487, i16 493, i16 496, i16 499, i16 502, i16 507, i16 511, i16 516, i16 520, i16 524, i16 527, i16 531, i16 535, i16 539, i16 543, i16 547, i16 551, i16 555, i16 559, i16 564, i16 567, i16 571, i16 574, i16 578, i16 582, i16 585, i16 589, i16 593, i16 598, i16 601, i16 605, i16 609, i16 613, i16 618, i16 622, i16 626, i16 630, i16 636, i16 641, i16 646, i16 651, i16 655, i16 662, i16 667, i16 674, i16 679, i16 684, i16 690, i16 695, i16 699, i16 704, i16 709, i16 714, i16 719, i16 724, i16 731, i16 736, i16 743, i16 748, i16 756, i16 761, i16 767, i16 775, i16 783, i16 788, i16 793, i16 798, i16 803, i16 808, i16 814, i16 818, i16 823, i16 827, i16 832, i16 838, i16 844, i16 851, i16 859, i16 865, i16 870, i16 874, i16 879, i16 884, i16 889, i16 896, i16 903, i16 910, i16 917, i16 923, i16 930, i16 937, i16 944, i16 950, i16 957, i16 963, i16 969, i16 976, i16 984, i16 991, i16 999, i16 1006, i16 1014, i16 1019, i16 1026, i16 1033, i16 1043, i16 1053, i16 1063, i16 1073, i16 1080, i16 1089, i16 1096, i16 1104, i16 1111, i16 1119, i16 1127, i16 1134, i16 1142, i16 1149, i16 1155, i16 1162, i16 1169, i16 1176, i16 1183, i16 1189, i16 1195, i16 1199, i16 1203, i16 1206, i16 1210, i16 1214, i16 1218, i16 1221, i16 1225, i16 1228, i16 1232, i16 1235, i16 1239, i16 1242, i16 1246, i16 1251, i16 1254, i16 1258, i16 1262, i16 1266, i16 1270, i16 1274, i16 1278, i16 1282, i16 1286, i16 1290, i16 1294, i16 1298, i16 1302, i16 1306, i16 1310, i16 1314, i16 1317, i16 1320, i16 1324, i16 1328, i16 1333, i16 1336, i16 1340, i16 1344, i16 1347, i16 1351, i16 1355, i16 1359, i16 1363, i16 1367, i16 1370, i16 1375, i16 1379, i16 1382, i16 1386, i16 1390, i16 1394, i16 1397, i16 1400, i16 1404, i16 1407, i16 1411, i16 1415, i16 1419, i16 1423, i16 1427, i16 1431, i16 1435, i16 1439, i16 1443, i16 1447, i16 1450, i16 1454, i16 1458, i16 1461, i16 1464, i16 1467, i16 1471, i16 1474, i16 1479, i16 1483, i16 1487, i16 1491, i16 1495, i16 1499, i16 1503, i16 1507, i16 1511, i16 1515, i16 1519, i16 1523, i16 1528, i16 1532, i16 1536, i16 1540, i16 1544, i16 1548, i16 1553, i16 1557, i16 1561, i16 1565, i16 1569, i16 1574, i16 1578, i16 1582, i16 1586, i16 1590, i16 1594, i16 1597, i16 1601, i16 1605, i16 1609, i16 1613, i16 1617, i16 1621, i16 1625, i16 1629, i16 1633, i16 1637, i16 1641, i16 1643, i16 1645, i16 1647, i16 1649, i16 1651]
@namegen_offsets.off_len = internal constant [22 x i16] [i16 0, i16 43, i16 43, i16 36, i16 79, i16 21, i16 100, i16 23, i16 123, i16 22, i16 145, i16 21, i16 166, i16 36, i16 202, i16 47, i16 249, i16 43, i16 292, i16 115, i16 407, i16 6]
define i32 @namegen_offsets(i32 %0, i16** %1) {
%3 = alloca i32
%4 = alloca i16**
store i32 %0, i32* %3
store i16** %1, i16*** %4
%5 = load i32, i32* %3
%6 = mul nsw i32 %5, 2
%7 = add nsw i32 %6, 0
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [22 x i16], [22 x i16]* @namegen_offsets.off_len, i64 0, i64 %8
%10 = load i16, i16* %9
%11 = sext i16 %10 to i32
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i16, i16* getelementptr inbounds ([413 x i16], [413 x i16]* @namegen_offsets.offsets_table, i64 0, i64 0), i64 %12
%14 = load i16**, i16*** %4
store i16* %13, i16** %14
%15 = load i32, i32* %3
%16 = mul nsw i32 %15, 2
%17 = add nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [22 x i16], [22 x i16]* @namegen_offsets.off_len, i64 0, i64 %18
%20 = load i16, i16* %19
%21 = sext i16 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
@namegen_offsets.offsets_table = internal constant [413 x i16] [i16 0, i16 2, i16 5, i16 8, i16 10, i16 13, i16 17, i16 20, i16 23, i16 25, i16 28, i16 30, i16 32, i16 34, i16 36, i16 38, i16 40, i16 43, i16 45, i16 47, i16 49, i16 52, i16 55, i16 57, i16 60, i16 62, i16 66, i16 69, i16 72, i16 75, i16 78, i16 81, i16 85, i16 88, i16 90, i16 93, i16 97, i16 100, i16 102, i16 104, i16 107, i16 109, i16 111, i16 114, i16 116, i16 118, i16 121, i16 124, i16 126, i16 128, i16 130, i16 133, i16 135, i16 137, i16 139, i16 142, i16 145, i16 148, i16 150, i16 152, i16 155, i16 158, i16 161, i16 163, i16 166, i16 168, i16 170, i16 173, i16 176, i16 179, i16 181, i16 184, i16 187, i16 190, i16 192, i16 195, i16 197, i16 199, i16 201, i16 203, i16 205, i16 208, i16 211, i16 214, i16 216, i16 218, i16 221, i16 224, i16 226, i16 229, i16 232, i16 235, i16 237, i16 239, i16 241, i16 244, i16 246, i16 248, i16 250, i16 253, i16 255, i16 259, i16 265, i16 271, i16 276, i16 282, i16 287, i16 295, i16 304, i16 314, i16 319, i16 324, i16 328, i16 333, i16 337, i16 342, i16 347, i16 352, i16 357, i16 361, i16 365, i16 370, i16 375, i16 380, i16 382, i16 384, i16 386, i16 388, i16 390, i16 392, i16 395, i16 398, i16 401, i16 404, i16 407, i16 410, i16 413, i16 416, i16 419, i16 422, i16 425, i16 428, i16 431, i16 434, i16 437, i16 440, i16 442, i16 444, i16 446, i16 448, i16 450, i16 452, i16 454, i16 456, i16 458, i16 460, i16 462, i16 464, i16 466, i16 468, i16 470, i16 472, i16 474, i16 476, i16 478, i16 480, i16 482, i16 487, i16 493, i16 496, i16 499, i16 502, i16 507, i16 511, i16 516, i16 520, i16 524, i16 527, i16 531, i16 535, i16 539, i16 543, i16 547, i16 551, i16 555, i16 559, i16 564, i16 567, i16 571, i16 574, i16 578, i16 582, i16 585, i16 589, i16 593, i16 598, i16 601, i16 605, i16 609, i16 613, i16 618, i16 622, i16 626, i16 630, i16 636, i16 641, i16 646, i16 651, i16 655, i16 662, i16 667, i16 674, i16 679, i16 684, i16 690, i16 695, i16 699, i16 704, i16 709, i16 714, i16 719, i16 724, i16 731, i16 736, i16 743, i16 748, i16 756, i16 761, i16 767, i16 775, i16 783, i16 788, i16 793, i16 798, i16 803, i16 808, i16 814, i16 818, i16 823, i16 827, i16 832, i16 838, i16 844, i16 851, i16 859, i16 865, i16 870, i16 874, i16 879, i16 884, i16 889, i16 896, i16 903, i16 910, i16 917, i16 923, i16 930, i16 937, i16 944, i16 950, i16 957, i16 963, i16 969, i16 976, i16 984, i16 991, i16 999, i16 1006, i16 1014, i16 1019, i16 1026, i16 1033, i16 1043, i16 1053, i16 1063, i16 1073, i16 1080, i16 1089, i16 1096, i16 1104, i16 1111, i16 1119, i16 1127, i16 1134, i16 1142, i16 1149, i16 1155, i16 1162, i16 1169, i16 1176, i16 1183, i16 1189, i16 1195, i16 1199, i16 1203, i16 1206, i16 1210, i16 1214, i16 1218, i16 1221, i16 1225, i16 1228, i16 1232, i16 1235, i16 1239, i16 1242, i16 1246, i16 1251, i16 1254, i16 1258, i16 1262, i16 1266, i16 1270, i16 1274, i16 1278, i16 1282, i16 1286, i16 1290, i16 1294, i16 1298, i16 1302, i16 1306, i16 1310, i16 1314, i16 1317, i16 1320, i16 1324, i16 1328, i16 1333, i16 1336, i16 1340, i16 1344, i16 1347, i16 1351, i16 1355, i16 1359, i16 1363, i16 1367, i16 1370, i16 1375, i16 1379, i16 1382, i16 1386, i16 1390, i16 1394, i16 1397, i16 1400, i16 1404, i16 1407, i16 1411, i16 1415, i16 1419, i16 1423, i16 1427, i16 1431, i16 1435, i16 1439, i16 1443, i16 1447, i16 1450, i16 1454, i16 1458, i16 1461, i16 1464, i16 1467, i16 1471, i16 1474, i16 1479, i16 1483, i16 1487, i16 1491, i16 1495, i16 1499, i16 1503, i16 1507, i16 1511, i16 1515, i16 1519, i16 1523, i16 1528, i16 1532, i16 1536, i16 1540, i16 1544, i16 1548, i16 1553, i16 1557, i16 1561, i16 1565, i16 1569, i16 1574, i16 1578, i16 1582, i16 1586, i16 1590, i16 1594, i16 1597, i16 1601, i16 1605, i16 1609, i16 1613, i16 1617, i16 1621, i16 1625, i16 1629, i16 1633, i16 1637, i16 1641, i16 1643, i16 1645, i16 1647, i16 1649, i16 1651]
@namegen_offsets.off_len = internal unnamed_addr constant [22 x i16] [i16 0, i16 43, i16 43, i16 36, i16 79, i16 21, i16 100, i16 23, i16 123, i16 22, i16 145, i16 21, i16 166, i16 36, i16 202, i16 47, i16 249, i16 43, i16 292, i16 115, i16 407, i16 6]
define i32 @namegen_offsets(i32 %0, i16** nocapture writeonly %1) {
%3 = shl nsw i32 %0, 1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [22 x i16], [22 x i16]* @namegen_offsets.off_len, i64 0, i64 %4
%6 = load i16, i16* %5
%7 = sext i16 %6 to i64
%8 = getelementptr inbounds [413 x i16], [413 x i16]* @namegen_offsets.offsets_table, i64 0, i64 %7
store i16* %8, i16** %1
%9 = or i32 %3, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [22 x i16], [22 x i16]* @namegen_offsets.off_len, i64 0, i64 %10
%12 = load i16, i16* %11
%13 = sext i16 %12 to i32
ret i32 %13
}