void sjis2ujis(sjis, ujis) unsigned char *sjis;
unsigned char *ujis;
{
  unsigned char *p, *q;
  int c1, c2, o1, o2;
  static unsigned char k2H_table[64][3] = {
      "\241\241", "\241\243", "\241\326", "\241\327", "\241\242", "\241\245",
      "\244\362", "\244\241", "\244\243", "\244\245", "\244\247", "\244\251",
      "\244\343", "\244\345", "\244\347", "\244\303", "\241\274", "\244\242",
      "\244\244", "\244\246", "\244\250", "\244\252", "\244\253", "\244\255",
      "\244\257", "\244\261", "\244\263", "\244\265", "\244\267", "\244\271",
      "\244\273", "\244\275", "\244\277", "\244\301", "\244\304", "\244\306",
      "\244\310", "\244\312", "\244\313", "\244\314", "\244\315", "\244\316",
      "\244\317", "\244\322", "\244\325", "\244\330", "\244\333", "\244\336",
      "\244\337", "\244\340", "\244\341", "\244\342", "\244\344", "\244\346",
      "\244\350", "\244\351", "\244\352", "\244\353", "\244\354", "\244\355",
      "\244\357", "\244\363", "\241\253", "\241\254"};
  static unsigned char k2H_dtable[64][3] = {
      "",         "",         "",         "",         "",         "",
      "",         "",         "",         "",         "",         "",
      "",         "",         "",         "",         "",         "",
      "",         "",         "",         "",         "\244\254", "\244\256",
      "\244\260", "\244\262", "\244\264", "\244\266", "\244\270", "\244\272",
      "\244\274", "\244\276", "\244\300", "\244\302", "\244\305", "\244\307",
      "\244\311", "",         "",         "",         "",         "",
      "\244\320", "\244\323", "\244\326", "\244\331", "\244\334", "",
      "",         "",         "",         "",         "",         "",
      "",         "",         "",         "",         "",         "",
      "",         "",         "",         ""};
  static unsigned char k2H_htable[64][3] = {
      "", "", "",         "",         "",         "",         "",         "",
      "", "", "",         "",         "",         "",         "",         "",
      "", "", "",         "",         "",         "",         "",         "",
      "", "", "",         "",         "",         "",         "",         "",
      "", "", "",         "",         "",         "",         "",         "",
      "", "", "\244\321", "\244\324", "\244\327", "\244\332", "\244\335", "",
      "", "", "",         "",         "",         "",         "",         "",
      "", "", "",         "",         "",         "",         "",         ""};
  p = sjis;
  q = ujis;
  while ((c1 = *p) != '\0') {
    if (c1 == ',') {
      *(q++) = ' ';
    } else if (c1 < 0x80) {
      *(q++) = c1;
    } else if ((0xa0 <= c1) && (c1 < 0xe0)) {
      c2 = p[1];
      if ((c2 == 0xde) && (k2H_dtable[c1 - 0xa0][0] != '\0')) {
        *(q++) = k2H_dtable[c1 - 0xa0][0];
        *(q++) = k2H_dtable[c1 - 0xa0][1];
        ++p;
      } else if ((c2 == 0xdf) && (k2H_htable[c1 - 0xa0][0] != '\0')) {
        *(q++) = k2H_htable[c1 - 0xa0][0];
        *(q++) = k2H_htable[c1 - 0xa0][1];
        ++p;
      } else {
        *(q++) = k2H_table[c1 - 0xa0][0];
        *(q++) = k2H_table[c1 - 0xa0][1];
      }
    } else {
      c2 = p[1];
      if (c2 >= 0x9f) {
        if (c1 >= 0xe0)
          o1 = c1 * 2 - 0xe0;
        else
          o1 = c1 * 2 - 0x60;
        o2 = c2 + 2;
      } else {
        if (c1 >= 0xe0)
          o1 = c1 * 2 - 0xe1;
        else
          o1 = c1 * 2 - 0x61;
        if (c2 >= 0x7f)
          o2 = c2 + 0x60;
        else
          o2 = c2 + 0x61;
      }
      *(q++) = o1;
      *(q++) = o2;
      ++p;
    }
    ++p;
  }
  *q = '\0';
}


