unsigned char unicode_to_gost(unsigned short val) {
  static const unsigned char tab0[256] = {
      017,  017,  017,  017,  017,  017,  017,  017,  017,  017,  0214, 017,
      017,  0174, 017,  017,  017,  017,  017,  017,  017,  017,  017,  017,
      017,  017,  017,  017,  017,  017,  017,  017,  0017, 0133, 0134, 0034,
      0127, 0126, 0121, 0033, 0022, 0023, 0031, 0012, 0015, 0013, 0016, 0014,
      0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007, 0010, 0011, 0037, 0026,
      0035, 0025, 0036, 0136, 0021, 0040, 0042, 0061, 0077, 0045, 0100, 0101,
      0055, 0102, 0103, 0052, 0104, 0054, 0105, 0056, 0060, 0106, 0107, 0110,
      0062, 0111, 0112, 0113, 0065, 0063, 0114, 0027, 017,  0030, 0115, 0132,
      0032, 0040, 0042, 0061, 0077, 0045, 0100, 0101, 0055, 0102, 0103, 0052,
      0104, 0054, 0105, 0056, 0060, 0106, 0107, 0110, 0062, 0111, 0112, 0113,
      0065, 0063, 0114, 017,  0130, 017,  0123, 017,  017,  017,  017,  017,
      017,  017,  017,  017,  017,  017,  017,  017,  017,  017,  017,  017,
      017,  017,  017,  017,  017,  017,  017,  017,  017,  017,  017,  017,
      017,  017,  017,  017,  017,  017,  017,  017,  017,  017,  017,  017,
      017,  017,  017,  017,  0123, 017,  017,  017,  0136, 017,  017,  017,
      017,  017,  017,  017,  017,  017,  017,  017,  017,  017,  017,  017,
      017,  017,  017,  017,  017,  017,  017,  017,  017,  017,  017,  017,
      017,  017,  017,  017,  017,  017,  017,  017,  017,  017,  017,  0024,
      017,  017,  017,  017,  017,  017,  017,  017,  017,  017,  017,  017,
      017,  017,  017,  017,  017,  017,  017,  017,  017,  017,  017,  017,
      017,  017,  017,  017,  017,  017,  017,  0124, 017,  017,  017,  017,
      017,  017,  017,  017,
  };
  switch (val >> 8) {
  case 0x00:
    return tab0[val];
  case 0x04:
    switch ((unsigned char)val) {
    case 0x10:
      return 0040;
    case 0x11:
      return 0041;
    case 0x12:
      return 0042;
    case 0x13:
      return 0043;
    case 0x14:
      return 0044;
    case 0x15:
      return 0045;
    case 0x16:
      return 0046;
    case 0x17:
      return 0047;
    case 0x18:
      return 0050;
    case 0x19:
      return 0051;
    case 0x1a:
      return 0052;
    case 0x1b:
      return 0053;
    case 0x1c:
      return 0054;
    case 0x1d:
      return 0055;
    case 0x1e:
      return 0056;
    case 0x1f:
      return 0057;
    case 0x20:
      return 0060;
    case 0x21:
      return 0061;
    case 0x22:
      return 0062;
    case 0x23:
      return 0063;
    case 0x24:
      return 0064;
    case 0x25:
      return 0065;
    case 0x26:
      return 0066;
    case 0x27:
      return 0067;
    case 0x28:
      return 0070;
    case 0x29:
      return 0071;
    case 0x2a:
      return 0135;
    case 0x2b:
      return 0072;
    case 0x2c:
      return 0073;
    case 0x2d:
      return 0074;
    case 0x2e:
      return 0075;
    case 0x2f:
      return 0076;
    case 0x30:
      return 0040;
    case 0x31:
      return 0041;
    case 0x32:
      return 0042;
    case 0x33:
      return 0043;
    case 0x34:
      return 0044;
    case 0x35:
      return 0045;
    case 0x36:
      return 0046;
    case 0x37:
      return 0047;
    case 0x38:
      return 0050;
    case 0x39:
      return 0051;
    case 0x3a:
      return 0052;
    case 0x3b:
      return 0053;
    case 0x3c:
      return 0054;
    case 0x3d:
      return 0055;
    case 0x3e:
      return 0056;
    case 0x3f:
      return 0057;
    case 0x40:
      return 0060;
    case 0x41:
      return 0061;
    case 0x42:
      return 0062;
    case 0x43:
      return 0063;
    case 0x44:
      return 0064;
    case 0x45:
      return 0065;
    case 0x46:
      return 0066;
    case 0x47:
      return 0067;
    case 0x48:
      return 0070;
    case 0x49:
      return 0071;
    case 0x4a:
      return 0135;
    case 0x4b:
      return 0072;
    case 0x4c:
      return 0073;
    case 0x4d:
      return 0074;
    case 0x4e:
      return 0075;
    case 0x4f:
      return 0076;
    }
    break;
  case 0x20:
    switch ((unsigned char)val) {
    case 0x15:
      return 0131;
    case 0x18:
      return 0032;
    case 0x19:
      return 0033;
    case 0x32:
      return 0137;
    case 0x3e:
      return 0115;
    }
    break;
  case 0x21:
    switch ((unsigned char)val) {
    case 0x2f:
      return 0020;
    case 0x91:
      return 0021;
    }
    break;
  case 0x22:
    switch ((unsigned char)val) {
    case 0x27:
      return 0121;
    case 0x28:
      return 0120;
    case 0x60:
      return 0034;
    case 0x61:
      return 0125;
    case 0x64:
      return 0116;
    case 0x65:
      return 0117;
    case 0x83:
      return 0122;
    }
    break;
  case 0x25:
    switch ((unsigned char)val) {
    case 0xc7:
      return 0127;
    case 0xca:
      return 0127;
    }
    break;
  }
  return 017;
}


