#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef size_t uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t interleave(uint8_t upper, uint8_t lower) {
  static const uint16_t map[256] = {
      0x0000, 0x0001, 0x0004, 0x0005, 0x0010, 0x0011, 0x0014, 0x0015, 0x0040,
      0x0041, 0x0044, 0x0045, 0x0050, 0x0051, 0x0054, 0x0055, 0x0100, 0x0101,
      0x0104, 0x0105, 0x0110, 0x0111, 0x0114, 0x0115, 0x0140, 0x0141, 0x0144,
      0x0145, 0x0150, 0x0151, 0x0154, 0x0155, 0x0400, 0x0401, 0x0404, 0x0405,
      0x0410, 0x0411, 0x0414, 0x0415, 0x0440, 0x0441, 0x0444, 0x0445, 0x0450,
      0x0451, 0x0454, 0x0455, 0x0500, 0x0501, 0x0504, 0x0505, 0x0510, 0x0511,
      0x0514, 0x0515, 0x0540, 0x0541, 0x0544, 0x0545, 0x0550, 0x0551, 0x0554,
      0x0555, 0x1000, 0x1001, 0x1004, 0x1005, 0x1010, 0x1011, 0x1014, 0x1015,
      0x1040, 0x1041, 0x1044, 0x1045, 0x1050, 0x1051, 0x1054, 0x1055, 0x1100,
      0x1101, 0x1104, 0x1105, 0x1110, 0x1111, 0x1114, 0x1115, 0x1140, 0x1141,
      0x1144, 0x1145, 0x1150, 0x1151, 0x1154, 0x1155, 0x1400, 0x1401, 0x1404,
      0x1405, 0x1410, 0x1411, 0x1414, 0x1415, 0x1440, 0x1441, 0x1444, 0x1445,
      0x1450, 0x1451, 0x1454, 0x1455, 0x1500, 0x1501, 0x1504, 0x1505, 0x1510,
      0x1511, 0x1514, 0x1515, 0x1540, 0x1541, 0x1544, 0x1545, 0x1550, 0x1551,
      0x1554, 0x1555, 0x4000, 0x4001, 0x4004, 0x4005, 0x4010, 0x4011, 0x4014,
      0x4015, 0x4040, 0x4041, 0x4044, 0x4045, 0x4050, 0x4051, 0x4054, 0x4055,
      0x4100, 0x4101, 0x4104, 0x4105, 0x4110, 0x4111, 0x4114, 0x4115, 0x4140,
      0x4141, 0x4144, 0x4145, 0x4150, 0x4151, 0x4154, 0x4155, 0x4400, 0x4401,
      0x4404, 0x4405, 0x4410, 0x4411, 0x4414, 0x4415, 0x4440, 0x4441, 0x4444,
      0x4445, 0x4450, 0x4451, 0x4454, 0x4455, 0x4500, 0x4501, 0x4504, 0x4505,
      0x4510, 0x4511, 0x4514, 0x4515, 0x4540, 0x4541, 0x4544, 0x4545, 0x4550,
      0x4551, 0x4554, 0x4555, 0x5000, 0x5001, 0x5004, 0x5005, 0x5010, 0x5011,
      0x5014, 0x5015, 0x5040, 0x5041, 0x5044, 0x5045, 0x5050, 0x5051, 0x5054,
      0x5055, 0x5100, 0x5101, 0x5104, 0x5105, 0x5110, 0x5111, 0x5114, 0x5115,
      0x5140, 0x5141, 0x5144, 0x5145, 0x5150, 0x5151, 0x5154, 0x5155, 0x5400,
      0x5401, 0x5404, 0x5405, 0x5410, 0x5411, 0x5414, 0x5415, 0x5440, 0x5441,
      0x5444, 0x5445, 0x5450, 0x5451, 0x5454, 0x5455, 0x5500, 0x5501, 0x5504,
      0x5505, 0x5510, 0x5511, 0x5514, 0x5515, 0x5540, 0x5541, 0x5544, 0x5545,
      0x5550, 0x5551, 0x5554, 0x5555};
  return (map[upper] << 1) + map[lower];
}


