unsigned char unicode_to_koi8(unsigned short val) {
  static unsigned char tab0[256] = {
      0,    0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
      0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
      0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23,
      0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
      0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
      0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
      0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53,
      0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
      0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b,
      0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
      0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0x9a, 0,    0,    0,    0,    0,    0,    0,
      0,    0xbf, 0,    0,    0x83, 0,    0,    0,    0x9c, 0,    0x9d, 0,
      0,    0,    0,    0x9e, 0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    'x',
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0x9f, 0,    0,    0,    0,
      0,    0,    0,    0,
  };
  switch (val >> 8) {
  case 0x00:
    return tab0[val];
  case 0x04:
    switch ((unsigned char)val) {
    case 0x01:
      return 0xb3;
    case 0x10:
      return 0xe1;
    case 0x11:
      return 0xe2;
    case 0x12:
      return 0xf7;
    case 0x13:
      return 0xe7;
    case 0x14:
      return 0xe4;
    case 0x15:
      return 0xe5;
    case 0x16:
      return 0xf6;
    case 0x17:
      return 0xfa;
    case 0x18:
      return 0xe9;
    case 0x19:
      return 0xea;
    case 0x1a:
      return 0xeb;
    case 0x1b:
      return 0xec;
    case 0x1c:
      return 0xed;
    case 0x1d:
      return 0xee;
    case 0x1e:
      return 0xef;
    case 0x1f:
      return 0xf0;
    case 0x20:
      return 0xf2;
    case 0x21:
      return 0xf3;
    case 0x22:
      return 0xf4;
    case 0x23:
      return 0xf5;
    case 0x24:
      return 0xe6;
    case 0x25:
      return 0xe8;
    case 0x26:
      return 0xe3;
    case 0x27:
      return 0xfe;
    case 0x28:
      return 0xfb;
    case 0x29:
      return 0xfd;
    case 0x2a:
      return 0xff;
    case 0x2b:
      return 0xf9;
    case 0x2c:
      return 0xf8;
    case 0x2d:
      return 0xfc;
    case 0x2e:
      return 0xe0;
    case 0x2f:
      return 0xf1;
    case 0x30:
      return 0xc1;
    case 0x31:
      return 0xc2;
    case 0x32:
      return 0xd7;
    case 0x33:
      return 0xc7;
    case 0x34:
      return 0xc4;
    case 0x35:
      return 0xc5;
    case 0x36:
      return 0xd6;
    case 0x37:
      return 0xda;
    case 0x38:
      return 0xc9;
    case 0x39:
      return 0xca;
    case 0x3a:
      return 0xcb;
    case 0x3b:
      return 0xcc;
    case 0x3c:
      return 0xcd;
    case 0x3d:
      return 0xce;
    case 0x3e:
      return 0xcf;
    case 0x3f:
      return 0xd0;
    case 0x40:
      return 0xd2;
    case 0x41:
      return 0xd3;
    case 0x42:
      return 0xd4;
    case 0x43:
      return 0xd5;
    case 0x44:
      return 0xc6;
    case 0x45:
      return 0xc8;
    case 0x46:
      return 0xc3;
    case 0x47:
      return 0xde;
    case 0x48:
      return 0xdb;
    case 0x49:
      return 0xdd;
    case 0x4a:
      return 0xdf;
    case 0x4b:
      return 0xd9;
    case 0x4c:
      return 0xd8;
    case 0x4d:
      return 0xdc;
    case 0x4e:
      return 0xc0;
    case 0x4f:
      return 0xd1;
    case 0x51:
      return 0xa3;
    }
    break;
  case 0x20:
    switch ((unsigned char)val) {
    case 0x15:
      return '-';
    case 0x18:
      return '`';
    case 0x19:
      return '\'';
    case 0x28:
      return 0x0a;
    case 0x32:
      return '\'';
    }
    break;
  case 0x21:
    switch ((unsigned char)val) {
    case 0x2f:
      return 'e';
    case 0x91:
      return '@';
    }
    break;
  case 0x22:
    switch ((unsigned char)val) {
    case 0x19:
      return 0x95;
    case 0x1a:
      return 0x96;
    case 0x27:
      return '^';
    case 0x28:
      return 'v';
    case 0x48:
      return 0x97;
    case 0x60:
      return '#';
    case 0x64:
      return 0x98;
    case 0x65:
      return 0x99;
    }
    break;
  case 0x23:
    switch ((unsigned char)val) {
    case 0x20:
      return 0x93;
    case 0x21:
      return 0x9b;
    }
    break;
  case 0x25:
    switch ((unsigned char)val) {
    case 0x00:
      return 0x80;
    case 0x02:
      return 0x81;
    case 0x0c:
      return 0x82;
    case 0x10:
      return 0x83;
    case 0x14:
      return 0x84;
    case 0x18:
      return 0x85;
    case 0x1c:
      return 0x86;
    case 0x24:
      return 0x87;
    case 0x2c:
      return 0x88;
    case 0x34:
      return 0x89;
    case 0x3c:
      return 0x8a;
    case 0x50:
      return 0xa0;
    case 0x51:
      return 0xa1;
    case 0x52:
      return 0xa2;
    case 0x53:
      return 0xa4;
    case 0x54:
      return 0xa5;
    case 0x55:
      return 0xa6;
    case 0x56:
      return 0xa7;
    case 0x57:
      return 0xa8;
    case 0x58:
      return 0xa9;
    case 0x59:
      return 0xaa;
    case 0x5a:
      return 0xab;
    case 0x5b:
      return 0xac;
    case 0x5c:
      return 0xad;
    case 0x5d:
      return 0xae;
    case 0x5e:
      return 0xaf;
    case 0x5f:
      return 0xb0;
    case 0x60:
      return 0xb1;
    case 0x61:
      return 0xb2;
    case 0x62:
      return 0xb4;
    case 0x63:
      return 0xb5;
    case 0x64:
      return 0xb6;
    case 0x65:
      return 0xb7;
    case 0x66:
      return 0xb8;
    case 0x67:
      return 0xb9;
    case 0x68:
      return 0xba;
    case 0x69:
      return 0xbb;
    case 0x6a:
      return 0xbc;
    case 0x6b:
      return 0xbd;
    case 0x6c:
      return 0xbe;
    case 0x80:
      return 0x8b;
    case 0x84:
      return 0x8c;
    case 0x88:
      return 0x8d;
    case 0x8c:
      return 0x8e;
    case 0x90:
      return 0x8f;
    case 0x91:
      return 0x90;
    case 0x92:
      return 0x91;
    case 0x93:
      return 0x92;
    case 0xa0:
      return 0x94;
    case 0xca:
      return '$';
    }
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<unicode_to_koi8>:
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     170c <unicode_to_koi8+0x60c>
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    0x2eee(%rip),%rax
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movzbl -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x50,%eax
ja     13c9 <unicode_to_koi8+0x2c9>
mov    -0x18(%rbp),%rax
lea    0x1402(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0xb3,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xe1,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xe2,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xf7,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xe7,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xe4,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xe5,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xf6,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xfa,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xe9,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xea,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xeb,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xec,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xed,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xee,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xef,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xf0,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xf2,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xf3,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xf4,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xf5,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xe6,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xe8,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xe3,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xfe,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xfb,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xfd,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xff,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xf9,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xf8,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xfc,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xe0,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xf1,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xc1,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xc2,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xd7,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xc7,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xc4,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xc5,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xd6,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xda,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xc9,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xca,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xcb,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xcc,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xcd,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xce,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xcf,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xd0,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xd2,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xd3,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xd4,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xd5,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xc6,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xc8,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xc3,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xde,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xdb,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xdd,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xdf,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xd9,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xd8,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xdc,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xc0,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xd1,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xa3,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
jmp    170c <unicode_to_koi8+0x60c>
movzbl -0x4(%rbp),%eax
add    $0xffffffeb,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x1d,%eax
ja     1425 <unicode_to_koi8+0x325>
mov    -0x20(%rbp),%rax
lea    0x1109(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x2d,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x60,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x27,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xa,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x27,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
jmp    170c <unicode_to_koi8+0x60c>
movzbl -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x2f,%eax
je     1452 <unicode_to_koi8+0x352>
jmp    143f <unicode_to_koi8+0x33f>
mov    -0x24(%rbp),%eax
sub    $0x91,%eax
je     145b <unicode_to_koi8+0x35b>
jmp    1464 <unicode_to_koi8+0x364>
movb   $0x65,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x40,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
jmp    170c <unicode_to_koi8+0x60c>
movzbl -0x4(%rbp),%eax
add    $0xffffffe7,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0x4c,%eax
ja     14db <unicode_to_koi8+0x3db>
mov    -0x30(%rbp),%rax
lea    0xf3a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x95,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x96,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x5e,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x76,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x97,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x23,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x98,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x99,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
jmp    170c <unicode_to_koi8+0x60c>
movzbl -0x4(%rbp),%eax
mov    %eax,-0x34(%rbp)
sub    $0x20,%eax
je     1506 <unicode_to_koi8+0x406>
jmp    14f5 <unicode_to_koi8+0x3f5>
mov    -0x34(%rbp),%eax
sub    $0x21,%eax
je     150f <unicode_to_koi8+0x40f>
jmp    1518 <unicode_to_koi8+0x418>
movb   $0x93,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x9b,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
jmp    170c <unicode_to_koi8+0x60c>
movzbl -0x4(%rbp),%eax
mov    %rax,-0x40(%rbp)
sub    $0xca,%rax
ja     1707 <unicode_to_koi8+0x607>
mov    -0x40(%rbp),%rax
lea    0xb5c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x80,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x81,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x82,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x83,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x84,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x85,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x86,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x87,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x88,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x89,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x8a,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xa0,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xa1,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xa2,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xa4,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xa5,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xa6,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xa7,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xa8,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xa9,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xaa,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xab,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xac,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xad,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xae,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xaf,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xb0,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xb1,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xb2,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xb4,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xb5,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xb6,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xb7,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xb8,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xb9,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xba,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xbb,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xbc,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xbd,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0xbe,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x8b,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x8c,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x8d,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x8e,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x8f,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x90,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x91,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x92,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x94,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
movb   $0x24,-0x1(%rbp)
jmp    1710 <unicode_to_koi8+0x610>
jmp    170c <unicode_to_koi8+0x60c>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unicode_to_koi8>:
mov    %edi,%eax
shr    $0x8,%eax
cmp    $0x25,%al
ja     11e8 <unicode_to_koi8+0xe8>
lea    0xeec(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movzwl %di,%eax
lea    0x14d9(%rip),%rcx
jmp    1142 <unicode_to_koi8+0x42>
add    $0xff,%dil
cmp    $0x51,%dil
jae    11e8 <unicode_to_koi8+0xe8>
movsbq %dil,%rax
lea    0x15be(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret
add    $0xeb,%dil
cmp    $0x1d,%dil
ja     11e8 <unicode_to_koi8+0xe8>
mov    $0x2d,%al
movzbl %dil,%ecx
lea    0x141f(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x27,%al
ret
cmp    $0x91,%dil
sete   %al
shl    $0x6,%al
cmp    $0x2f,%dil
movzbl %al,%ecx
mov    $0x65,%eax
cmovne %ecx,%eax
ret
add    $0xe7,%dil
cmp    $0x4c,%dil
ja     11e8 <unicode_to_koi8+0xe8>
mov    $0x95,%al
movzbl %dil,%ecx
lea    0x12ae(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x96,%al
ret
xor    %eax,%eax
cmp    $0x21,%dil
mov    $0x9b,%ecx
cmovne %eax,%ecx
cmp    $0x20,%dil
mov    $0x93,%eax
cmovne %ecx,%eax
ret
add    $0x80,%dil
cmp    $0xec,%dil
ja     11e8 <unicode_to_koi8+0xe8>
mov    $0x80,%al
movzbl %dil,%ecx
lea    0xebc(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x8b,%al
ret
xor    %eax,%eax
ret
mov    $0x60,%al
ret
mov    $0xa,%al
ret
mov    $0x5e,%al
ret
mov    $0x76,%al
ret
mov    $0x97,%al
ret
mov    $0x23,%al
ret
mov    $0x98,%al
ret
mov    $0x99,%al
ret
mov    $0x8c,%al
ret
mov    $0x8d,%al
ret
mov    $0x8e,%al
ret
mov    $0x8f,%al
ret
mov    $0x90,%al
ret
mov    $0x91,%al
ret
mov    $0x92,%al
ret
mov    $0x94,%al
ret
mov    $0x24,%al
ret
mov    $0x81,%al
ret
mov    $0x82,%al
ret
mov    $0x83,%al
ret
mov    $0x84,%al
ret
mov    $0x85,%al
ret
mov    $0x86,%al
ret
mov    $0x87,%al
ret
mov    $0x88,%al
ret
mov    $0x89,%al
ret
mov    $0x8a,%al
ret
mov    $0xa0,%al
ret
mov    $0xa1,%al
ret
mov    $0xa2,%al
ret
mov    $0xa4,%al
ret
mov    $0xa5,%al
ret
mov    $0xa6,%al
ret
mov    $0xa7,%al
ret
mov    $0xa8,%al
ret
mov    $0xa9,%al
ret
mov    $0xaa,%al
ret
mov    $0xab,%al
ret
mov    $0xac,%al
ret
mov    $0xad,%al
ret
mov    $0xae,%al
ret
mov    $0xaf,%al
ret
mov    $0xb0,%al
ret
mov    $0xb1,%al
ret
mov    $0xb2,%al
ret
mov    $0xb4,%al
ret
mov    $0xb5,%al
ret
mov    $0xb6,%al
ret
mov    $0xb7,%al
ret
mov    $0xb8,%al
ret
mov    $0xb9,%al
ret
mov    $0xba,%al
ret
mov    $0xbb,%al
ret
mov    $0xbc,%al
ret
mov    $0xbd,%al
ret
mov    $0xbe,%al
ret

LLVM IR (-O0):
@unicode_to_koi8.tab0 = internal global <{ [248 x i8], [8 x i8] }> <{ [248 x i8] c"\00\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\0F\10\11\12\13\14\15\16\17\18\19\1A\1B\1C\1D\1E\1F !\22#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\7F\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\9A\00\00\00\00\00\00\00\00\BF\00\00\83\00\00\00\9C\00\9D\00\00\00\00\9E\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00x\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\9F", [8 x i8] zeroinitializer }>
define zeroext i8 @unicode_to_koi8(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 %175 [
i32 0, label %7
i32 4, label %12
i32 32, label %83
i32 33, label %93
i32 34, label %100
i32 35, label %113
i32 37, label %120
]
7: ; preds = %1
%8 = load i16, i16* %3
%9 = zext i16 %8 to i64
%10 = getelementptr inbounds [256 x i8], [256 x i8]* bitcast (<{ [248 x i8], [8 x i8] }>* @unicode_to_koi8.tab0 to [256 x i8]*), i64 0, i64 %9
%11 = load i8, i8* %10
store i8 %11, i8* %2
br label %176
12: ; preds = %1
%13 = load i16, i16* %3
%14 = trunc i16 %13 to i8
%15 = zext i8 %14 to i32
switch i32 %15, label %82 [
i32 1, label %16
i32 16, label %17
i32 17, label %18
i32 18, label %19
i32 19, label %20
i32 20, label %21
i32 21, label %22
i32 22, label %23
i32 23, label %24
i32 24, label %25
i32 25, label %26
i32 26, label %27
i32 27, label %28
i32 28, label %29
i32 29, label %30
i32 30, label %31
i32 31, label %32
i32 32, label %33
i32 33, label %34
i32 34, label %35
i32 35, label %36
i32 36, label %37
i32 37, label %38
i32 38, label %39
i32 39, label %40
i32 40, label %41
i32 41, label %42
i32 42, label %43
i32 43, label %44
i32 44, label %45
i32 45, label %46
i32 46, label %47
i32 47, label %48
i32 48, label %49
i32 49, label %50
i32 50, label %51
i32 51, label %52
i32 52, label %53
i32 53, label %54
i32 54, label %55
i32 55, label %56
i32 56, label %57
i32 57, label %58
i32 58, label %59
i32 59, label %60
i32 60, label %61
i32 61, label %62
i32 62, label %63
i32 63, label %64
i32 64, label %65
i32 65, label %66
i32 66, label %67
i32 67, label %68
i32 68, label %69
i32 69, label %70
i32 70, label %71
i32 71, label %72
i32 72, label %73
i32 73, label %74
i32 74, label %75
i32 75, label %76
i32 76, label %77
i32 77, label %78
i32 78, label %79
i32 79, label %80
i32 81, label %81
]
16: ; preds = %12
store i8 -77, i8* %2
br label %176
17: ; preds = %12
store i8 -31, i8* %2
br label %176
18: ; preds = %12
store i8 -30, i8* %2
br label %176
19: ; preds = %12
store i8 -9, i8* %2
br label %176
20: ; preds = %12
store i8 -25, i8* %2
br label %176
21: ; preds = %12
store i8 -28, i8* %2
br label %176
22: ; preds = %12
store i8 -27, i8* %2
br label %176
23: ; preds = %12
store i8 -10, i8* %2
br label %176
24: ; preds = %12
store i8 -6, i8* %2
br label %176
25: ; preds = %12
store i8 -23, i8* %2
br label %176
26: ; preds = %12
store i8 -22, i8* %2
br label %176
27: ; preds = %12
store i8 -21, i8* %2
br label %176
28: ; preds = %12
store i8 -20, i8* %2
br label %176
29: ; preds = %12
store i8 -19, i8* %2
br label %176
30: ; preds = %12
store i8 -18, i8* %2
br label %176
31: ; preds = %12
store i8 -17, i8* %2
br label %176
32: ; preds = %12
store i8 -16, i8* %2
br label %176
33: ; preds = %12
store i8 -14, i8* %2
br label %176
34: ; preds = %12
store i8 -13, i8* %2
br label %176
35: ; preds = %12
store i8 -12, i8* %2
br label %176
36: ; preds = %12
store i8 -11, i8* %2
br label %176
37: ; preds = %12
store i8 -26, i8* %2
br label %176
38: ; preds = %12
store i8 -24, i8* %2
br label %176
39: ; preds = %12
store i8 -29, i8* %2
br label %176
40: ; preds = %12
store i8 -2, i8* %2
br label %176
41: ; preds = %12
store i8 -5, i8* %2
br label %176
42: ; preds = %12
store i8 -3, i8* %2
br label %176
43: ; preds = %12
store i8 -1, i8* %2
br label %176
44: ; preds = %12
store i8 -7, i8* %2
br label %176
45: ; preds = %12
store i8 -8, i8* %2
br label %176
46: ; preds = %12
store i8 -4, i8* %2
br label %176
47: ; preds = %12
store i8 -32, i8* %2
br label %176
48: ; preds = %12
store i8 -15, i8* %2
br label %176
49: ; preds = %12
store i8 -63, i8* %2
br label %176
50: ; preds = %12
store i8 -62, i8* %2
br label %176
51: ; preds = %12
store i8 -41, i8* %2
br label %176
52: ; preds = %12
store i8 -57, i8* %2
br label %176
53: ; preds = %12
store i8 -60, i8* %2
br label %176
54: ; preds = %12
store i8 -59, i8* %2
br label %176
55: ; preds = %12
store i8 -42, i8* %2
br label %176
56: ; preds = %12
store i8 -38, i8* %2
br label %176
57: ; preds = %12
store i8 -55, i8* %2
br label %176
58: ; preds = %12
store i8 -54, i8* %2
br label %176
59: ; preds = %12
store i8 -53, i8* %2
br label %176
60: ; preds = %12
store i8 -52, i8* %2
br label %176
61: ; preds = %12
store i8 -51, i8* %2
br label %176
62: ; preds = %12
store i8 -50, i8* %2
br label %176
63: ; preds = %12
store i8 -49, i8* %2
br label %176
64: ; preds = %12
store i8 -48, i8* %2
br label %176
65: ; preds = %12
store i8 -46, i8* %2
br label %176
66: ; preds = %12
store i8 -45, i8* %2
br label %176
67: ; preds = %12
store i8 -44, i8* %2
br label %176
68: ; preds = %12
store i8 -43, i8* %2
br label %176
69: ; preds = %12
store i8 -58, i8* %2
br label %176
70: ; preds = %12
store i8 -56, i8* %2
br label %176
71: ; preds = %12
store i8 -61, i8* %2
br label %176
72: ; preds = %12
store i8 -34, i8* %2
br label %176
73: ; preds = %12
store i8 -37, i8* %2
br label %176
74: ; preds = %12
store i8 -35, i8* %2
br label %176
75: ; preds = %12
store i8 -33, i8* %2
br label %176
76: ; preds = %12
store i8 -39, i8* %2
br label %176
77: ; preds = %12
store i8 -40, i8* %2
br label %176
78: ; preds = %12
store i8 -36, i8* %2
br label %176
79: ; preds = %12
store i8 -64, i8* %2
br label %176
80: ; preds = %12
store i8 -47, i8* %2
br label %176
81: ; preds = %12
store i8 -93, i8* %2
br label %176
82: ; preds = %12
br label %175
83: ; preds = %1
%84 = load i16, i16* %3
%85 = trunc i16 %84 to i8
%86 = zext i8 %85 to i32
switch i32 %86, label %92 [
i32 21, label %87
i32 24, label %88
i32 25, label %89
i32 40, label %90
i32 50, label %91
]
87: ; preds = %83
store i8 45, i8* %2
br label %176
88: ; preds = %83
store i8 96, i8* %2
br label %176
89: ; preds = %83
store i8 39, i8* %2
br label %176
90: ; preds = %83
store i8 10, i8* %2
br label %176
91: ; preds = %83
store i8 39, i8* %2
br label %176
92: ; preds = %83
br label %175
93: ; preds = %1
%94 = load i16, i16* %3
%95 = trunc i16 %94 to i8
%96 = zext i8 %95 to i32
switch i32 %96, label %99 [
i32 47, label %97
i32 145, label %98
]
97: ; preds = %93
store i8 101, i8* %2
br label %176
98: ; preds = %93
store i8 64, i8* %2
br label %176
99: ; preds = %93
br label %175
100: ; preds = %1
%101 = load i16, i16* %3
%102 = trunc i16 %101 to i8
%103 = zext i8 %102 to i32
switch i32 %103, label %112 [
i32 25, label %104
i32 26, label %105
i32 39, label %106
i32 40, label %107
i32 72, label %108
i32 96, label %109
i32 100, label %110
i32 101, label %111
]
104: ; preds = %100
store i8 -107, i8* %2
br label %176
105: ; preds = %100
store i8 -106, i8* %2
br label %176
106: ; preds = %100
store i8 94, i8* %2
br label %176
107: ; preds = %100
store i8 118, i8* %2
br label %176
108: ; preds = %100
store i8 -105, i8* %2
br label %176
109: ; preds = %100
store i8 35, i8* %2
br label %176
110: ; preds = %100
store i8 -104, i8* %2
br label %176
111: ; preds = %100
store i8 -103, i8* %2
br label %176
112: ; preds = %100
br label %175
113: ; preds = %1
%114 = load i16, i16* %3
%115 = trunc i16 %114 to i8
%116 = zext i8 %115 to i32
switch i32 %116, label %119 [
i32 32, label %117
i32 33, label %118
]
117: ; preds = %113
store i8 -109, i8* %2
br label %176
118: ; preds = %113
store i8 -101, i8* %2
br label %176
119: ; preds = %113
br label %175
120: ; preds = %1
%121 = load i16, i16* %3
%122 = trunc i16 %121 to i8
%123 = zext i8 %122 to i32
switch i32 %123, label %174 [
i32 0, label %124
i32 2, label %125
i32 12, label %126
i32 16, label %127
i32 20, label %128
i32 24, label %129
i32 28, label %130
i32 36, label %131
i32 44, label %132
i32 52, label %133
i32 60, label %134
i32 80, label %135
i32 81, label %136
i32 82, label %137
i32 83, label %138
i32 84, label %139
i32 85, label %140
i32 86, label %141
i32 87, label %142
i32 88, label %143
i32 89, label %144
i32 90, label %145
i32 91, label %146
i32 92, label %147
i32 93, label %148
i32 94, label %149
i32 95, label %150
i32 96, label %151
i32 97, label %152
i32 98, label %153
i32 99, label %154
i32 100, label %155
i32 101, label %156
i32 102, label %157
i32 103, label %158
i32 104, label %159
i32 105, label %160
i32 106, label %161
i32 107, label %162
i32 108, label %163
i32 128, label %164
i32 132, label %165
i32 136, label %166
i32 140, label %167
i32 144, label %168
i32 145, label %169
i32 146, label %170
i32 147, label %171
i32 160, label %172
i32 202, label %173
]
124: ; preds = %120
store i8 -128, i8* %2
br label %176
125: ; preds = %120
store i8 -127, i8* %2
br label %176
126: ; preds = %120
store i8 -126, i8* %2
br label %176
127: ; preds = %120
store i8 -125, i8* %2
br label %176
128: ; preds = %120
store i8 -124, i8* %2
br label %176
129: ; preds = %120
store i8 -123, i8* %2
br label %176
130: ; preds = %120
store i8 -122, i8* %2
br label %176
131: ; preds = %120
store i8 -121, i8* %2
br label %176
132: ; preds = %120
store i8 -120, i8* %2
br label %176
133: ; preds = %120
store i8 -119, i8* %2
br label %176
134: ; preds = %120
store i8 -118, i8* %2
br label %176
135: ; preds = %120
store i8 -96, i8* %2
br label %176
136: ; preds = %120
store i8 -95, i8* %2
br label %176
137: ; preds = %120
store i8 -94, i8* %2
br label %176
138: ; preds = %120
store i8 -92, i8* %2
br label %176
139: ; preds = %120
store i8 -91, i8* %2
br label %176
140: ; preds = %120
store i8 -90, i8* %2
br label %176
141: ; preds = %120
store i8 -89, i8* %2
br label %176
142: ; preds = %120
store i8 -88, i8* %2
br label %176
143: ; preds = %120
store i8 -87, i8* %2
br label %176
144: ; preds = %120
store i8 -86, i8* %2
br label %176
145: ; preds = %120
store i8 -85, i8* %2
br label %176
146: ; preds = %120
store i8 -84, i8* %2
br label %176
147: ; preds = %120
store i8 -83, i8* %2
br label %176
148: ; preds = %120
store i8 -82, i8* %2
br label %176
149: ; preds = %120
store i8 -81, i8* %2
br label %176
150: ; preds = %120
store i8 -80, i8* %2
br label %176
151: ; preds = %120
store i8 -79, i8* %2
br label %176
152: ; preds = %120
store i8 -78, i8* %2
br label %176
153: ; preds = %120
store i8 -76, i8* %2
br label %176
154: ; preds = %120
store i8 -75, i8* %2
br label %176
155: ; preds = %120
store i8 -74, i8* %2
br label %176
156: ; preds = %120
store i8 -73, i8* %2
br label %176
157: ; preds = %120
store i8 -72, i8* %2
br label %176
158: ; preds = %120
store i8 -71, i8* %2
br label %176
159: ; preds = %120
store i8 -70, i8* %2
br label %176
160: ; preds = %120
store i8 -69, i8* %2
br label %176
161: ; preds = %120
store i8 -68, i8* %2
br label %176
162: ; preds = %120
store i8 -67, i8* %2
br label %176
163: ; preds = %120
store i8 -66, i8* %2
br label %176
164: ; preds = %120
store i8 -117, i8* %2
br label %176
165: ; preds = %120
store i8 -116, i8* %2
br label %176
166: ; preds = %120
store i8 -115, i8* %2
br label %176
167: ; preds = %120
store i8 -114, i8* %2
br label %176
168: ; preds = %120
store i8 -113, i8* %2
br label %176
169: ; preds = %120
store i8 -112, i8* %2
br label %176
170: ; preds = %120
store i8 -111, i8* %2
br label %176
171: ; preds = %120
store i8 -110, i8* %2
br label %176
172: ; preds = %120
store i8 -108, i8* %2
br label %176
173: ; preds = %120
store i8 36, i8* %2
br label %176
174: ; preds = %120
br label %175
175: ; preds = %1, %174, %119, %112, %99, %92, %82
store i8 0, i8* %2
br label %176
176: ; preds = %175, %173, %172, %171, %170, %169, %168, %167, %166, %165, %164, %163, %162, %161, %160, %159, %158, %157, %156, %155, %154, %153, %152, %151, %150, %149, %148, %147, %146, %145, %144, %143, %142, %141, %140, %139, %138, %137, %136, %135, %134, %133, %132, %131, %130, %129, %128, %127, %126, %125, %124, %118, %117, %111, %110, %109, %108, %107, %106, %105, %104, %98, %97, %91, %90, %89, %88, %87, %81, %80, %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
%177 = load i8, i8* %2
ret i8 %177
}

LLVM IR (-O2):
@unicode_to_koi8.tab0 = internal unnamed_addr constant <{ [248 x i8], [8 x i8] }> <{ [248 x i8] c"\00\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\0F\10\11\12\13\14\15\16\17\18\19\1A\1B\1C\1D\1E\1F !\22#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\7F\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\9A\00\00\00\00\00\00\00\00\BF\00\00\83\00\00\00\9C\00\9D\00\00\00\00\9E\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00x\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\9F", [8 x i8] zeroinitializer }>
@switch.table.unicode_to_koi8 = [81 x i8] c"\B3\00\00\00\00\00\00\00\00\00\00\00\00\00\00\E1\E2\F7\E7\E4\E5\F6\FA\E9\EA\EB\EC\ED\EE\EF\F0\F2\F3\F4\F5\E6\E8\E3\FE\FB\FD\FF\F9\F8\FC\E0\F1\C1\C2\D7\C7\C4\C5\D6\DA\C9\CA\CB\CC\CD\CE\CF\D0\D2\D3\D4\D5\C6\C8\C3\DE\DB\DD\DF\D9\D8\DC\C0\D1\00\A3"
define zeroext i8 @unicode_to_koi8(i16 zeroext %0) {
%2 = lshr i16 %0, 8
%3 = trunc i16 %2 to i8
switch i8 %3, label %90 [
i8 0, label %4
i8 4, label %8
i8 32, label %12
i8 33, label %18
i8 34, label %24
i8 35, label %33
i8 37, label %39
]
4: ; preds = %1
%5 = zext i16 %0 to i64
%6 = getelementptr inbounds [256 x i8], [256 x i8]* bitcast (<{ [248 x i8], [8 x i8] }>* @unicode_to_koi8.tab0 to [256 x i8]*), i64 0, i64 %5
%7 = load i8, i8* %6
br label %95
8: ; preds = %1
%9 = trunc i16 %0 to i8
%10 = add i8 %9, -1
%11 = icmp ult i8 %10, 81
br i1 %11, label %91, label %90
12: ; preds = %1
%13 = trunc i16 %0 to i8
switch i8 %13, label %90 [
i8 21, label %95
i8 24, label %14
i8 25, label %15
i8 40, label %16
i8 50, label %17
]
14: ; preds = %12
br label %95
15: ; preds = %12
br label %95
16: ; preds = %12
br label %95
17: ; preds = %12
br label %95
18: ; preds = %1
%19 = trunc i16 %0 to i8
%20 = icmp eq i8 %19, -111
%21 = select i1 %20, i8 64, i8 0
%22 = icmp eq i8 %19, 47
%23 = select i1 %22, i8 101, i8 %21
br label %95
24: ; preds = %1
%25 = trunc i16 %0 to i8
switch i8 %25, label %90 [
i8 25, label %95
i8 26, label %26
i8 39, label %27
i8 40, label %28
i8 72, label %29
i8 96, label %30
i8 100, label %31
i8 101, label %32
]
26: ; preds = %24
br label %95
27: ; preds = %24
br label %95
28: ; preds = %24
br label %95
29: ; preds = %24
br label %95
30: ; preds = %24
br label %95
31: ; preds = %24
br label %95
32: ; preds = %24
br label %95
33: ; preds = %1
%34 = trunc i16 %0 to i8
%35 = icmp eq i8 %34, 33
%36 = select i1 %35, i8 -101, i8 0
%37 = icmp eq i8 %34, 32
%38 = select i1 %37, i8 -109, i8 %36
br label %95
39: ; preds = %1
%40 = trunc i16 %0 to i8
switch i8 %40, label %90 [
i8 0, label %95
i8 2, label %41
i8 12, label %42
i8 16, label %43
i8 20, label %44
i8 24, label %45
i8 28, label %46
i8 36, label %47
i8 44, label %48
i8 52, label %49
i8 60, label %50
i8 80, label %51
i8 81, label %52
i8 82, label %53
i8 83, label %54
i8 84, label %55
i8 85, label %56
i8 86, label %57
i8 87, label %58
i8 88, label %59
i8 89, label %60
i8 90, label %61
i8 91, label %62
i8 92, label %63
i8 93, label %64
i8 94, label %65
i8 95, label %66
i8 96, label %67
i8 97, label %68
i8 98, label %69
i8 99, label %70
i8 100, label %71
i8 101, label %72
i8 102, label %73
i8 103, label %74
i8 104, label %75
i8 105, label %76
i8 106, label %77
i8 107, label %78
i8 108, label %79
i8 -128, label %80
i8 -124, label %81
i8 -120, label %82
i8 -116, label %83
i8 -112, label %84
i8 -111, label %85
i8 -110, label %86
i8 -109, label %87
i8 -96, label %88
i8 -54, label %89
]
41: ; preds = %39
br label %95
42: ; preds = %39
br label %95
43: ; preds = %39
br label %95
44: ; preds = %39
br label %95
45: ; preds = %39
br label %95
46: ; preds = %39
br label %95
47: ; preds = %39
br label %95
48: ; preds = %39
br label %95
49: ; preds = %39
br label %95
50: ; preds = %39
br label %95
51: ; preds = %39
br label %95
52: ; preds = %39
br label %95
53: ; preds = %39
br label %95
54: ; preds = %39
br label %95
55: ; preds = %39
br label %95
56: ; preds = %39
br label %95
57: ; preds = %39
br label %95
58: ; preds = %39
br label %95
59: ; preds = %39
br label %95
60: ; preds = %39
br label %95
61: ; preds = %39
br label %95
62: ; preds = %39
br label %95
63: ; preds = %39
br label %95
64: ; preds = %39
br label %95
65: ; preds = %39
br label %95
66: ; preds = %39
br label %95
67: ; preds = %39
br label %95
68: ; preds = %39
br label %95
69: ; preds = %39
br label %95
70: ; preds = %39
br label %95
71: ; preds = %39
br label %95
72: ; preds = %39
br label %95
73: ; preds = %39
br label %95
74: ; preds = %39
br label %95
75: ; preds = %39
br label %95
76: ; preds = %39
br label %95
77: ; preds = %39
br label %95
78: ; preds = %39
br label %95
79: ; preds = %39
br label %95
80: ; preds = %39
br label %95
81: ; preds = %39
br label %95
82: ; preds = %39
br label %95
83: ; preds = %39
br label %95
84: ; preds = %39
br label %95
85: ; preds = %39
br label %95
86: ; preds = %39
br label %95
87: ; preds = %39
br label %95
88: ; preds = %39
br label %95
89: ; preds = %39
br label %95
90: ; preds = %8, %39, %24, %12, %1
br label %95
91: ; preds = %8
%92 = sext i8 %10 to i64
%93 = getelementptr inbounds [81 x i8], [81 x i8]* @switch.table.unicode_to_koi8, i64 0, i64 %92
%94 = load i8, i8* %93
br label %95
95: ; preds = %91, %39, %33, %24, %18, %12, %90, %89, %88, %87, %86, %85, %84, %83, %82, %81, %80, %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, %32, %31, %30, %29, %28, %27, %26, %17, %16, %15, %14, %4
%96 = phi i8 [ 0, %90 ], [ 36, %89 ], [ -108, %88 ], [ -110, %87 ], [ -111, %86 ], [ -112, %85 ], [ -113, %84 ], [ -114, %83 ], [ -115, %82 ], [ -116, %81 ], [ -117, %80 ], [ -66, %79 ], [ -67, %78 ], [ -68, %77 ], [ -69, %76 ], [ -70, %75 ], [ -71, %74 ], [ -72, %73 ], [ -73, %72 ], [ -74, %71 ], [ -75, %70 ], [ -76, %69 ], [ -78, %68 ], [ -79, %67 ], [ -80, %66 ], [ -81, %65 ], [ -82, %64 ], [ -83, %63 ], [ -84, %62 ], [ -85, %61 ], [ -86, %60 ], [ -87, %59 ], [ -88, %58 ], [ -89, %57 ], [ -90, %56 ], [ -91, %55 ], [ -92, %54 ], [ -94, %53 ], [ -95, %52 ], [ -96, %51 ], [ -118, %50 ], [ -119, %49 ], [ -120, %48 ], [ -121, %47 ], [ -122, %46 ], [ -123, %45 ], [ -124, %44 ], [ -125, %43 ], [ -126, %42 ], [ -127, %41 ], [ -103, %32 ], [ -104, %31 ], [ 35, %30 ], [ -105, %29 ], [ 118, %28 ], [ 94, %27 ], [ -106, %26 ], [ 39, %17 ], [ 10, %16 ], [ 39, %15 ], [ 96, %14 ], [ %7, %4 ], [ 45, %12 ], [ %23, %18 ], [ -107, %24 ], [ %38, %33 ], [ -128, %39 ], [ %94, %91 ]
ret i8 %96
}