unsigned long polydivide(unsigned long l) {
  static const unsigned long crc_table[] = {
      0x00000000, 0x01102100, 0x02204200, 0x03306300, 0x04408400, 0x0550A500,
      0x0660C600, 0x0770E700, 0x08810800, 0x09912900, 0x0AA14A00, 0x0BB16B00,
      0x0CC18C00, 0x0DD1AD00, 0x0EE1CE00, 0x0FF1EF00, 0x10123100, 0x11021000,
      0x12327300, 0x13225200, 0x1452B500, 0x15429400, 0x1672F700, 0x1762D600,
      0x18933900, 0x19831800, 0x1AB37B00, 0x1BA35A00, 0x1CD3BD00, 0x1DC39C00,
      0x1EF3FF00, 0x1FE3DE00, 0x20246200, 0x21344300, 0x22042000, 0x23140100,
      0x2464E600, 0x2574C700, 0x2644A400, 0x27548500, 0x28A56A00, 0x29B54B00,
      0x2A852800, 0x2B950900, 0x2CE5EE00, 0x2DF5CF00, 0x2EC5AC00, 0x2FD58D00,
      0x30365300, 0x31267200, 0x32161100, 0x33063000, 0x3476D700, 0x3566F600,
      0x36569500, 0x3746B400, 0x38B75B00, 0x39A77A00, 0x3A971900, 0x3B873800,
      0x3CF7DF00, 0x3DE7FE00, 0x3ED79D00, 0x3FC7BC00, 0x4048C400, 0x4158E500,
      0x42688600, 0x4378A700, 0x44084000, 0x45186100, 0x46280200, 0x47382300,
      0x48C9CC00, 0x49D9ED00, 0x4AE98E00, 0x4BF9AF00, 0x4C894800, 0x4D996900,
      0x4EA90A00, 0x4FB92B00, 0x505AF500, 0x514AD400, 0x527AB700, 0x536A9600,
      0x541A7100, 0x550A5000, 0x563A3300, 0x572A1200, 0x58DBFD00, 0x59CBDC00,
      0x5AFBBF00, 0x5BEB9E00, 0x5C9B7900, 0x5D8B5800, 0x5EBB3B00, 0x5FAB1A00,
      0x606CA600, 0x617C8700, 0x624CE400, 0x635CC500, 0x642C2200, 0x653C0300,
      0x660C6000, 0x671C4100, 0x68EDAE00, 0x69FD8F00, 0x6ACDEC00, 0x6BDDCD00,
      0x6CAD2A00, 0x6DBD0B00, 0x6E8D6800, 0x6F9D4900, 0x707E9700, 0x716EB600,
      0x725ED500, 0x734EF400, 0x743E1300, 0x752E3200, 0x761E5100, 0x770E7000,
      0x78FF9F00, 0x79EFBE00, 0x7ADFDD00, 0x7BCFFC00, 0x7CBF1B00, 0x7DAF3A00,
      0x7E9F5900, 0x7F8F7800, 0x80918800, 0x8181A900, 0x82B1CA00, 0x83A1EB00,
      0x84D10C00, 0x85C12D00, 0x86F14E00, 0x87E16F00, 0x88108000, 0x8900A100,
      0x8A30C200, 0x8B20E300, 0x8C500400, 0x8D402500, 0x8E704600, 0x8F606700,
      0x9083B900, 0x91939800, 0x92A3FB00, 0x93B3DA00, 0x94C33D00, 0x95D31C00,
      0x96E37F00, 0x97F35E00, 0x9802B100, 0x99129000, 0x9A22F300, 0x9B32D200,
      0x9C423500, 0x9D521400, 0x9E627700, 0x9F725600, 0xA0B5EA00, 0xA1A5CB00,
      0xA295A800, 0xA3858900, 0xA4F56E00, 0xA5E54F00, 0xA6D52C00, 0xA7C50D00,
      0xA834E200, 0xA924C300, 0xAA14A000, 0xAB048100, 0xAC746600, 0xAD644700,
      0xAE542400, 0xAF440500, 0xB0A7DB00, 0xB1B7FA00, 0xB2879900, 0xB397B800,
      0xB4E75F00, 0xB5F77E00, 0xB6C71D00, 0xB7D73C00, 0xB826D300, 0xB936F200,
      0xBA069100, 0xBB16B000, 0xBC665700, 0xBD767600, 0xBE461500, 0xBF563400,
      0xC0D94C00, 0xC1C96D00, 0xC2F90E00, 0xC3E92F00, 0xC499C800, 0xC589E900,
      0xC6B98A00, 0xC7A9AB00, 0xC8584400, 0xC9486500, 0xCA780600, 0xCB682700,
      0xCC18C000, 0xCD08E100, 0xCE388200, 0xCF28A300, 0xD0CB7D00, 0xD1DB5C00,
      0xD2EB3F00, 0xD3FB1E00, 0xD48BF900, 0xD59BD800, 0xD6ABBB00, 0xD7BB9A00,
      0xD84A7500, 0xD95A5400, 0xDA6A3700, 0xDB7A1600, 0xDC0AF100, 0xDD1AD000,
      0xDE2AB300, 0xDF3A9200, 0xE0FD2E00, 0xE1ED0F00, 0xE2DD6C00, 0xE3CD4D00,
      0xE4BDAA00, 0xE5AD8B00, 0xE69DE800, 0xE78DC900, 0xE87C2600, 0xE96C0700,
      0xEA5C6400, 0xEB4C4500, 0xEC3CA200, 0xED2C8300, 0xEE1CE000, 0xEF0CC100,
      0xF0EF1F00, 0xF1FF3E00, 0xF2CF5D00, 0xF3DF7C00, 0xF4AF9B00, 0xF5BFBA00,
      0xF68FD900, 0xF79FF800, 0xF86E1700, 0xF97E3600, 0xFA4E5500, 0xFB5E7400,
      0xFC2E9300, 0xFD3EB200, 0xFE0ED100, 0xFF1EF000,
  };
  return l ^ crc_table[l >> 24];
}