x86 assembly (clang, -O0):
<unicode_to_gost>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x25,%eax
ja     1559 <unicode_to_gost+0x459>
mov    -0x10(%rbp),%rax
lea    0xed4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movzwl -0x4(%rbp),%eax
mov    %eax,%ecx
lea    0x10fe(%rip),%rax
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movzbl -0x4(%rbp),%eax
add    $0xfffffff0,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x3f,%eax
ja     13b7 <unicode_to_gost+0x2b7>
mov    -0x18(%rbp),%rax
lea    0xfd2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x20,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x21,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x22,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x23,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x24,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x25,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x26,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x27,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x28,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x29,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x2a,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x2b,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x2c,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x2d,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x2e,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x2f,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x30,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x31,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x32,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x33,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x34,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x35,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x36,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x37,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x38,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x39,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x5d,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x3a,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x3b,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x3c,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x3d,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x3e,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x20,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x21,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x22,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x23,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x24,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x25,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x26,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x27,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x28,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x29,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x2a,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x2b,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x2c,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x2d,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x2e,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x2f,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x30,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x31,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x32,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x33,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x34,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x35,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x36,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x37,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x38,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x39,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x5d,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x3a,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x3b,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x3c,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x3d,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x3e,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
jmp    1559 <unicode_to_gost+0x459>
movzbl -0x4(%rbp),%eax
add    $0xffffffeb,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x29,%eax
ja     1413 <unicode_to_gost+0x313>
mov    -0x20(%rbp),%rax
lea    0xcbb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x59,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x1a,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x1b,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x5f,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x4d,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
jmp    1559 <unicode_to_gost+0x459>
movzbl -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x2f,%eax
je     1440 <unicode_to_gost+0x340>
jmp    142d <unicode_to_gost+0x32d>
mov    -0x24(%rbp),%eax
sub    $0x91,%eax
je     1449 <unicode_to_gost+0x349>
jmp    1452 <unicode_to_gost+0x352>
movb   $0x10,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x11,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
jmp    1559 <unicode_to_gost+0x459>
movzbl -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
sub    $0x27,%eax
je     14d4 <unicode_to_gost+0x3d4>
jmp    146c <unicode_to_gost+0x36c>
mov    -0x28(%rbp),%eax
sub    $0x28,%eax
je     14dd <unicode_to_gost+0x3dd>
jmp    147d <unicode_to_gost+0x37d>
mov    -0x28(%rbp),%eax
sub    $0x60,%eax
je     14e6 <unicode_to_gost+0x3e6>
jmp    148e <unicode_to_gost+0x38e>
mov    -0x28(%rbp),%eax
sub    $0x61,%eax
je     14ef <unicode_to_gost+0x3ef>
jmp    149f <unicode_to_gost+0x39f>
mov    -0x28(%rbp),%eax
sub    $0x64,%eax
je     14f8 <unicode_to_gost+0x3f8>
jmp    14b0 <unicode_to_gost+0x3b0>
mov    -0x28(%rbp),%eax
sub    $0x65,%eax
je     1501 <unicode_to_gost+0x401>
jmp    14c1 <unicode_to_gost+0x3c1>
mov    -0x28(%rbp),%eax
sub    $0x83,%eax
je     150a <unicode_to_gost+0x40a>
jmp    1513 <unicode_to_gost+0x413>
movb   $0x51,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x50,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x1c,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x55,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x4e,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x4f,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x52,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
jmp    1559 <unicode_to_gost+0x459>
movzbl -0x4(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0xc7,%eax
je     1542 <unicode_to_gost+0x442>
jmp    152f <unicode_to_gost+0x42f>
mov    -0x2c(%rbp),%eax
sub    $0xca,%eax
je     154b <unicode_to_gost+0x44b>
jmp    1554 <unicode_to_gost+0x454>
movb   $0x57,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
movb   $0x57,-0x1(%rbp)
jmp    155d <unicode_to_gost+0x45d>
jmp    1559 <unicode_to_gost+0x459>
movb   $0xf,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unicode_to_gost>:
mov    %edi,%eax
shr    $0x8,%eax
cmp    $0x25,%al
ja     11dd <unicode_to_gost+0xdd>
lea    0xeec(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movzwl %di,%eax
lea    0x1039(%rip),%rcx
jmp    1142 <unicode_to_gost+0x42>
add    $0xf0,%dil
cmp    $0x40,%dil
jae    11dd <unicode_to_gost+0xdd>
movsbq %dil,%rax
lea    0x111e(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret
add    $0xeb,%dil
cmp    $0x29,%dil
ja     11dd <unicode_to_gost+0xdd>
mov    $0x59,%al
movzbl %dil,%ecx
lea    0xf4f(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x1a,%al
ret
cmp    $0x91,%dil
sete   %al
add    %al,%al
add    $0xf,%al
cmp    $0x2f,%dil
movzbl %al,%ecx
mov    $0x10,%eax
cmovne %ecx,%eax
ret
cmp    $0x5f,%dil
jle    11c8 <unicode_to_gost+0xc8>
add    $0xa0,%dil
cmp    $0x5,%dil
ja     11dd <unicode_to_gost+0xdd>
movzbl %dil,%eax
lea    0xef5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x1c,%al
ret
cmp    $0xca,%dil
mov    $0x57,%ecx
mov    $0xf,%eax
cmove  %ecx,%eax
cmp    $0xc7,%dil
cmove  %ecx,%eax
ret
cmp    $0x83,%dil
je     11f2 <unicode_to_gost+0xf2>
cmp    $0x27,%dil
je     11f5 <unicode_to_gost+0xf5>
cmp    $0x28,%dil
jne    11dd <unicode_to_gost+0xdd>
mov    $0x50,%al
ret
mov    $0xf,%al
ret
mov    $0x1b,%al
ret
mov    $0x5f,%al
ret
mov    $0x4d,%al
ret
mov    $0x55,%al
ret
mov    $0x4e,%al
ret
mov    $0x4f,%al
ret
mov    $0x52,%al
ret
mov    $0x51,%al
ret

LLVM IR (-O0):
@unicode_to_gost.tab0 = internal constant [256 x i8] c"\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\8C\0F\0F|\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F[\\\1CWVQ\1B\12\13\19\0A\0D\0B\0E\0C\00\01\02\03\04\05\06\07\08\09\1F\16\1D\15\1E^\11 \221?%@A-BC*D,E.0FGH2IJK53L\17\0F\18MZ\1A \221?%@A-BC*D,E.0FGH2IJK53L\0FX\0FS\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0FS\0F\0F\0F^\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\14\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0FT\0F\0F\0F\0F\0F\0F\0F\0F"
define zeroext i8 @unicode_to_gost(i16 zeroext %0) {
%2 = alloca i8
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = ashr i32 %5, 8
switch i32 %6, label %117 [
i32 0, label %7
i32 4, label %12
i32 32, label %81
i32 33, label %91
i32 34, label %98
i32 37, label %110
]
7: ; preds = %1
%8 = load i16, i16* %3
%9 = zext i16 %8 to i64
%10 = getelementptr inbounds [256 x i8], [256 x i8]* @unicode_to_gost.tab0, i64 0, i64 %9
%11 = load i8, i8* %10
store i8 %11, i8* %2
br label %118
12: ; preds = %1
%13 = load i16, i16* %3
%14 = trunc i16 %13 to i8
%15 = zext i8 %14 to i32
switch i32 %15, label %80 [
i32 16, label %16
i32 17, label %17
i32 18, label %18
i32 19, label %19
i32 20, label %20
i32 21, label %21
i32 22, label %22
i32 23, label %23
i32 24, label %24
i32 25, label %25
i32 26, label %26
i32 27, label %27
i32 28, label %28
i32 29, label %29
i32 30, label %30
i32 31, label %31
i32 32, label %32
i32 33, label %33
i32 34, label %34
i32 35, label %35
i32 36, label %36
i32 37, label %37
i32 38, label %38
i32 39, label %39
i32 40, label %40
i32 41, label %41
i32 42, label %42
i32 43, label %43
i32 44, label %44
i32 45, label %45
i32 46, label %46
i32 47, label %47
i32 48, label %48
i32 49, label %49
i32 50, label %50
i32 51, label %51
i32 52, label %52
i32 53, label %53
i32 54, label %54
i32 55, label %55
i32 56, label %56
i32 57, label %57
i32 58, label %58
i32 59, label %59
i32 60, label %60
i32 61, label %61
i32 62, label %62
i32 63, label %63
i32 64, label %64
i32 65, label %65
i32 66, label %66
i32 67, label %67
i32 68, label %68
i32 69, label %69
i32 70, label %70
i32 71, label %71
i32 72, label %72
i32 73, label %73
i32 74, label %74
i32 75, label %75
i32 76, label %76
i32 77, label %77
i32 78, label %78
i32 79, label %79
]
16: ; preds = %12
store i8 32, i8* %2
br label %118
17: ; preds = %12
store i8 33, i8* %2
br label %118
18: ; preds = %12
store i8 34, i8* %2
br label %118
19: ; preds = %12
store i8 35, i8* %2
br label %118
20: ; preds = %12
store i8 36, i8* %2
br label %118
21: ; preds = %12
store i8 37, i8* %2
br label %118
22: ; preds = %12
store i8 38, i8* %2
br label %118
23: ; preds = %12
store i8 39, i8* %2
br label %118
24: ; preds = %12
store i8 40, i8* %2
br label %118
25: ; preds = %12
store i8 41, i8* %2
br label %118
26: ; preds = %12
store i8 42, i8* %2
br label %118
27: ; preds = %12
store i8 43, i8* %2
br label %118
28: ; preds = %12
store i8 44, i8* %2
br label %118
29: ; preds = %12
store i8 45, i8* %2
br label %118
30: ; preds = %12
store i8 46, i8* %2
br label %118
31: ; preds = %12
store i8 47, i8* %2
br label %118
32: ; preds = %12
store i8 48, i8* %2
br label %118
33: ; preds = %12
store i8 49, i8* %2
br label %118
34: ; preds = %12
store i8 50, i8* %2
br label %118
35: ; preds = %12
store i8 51, i8* %2
br label %118
36: ; preds = %12
store i8 52, i8* %2
br label %118
37: ; preds = %12
store i8 53, i8* %2
br label %118
38: ; preds = %12
store i8 54, i8* %2
br label %118
39: ; preds = %12
store i8 55, i8* %2
br label %118
40: ; preds = %12
store i8 56, i8* %2
br label %118
41: ; preds = %12
store i8 57, i8* %2
br label %118
42: ; preds = %12
store i8 93, i8* %2
br label %118
43: ; preds = %12
store i8 58, i8* %2
br label %118
44: ; preds = %12
store i8 59, i8* %2
br label %118
45: ; preds = %12
store i8 60, i8* %2
br label %118
46: ; preds = %12
store i8 61, i8* %2
br label %118
47: ; preds = %12
store i8 62, i8* %2
br label %118
48: ; preds = %12
store i8 32, i8* %2
br label %118
49: ; preds = %12
store i8 33, i8* %2
br label %118
50: ; preds = %12
store i8 34, i8* %2
br label %118
51: ; preds = %12
store i8 35, i8* %2
br label %118
52: ; preds = %12
store i8 36, i8* %2
br label %118
53: ; preds = %12
store i8 37, i8* %2
br label %118
54: ; preds = %12
store i8 38, i8* %2
br label %118
55: ; preds = %12
store i8 39, i8* %2
br label %118
56: ; preds = %12
store i8 40, i8* %2
br label %118
57: ; preds = %12
store i8 41, i8* %2
br label %118
58: ; preds = %12
store i8 42, i8* %2
br label %118
59: ; preds = %12
store i8 43, i8* %2
br label %118
60: ; preds = %12
store i8 44, i8* %2
br label %118
61: ; preds = %12
store i8 45, i8* %2
br label %118
62: ; preds = %12
store i8 46, i8* %2
br label %118
63: ; preds = %12
store i8 47, i8* %2
br label %118
64: ; preds = %12
store i8 48, i8* %2
br label %118
65: ; preds = %12
store i8 49, i8* %2
br label %118
66: ; preds = %12
store i8 50, i8* %2
br label %118
67: ; preds = %12
store i8 51, i8* %2
br label %118
68: ; preds = %12
store i8 52, i8* %2
br label %118
69: ; preds = %12
store i8 53, i8* %2
br label %118
70: ; preds = %12
store i8 54, i8* %2
br label %118
71: ; preds = %12
store i8 55, i8* %2
br label %118
72: ; preds = %12
store i8 56, i8* %2
br label %118
73: ; preds = %12
store i8 57, i8* %2
br label %118
74: ; preds = %12
store i8 93, i8* %2
br label %118
75: ; preds = %12
store i8 58, i8* %2
br label %118
76: ; preds = %12
store i8 59, i8* %2
br label %118
77: ; preds = %12
store i8 60, i8* %2
br label %118
78: ; preds = %12
store i8 61, i8* %2
br label %118
79: ; preds = %12
store i8 62, i8* %2
br label %118
80: ; preds = %12
br label %117
81: ; preds = %1
%82 = load i16, i16* %3
%83 = trunc i16 %82 to i8
%84 = zext i8 %83 to i32
switch i32 %84, label %90 [
i32 21, label %85
i32 24, label %86
i32 25, label %87
i32 50, label %88
i32 62, label %89
]
85: ; preds = %81
store i8 89, i8* %2
br label %118
86: ; preds = %81
store i8 26, i8* %2
br label %118
87: ; preds = %81
store i8 27, i8* %2
br label %118
88: ; preds = %81
store i8 95, i8* %2
br label %118
89: ; preds = %81
store i8 77, i8* %2
br label %118
90: ; preds = %81
br label %117
91: ; preds = %1
%92 = load i16, i16* %3
%93 = trunc i16 %92 to i8
%94 = zext i8 %93 to i32
switch i32 %94, label %97 [
i32 47, label %95
i32 145, label %96
]
95: ; preds = %91
store i8 16, i8* %2
br label %118
96: ; preds = %91
store i8 17, i8* %2
br label %118
97: ; preds = %91
br label %117
98: ; preds = %1
%99 = load i16, i16* %3
%100 = trunc i16 %99 to i8
%101 = zext i8 %100 to i32
switch i32 %101, label %109 [
i32 39, label %102
i32 40, label %103
i32 96, label %104
i32 97, label %105
i32 100, label %106
i32 101, label %107
i32 131, label %108
]
102: ; preds = %98
store i8 81, i8* %2
br label %118
103: ; preds = %98
store i8 80, i8* %2
br label %118
104: ; preds = %98
store i8 28, i8* %2
br label %118
105: ; preds = %98
store i8 85, i8* %2
br label %118
106: ; preds = %98
store i8 78, i8* %2
br label %118
107: ; preds = %98
store i8 79, i8* %2
br label %118
108: ; preds = %98
store i8 82, i8* %2
br label %118
109: ; preds = %98
br label %117
110: ; preds = %1
%111 = load i16, i16* %3
%112 = trunc i16 %111 to i8
%113 = zext i8 %112 to i32
switch i32 %113, label %116 [
i32 199, label %114
i32 202, label %115
]
114: ; preds = %110
store i8 87, i8* %2
br label %118
115: ; preds = %110
store i8 87, i8* %2
br label %118
116: ; preds = %110
br label %117
117: ; preds = %1, %116, %109, %97, %90, %80
store i8 15, i8* %2
br label %118
118: ; preds = %117, %115, %114, %108, %107, %106, %105, %104, %103, %102, %96, %95, %89, %88, %87, %86, %85, %79, %78, %77, %76, %75, %74, %73, %72, %71, %70, %69, %68, %67, %66, %65, %64, %63, %62, %61, %60, %59, %58, %57, %56, %55, %54, %53, %52, %51, %50, %49, %48, %47, %46, %45, %44, %43, %42, %41, %40, %39, %38, %37, %36, %35, %34, %33, %32, %31, %30, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %7
%119 = load i8, i8* %2
ret i8 %119
}

LLVM IR (-O2):
@unicode_to_gost.tab0 = internal unnamed_addr constant [256 x i8] c"\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\8C\0F\0F|\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F[\\\1CWVQ\1B\12\13\19\0A\0D\0B\0E\0C\00\01\02\03\04\05\06\07\08\09\1F\16\1D\15\1E^\11 \221?%@A-BC*D,E.0FGH2IJK53L\17\0F\18MZ\1A \221?%@A-BC*D,E.0FGH2IJK53L\0FX\0FS\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0FS\0F\0F\0F^\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\14\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0F\0FT\0F\0F\0F\0F\0F\0F\0F\0F"
@switch.table.unicode_to_gost = [64 x i8] c" !\22#$%&'()*+,-./0123456789]:;<=> !\22#$%&'()*+,-./0123456789]:;<=>"
define zeroext i8 @unicode_to_gost(i16 zeroext %0) {
%2 = lshr i16 %0, 8
%3 = trunc i16 %2 to i8
switch i8 %3, label %38 [
i8 0, label %4
i8 4, label %8
i8 32, label %12
i8 33, label %18
i8 34, label %24
i8 37, label %32
]
4: ; preds = %1
%5 = zext i16 %0 to i64
%6 = getelementptr inbounds [256 x i8], [256 x i8]* @unicode_to_gost.tab0, i64 0, i64 %5
%7 = load i8, i8* %6
br label %43
8: ; preds = %1
%9 = trunc i16 %0 to i8
%10 = add i8 %9, -16
%11 = icmp ult i8 %10, 64
br i1 %11, label %39, label %38
12: ; preds = %1
%13 = trunc i16 %0 to i8
switch i8 %13, label %38 [
i8 21, label %43
i8 24, label %14
i8 25, label %15
i8 50, label %16
i8 62, label %17
]
14: ; preds = %12
br label %43
15: ; preds = %12
br label %43
16: ; preds = %12
br label %43
17: ; preds = %12
br label %43
18: ; preds = %1
%19 = trunc i16 %0 to i8
%20 = icmp eq i8 %19, -111
%21 = select i1 %20, i8 17, i8 15
%22 = icmp eq i8 %19, 47
%23 = select i1 %22, i8 16, i8 %21
br label %43
24: ; preds = %1
%25 = trunc i16 %0 to i8
switch i8 %25, label %38 [
i8 39, label %43
i8 40, label %26
i8 96, label %27
i8 97, label %28
i8 100, label %29
i8 101, label %30
i8 -125, label %31
]
26: ; preds = %24
br label %43
27: ; preds = %24
br label %43
28: ; preds = %24
br label %43
29: ; preds = %24
br label %43
30: ; preds = %24
br label %43
31: ; preds = %24
br label %43
32: ; preds = %1
%33 = trunc i16 %0 to i8
%34 = icmp eq i8 %33, -57
%35 = icmp eq i8 %33, -54
%36 = or i1 %34, %35
%37 = select i1 %36, i8 87, i8 15
br label %43
38: ; preds = %8, %24, %12, %1
br label %43
39: ; preds = %8
%40 = sext i8 %10 to i64
%41 = getelementptr inbounds [64 x i8], [64 x i8]* @switch.table.unicode_to_gost, i64 0, i64 %40
%42 = load i8, i8* %41
br label %43
43: ; preds = %39, %32, %24, %18, %12, %38, %31, %30, %29, %28, %27, %26, %17, %16, %15, %14, %4
%44 = phi i8 [ 15, %38 ], [ 82, %31 ], [ 79, %30 ], [ 78, %29 ], [ 85, %28 ], [ 28, %27 ], [ 80, %26 ], [ 77, %17 ], [ 95, %16 ], [ 27, %15 ], [ 26, %14 ], [ %7, %4 ], [ 89, %12 ], [ %23, %18 ], [ 81, %24 ], [ %37, %32 ], [ %42, %39 ]
ret i8 %44
}