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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ b2g(unsigned char *);
int /*<<< orphan*/ correctg2b(unsigned char *, unsigned char *);
int /*<<< orphan*/ extrab2g(unsigned char *);
int /*<<< orphan*/ extrag2b(unsigned char *);
int /*<<< orphan*/ g2b(unsigned char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  unsigned char c[2], cc[2];
  int i;
  printf("//g2btab[c2-0x40][(c1-0x80)*2], g2btab[c2-0x40][(c1-0x80)*2+1]\n");
  printf("//c1: 0x80-0xff, c2: 0x40-0xfe\n");
  printf("static const char g2btab[192][256]={\n");
  for (c[1] = 0x40; c[1]; c[1]++) {
    printf("\t{");
    for (i = 0, c[0] = 0x80; c[0]; c[0]++, i++) {
      cc[0] = c[0];
      cc[1] = c[1];
      g2b(cc);
      correctg2b(c, cc);
      if (cc[0] == 0xa1 && cc[1] == 0xbc) {
        cc[0] = c[0];
        cc[1] = c[1];
        extrag2b(cc);
      }
      printf("%3d,%3d%s", (int)cc[0], (int)cc[1], c[0] == 0xff ? "" : ",");
      if (i % 10 == 9)
        printf("\n\t ");
    }
    printf("}%s\n", c[1] == 0xff ? "" : ",");
  }
  printf("};\n");
  printf("//b2gtab[c2-0x40][(c1-0x80)*2], b2gtab[c2-0x40][(c1-0x80)*2+1]\n");
  printf("//c1: 0x80-0xff, c2: 0x40-0xfe\n");
  printf("static const char b2gtab[192][256]={\n");
  for (c[1] = 0x40; c[1] <= 0xff && c[1]; c[1]++) {
    printf("\t{");
    for (i = 0, c[0] = 0x80; c[0] <= 0xff && c[0]; c[0]++, i++) {
      cc[0] = c[0];
      cc[1] = c[1];
      b2g(cc);
      correctg2b(c, cc);
      if (cc[0] == 0xa1 && cc[1] == 0xf5) {
        cc[0] = c[0];
        cc[1] = c[1];
        extrab2g(cc);
      }
      printf("%3d,%3d%s", (int)cc[0], (int)cc[1], c[0] == 0xff ? "" : ",");
      if (i % 10 == 9)
        printf("\n\t ");
    }
    printf("}%s\n", c[1] == 0xff ? "" : ",");
  }
  printf("};\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movb   $0x40,-0x5(%rbp)
cmpb   $0x0,-0x5(%rbp)
je     12c5 <main+0x165>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
movb   $0x80,-0x6(%rbp)
cmpb   $0x0,-0x6(%rbp)
je     128e <main+0x12e>
mov    -0x6(%rbp),%al
mov    %al,-0x8(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x7(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <g2b@plt>
lea    -0x6(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <correctg2b@plt>
movzbl -0x8(%rbp),%eax
cmp    $0xa1,%eax
jne    121f <main+0xbf>
movzbl -0x7(%rbp),%eax
cmp    $0xbc,%eax
jne    121f <main+0xbf>
mov    -0x6(%rbp),%al
mov    %al,-0x8(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x7(%rbp)
lea    -0x8(%rbp),%rdi
call   1060 <extrag2b@plt>
movzbl -0x8(%rbp),%esi
movzbl -0x7(%rbp),%edx
movzbl -0x6(%rbp),%edi
lea    0xe61(%rip),%rcx
lea    0xe68(%rip),%rax
cmp    $0xff,%edi
cmove  %rax,%rcx
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x9,%edx
jne    1273 <main+0x113>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1278 <main+0x118>
mov    -0x6(%rbp),%al
add    $0x1,%al
mov    %al,-0x6(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11c0 <main+0x60>
movzbl -0x5(%rbp),%ecx
lea    0xdfa(%rip),%rsi
lea    0xe01(%rip),%rax
cmp    $0xff,%ecx
cmove  %rax,%rsi
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    119d <main+0x3d>
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movb   $0x40,-0x5(%rbp)
movzbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    $0xff,%ecx
mov    %al,-0xd(%rbp)
jg     1323 <main+0x1c3>
movzbl -0x5(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1333 <main+0x1d3>
jmp    1479 <main+0x319>
lea    0xd4c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
movb   $0x80,-0x6(%rbp)
movzbl -0x6(%rbp),%ecx
xor    %eax,%eax
cmp    $0xff,%ecx
mov    %al,-0xe(%rbp)
jg     136e <main+0x20e>
movzbl -0x6(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
test   $0x1,%al
jne    137e <main+0x21e>
jmp    1442 <main+0x2e2>
mov    -0x6(%rbp),%al
mov    %al,-0x8(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x7(%rbp)
lea    -0x8(%rbp),%rdi
call   1080 <b2g@plt>
lea    -0x6(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <correctg2b@plt>
movzbl -0x8(%rbp),%eax
cmp    $0xa1,%eax
jne    13d3 <main+0x273>
movzbl -0x7(%rbp),%eax
cmp    $0xf5,%eax
jne    13d3 <main+0x273>
mov    -0x6(%rbp),%al
mov    %al,-0x8(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x7(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <extrab2g@plt>
movzbl -0x8(%rbp),%esi
movzbl -0x7(%rbp),%edx
movzbl -0x6(%rbp),%edi
lea    0xcad(%rip),%rcx
lea    0xcb4(%rip),%rax
cmp    $0xff,%edi
cmove  %rax,%rcx
lea    0xc8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x9,%edx
jne    1427 <main+0x2c7>
lea    0xc75(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    142c <main+0x2cc>
mov    -0x6(%rbp),%al
add    $0x1,%al
mov    %al,-0x6(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    134c <main+0x1ec>
movzbl -0x5(%rbp),%ecx
lea    0xc46(%rip),%rsi
lea    0xc4d(%rip),%rax
cmp    $0xff,%ecx
cmove  %rax,%rsi
lea    0xc34(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1301 <main+0x1a1>
lea    0xc1e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2d(%rip),%rdi
call   1030 <puts@plt>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
movb   $0x40,0x5(%rsp)
lea    0x6(%rsp),%rbx
lea    0xe5d(%rip),%r14
jmp    11ec <main+0x7c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0xff,0x5(%rsp)
mov    %r14,%rsi
lea    0xe48(%rip),%rax
cmove  %rax,%rsi
lea    0xe39(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
addb   $0x1,0x5(%rsp)
je     12d1 <main+0x161>
lea    0xe0d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movb   $0x80,0x4(%rsp)
mov    $0x80,%al
mov    $0x9,%r13d
xor    %r15d,%r15d
jmp    1225 <main+0xb5>
nopl   0x0(%rax)
movzbl 0x4(%rsp),%eax
add    $0x1,%r15d
add    $0xffffffff,%r13d
inc    %al
mov    %al,0x4(%rsp)
je     11c0 <main+0x50>
mov    %r15d,%r12d
mov    $0xcccccccd,%ecx
imul   %rcx,%r12
shr    $0x23,%r12
mov    %al,0x6(%rsp)
movzbl 0x5(%rsp),%eax
mov    %al,0x7(%rsp)
mov    %rbx,%rdi
call   1060 <g2b@plt>
lea    0x4(%rsp),%rdi
mov    %rbx,%rsi
call   1080 <correctg2b@plt>
movzbl 0x6(%rsp),%eax
movzbl 0x7(%rsp),%ecx
cmp    $0xa1,%al
jne    1286 <main+0x116>
cmp    $0xbc,%cl
jne    1286 <main+0x116>
movzwl 0x4(%rsp),%eax
mov    %ax,0x6(%rsp)
mov    %rbx,%rdi
call   1070 <extrag2b@plt>
movzbl 0x6(%rsp),%eax
movzbl 0x7(%rsp),%ecx
lea    (%r12,%r12,4),%edx
lea    0x0(%r13,%rdx,2),%ebp
movzbl %al,%esi
movzbl %cl,%edx
cmpb   $0xff,0x4(%rsp)
mov    %r14,%rcx
lea    0xd73(%rip),%rax
cmove  %rax,%rcx
lea    0xd54(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebp,%ebp
jne    1210 <main+0xa0>
lea    0xd4a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1210 <main+0xa0>
lea    0xe27(%rip),%rdi
call   1030 <puts@plt>
lea    0xd98(%rip),%rdi
call   1030 <puts@plt>
lea    0xdcb(%rip),%rdi
call   1030 <puts@plt>
lea    0xdde(%rip),%rdi
call   1030 <puts@plt>
movb   $0x40,0x5(%rsp)
lea    0x6(%rsp),%rbx
jmp    133c <main+0x1cc>
nopl   (%rax)
cmpb   $0xff,0x5(%rsp)
mov    %r14,%rsi
lea    0xcf8(%rip),%rax
cmove  %rax,%rsi
lea    0xce9(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
addb   $0x1,0x5(%rsp)
je     1421 <main+0x2b1>
lea    0xcbd(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movb   $0x80,0x4(%rsp)
mov    $0x80,%al
mov    $0x9,%r13d
xor    %r15d,%r15d
jmp    1375 <main+0x205>
nopl   0x0(%rax)
movzbl 0x4(%rsp),%eax
add    $0x1,%r15d
add    $0xffffffff,%r13d
inc    %al
mov    %al,0x4(%rsp)
je     1310 <main+0x1a0>
mov    %r15d,%r12d
mov    $0xcccccccd,%ecx
imul   %rcx,%r12
shr    $0x23,%r12
mov    %al,0x6(%rsp)
movzbl 0x5(%rsp),%eax
mov    %al,0x7(%rsp)
mov    %rbx,%rdi
call   1090 <b2g@plt>
lea    0x4(%rsp),%rdi
mov    %rbx,%rsi
call   1080 <correctg2b@plt>
movzbl 0x6(%rsp),%eax
movzbl 0x7(%rsp),%ecx
cmp    $0xa1,%al
jne    13d6 <main+0x266>
cmp    $0xf5,%cl
jne    13d6 <main+0x266>
movzwl 0x4(%rsp),%eax
mov    %ax,0x6(%rsp)
mov    %rbx,%rdi
call   1040 <extrab2g@plt>
movzbl 0x6(%rsp),%eax
movzbl 0x7(%rsp),%ecx
lea    (%r12,%r12,4),%edx
lea    0x0(%r13,%rdx,2),%ebp
movzbl %al,%esi
movzbl %cl,%edx
cmpb   $0xff,0x4(%rsp)
mov    %r14,%rcx
lea    0xc23(%rip),%rax
cmove  %rax,%rcx
lea    0xc04(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebp,%ebp
jne    1360 <main+0x1f0>
lea    0xbfa(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1360 <main+0x1f0>
lea    0xcd7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [64 x i8] c"//g2btab[c2-0x40][(c1-0x80)*2], g2btab[c2-0x40][(c1-0x80)*2+1]\0A\00"
@.str.1 = [32 x i8] c"//c1: 0x80-0xff, c2: 0x40-0xfe\0A\00"
@.str.2 = [38 x i8] c"static const char g2btab[192][256]={\0A\00"
@.str.3 = [3 x i8] c"\09{\00"
@.str.4 = [10 x i8] c"%3d,%3d%s\00"
@.str.5 = [1 x i8] zeroinitializer
@.str.6 = [2 x i8] c",\00"
@.str.7 = [4 x i8] c"\0A\09 \00"
@.str.8 = [5 x i8] c"}%s\0A\00"
@.str.9 = [4 x i8] c"};\0A\00"
@.str.10 = [64 x i8] c"//b2gtab[c2-0x40][(c1-0x80)*2], b2gtab[c2-0x40][(c1-0x80)*2+1]\0A\00"
@.str.11 = [38 x i8] c"static const char b2gtab[192][256]={\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i8]
%3 = alloca [2 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 64, i8* %8
br label %9
9: ; preds = %84, %0
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %88
13: ; preds = %9
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %4
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 -128, i8* %15
br label %16
16: ; preds = %70, %13
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%18 = load i8, i8* %17
%19 = icmp ne i8 %18, 0
br i1 %19, label %20, label %76
20: ; preds = %16
%21 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%22 = load i8, i8* %21
%23 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %22, i8* %23
%24 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%25 = load i8, i8* %24
%26 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %25, i8* %26
%27 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%28 = call i32 @g2b(i8* %27)
%29 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%30 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%31 = call i32 @correctg2b(i8* %29, i8* %30)
%32 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = icmp eq i32 %34, 161
br i1 %35, label %36, label %50
36: ; preds = %20
%37 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = icmp eq i32 %39, 188
br i1 %40, label %41, label %50
41: ; preds = %36
%42 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%43 = load i8, i8* %42
%44 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %43, i8* %44
%45 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%46 = load i8, i8* %45
%47 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %46, i8* %47
%48 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%49 = call i32 @extrag2b(i8* %48)
br label %50
50: ; preds = %41, %36, %20
%51 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%52 = load i8, i8* %51
%53 = zext i8 %52 to i32
%54 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%55 = load i8, i8* %54
%56 = zext i8 %55 to i32
%57 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%58 = load i8, i8* %57
%59 = zext i8 %58 to i32
%60 = icmp eq i32 %59, 255
%61 = zext i1 %60 to i64
%62 = select i1 %60, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0)
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %53, i32 %56, i8* %62)
%64 = load i32, i32* %4
%65 = srem i32 %64, 10
%66 = icmp eq i32 %65, 9
br i1 %66, label %67, label %69
67: ; preds = %50
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %69
69: ; preds = %67, %50
br label %70
70: ; preds = %69
%71 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%72 = load i8, i8* %71
%73 = add i8 %72, 1
store i8 %73, i8* %71
%74 = load i32, i32* %4
%75 = add nsw i32 %74, 1
store i32 %75, i32* %4
br label %16
76: ; preds = %16
%77 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%78 = load i8, i8* %77
%79 = zext i8 %78 to i32
%80 = icmp eq i32 %79, 255
%81 = zext i1 %80 to i64
%82 = select i1 %80, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0)
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %82)
br label %84
84: ; preds = %76
%85 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%86 = load i8, i8* %85
%87 = add i8 %86, 1
store i8 %87, i8* %85
br label %9
88: ; preds = %9
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.10, i64 0, i64 0))
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.11, i64 0, i64 0))
%93 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 64, i8* %93
br label %94
94: ; preds = %185, %88
%95 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%96 = load i8, i8* %95
%97 = zext i8 %96 to i32
%98 = icmp sle i32 %97, 255
br i1 %98, label %99, label %104
99: ; preds = %94
%100 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%101 = load i8, i8* %100
%102 = zext i8 %101 to i32
%103 = icmp ne i32 %102, 0
br label %104
104: ; preds = %99, %94
%105 = phi i1 [ false, %94 ], [ %103, %99 ]
br i1 %105, label %106, label %189
106: ; preds = %104
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %4
%108 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 -128, i8* %108
br label %109
109: ; preds = %171, %106
%110 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%111 = load i8, i8* %110
%112 = zext i8 %111 to i32
%113 = icmp sle i32 %112, 255
br i1 %113, label %114, label %119
114: ; preds = %109
%115 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%116 = load i8, i8* %115
%117 = zext i8 %116 to i32
%118 = icmp ne i32 %117, 0
br label %119
119: ; preds = %114, %109
%120 = phi i1 [ false, %109 ], [ %118, %114 ]
br i1 %120, label %121, label %177
121: ; preds = %119
%122 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%123 = load i8, i8* %122
%124 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %123, i8* %124
%125 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%126 = load i8, i8* %125
%127 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %126, i8* %127
%128 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%129 = call i32 @b2g(i8* %128)
%130 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%131 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%132 = call i32 @correctg2b(i8* %130, i8* %131)
%133 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%134 = load i8, i8* %133
%135 = zext i8 %134 to i32
%136 = icmp eq i32 %135, 161
br i1 %136, label %137, label %151
137: ; preds = %121
%138 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%139 = load i8, i8* %138
%140 = zext i8 %139 to i32
%141 = icmp eq i32 %140, 245
br i1 %141, label %142, label %151
142: ; preds = %137
%143 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%144 = load i8, i8* %143
%145 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %144, i8* %145
%146 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%147 = load i8, i8* %146
%148 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %147, i8* %148
%149 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%150 = call i32 @extrab2g(i8* %149)
br label %151
151: ; preds = %142, %137, %121
%152 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%153 = load i8, i8* %152
%154 = zext i8 %153 to i32
%155 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%156 = load i8, i8* %155
%157 = zext i8 %156 to i32
%158 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%159 = load i8, i8* %158
%160 = zext i8 %159 to i32
%161 = icmp eq i32 %160, 255
%162 = zext i1 %161 to i64
%163 = select i1 %161, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0)
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %154, i32 %157, i8* %163)
%165 = load i32, i32* %4
%166 = srem i32 %165, 10
%167 = icmp eq i32 %166, 9
br i1 %167, label %168, label %170
168: ; preds = %151
%169 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %170
170: ; preds = %168, %151
br label %171
171: ; preds = %170
%172 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%173 = load i8, i8* %172
%174 = add i8 %173, 1
store i8 %174, i8* %172
%175 = load i32, i32* %4
%176 = add nsw i32 %175, 1
store i32 %176, i32* %4
br label %109
177: ; preds = %119
%178 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%179 = load i8, i8* %178
%180 = zext i8 %179 to i32
%181 = icmp eq i32 %180, 255
%182 = zext i1 %181 to i64
%183 = select i1 %181, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0)
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %183)
br label %185
185: ; preds = %177
%186 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%187 = load i8, i8* %186
%188 = add i8 %187, 1
store i8 %188, i8* %186
br label %94
189: ; preds = %104
%190 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [3 x i8] c"\09{\00"
@.str.4 = [10 x i8] c"%3d,%3d%s\00"
@.str.5 = [1 x i8] zeroinitializer
@.str.6 = [2 x i8] c",\00"
@.str.7 = [4 x i8] c"\0A\09 \00"
@.str.8 = [5 x i8] c"}%s\0A\00"
@str = [63 x i8] c"//g2btab[c2-0x40][(c1-0x80)*2], g2btab[c2-0x40][(c1-0x80)*2+1]\00"
@str.13 = [37 x i8] c"static const char g2btab[192][256]={\00"
@str.15 = [63 x i8] c"//b2gtab[c2-0x40][(c1-0x80)*2], b2gtab[c2-0x40][(c1-0x80)*2+1]\00"
@str.16 = [31 x i8] c"//c1: 0x80-0xff, c2: 0x40-0xfe\00"
@str.17 = [37 x i8] c"static const char b2gtab[192][256]={\00"
@str.18 = [3 x i8] c"};\00"
define i32 @main() {
%1 = alloca [2 x i8]
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.16, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.13, i64 0, i64 0))
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
store i8 64, i8* %8
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
br label %10
10: ; preds = %0, %47
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i8 -128, i8* %3
br label %12
12: ; preds = %10, %42
%13 = phi i32 [ 0, %10 ], [ %45, %42 ]
%14 = phi i8 [ -128, %10 ], [ %44, %42 ]
store i8 %14, i8* %4
%15 = load i8, i8* %8
store i8 %15, i8* %9
%16 = call i32 @g2b(i8* %4)
%17 = call i32 @correctg2b(i8* %3, i8* %4)
%18 = load i8, i8* %4
%19 = icmp eq i8 %18, -95
%20 = load i8, i8* %9
%21 = icmp eq i8 %20, -68
%22 = select i1 %19, i1 %21, i1 false
br i1 %22, label %23, label %29
23: ; preds = %12
%24 = load i8, i8* %3
store i8 %24, i8* %4
%25 = load i8, i8* %8
store i8 %25, i8* %9
%26 = call i32 @extrag2b(i8* %4)
%27 = load i8, i8* %4
%28 = load i8, i8* %9
br label %29
29: ; preds = %23, %12
%30 = phi i8 [ %28, %23 ], [ %20, %12 ]
%31 = phi i8 [ %27, %23 ], [ %18, %12 ]
%32 = zext i8 %31 to i32
%33 = zext i8 %30 to i32
%34 = load i8, i8* %3
%35 = icmp eq i8 %34, -1
%36 = select i1 %35, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0)
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %32, i32 %33, i8* %36)
%38 = urem i32 %13, 10
%39 = icmp eq i32 %38, 9
br i1 %39, label %40, label %42
40: ; preds = %29
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %42
42: ; preds = %29, %40
%43 = load i8, i8* %3
%44 = add i8 %43, 1
store i8 %44, i8* %3
%45 = add nuw nsw i32 %13, 1
%46 = icmp eq i8 %44, 0
br i1 %46, label %47, label %12
47: ; preds = %42
%48 = load i8, i8* %8
%49 = icmp eq i8 %48, -1
%50 = select i1 %49, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0)
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %50)
%52 = load i8, i8* %8
%53 = add i8 %52, 1
store i8 %53, i8* %8
%54 = icmp eq i8 %53, 0
br i1 %54, label %55, label %10
55: ; preds = %47
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.18, i64 0, i64 0))
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.15, i64 0, i64 0))
%58 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.16, i64 0, i64 0))
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.17, i64 0, i64 0))
store i8 64, i8* %8
br label %60
60: ; preds = %55, %97
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i8 -128, i8* %3
br label %62
62: ; preds = %60, %92
%63 = phi i32 [ 0, %60 ], [ %95, %92 ]
%64 = phi i8 [ -128, %60 ], [ %94, %92 ]
store i8 %64, i8* %4
%65 = load i8, i8* %8
store i8 %65, i8* %9
%66 = call i32 @b2g(i8* %4)
%67 = call i32 @correctg2b(i8* %3, i8* %4)
%68 = load i8, i8* %4
%69 = icmp eq i8 %68, -95
%70 = load i8, i8* %9
%71 = icmp eq i8 %70, -11
%72 = select i1 %69, i1 %71, i1 false
br i1 %72, label %73, label %79
73: ; preds = %62
%74 = load i8, i8* %3
store i8 %74, i8* %4
%75 = load i8, i8* %8
store i8 %75, i8* %9
%76 = call i32 @extrab2g(i8* %4)
%77 = load i8, i8* %4
%78 = load i8, i8* %9
br label %79
79: ; preds = %73, %62
%80 = phi i8 [ %78, %73 ], [ %70, %62 ]
%81 = phi i8 [ %77, %73 ], [ %68, %62 ]
%82 = zext i8 %81 to i32
%83 = zext i8 %80 to i32
%84 = load i8, i8* %3
%85 = icmp eq i8 %84, -1
%86 = select i1 %85, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0)
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %82, i32 %83, i8* %86)
%88 = urem i32 %63, 10
%89 = icmp eq i32 %88, 9
br i1 %89, label %90, label %92
90: ; preds = %79
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %92
92: ; preds = %79, %90
%93 = load i8, i8* %3
%94 = add i8 %93, 1
store i8 %94, i8* %3
%95 = add nuw nsw i32 %63, 1
%96 = icmp eq i8 %94, 0
br i1 %96, label %97, label %62
97: ; preds = %92
%98 = load i8, i8* %8
%99 = icmp eq i8 %98, -1
%100 = select i1 %99, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0)
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %100)
%102 = load i8, i8* %8
%103 = add i8 %102, 1
store i8 %103, i8* %8
%104 = icmp eq i8 %103, 0
br i1 %104, label %105, label %60
105: ; preds = %97
%106 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.18, i64 0, i64 0))
ret i32 0
}