x86 assembly (clang, -O0):
<polydivide>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rdx
shr    $0x18,%rdx
lea    0xee5(%rip),%rcx
xor    (%rcx,%rdx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<polydivide>:
mov    %rdi,%rax
mov    %rdi,%rcx
shr    $0x18,%rcx
lea    0xeef(%rip),%rdx
xor    (%rdx,%rcx,8),%rax
ret

LLVM IR (-O0):
@polydivide.crc_table = internal constant [256 x i64] [i64 0, i64 17834240, i64 35668480, i64 53502720, i64 71336960, i64 89171200, i64 107005440, i64 124839680, i64 142673920, i64 160508160, i64 178342400, i64 196176640, i64 214010880, i64 231845120, i64 249679360, i64 267513600, i64 269627648, i64 285347840, i64 305296128, i64 321016320, i64 340964608, i64 356684800, i64 376633088, i64 392353280, i64 412301568, i64 428021760, i64 447970048, i64 463690240, i64 483638528, i64 499358720, i64 519307008, i64 535027200, i64 539255296, i64 557073152, i64 570695680, i64 588513536, i64 610592256, i64 628410112, i64 642032640, i64 659850496, i64 681929216, i64 699747072, i64 713369600, i64 731187456, i64 753266176, i64 771084032, i64 784706560, i64 802524416, i64 808866560, i64 824603136, i64 840306944, i64 856043520, i64 880203520, i64 895940096, i64 911643904, i64 927380480, i64 951540480, i64 967277056, i64 982980864, i64 998717440, i64 1022877440, i64 1038614016, i64 1054317824, i64 1070054400, i64 1078510592, i64 1096344832, i64 1114146304, i64 1131980544, i64 1141391360, i64 1159225600, i64 1177027072, i64 1194861312, i64 1221184512, i64 1239018752, i64 1256820224, i64 1274654464, i64 1284065280, i64 1301899520, i64 1319700992, i64 1337535232, i64 1348138240, i64 1363858432, i64 1383773952, i64 1399494144, i64 1411019008, i64 1426739200, i64 1446654720, i64 1462374912, i64 1490812160, i64 1506532352, i64 1526447872, i64 1542168064, i64 1553692928, i64 1569413120, i64 1589328640, i64 1605048832, i64 1617733120, i64 1635550976, i64 1649206272, i64 1667024128, i64 1680613888, i64 1698431744, i64 1712087040, i64 1729904896, i64 1760407040, i64 1778224896, i64 1791880192, i64 1809698048, i64 1823287808, i64 1841105664, i64 1854760960, i64 1872578816, i64 1887344384, i64 1903080960, i64 1918817536, i64 1934554112, i64 1950225152, i64 1965961728, i64 1981698304, i64 1997434880, i64 2030018304, i64 2045754880, i64 2061491456, i64 2077228032, i64 2092899072, i64 2108635648, i64 2124372224, i64 2140108800, i64 2157021184, i64 2172758272, i64 2192689664, i64 2208426752, i64 2228292608, i64 2244029696, i64 2263961088, i64 2279698176, i64 2282782720, i64 2298519808, i64 2318451200, i64 2334188288, i64 2354054144, i64 2369791232, i64 2389722624, i64 2405459712, i64 2424551680, i64 2442369024, i64 2460220160, i64 2478037504, i64 2495823104, i64 2513640448, i64 2531491584, i64 2549308928, i64 2550313216, i64 2568130560, i64 2585981696, i64 2603799040, i64 2621584640, i64 2639401984, i64 2657253120, i64 2675070464, i64 2696276480, i64 2711997184, i64 2727716864, i64 2743437568, i64 2767547904, i64 2783268608, i64 2798988288, i64 2814708992, i64 2822038016, i64 2837758720, i64 2853478400, i64 2869199104, i64 2893309440, i64 2909030144, i64 2924749824, i64 2940470528, i64 2963790592, i64 2981624320, i64 2995230976, i64 3013064704, i64 3035062016, i64 3052895744, i64 3066502400, i64 3084336128, i64 3089552128, i64 3107385856, i64 3120992512, i64 3138826240, i64 3160823552, i64 3178657280, i64 3192263936, i64 3210097664, i64 3235466240, i64 3251203328, i64 3271101952, i64 3286839040, i64 3298412544, i64 3314149632, i64 3334048256, i64 3349785344, i64 3361227776, i64 3376964864, i64 3396863488, i64 3412600576, i64 3424174080, i64 3439911168, i64 3459809792, i64 3475546880, i64 3502996736, i64 3520814080, i64 3538632448, i64 3556449792, i64 3565943040, i64 3583760384, i64 3601578752, i64 3619396096, i64 3628758272, i64 3646575616, i64 3664393984, i64 3682211328, i64 3691704576, i64 3709521920, i64 3727340288, i64 3745157632, i64 3774688768, i64 3790409472, i64 3806161920, i64 3821882624, i64 3837635072, i64 3853355776, i64 3869108224, i64 3884828928, i64 3900450304, i64 3916171008, i64 3931923456, i64 3947644160, i64 3963396608, i64 3979117312, i64 3994869760, i64 4010590464, i64 4042202880, i64 4060036608, i64 4073676032, i64 4091509760, i64 4105149184, i64 4122982912, i64 4136622336, i64 4154456064, i64 4167964416, i64 4185798144, i64 4199437568, i64 4217271296, i64 4230910720, i64 4248744448, i64 4262383872, i64 4280217600]
define i64 @polydivide(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = lshr i64 %4, 24
%6 = getelementptr inbounds [256 x i64], [256 x i64]* @polydivide.crc_table, i64 0, i64 %5
%7 = load i64, i64* %6
%8 = xor i64 %3, %7
ret i64 %8
}

LLVM IR (-O2):
@polydivide.crc_table = internal unnamed_addr constant [256 x i64] [i64 0, i64 17834240, i64 35668480, i64 53502720, i64 71336960, i64 89171200, i64 107005440, i64 124839680, i64 142673920, i64 160508160, i64 178342400, i64 196176640, i64 214010880, i64 231845120, i64 249679360, i64 267513600, i64 269627648, i64 285347840, i64 305296128, i64 321016320, i64 340964608, i64 356684800, i64 376633088, i64 392353280, i64 412301568, i64 428021760, i64 447970048, i64 463690240, i64 483638528, i64 499358720, i64 519307008, i64 535027200, i64 539255296, i64 557073152, i64 570695680, i64 588513536, i64 610592256, i64 628410112, i64 642032640, i64 659850496, i64 681929216, i64 699747072, i64 713369600, i64 731187456, i64 753266176, i64 771084032, i64 784706560, i64 802524416, i64 808866560, i64 824603136, i64 840306944, i64 856043520, i64 880203520, i64 895940096, i64 911643904, i64 927380480, i64 951540480, i64 967277056, i64 982980864, i64 998717440, i64 1022877440, i64 1038614016, i64 1054317824, i64 1070054400, i64 1078510592, i64 1096344832, i64 1114146304, i64 1131980544, i64 1141391360, i64 1159225600, i64 1177027072, i64 1194861312, i64 1221184512, i64 1239018752, i64 1256820224, i64 1274654464, i64 1284065280, i64 1301899520, i64 1319700992, i64 1337535232, i64 1348138240, i64 1363858432, i64 1383773952, i64 1399494144, i64 1411019008, i64 1426739200, i64 1446654720, i64 1462374912, i64 1490812160, i64 1506532352, i64 1526447872, i64 1542168064, i64 1553692928, i64 1569413120, i64 1589328640, i64 1605048832, i64 1617733120, i64 1635550976, i64 1649206272, i64 1667024128, i64 1680613888, i64 1698431744, i64 1712087040, i64 1729904896, i64 1760407040, i64 1778224896, i64 1791880192, i64 1809698048, i64 1823287808, i64 1841105664, i64 1854760960, i64 1872578816, i64 1887344384, i64 1903080960, i64 1918817536, i64 1934554112, i64 1950225152, i64 1965961728, i64 1981698304, i64 1997434880, i64 2030018304, i64 2045754880, i64 2061491456, i64 2077228032, i64 2092899072, i64 2108635648, i64 2124372224, i64 2140108800, i64 2157021184, i64 2172758272, i64 2192689664, i64 2208426752, i64 2228292608, i64 2244029696, i64 2263961088, i64 2279698176, i64 2282782720, i64 2298519808, i64 2318451200, i64 2334188288, i64 2354054144, i64 2369791232, i64 2389722624, i64 2405459712, i64 2424551680, i64 2442369024, i64 2460220160, i64 2478037504, i64 2495823104, i64 2513640448, i64 2531491584, i64 2549308928, i64 2550313216, i64 2568130560, i64 2585981696, i64 2603799040, i64 2621584640, i64 2639401984, i64 2657253120, i64 2675070464, i64 2696276480, i64 2711997184, i64 2727716864, i64 2743437568, i64 2767547904, i64 2783268608, i64 2798988288, i64 2814708992, i64 2822038016, i64 2837758720, i64 2853478400, i64 2869199104, i64 2893309440, i64 2909030144, i64 2924749824, i64 2940470528, i64 2963790592, i64 2981624320, i64 2995230976, i64 3013064704, i64 3035062016, i64 3052895744, i64 3066502400, i64 3084336128, i64 3089552128, i64 3107385856, i64 3120992512, i64 3138826240, i64 3160823552, i64 3178657280, i64 3192263936, i64 3210097664, i64 3235466240, i64 3251203328, i64 3271101952, i64 3286839040, i64 3298412544, i64 3314149632, i64 3334048256, i64 3349785344, i64 3361227776, i64 3376964864, i64 3396863488, i64 3412600576, i64 3424174080, i64 3439911168, i64 3459809792, i64 3475546880, i64 3502996736, i64 3520814080, i64 3538632448, i64 3556449792, i64 3565943040, i64 3583760384, i64 3601578752, i64 3619396096, i64 3628758272, i64 3646575616, i64 3664393984, i64 3682211328, i64 3691704576, i64 3709521920, i64 3727340288, i64 3745157632, i64 3774688768, i64 3790409472, i64 3806161920, i64 3821882624, i64 3837635072, i64 3853355776, i64 3869108224, i64 3884828928, i64 3900450304, i64 3916171008, i64 3931923456, i64 3947644160, i64 3963396608, i64 3979117312, i64 3994869760, i64 4010590464, i64 4042202880, i64 4060036608, i64 4073676032, i64 4091509760, i64 4105149184, i64 4122982912, i64 4136622336, i64 4154456064, i64 4167964416, i64 4185798144, i64 4199437568, i64 4217271296, i64 4230910720, i64 4248744448, i64 4262383872, i64 4280217600]
define i64 @polydivide(i64 %0) {
%2 = lshr i64 %0, 24
%3 = getelementptr inbounds [256 x i64], [256 x i64]* @polydivide.crc_table, i64 0, i64 %2
%4 = load i64, i64* %3
%5 = xor i64 %4, %0
ret i64 %5
}