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

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sjis2kuten(int, int, int *, int *);
int main(void) {
  int i, j, pl;
  int startrow, startcell, endrow, endcell;
  FILE *jp = fopen("shift-jis.html", "w");
  if (!jp)
    return 1;
  fputs("<html lang=ja>\n <head>\n  <meta http-equiv=\"Content-Type\" "
        "content=\"text/html;charset=shift_jis\">\n  <title>Shift-JIS</title>\n"
        "  <style>.unused { background: #ccc; }"
        " table { float: left; }</style>\n"
        " </head>\n <body>"
        "  <table><caption>ASCII/JIS-Roman + half-width katakana</caption>\n"
        "   <tr><th>  ",
        jp);
  for (i = 0; i < 16; i++) {
    fprintf(jp, "<th>%X", i);
  }
  for (i = 32; i < 224; i++) {
    if (128 == i) {
      i = 160;
    }
    if (0 == (i & 0x0F)) {
      fprintf(jp, "\n   <tr><th>%02X", i);
    }
    fprintf(jp, "<td%s>%c", (127 == i || 160 == i) ? " class=unused" : "",
            (char)i);
  }
  fputs("\n  </table>\n", jp);
  for (i = 0x81; i <= 0xEF; i++) {
    if (0xA0 == i) {
      i = 0xE0;
    }
    sjis2kuten(i, 0x40, &startrow, &startcell);
    sjis2kuten(i, 0xFC, &endrow, &endcell);
    fprintf(jp,
            "  <table><caption>Multibyte lead %X (JIS X 0208:1997 "
            "rows %d&ndash;%d)</caption>\n   <tr><th> ",
            i, startrow, endrow);
    for (j = 0; j < 16; j++) {
      fprintf(jp, "<th>%X", j);
    }
    for (j = 0x40; j < 0x100; j++) {
      if (0 == (j & 0x0F)) {
        fprintf(jp, "\n   <tr><th>%02X", j);
      }
      if (0x7F == j || j > 0xFC) {
        fputs("<td class=unused>&nbsp;", jp);
      } else {
        fprintf(jp, "<td>%c%c", (char)i, (char)j);
      }
    }
    fputs("\n  </table>\n", jp);
  }
  fputs("\n </body>\n</html>\n", jp);
  fclose(jp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    118d <main+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1411 <main+0x2c1>
mov    -0x28(%rbp),%rsi
lea    0xe79(%rip),%rdi
call   1040 <fputs@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    11d1 <main+0x81>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xf76(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a4 <main+0x54>
movl   $0x20,-0x8(%rbp)
cmpl   $0xe0,-0x8(%rbp)
jge    1286 <main+0x136>
mov    $0x80,%eax
cmp    -0x8(%rbp),%eax
jne    11fa <main+0xaa>
movl   $0xa0,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
and    $0xf,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    121f <main+0xcf>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xf21(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    $0x1,%al
mov    $0x7f,%ecx
cmp    -0x8(%rbp),%ecx
mov    %al,-0x29(%rbp)
je     1248 <main+0xf8>
mov    $0xa0,%eax
cmp    -0x8(%rbp),%eax
sete   %al
mov    %al,-0x29(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x29(%rbp),%cl
lea    0xf17(%rip),%rdx
lea    0xef6(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rdx
mov    -0x8(%rbp),%eax
movsbl %al,%ecx
lea    0xed9(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11d8 <main+0x88>
mov    -0x28(%rbp),%rsi
lea    0xed0(%rip),%rdi
call   1040 <fputs@plt>
movl   $0x81,-0x8(%rbp)
cmpl   $0xef,-0x8(%rbp)
jg     13f1 <main+0x2a1>
mov    $0xa0,%eax
cmp    -0x8(%rbp),%eax
jne    12bf <main+0x16f>
movl   $0xe0,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x40,%esi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1070 <sjis2kuten@plt>
mov    -0x8(%rbp),%edi
mov    $0xfc,%esi
lea    -0x1c(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1070 <sjis2kuten@plt>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
lea    0xe70(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1339 <main+0x1e9>
mov    -0x28(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe0e(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    130c <main+0x1bc>
movl   $0x40,-0xc(%rbp)
cmpl   $0x100,-0xc(%rbp)
jge    13d3 <main+0x283>
mov    -0xc(%rbp),%ecx
and    $0xf,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1372 <main+0x222>
mov    -0x28(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xdce(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x7f,%eax
cmp    -0xc(%rbp),%eax
je     138d <main+0x23d>
cmpl   $0xfc,-0xc(%rbp)
jle    13a2 <main+0x252>
mov    -0x28(%rbp),%rsi
lea    0xe34(%rip),%rdi
call   1040 <fputs@plt>
jmp    13c0 <main+0x270>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%eax
movsbl %al,%edx
mov    -0xc(%rbp),%eax
movsbl %al,%ecx
lea    0xe2b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    13c5 <main+0x275>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1340 <main+0x1f0>
mov    -0x28(%rbp),%rsi
lea    0xd83(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    129d <main+0x14d>
mov    -0x28(%rbp),%rsi
lea    0xdf1(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe9b(%rip),%rdi
lea    0xea3(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     15b2 <main+0x462>
mov    %rax,%rbx
lea    0xe8d(%rip),%rdi
mov    $0x120,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1070 <fwrite@plt>
lea    0xf95(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x7,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x9,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0xa,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0xb,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0xc,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0xd,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0xe,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0xf,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x20,%ebp
mov    $0xa0,%r12d
lea    0xe87(%rip),%r13
lea    0xe9a(%rip),%r14
lea    0xe70(%rip),%r15
jmp    1305 <main+0x1b5>
nopl   0x0(%rax)
cmp    $0x7f,%ebp
cmove  %r13,%rdx
movsbl %bpl,%ecx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0x1(%rbp),%eax
cmp    $0xdf,%ebp
mov    %eax,%ebp
jge    1338 <main+0x1e8>
cmp    $0x80,%ebp
cmove  %r12d,%ebp
test   $0xf,%bpl
jne    1328 <main+0x1d8>
mov    %rbx,%rdi
lea    0xe1a(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %r13,%rdx
cmp    $0xa0,%ebp
je     12e0 <main+0x190>
mov    %r14,%rdx
jmp    12e0 <main+0x190>
lea    0xe22(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1070 <fwrite@plt>
mov    $0x81,%r15d
lea    0xe86(%rip),%r12
jmp    138d <main+0x23d>
mov    $0xc,%esi
mov    $0x1,%edx
lea    0xdf0(%rip),%rdi
mov    %rbx,%rcx
call   1070 <fwrite@plt>
lea    0x1(%r15),%eax
cmp    $0xef,%r15d
mov    %eax,%r15d
jge    158d <main+0x43d>
cmp    $0xa0,%r15d
mov    $0xe0,%eax
cmove  %eax,%r15d
mov    $0x40,%ebp
mov    %r15d,%edi
mov    $0x40,%esi
lea    0xc(%rsp),%rdx
lea    0x14(%rsp),%rcx
call   1060 <sjis2kuten@plt>
mov    %r15d,%edi
mov    $0xfc,%esi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1060 <sjis2kuten@plt>
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    %rbx,%rdi
lea    0xd8b(%rip),%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
lea    0xd3b(%rip),%r14
mov    %r14,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x6,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x7,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x9,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xb,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xc,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xd,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xe,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xf,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
movsbl %r15b,%r13d
mov    $0x40000000,%r14d
jmp    154f <main+0x3ff>
nopl   (%rax)
mov    $0x17,%esi
mov    $0x1,%edx
lea    0xc9b(%rip),%rdi
mov    %rbx,%rcx
call   1070 <fwrite@plt>
add    $0x1,%ebp
add    $0x1000000,%r14d
cmp    $0x100,%ebp
je     1360 <main+0x210>
test   $0xf,%bpl
jne    1568 <main+0x418>
mov    %rbx,%rdi
lea    0xbda(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
cmp    $0x7f,%ebp
je     1520 <main+0x3d0>
cmp    $0xfd,%ebp
jae    1520 <main+0x3d0>
mov    %r14d,%ecx
sar    $0x18,%ecx
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1539 <main+0x3e9>
lea    0xc59(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1070 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    15b7 <main+0x467>
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"shift-jis.html\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [289 x i8] c"<html lang=ja>\0A <head>\0A <meta http-equiv=\22Content-Type\22 content=\22text/html;charset=shift_jis\22>\0A <title>Shift-JIS</title>\0A <style>.unused { background: #ccc; } table { float: left; }</style>\0A </head>\0A <body> <table><caption>ASCII/JIS-Roman + half-width katakana</caption>\0A <tr><th> \00"
@.str.3 = [7 x i8] c"<th>%X\00"
@.str.4 = [17 x i8] c"\0A <tr><th>%02X\00"
@.str.5 = [9 x i8] c"<td%s>%c\00"
@.str.6 = [14 x i8] c" class=unused\00"
@.str.7 = [1 x i8] zeroinitializer
@.str.8 = [13 x i8] c"\0A </table>\0A\00"
@.str.9 = [94 x i8] c" <table><caption>Multibyte lead %X (JIS X 0208:1997 rows %d&ndash;%d)</caption>\0A <tr><th> \00"
@.str.10 = [24 x i8] c"<td class=unused>&nbsp;\00"
@.str.11 = [9 x i8] c"<td>%c%c\00"
@.str.12 = [19 x i8] c"\0A </body>\0A</html>\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
store i32 0, i32* %1
%10 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %9
%11 = load i32*, i32** %9
%12 = icmp ne i32* %11, null
br i1 %12, label %14, label %13
13: ; preds = %0
store i32 1, i32* %1
br label %136
14: ; preds = %0
%15 = load i32*, i32** %9
%16 = call i32 @fputs(i8* getelementptr inbounds ([289 x i8], [289 x i8]* @.str.2, i64 0, i64 0), i32* %15)
store i32 0, i32* %2
br label %17
17: ; preds = %24, %14
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 16
br i1 %19, label %20, label %27
20: ; preds = %17
%21 = load i32*, i32** %9
%22 = load i32, i32* %2
%23 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %20
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %17
27: ; preds = %17
store i32 32, i32* %2
br label %28
28: ; preds = %58, %27
%29 = load i32, i32* %2
%30 = icmp slt i32 %29, 224
br i1 %30, label %31, label %61
31: ; preds = %28
%32 = load i32, i32* %2
%33 = icmp eq i32 128, %32
br i1 %33, label %34, label %35
34: ; preds = %31
store i32 160, i32* %2
br label %35
35: ; preds = %34, %31
%36 = load i32, i32* %2
%37 = and i32 %36, 15
%38 = icmp eq i32 0, %37
br i1 %38, label %39, label %43
39: ; preds = %35
%40 = load i32*, i32** %9
%41 = load i32, i32* %2
%42 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %39, %35
%44 = load i32*, i32** %9
%45 = load i32, i32* %2
%46 = icmp eq i32 127, %45
br i1 %46, label %50, label %47
47: ; preds = %43
%48 = load i32, i32* %2
%49 = icmp eq i32 160, %48
br label %50
50: ; preds = %47, %43
%51 = phi i1 [ true, %43 ], [ %49, %47 ]
%52 = zext i1 %51 to i64
%53 = select i1 %51, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0)
%54 = load i32, i32* %2
%55 = trunc i32 %54 to i8
%56 = sext i8 %55 to i32
%57 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %53, i32 %56)
br label %58
58: ; preds = %50
%59 = load i32, i32* %2
%60 = add nsw i32 %59, 1
store i32 %60, i32* %2
br label %28
61: ; preds = %28
%62 = load i32*, i32** %9
%63 = call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32* %62)
store i32 129, i32* %2
br label %64
64: ; preds = %128, %61
%65 = load i32, i32* %2
%66 = icmp sle i32 %65, 239
br i1 %66, label %67, label %131
67: ; preds = %64
%68 = load i32, i32* %2
%69 = icmp eq i32 160, %68
br i1 %69, label %70, label %71
70: ; preds = %67
store i32 224, i32* %2
br label %71
71: ; preds = %70, %67
%72 = load i32, i32* %2
%73 = call i32 @sjis2kuten(i32 %72, i32 64, i32* %5, i32* %6)
%74 = load i32, i32* %2
%75 = call i32 @sjis2kuten(i32 %74, i32 252, i32* %7, i32* %8)
%76 = load i32*, i32** %9
%77 = load i32, i32* %2
%78 = load i32, i32* %5
%79 = load i32, i32* %7
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %76, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str.9, i64 0, i64 0), i32 %77, i32 %78, i32 %79)
store i32 0, i32* %3
br label %81
81: ; preds = %88, %71
%82 = load i32, i32* %3
%83 = icmp slt i32 %82, 16
br i1 %83, label %84, label %91
84: ; preds = %81
%85 = load i32*, i32** %9
%86 = load i32, i32* %3
%87 = call i32 (i32*, i8*, ...) @fprintf(i32* %85, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %86)
br label %88
88: ; preds = %84
%89 = load i32, i32* %3
%90 = add nsw i32 %89, 1
store i32 %90, i32* %3
br label %81
91: ; preds = %81
store i32 64, i32* %3
br label %92
92: ; preds = %122, %91
%93 = load i32, i32* %3
%94 = icmp slt i32 %93, 256
br i1 %94, label %95, label %125
95: ; preds = %92
%96 = load i32, i32* %3
%97 = and i32 %96, 15
%98 = icmp eq i32 0, %97
br i1 %98, label %99, label %103
99: ; preds = %95
%100 = load i32*, i32** %9
%101 = load i32, i32* %3
%102 = call i32 (i32*, i8*, ...) @fprintf(i32* %100, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %101)
br label %103
103: ; preds = %99, %95
%104 = load i32, i32* %3
%105 = icmp eq i32 127, %104
br i1 %105, label %109, label %106
106: ; preds = %103
%107 = load i32, i32* %3
%108 = icmp sgt i32 %107, 252
br i1 %108, label %109, label %112
109: ; preds = %106, %103
%110 = load i32*, i32** %9
%111 = call i32 @fputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), i32* %110)
br label %121
112: ; preds = %106
%113 = load i32*, i32** %9
%114 = load i32, i32* %2
%115 = trunc i32 %114 to i8
%116 = sext i8 %115 to i32
%117 = load i32, i32* %3
%118 = trunc i32 %117 to i8
%119 = sext i8 %118 to i32
%120 = call i32 (i32*, i8*, ...) @fprintf(i32* %113, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i32 %116, i32 %119)
br label %121
121: ; preds = %112, %109
br label %122
122: ; preds = %121
%123 = load i32, i32* %3
%124 = add nsw i32 %123, 1
store i32 %124, i32* %3
br label %92
125: ; preds = %92
%126 = load i32*, i32** %9
%127 = call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32* %126)
br label %128
128: ; preds = %125
%129 = load i32, i32* %2
%130 = add nsw i32 %129, 1
store i32 %130, i32* %2
br label %64
131: ; preds = %64
%132 = load i32*, i32** %9
%133 = call i32 @fputs(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i32* %132)
%134 = load i32*, i32** %9
%135 = call i32 @fclose(i32* %134)
store i32 0, i32* %1
br label %136
136: ; preds = %131, %13
%137 = load i32, i32* %1
ret i32 %137
}

LLVM IR (-O2):
@.str = [15 x i8] c"shift-jis.html\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [289 x i8] c"<html lang=ja>\0A <head>\0A <meta http-equiv=\22Content-Type\22 content=\22text/html;charset=shift_jis\22>\0A <title>Shift-JIS</title>\0A <style>.unused { background: #ccc; } table { float: left; }</style>\0A </head>\0A <body> <table><caption>ASCII/JIS-Roman + half-width katakana</caption>\0A <tr><th> \00"
@.str.3 = [7 x i8] c"<th>%X\00"
@.str.4 = [17 x i8] c"\0A <tr><th>%02X\00"
@.str.5 = [9 x i8] c"<td%s>%c\00"
@.str.6 = [14 x i8] c" class=unused\00"
@.str.7 = [1 x i8] zeroinitializer
@.str.8 = [13 x i8] c"\0A </table>\0A\00"
@.str.9 = [94 x i8] c" <table><caption>Multibyte lead %X (JIS X 0208:1997 rows %d&ndash;%d)</caption>\0A <tr><th> \00"
@.str.10 = [24 x i8] c"<td class=unused>&nbsp;\00"
@.str.11 = [9 x i8] c"<td>%c%c\00"
@.str.12 = [19 x i8] c"\0A </body>\0A</html>\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %102, label %11
11: ; preds = %0
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([289 x i8], [289 x i8]* @.str.2, i64 0, i64 0), i64 288, i64 1, i32* %9)
%13 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 0)
%14 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 1)
%15 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 2)
%16 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 3)
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 4)
%18 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 5)
%19 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 6)
%20 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 7)
%21 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 8)
%22 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 9)
%23 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 10)
%24 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 11)
%25 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 12)
%26 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 13)
%27 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 14)
%28 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 15)
br label %29
29: ; preds = %11, %37
%30 = phi i32 [ %45, %37 ], [ 32, %11 ]
%31 = icmp eq i32 %30, 128
%32 = select i1 %31, i32 160, i32 %30
%33 = and i32 %32, 15
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %29
%36 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %32)
br label %37
37: ; preds = %35, %29
%38 = icmp eq i32 %32, 127
%39 = icmp eq i32 %32, 160
%40 = or i1 %38, %39
%41 = select i1 %40, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0)
%42 = shl i32 %32, 24
%43 = ashr exact i32 %42, 24
%44 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %41, i32 %43)
%45 = add nsw i32 %32, 1
%46 = icmp slt i32 %32, 223
br i1 %46, label %29, label %47
47: ; preds = %37
%48 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i64 12, i64 1, i32* %9)
br label %49
49: ; preds = %47, %95
%50 = phi i32 [ 129, %47 ], [ %97, %95 ]
%51 = icmp eq i32 %50, 160
%52 = select i1 %51, i32 224, i32 %50
%53 = call i32 @sjis2kuten(i32 %52, i32 64, i32* %1, i32* %2)
%54 = call i32 @sjis2kuten(i32 %52, i32 252, i32* %3, i32* %4)
%55 = load i32, i32* %1
%56 = load i32, i32* %3
%57 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str.9, i64 0, i64 0), i32 %52, i32 %55, i32 %56)
%58 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 0)
%59 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 1)
%60 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 2)
%61 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 3)
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 4)
%63 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 5)
%64 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 6)
%65 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 7)
%66 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 8)
%67 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 9)
%68 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 10)
%69 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 11)
%70 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 12)
%71 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 13)
%72 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 14)
%73 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 15)
%74 = shl i32 %52, 24
%75 = ashr exact i32 %74, 24
br label %76
76: ; preds = %49, %92
%77 = phi i32 [ 64, %49 ], [ %93, %92 ]
%78 = and i32 %77, 15
%79 = icmp eq i32 %78, 0
br i1 %79, label %80, label %82
80: ; preds = %76
%81 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %77)
br label %82
82: ; preds = %80, %76
%83 = icmp eq i32 %77, 127
%84 = icmp ugt i32 %77, 252
%85 = or i1 %83, %84
br i1 %85, label %86, label %88
86: ; preds = %82
%87 = call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), i64 23, i64 1, i32* %9)
br label %92
88: ; preds = %82
%89 = shl nuw i32 %77, 24
%90 = ashr exact i32 %89, 24
%91 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i32 %75, i32 %90)
br label %92
92: ; preds = %86, %88
%93 = add nuw nsw i32 %77, 1
%94 = icmp eq i32 %93, 256
br i1 %94, label %95, label %76
95: ; preds = %92
%96 = call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i64 12, i64 1, i32* %9)
%97 = add nsw i32 %52, 1
%98 = icmp slt i32 %52, 239
br i1 %98, label %49, label %99
99: ; preds = %95
%100 = call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i64 18, i64 1, i32* %9)
%101 = call i32 @fclose(i32* %9)
br label %102
102: ; preds = %0, %99
%103 = phi i32 [ 0, %99 ], [ 1, %0 ]
ret i32 %103
}