x86 assembly (clang, -O0):
<sjis2ujis>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     1430 <sjis2ujis+0x330>
cmpl   $0x2c,-0x24(%rbp)
jne    1150 <sjis2ujis+0x50>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x20,(%rax)
jmp    141f <sjis2ujis+0x31f>
cmpl   $0x80,-0x24(%rbp)
jge    1178 <sjis2ujis+0x78>
mov    -0x24(%rbp),%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    141a <sjis2ujis+0x31a>
mov    $0xa0,%eax
cmp    -0x24(%rbp),%eax
jg     1339 <sjis2ujis+0x239>
cmpl   $0xe0,-0x24(%rbp)
jge    1339 <sjis2ujis+0x239>
mov    -0x18(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0xde,-0x28(%rbp)
jne    123a <sjis2ujis+0x13a>
mov    -0x24(%rbp),%eax
sub    $0xa0,%eax
movslq %eax,%rcx
lea    0x2f33(%rip),%rax
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     123a <sjis2ujis+0x13a>
mov    -0x24(%rbp),%eax
sub    $0xa0,%eax
movslq %eax,%rcx
lea    0x2f0e(%rip),%rax
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x24(%rbp),%eax
sub    $0xa0,%eax
movslq %eax,%rcx
lea    0x2ee2(%rip),%rax
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
mov    0x1(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1334 <sjis2ujis+0x234>
cmpl   $0xdf,-0x28(%rbp)
jne    12d6 <sjis2ujis+0x1d6>
mov    -0x24(%rbp),%eax
sub    $0xa0,%eax
movslq %eax,%rcx
lea    0x2f57(%rip),%rax
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     12d6 <sjis2ujis+0x1d6>
mov    -0x24(%rbp),%eax
sub    $0xa0,%eax
movslq %eax,%rcx
lea    0x2f32(%rip),%rax
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x24(%rbp),%eax
sub    $0xa0,%eax
movslq %eax,%rcx
lea    0x2f06(%rip),%rax
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
mov    0x1(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    132f <sjis2ujis+0x22f>
mov    -0x24(%rbp),%eax
sub    $0xa0,%eax
movslq %eax,%rcx
lea    0x2d48(%rip),%rax
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x24(%rbp),%eax
sub    $0xa0,%eax
movslq %eax,%rcx
lea    0x2d1c(%rip),%rax
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
mov    0x1(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    1334 <sjis2ujis+0x234>
jmp    1415 <sjis2ujis+0x315>
mov    -0x18(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x9f,-0x28(%rbp)
jl     138b <sjis2ujis+0x28b>
cmpl   $0xe0,-0x24(%rbp)
jl     1371 <sjis2ujis+0x271>
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
sub    $0xe0,%eax
mov    %eax,-0x2c(%rbp)
jmp    137d <sjis2ujis+0x27d>
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
sub    $0x60,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x30(%rbp)
jmp    13dd <sjis2ujis+0x2dd>
cmpl   $0xe0,-0x24(%rbp)
jl     13ab <sjis2ujis+0x2ab>
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
sub    $0xe1,%eax
mov    %eax,-0x2c(%rbp)
jmp    13b7 <sjis2ujis+0x2b7>
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
sub    $0x61,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x7f,-0x28(%rbp)
jl     13cf <sjis2ujis+0x2cf>
mov    -0x28(%rbp),%eax
add    $0x60,%eax
mov    %eax,-0x30(%rbp)
jmp    13d8 <sjis2ujis+0x2d8>
mov    -0x28(%rbp),%eax
add    $0x61,%eax
mov    %eax,-0x30(%rbp)
jmp    13dd <sjis2ujis+0x2dd>
mov    -0x2c(%rbp),%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x30(%rbp),%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    141a <sjis2ujis+0x31a>
jmp    141f <sjis2ujis+0x31f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <sjis2ujis+0x1c>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sjis2ujis>:
push   %rbp
push   %r15
push   %r14
push   %rbx
lea    0xfb3(%rip),%r8
lea    0xeec(%rip),%r10
lea    0x1065(%rip),%r9
mov    $0x20,%r11d
mov    $0x1f,%r14d
mov    $0x2,%r15d
jmp    113b <sjis2ujis+0x3b>
nop
movb   $0x20,(%rsi)
add    $0x1,%rsi
add    $0x1,%rdi
movzbl (%rdi),%ebx
cmp    $0x2c,%ebx
je     1130 <sjis2ujis+0x30>
test   %bl,%bl
je     1200 <sjis2ujis+0x100>
js     1151 <sjis2ujis+0x51>
mov    %bl,(%rsi)
jmp    1133 <sjis2ujis+0x33>
lea    0x60(%rbx),%ecx
lea    0x1(%rdi),%rbp
movzbl 0x1(%rdi),%edx
cmp    $0x3f,%cl
ja     1188 <sjis2ujis+0x88>
add    $0xffffff60,%ebx
cmp    $0xde,%dl
je     11c0 <sjis2ujis+0xc0>
cmp    $0xdf,%dl
jne    11e8 <sjis2ujis+0xe8>
lea    (%rbx,%rbx,2),%rdx
movzbl (%r9,%rdx,1),%ecx
test   %cl,%cl
je     11e8 <sjis2ujis+0xe8>
mov    %cl,(%rsi)
movzbl 0x1(%r9,%rdx,1),%ecx
jmp    11d5 <sjis2ujis+0xd5>
cmp    $0xe0,%bl
mov    $0xa0,%ecx
cmovae %r11d,%ecx
lea    (%rbx,%rbx,1),%edi
mov    $0x9f,%ebx
cmovae %r14d,%ebx
cmp    $0x7f,%dl
mov    $0x61,%al
adc    $0xff,%al
cmp    $0x9f,%dl
movzbl %al,%eax
cmovae %r15d,%eax
cmovae %ecx,%ebx
add    %dil,%bl
add    %dl,%al
mov    %bl,(%rsi)
mov    %al,0x1(%rsi)
jmp    11d8 <sjis2ujis+0xd8>
lea    (%rbx,%rbx,2),%rdx
movzbl (%r8,%rdx,1),%ecx
test   %cl,%cl
je     11e8 <sjis2ujis+0xe8>
mov    %cl,(%rsi)
movzbl 0x1(%r8,%rdx,1),%ecx
mov    %cl,0x1(%rsi)
add    $0x2,%rsi
add    $0x1,%rbp
mov    %rbp,%rdi
jmp    113b <sjis2ujis+0x3b>
lea    (%rbx,%rbx,2),%rcx
movzwl (%r10,%rcx,1),%ecx
mov    %cx,(%rsi)
add    $0x2,%rsi
mov    %rbp,%rdi
jmp    113b <sjis2ujis+0x3b>
movb   $0x0,(%rsi)
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@sjis2ujis.k2H_table = internal global [64 x [3 x i8]] [[3 x i8] c"\A1\A1\00", [3 x i8] c"\A1\A3\00", [3 x i8] c"\A1\D6\00", [3 x i8] c"\A1\D7\00", [3 x i8] c"\A1\A2\00", [3 x i8] c"\A1\A5\00", [3 x i8] c"\A4\F2\00", [3 x i8] c"\A4\A1\00", [3 x i8] c"\A4\A3\00", [3 x i8] c"\A4\A5\00", [3 x i8] c"\A4\A7\00", [3 x i8] c"\A4\A9\00", [3 x i8] c"\A4\E3\00", [3 x i8] c"\A4\E5\00", [3 x i8] c"\A4\E7\00", [3 x i8] c"\A4\C3\00", [3 x i8] c"\A1\BC\00", [3 x i8] c"\A4\A2\00", [3 x i8] c"\A4\A4\00", [3 x i8] c"\A4\A6\00", [3 x i8] c"\A4\A8\00", [3 x i8] c"\A4\AA\00", [3 x i8] c"\A4\AB\00", [3 x i8] c"\A4\AD\00", [3 x i8] c"\A4\AF\00", [3 x i8] c"\A4\B1\00", [3 x i8] c"\A4\B3\00", [3 x i8] c"\A4\B5\00", [3 x i8] c"\A4\B7\00", [3 x i8] c"\A4\B9\00", [3 x i8] c"\A4\BB\00", [3 x i8] c"\A4\BD\00", [3 x i8] c"\A4\BF\00", [3 x i8] c"\A4\C1\00", [3 x i8] c"\A4\C4\00", [3 x i8] c"\A4\C6\00", [3 x i8] c"\A4\C8\00", [3 x i8] c"\A4\CA\00", [3 x i8] c"\A4\CB\00", [3 x i8] c"\A4\CC\00", [3 x i8] c"\A4\CD\00", [3 x i8] c"\A4\CE\00", [3 x i8] c"\A4\CF\00", [3 x i8] c"\A4\D2\00", [3 x i8] c"\A4\D5\00", [3 x i8] c"\A4\D8\00", [3 x i8] c"\A4\DB\00", [3 x i8] c"\A4\DE\00", [3 x i8] c"\A4\DF\00", [3 x i8] c"\A4\E0\00", [3 x i8] c"\A4\E1\00", [3 x i8] c"\A4\E2\00", [3 x i8] c"\A4\E4\00", [3 x i8] c"\A4\E6\00", [3 x i8] c"\A4\E8\00", [3 x i8] c"\A4\E9\00", [3 x i8] c"\A4\EA\00", [3 x i8] c"\A4\EB\00", [3 x i8] c"\A4\EC\00", [3 x i8] c"\A4\ED\00", [3 x i8] c"\A4\EF\00", [3 x i8] c"\A4\F3\00", [3 x i8] c"\A1\AB\00", [3 x i8] c"\A1\AC\00"]
@sjis2ujis.k2H_dtable = internal global <{ [47 x [3 x i8]], [17 x [3 x i8]] }> <{ [47 x [3 x i8]] [[3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] c"\A4\AC\00", [3 x i8] c"\A4\AE\00", [3 x i8] c"\A4\B0\00", [3 x i8] c"\A4\B2\00", [3 x i8] c"\A4\B4\00", [3 x i8] c"\A4\B6\00", [3 x i8] c"\A4\B8\00", [3 x i8] c"\A4\BA\00", [3 x i8] c"\A4\BC\00", [3 x i8] c"\A4\BE\00", [3 x i8] c"\A4\C0\00", [3 x i8] c"\A4\C2\00", [3 x i8] c"\A4\C5\00", [3 x i8] c"\A4\C7\00", [3 x i8] c"\A4\C9\00", [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] c"\A4\D0\00", [3 x i8] c"\A4\D3\00", [3 x i8] c"\A4\D6\00", [3 x i8] c"\A4\D9\00", [3 x i8] c"\A4\DC\00"], [17 x [3 x i8]] zeroinitializer }>
@sjis2ujis.k2H_htable = internal global <{ [47 x [3 x i8]], [17 x [3 x i8]] }> <{ [47 x [3 x i8]] [[3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] c"\A4\D1\00", [3 x i8] c"\A4\D4\00", [3 x i8] c"\A4\D7\00", [3 x i8] c"\A4\DA\00", [3 x i8] c"\A4\DD\00"], [17 x [3 x i8]] zeroinitializer }>
define void @sjis2ujis(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%11 = load i8*, i8** %3
store i8* %11, i8** %5
%12 = load i8*, i8** %4
store i8* %12, i8** %6
br label %13
13: ; preds = %178, %2
%14 = load i8*, i8** %5
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
store i32 %16, i32* %7
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %181
18: ; preds = %13
%19 = load i32, i32* %7
%20 = icmp eq i32 %19, 44
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i8*, i8** %6
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %6
store i8 32, i8* %22
br label %178
24: ; preds = %18
%25 = load i32, i32* %7
%26 = icmp slt i32 %25, 128
br i1 %26, label %27, label %32
27: ; preds = %24
%28 = load i32, i32* %7
%29 = trunc i32 %28 to i8
%30 = load i8*, i8** %6
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %6
store i8 %29, i8* %30
br label %177
32: ; preds = %24
%33 = load i32, i32* %7
%34 = icmp sle i32 160, %33
br i1 %34, label %35, label %123
35: ; preds = %32
%36 = load i32, i32* %7
%37 = icmp slt i32 %36, 224
br i1 %37, label %38, label %123
38: ; preds = %35
%39 = load i8*, i8** %5
%40 = getelementptr inbounds i8, i8* %39, i64 1
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
store i32 %42, i32* %8
%43 = load i32, i32* %8
%44 = icmp eq i32 %43, 222
br i1 %44, label %45, label %73
45: ; preds = %38
%46 = load i32, i32* %7
%47 = sub nsw i32 %46, 160
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [64 x [3 x i8]], [64 x [3 x i8]]* bitcast (<{ [47 x [3 x i8]], [17 x [3 x i8]] }>* @sjis2ujis.k2H_dtable to [64 x [3 x i8]]*), i64 0, i64 %48
%50 = getelementptr inbounds [3 x i8], [3 x i8]* %49, i64 0, i64 0
%51 = load i8, i8* %50
%52 = zext i8 %51 to i32
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %73
54: ; preds = %45
%55 = load i32, i32* %7
%56 = sub nsw i32 %55, 160
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [64 x [3 x i8]], [64 x [3 x i8]]* bitcast (<{ [47 x [3 x i8]], [17 x [3 x i8]] }>* @sjis2ujis.k2H_dtable to [64 x [3 x i8]]*), i64 0, i64 %57
%59 = getelementptr inbounds [3 x i8], [3 x i8]* %58, i64 0, i64 0
%60 = load i8, i8* %59
%61 = load i8*, i8** %6
%62 = getelementptr inbounds i8, i8* %61, i32 1
store i8* %62, i8** %6
store i8 %60, i8* %61
%63 = load i32, i32* %7
%64 = sub nsw i32 %63, 160
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [64 x [3 x i8]], [64 x [3 x i8]]* bitcast (<{ [47 x [3 x i8]], [17 x [3 x i8]] }>* @sjis2ujis.k2H_dtable to [64 x [3 x i8]]*), i64 0, i64 %65
%67 = getelementptr inbounds [3 x i8], [3 x i8]* %66, i64 0, i64 1
%68 = load i8, i8* %67
%69 = load i8*, i8** %6
%70 = getelementptr inbounds i8, i8* %69, i32 1
store i8* %70, i8** %6
store i8 %68, i8* %69
%71 = load i8*, i8** %5
%72 = getelementptr inbounds i8, i8* %71, i32 1
store i8* %72, i8** %5
br label %122
73: ; preds = %45, %38
%74 = load i32, i32* %8
%75 = icmp eq i32 %74, 223
br i1 %75, label %76, label %104
76: ; preds = %73
%77 = load i32, i32* %7
%78 = sub nsw i32 %77, 160
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [64 x [3 x i8]], [64 x [3 x i8]]* bitcast (<{ [47 x [3 x i8]], [17 x [3 x i8]] }>* @sjis2ujis.k2H_htable to [64 x [3 x i8]]*), i64 0, i64 %79
%81 = getelementptr inbounds [3 x i8], [3 x i8]* %80, i64 0, i64 0
%82 = load i8, i8* %81
%83 = zext i8 %82 to i32
%84 = icmp ne i32 %83, 0
br i1 %84, label %85, label %104
85: ; preds = %76
%86 = load i32, i32* %7
%87 = sub nsw i32 %86, 160
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [64 x [3 x i8]], [64 x [3 x i8]]* bitcast (<{ [47 x [3 x i8]], [17 x [3 x i8]] }>* @sjis2ujis.k2H_htable to [64 x [3 x i8]]*), i64 0, i64 %88
%90 = getelementptr inbounds [3 x i8], [3 x i8]* %89, i64 0, i64 0
%91 = load i8, i8* %90
%92 = load i8*, i8** %6
%93 = getelementptr inbounds i8, i8* %92, i32 1
store i8* %93, i8** %6
store i8 %91, i8* %92
%94 = load i32, i32* %7
%95 = sub nsw i32 %94, 160
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [64 x [3 x i8]], [64 x [3 x i8]]* bitcast (<{ [47 x [3 x i8]], [17 x [3 x i8]] }>* @sjis2ujis.k2H_htable to [64 x [3 x i8]]*), i64 0, i64 %96
%98 = getelementptr inbounds [3 x i8], [3 x i8]* %97, i64 0, i64 1
%99 = load i8, i8* %98
%100 = load i8*, i8** %6
%101 = getelementptr inbounds i8, i8* %100, i32 1
store i8* %101, i8** %6
store i8 %99, i8* %100
%102 = load i8*, i8** %5
%103 = getelementptr inbounds i8, i8* %102, i32 1
store i8* %103, i8** %5
br label %121
104: ; preds = %76, %73
%105 = load i32, i32* %7
%106 = sub nsw i32 %105, 160
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [64 x [3 x i8]], [64 x [3 x i8]]* @sjis2ujis.k2H_table, i64 0, i64 %107
%109 = getelementptr inbounds [3 x i8], [3 x i8]* %108, i64 0, i64 0
%110 = load i8, i8* %109
%111 = load i8*, i8** %6
%112 = getelementptr inbounds i8, i8* %111, i32 1
store i8* %112, i8** %6
store i8 %110, i8* %111
%113 = load i32, i32* %7
%114 = sub nsw i32 %113, 160
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds [64 x [3 x i8]], [64 x [3 x i8]]* @sjis2ujis.k2H_table, i64 0, i64 %115
%117 = getelementptr inbounds [3 x i8], [3 x i8]* %116, i64 0, i64 1
%118 = load i8, i8* %117
%119 = load i8*, i8** %6
%120 = getelementptr inbounds i8, i8* %119, i32 1
store i8* %120, i8** %6
store i8 %118, i8* %119
br label %121
121: ; preds = %104, %85
br label %122
122: ; preds = %121, %54
br label %176
123: ; preds = %35, %32
%124 = load i8*, i8** %5
%125 = getelementptr inbounds i8, i8* %124, i64 1
%126 = load i8, i8* %125
%127 = zext i8 %126 to i32
store i32 %127, i32* %8
%128 = load i32, i32* %8
%129 = icmp sge i32 %128, 159
br i1 %129, label %130, label %144
130: ; preds = %123
%131 = load i32, i32* %7
%132 = icmp sge i32 %131, 224
br i1 %132, label %133, label %137
133: ; preds = %130
%134 = load i32, i32* %7
%135 = mul nsw i32 %134, 2
%136 = sub nsw i32 %135, 224
store i32 %136, i32* %9
br label %141
137: ; preds = %130
%138 = load i32, i32* %7
%139 = mul nsw i32 %138, 2
%140 = sub nsw i32 %139, 96
store i32 %140, i32* %9
br label %141
141: ; preds = %137, %133
%142 = load i32, i32* %8
%143 = add nsw i32 %142, 2
store i32 %143, i32* %10
br label %165
144: ; preds = %123
%145 = load i32, i32* %7
%146 = icmp sge i32 %145, 224
br i1 %146, label %147, label %151
147: ; preds = %144
%148 = load i32, i32* %7
%149 = mul nsw i32 %148, 2
%150 = sub nsw i32 %149, 225
store i32 %150, i32* %9
br label %155
151: ; preds = %144
%152 = load i32, i32* %7
%153 = mul nsw i32 %152, 2
%154 = sub nsw i32 %153, 97
store i32 %154, i32* %9
br label %155
155: ; preds = %151, %147
%156 = load i32, i32* %8
%157 = icmp sge i32 %156, 127
br i1 %157, label %158, label %161
158: ; preds = %155
%159 = load i32, i32* %8
%160 = add nsw i32 %159, 96
store i32 %160, i32* %10
br label %164
161: ; preds = %155
%162 = load i32, i32* %8
%163 = add nsw i32 %162, 97
store i32 %163, i32* %10
br label %164
164: ; preds = %161, %158
br label %165
165: ; preds = %164, %141
%166 = load i32, i32* %9
%167 = trunc i32 %166 to i8
%168 = load i8*, i8** %6
%169 = getelementptr inbounds i8, i8* %168, i32 1
store i8* %169, i8** %6
store i8 %167, i8* %168
%170 = load i32, i32* %10
%171 = trunc i32 %170 to i8
%172 = load i8*, i8** %6
%173 = getelementptr inbounds i8, i8* %172, i32 1
store i8* %173, i8** %6
store i8 %171, i8* %172
%174 = load i8*, i8** %5
%175 = getelementptr inbounds i8, i8* %174, i32 1
store i8* %175, i8** %5
br label %176
176: ; preds = %165, %122
br label %177
177: ; preds = %176, %27
br label %178
178: ; preds = %177, %21
%179 = load i8*, i8** %5
%180 = getelementptr inbounds i8, i8* %179, i32 1
store i8* %180, i8** %5
br label %13
181: ; preds = %13
%182 = load i8*, i8** %6
store i8 0, i8* %182
ret void
}

LLVM IR (-O2):
@sjis2ujis.k2H_table = internal unnamed_addr constant [64 x [3 x i8]] [[3 x i8] c"\A1\A1\00", [3 x i8] c"\A1\A3\00", [3 x i8] c"\A1\D6\00", [3 x i8] c"\A1\D7\00", [3 x i8] c"\A1\A2\00", [3 x i8] c"\A1\A5\00", [3 x i8] c"\A4\F2\00", [3 x i8] c"\A4\A1\00", [3 x i8] c"\A4\A3\00", [3 x i8] c"\A4\A5\00", [3 x i8] c"\A4\A7\00", [3 x i8] c"\A4\A9\00", [3 x i8] c"\A4\E3\00", [3 x i8] c"\A4\E5\00", [3 x i8] c"\A4\E7\00", [3 x i8] c"\A4\C3\00", [3 x i8] c"\A1\BC\00", [3 x i8] c"\A4\A2\00", [3 x i8] c"\A4\A4\00", [3 x i8] c"\A4\A6\00", [3 x i8] c"\A4\A8\00", [3 x i8] c"\A4\AA\00", [3 x i8] c"\A4\AB\00", [3 x i8] c"\A4\AD\00", [3 x i8] c"\A4\AF\00", [3 x i8] c"\A4\B1\00", [3 x i8] c"\A4\B3\00", [3 x i8] c"\A4\B5\00", [3 x i8] c"\A4\B7\00", [3 x i8] c"\A4\B9\00", [3 x i8] c"\A4\BB\00", [3 x i8] c"\A4\BD\00", [3 x i8] c"\A4\BF\00", [3 x i8] c"\A4\C1\00", [3 x i8] c"\A4\C4\00", [3 x i8] c"\A4\C6\00", [3 x i8] c"\A4\C8\00", [3 x i8] c"\A4\CA\00", [3 x i8] c"\A4\CB\00", [3 x i8] c"\A4\CC\00", [3 x i8] c"\A4\CD\00", [3 x i8] c"\A4\CE\00", [3 x i8] c"\A4\CF\00", [3 x i8] c"\A4\D2\00", [3 x i8] c"\A4\D5\00", [3 x i8] c"\A4\D8\00", [3 x i8] c"\A4\DB\00", [3 x i8] c"\A4\DE\00", [3 x i8] c"\A4\DF\00", [3 x i8] c"\A4\E0\00", [3 x i8] c"\A4\E1\00", [3 x i8] c"\A4\E2\00", [3 x i8] c"\A4\E4\00", [3 x i8] c"\A4\E6\00", [3 x i8] c"\A4\E8\00", [3 x i8] c"\A4\E9\00", [3 x i8] c"\A4\EA\00", [3 x i8] c"\A4\EB\00", [3 x i8] c"\A4\EC\00", [3 x i8] c"\A4\ED\00", [3 x i8] c"\A4\EF\00", [3 x i8] c"\A4\F3\00", [3 x i8] c"\A1\AB\00", [3 x i8] c"\A1\AC\00"]
@sjis2ujis.k2H_dtable = internal unnamed_addr constant <{ [47 x [3 x i8]], [17 x [3 x i8]] }> <{ [47 x [3 x i8]] [[3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] c"\A4\AC\00", [3 x i8] c"\A4\AE\00", [3 x i8] c"\A4\B0\00", [3 x i8] c"\A4\B2\00", [3 x i8] c"\A4\B4\00", [3 x i8] c"\A4\B6\00", [3 x i8] c"\A4\B8\00", [3 x i8] c"\A4\BA\00", [3 x i8] c"\A4\BC\00", [3 x i8] c"\A4\BE\00", [3 x i8] c"\A4\C0\00", [3 x i8] c"\A4\C2\00", [3 x i8] c"\A4\C5\00", [3 x i8] c"\A4\C7\00", [3 x i8] c"\A4\C9\00", [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] c"\A4\D0\00", [3 x i8] c"\A4\D3\00", [3 x i8] c"\A4\D6\00", [3 x i8] c"\A4\D9\00", [3 x i8] c"\A4\DC\00"], [17 x [3 x i8]] zeroinitializer }>
@sjis2ujis.k2H_htable = internal unnamed_addr constant <{ [47 x [3 x i8]], [17 x [3 x i8]] }> <{ [47 x [3 x i8]] [[3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] c"\A4\D1\00", [3 x i8] c"\A4\D4\00", [3 x i8] c"\A4\D7\00", [3 x i8] c"\A4\DA\00", [3 x i8] c"\A4\DD\00"], [17 x [3 x i8]] zeroinitializer }>
define void @sjis2ujis(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %67, %2
%4 = phi i8* [ %1, %2 ], [ %68, %67 ]
%5 = phi i8* [ %0, %2 ], [ %70, %67 ]
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
switch i8 %6, label %10 [
i8 0, label %71
i8 44, label %8
]
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
store i8 32, i8* %4
br label %67
10: ; preds = %3
%11 = icmp sgt i8 %6, -1
br i1 %11, label %12, label %14
12: ; preds = %10
%13 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %6, i8* %4
br label %67
14: ; preds = %10
%15 = add nsw i8 %6, 96
%16 = icmp ult i8 %15, 64
%17 = getelementptr inbounds i8, i8* %5, i64 1
%18 = load i8, i8* %17
br i1 %16, label %19, label %53
19: ; preds = %14
switch i8 %18, label %20 [
i8 -34, label %23
i8 -33, label %34
]
20: ; preds = %19
%21 = add nsw i32 %7, -160
%22 = zext i32 %21 to i64
br label %45
23: ; preds = %19
%24 = add nsw i32 %7, -160
%25 = zext i32 %24 to i64
%26 = getelementptr inbounds [64 x [3 x i8]], [64 x [3 x i8]]* bitcast (<{ [47 x [3 x i8]], [17 x [3 x i8]] }>* @sjis2ujis.k2H_dtable to [64 x [3 x i8]]*), i64 0, i64 %25, i64 0
%27 = load i8, i8* %26
%28 = icmp eq i8 %27, 0
br i1 %28, label %45, label %29
29: ; preds = %23
%30 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %27, i8* %4
%31 = getelementptr inbounds [64 x [3 x i8]], [64 x [3 x i8]]* bitcast (<{ [47 x [3 x i8]], [17 x [3 x i8]] }>* @sjis2ujis.k2H_dtable to [64 x [3 x i8]]*), i64 0, i64 %25, i64 1
%32 = load i8, i8* %31
%33 = getelementptr inbounds i8, i8* %4, i64 2
store i8 %32, i8* %30
br label %67
34: ; preds = %19
%35 = add nsw i32 %7, -160
%36 = zext i32 %35 to i64
%37 = getelementptr inbounds [64 x [3 x i8]], [64 x [3 x i8]]* bitcast (<{ [47 x [3 x i8]], [17 x [3 x i8]] }>* @sjis2ujis.k2H_htable to [64 x [3 x i8]]*), i64 0, i64 %36, i64 0
%38 = load i8, i8* %37
%39 = icmp eq i8 %38, 0
br i1 %39, label %45, label %40
40: ; preds = %34
%41 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %38, i8* %4
%42 = getelementptr inbounds [64 x [3 x i8]], [64 x [3 x i8]]* bitcast (<{ [47 x [3 x i8]], [17 x [3 x i8]] }>* @sjis2ujis.k2H_htable to [64 x [3 x i8]]*), i64 0, i64 %36, i64 1
%43 = load i8, i8* %42
%44 = getelementptr inbounds i8, i8* %4, i64 2
store i8 %43, i8* %41
br label %67
45: ; preds = %20, %23, %34
%46 = phi i64 [ %22, %20 ], [ %25, %23 ], [ %36, %34 ]
%47 = getelementptr inbounds [64 x [3 x i8]], [64 x [3 x i8]]* @sjis2ujis.k2H_table, i64 0, i64 %46, i64 0
%48 = load i8, i8* %47
%49 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %48, i8* %4
%50 = getelementptr inbounds [64 x [3 x i8]], [64 x [3 x i8]]* @sjis2ujis.k2H_table, i64 0, i64 %46, i64 1
%51 = load i8, i8* %50
%52 = getelementptr inbounds i8, i8* %4, i64 2
store i8 %51, i8* %49
br label %67
53: ; preds = %14
%54 = icmp ugt i8 %18, -98
%55 = icmp ugt i8 %6, -33
%56 = shl i8 %6, 1
%57 = select i1 %55, i8 32, i8 -96
%58 = select i1 %55, i8 31, i8 -97
%59 = icmp ugt i8 %18, 126
%60 = select i1 %59, i8 96, i8 97
%61 = select i1 %54, i8 2, i8 %60
%62 = select i1 %54, i8 %57, i8 %58
%63 = add i8 %56, %62
%64 = add i8 %18, %61
%65 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %63, i8* %4
%66 = getelementptr inbounds i8, i8* %4, i64 2
store i8 %64, i8* %65
br label %67
67: ; preds = %12, %29, %45, %40, %53, %8
%68 = phi i8* [ %9, %8 ], [ %13, %12 ], [ %33, %29 ], [ %44, %40 ], [ %52, %45 ], [ %66, %53 ]
%69 = phi i8* [ %5, %8 ], [ %5, %12 ], [ %17, %29 ], [ %17, %40 ], [ %5, %45 ], [ %17, %53 ]
%70 = getelementptr inbounds i8, i8* %69, i64 1
br label %3
71: ; preds = %3
store i8 0, i8* %4
ret void
}