x86 assembly (clang, -O0):
<interleave>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xee9(%rip),%rax
mov    (%rax,%rcx,4),%eax
shl    $0x1,%eax
mov    -0x10(%rbp),%rdx
lea    0xed8(%rip),%rcx
add    (%rcx,%rdx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interleave>:
lea    0xef9(%rip),%rcx
mov    (%rcx,%rdi,4),%eax
add    %eax,%eax
add    (%rcx,%rsi,4),%eax
ret

LLVM IR (-O0):
@interleave.map = internal constant [256 x i32] [i32 0, i32 1, i32 4, i32 5, i32 16, i32 17, i32 20, i32 21, i32 64, i32 65, i32 68, i32 69, i32 80, i32 81, i32 84, i32 85, i32 256, i32 257, i32 260, i32 261, i32 272, i32 273, i32 276, i32 277, i32 320, i32 321, i32 324, i32 325, i32 336, i32 337, i32 340, i32 341, i32 1024, i32 1025, i32 1028, i32 1029, i32 1040, i32 1041, i32 1044, i32 1045, i32 1088, i32 1089, i32 1092, i32 1093, i32 1104, i32 1105, i32 1108, i32 1109, i32 1280, i32 1281, i32 1284, i32 1285, i32 1296, i32 1297, i32 1300, i32 1301, i32 1344, i32 1345, i32 1348, i32 1349, i32 1360, i32 1361, i32 1364, i32 1365, i32 4096, i32 4097, i32 4100, i32 4101, i32 4112, i32 4113, i32 4116, i32 4117, i32 4160, i32 4161, i32 4164, i32 4165, i32 4176, i32 4177, i32 4180, i32 4181, i32 4352, i32 4353, i32 4356, i32 4357, i32 4368, i32 4369, i32 4372, i32 4373, i32 4416, i32 4417, i32 4420, i32 4421, i32 4432, i32 4433, i32 4436, i32 4437, i32 5120, i32 5121, i32 5124, i32 5125, i32 5136, i32 5137, i32 5140, i32 5141, i32 5184, i32 5185, i32 5188, i32 5189, i32 5200, i32 5201, i32 5204, i32 5205, i32 5376, i32 5377, i32 5380, i32 5381, i32 5392, i32 5393, i32 5396, i32 5397, i32 5440, i32 5441, i32 5444, i32 5445, i32 5456, i32 5457, i32 5460, i32 5461, i32 16384, i32 16385, i32 16388, i32 16389, i32 16400, i32 16401, i32 16404, i32 16405, i32 16448, i32 16449, i32 16452, i32 16453, i32 16464, i32 16465, i32 16468, i32 16469, i32 16640, i32 16641, i32 16644, i32 16645, i32 16656, i32 16657, i32 16660, i32 16661, i32 16704, i32 16705, i32 16708, i32 16709, i32 16720, i32 16721, i32 16724, i32 16725, i32 17408, i32 17409, i32 17412, i32 17413, i32 17424, i32 17425, i32 17428, i32 17429, i32 17472, i32 17473, i32 17476, i32 17477, i32 17488, i32 17489, i32 17492, i32 17493, i32 17664, i32 17665, i32 17668, i32 17669, i32 17680, i32 17681, i32 17684, i32 17685, i32 17728, i32 17729, i32 17732, i32 17733, i32 17744, i32 17745, i32 17748, i32 17749, i32 20480, i32 20481, i32 20484, i32 20485, i32 20496, i32 20497, i32 20500, i32 20501, i32 20544, i32 20545, i32 20548, i32 20549, i32 20560, i32 20561, i32 20564, i32 20565, i32 20736, i32 20737, i32 20740, i32 20741, i32 20752, i32 20753, i32 20756, i32 20757, i32 20800, i32 20801, i32 20804, i32 20805, i32 20816, i32 20817, i32 20820, i32 20821, i32 21504, i32 21505, i32 21508, i32 21509, i32 21520, i32 21521, i32 21524, i32 21525, i32 21568, i32 21569, i32 21572, i32 21573, i32 21584, i32 21585, i32 21588, i32 21589, i32 21760, i32 21761, i32 21764, i32 21765, i32 21776, i32 21777, i32 21780, i32 21781, i32 21824, i32 21825, i32 21828, i32 21829, i32 21840, i32 21841, i32 21844, i32 21845]
define i32 @interleave(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = getelementptr inbounds [256 x i32], [256 x i32]* @interleave.map, i64 0, i64 %5
%7 = load i32, i32* %6
%8 = shl i32 %7, 1
%9 = load i64, i64* %4
%10 = getelementptr inbounds [256 x i32], [256 x i32]* @interleave.map, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = add nsw i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
@interleave.map = internal unnamed_addr constant [256 x i32] [i32 0, i32 1, i32 4, i32 5, i32 16, i32 17, i32 20, i32 21, i32 64, i32 65, i32 68, i32 69, i32 80, i32 81, i32 84, i32 85, i32 256, i32 257, i32 260, i32 261, i32 272, i32 273, i32 276, i32 277, i32 320, i32 321, i32 324, i32 325, i32 336, i32 337, i32 340, i32 341, i32 1024, i32 1025, i32 1028, i32 1029, i32 1040, i32 1041, i32 1044, i32 1045, i32 1088, i32 1089, i32 1092, i32 1093, i32 1104, i32 1105, i32 1108, i32 1109, i32 1280, i32 1281, i32 1284, i32 1285, i32 1296, i32 1297, i32 1300, i32 1301, i32 1344, i32 1345, i32 1348, i32 1349, i32 1360, i32 1361, i32 1364, i32 1365, i32 4096, i32 4097, i32 4100, i32 4101, i32 4112, i32 4113, i32 4116, i32 4117, i32 4160, i32 4161, i32 4164, i32 4165, i32 4176, i32 4177, i32 4180, i32 4181, i32 4352, i32 4353, i32 4356, i32 4357, i32 4368, i32 4369, i32 4372, i32 4373, i32 4416, i32 4417, i32 4420, i32 4421, i32 4432, i32 4433, i32 4436, i32 4437, i32 5120, i32 5121, i32 5124, i32 5125, i32 5136, i32 5137, i32 5140, i32 5141, i32 5184, i32 5185, i32 5188, i32 5189, i32 5200, i32 5201, i32 5204, i32 5205, i32 5376, i32 5377, i32 5380, i32 5381, i32 5392, i32 5393, i32 5396, i32 5397, i32 5440, i32 5441, i32 5444, i32 5445, i32 5456, i32 5457, i32 5460, i32 5461, i32 16384, i32 16385, i32 16388, i32 16389, i32 16400, i32 16401, i32 16404, i32 16405, i32 16448, i32 16449, i32 16452, i32 16453, i32 16464, i32 16465, i32 16468, i32 16469, i32 16640, i32 16641, i32 16644, i32 16645, i32 16656, i32 16657, i32 16660, i32 16661, i32 16704, i32 16705, i32 16708, i32 16709, i32 16720, i32 16721, i32 16724, i32 16725, i32 17408, i32 17409, i32 17412, i32 17413, i32 17424, i32 17425, i32 17428, i32 17429, i32 17472, i32 17473, i32 17476, i32 17477, i32 17488, i32 17489, i32 17492, i32 17493, i32 17664, i32 17665, i32 17668, i32 17669, i32 17680, i32 17681, i32 17684, i32 17685, i32 17728, i32 17729, i32 17732, i32 17733, i32 17744, i32 17745, i32 17748, i32 17749, i32 20480, i32 20481, i32 20484, i32 20485, i32 20496, i32 20497, i32 20500, i32 20501, i32 20544, i32 20545, i32 20548, i32 20549, i32 20560, i32 20561, i32 20564, i32 20565, i32 20736, i32 20737, i32 20740, i32 20741, i32 20752, i32 20753, i32 20756, i32 20757, i32 20800, i32 20801, i32 20804, i32 20805, i32 20816, i32 20817, i32 20820, i32 20821, i32 21504, i32 21505, i32 21508, i32 21509, i32 21520, i32 21521, i32 21524, i32 21525, i32 21568, i32 21569, i32 21572, i32 21573, i32 21584, i32 21585, i32 21588, i32 21589, i32 21760, i32 21761, i32 21764, i32 21765, i32 21776, i32 21777, i32 21780, i32 21781, i32 21824, i32 21825, i32 21828, i32 21829, i32 21840, i32 21841, i32 21844, i32 21845]
define i32 @interleave(i64 %0, i64 %1) {
%3 = getelementptr inbounds [256 x i32], [256 x i32]* @interleave.map, i64 0, i64 %0
%4 = load i32, i32* %3
%5 = shl i32 %4, 1
%6 = getelementptr inbounds [256 x i32], [256 x i32]* @interleave.map, i64 0, i64 %1
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}